-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create ProviderETLHandler Abstract class for Workflows
- Loading branch information
1 parent
3346b35
commit da7c060
Showing
2 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
apiserver/dora/service/workflows/sync/etl_provider_handler.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import List | ||
|
||
from dora.store.models.code import ( | ||
OrgRepo, | ||
RepoWorkflow, | ||
RepoWorkflowRunsBookmark, | ||
RepoWorkflowRuns, | ||
) | ||
|
||
|
||
class ProviderETLHandler(ABC): | ||
@abstractmethod | ||
def check_pat_validity(self) -> bool: | ||
""" | ||
This method checks if the PAT is valid. | ||
:return: PAT details | ||
:raises: Exception if PAT is invalid | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_workflow_runs( | ||
self, | ||
org_repo: OrgRepo, | ||
repo_workflow: RepoWorkflow, | ||
bookmark: RepoWorkflowRunsBookmark, | ||
) -> List[RepoWorkflowRuns]: | ||
""" | ||
This method returns all workflow runs of a repo's workflow. After the bookmark date. | ||
:param org_repo: OrgRepo object to get workflow runs for | ||
:param repo_workflow: RepoWorkflow object to get workflow runs for | ||
:param bookmark: Bookmark object to get all workflow runs after this date | ||
:return: List of RepoWorkflowRuns objects | ||
""" | ||
pass |