Skip to content

Commit

Permalink
Fix target override identifier in github check rerun event
Browse files Browse the repository at this point in the history
  • Loading branch information
majamassarini committed Nov 29, 2024
1 parent 0f2e9b2 commit 5dfb47c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packit_service/worker/events/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,24 +236,16 @@ def __init__(
)
self.job_identifier = job_identifier

def _parse_target_and_identifier(self, target_string: str) -> tuple[str, str]:
"""Parse target and identifier from check name target string."""
if ":" in target_string:
target, identifier = target_string.split(":")
else:
target, identifier = target_string, ""
return target, identifier

@property
def build_targets_override(self) -> Optional[set[tuple[str, str]]]:
if self.check_name_job in {"rpm-build", "production-build", "koji-build"}:
return {self._parse_target_and_identifier(self.check_name_target)}
return {(self.check_name_target, self.job_identifier)}
return None

@property
def tests_targets_override(self) -> Optional[set[tuple[str, str]]]:
if self.check_name_job == "testing-farm":
return {self._parse_target_and_identifier(self.check_name_target)}
return {(self.check_name_target, self.job_identifier)}
return None

@property
Expand Down

0 comments on commit 5dfb47c

Please sign in to comment.