Skip to content

Commit

Permalink
Merge pull request #2398 from IntersectMBO/simplify_gh_blocker
Browse files Browse the repository at this point in the history
Simplify GH blocker
  • Loading branch information
mkoura authored Apr 18, 2024
2 parents 28caa09 + 6bbd663 commit ce6ab2f
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions cardano_node_tests/utils/blockers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,17 @@ def __init__(
self.repo = repo
self.fixed_in = fixed_in
self.message = message
self.repo_name = repo.split("/")[-1]
self.gh_issue = gh_issue.GHIssue(number=self.issue, repo=self.repo)

self._project = None
self.is_blocked: tp.Callable[[], bool]
if self.repo == "IntersectMBO/cardano-node":
self._project = "node"
self.is_blocked = self._node_issue_is_blocked
elif self.repo == "IntersectMBO/cardano-cli":
self._project = "cli"
self.is_blocked = self._cli_issue_is_blocked
elif self.repo == "IntersectMBO/cardano-db-sync":
self._project = "dbsync"

def is_blocked(self) -> bool:
"""Check if issue is blocked."""
if self._project == "node":
return self._node_issue_is_blocked()
if self._project == "cli":
return self._cli_issue_is_blocked()
if self._project == "dbsync":
return self._dbsync_issue_is_blocked()
return self._issue_is_blocked()
self.is_blocked = self._dbsync_issue_is_blocked
else:
self.is_blocked = self._issue_is_blocked

def _node_issue_is_blocked(self) -> bool:
"""Check if node issue is blocked."""
Expand Down

0 comments on commit ce6ab2f

Please sign in to comment.