Skip to content

Commit

Permalink
Merge pull request #313 from ashwindasr/fix-promote
Browse files Browse the repository at this point in the history
skip verify-flaws for preview and prerelease
  • Loading branch information
ashwindasr authored Jan 12, 2024
2 parents 4859a1d + 741aa65 commit e1c9233
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pyartcd/pyartcd/pipelines/promote.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,13 @@ async def run(self):
# logger.info("%s is GA'd. Blocking Bug check will be enforced.", next_minor)
logger.info("Verifying attached bugs...")
advisories = list(filter(lambda ad: ad > 0, impetus_advisories.values()))

verify_flaws = True
if "prerelease" in impetus_advisories.keys() or assembly_type == assembly.AssemblyTypes.PREVIEW:
verify_flaws = False
try:
await self.verify_attached_bugs(advisories, no_verify_blocking_bugs=no_verify_blocking_bugs)
await self.verify_attached_bugs(advisories, no_verify_blocking_bugs=no_verify_blocking_bugs,
verify_flaws=verify_flaws)
except ChildProcessError as err:
logger.warn("Error verifying attached bugs: %s", err)
justification = self._reraise_if_not_permitted(err, "ATTACHED_BUGS", permits)
Expand Down Expand Up @@ -881,7 +886,8 @@ def verify_advisory_status(self, advisory_info: Dict):
if advisory_info["status"] not in {"QE", "REL_PREP", "PUSH_READY", "IN_PUSH", "SHIPPED_LIVE"}:
raise VerificationError(f"Advisory {advisory_info['id']} should not be in {advisory_info['status']} state.")

async def verify_attached_bugs(self, advisories: Iterable[int], no_verify_blocking_bugs: bool):
async def verify_attached_bugs(self, advisories: Iterable[int], no_verify_blocking_bugs: bool,
verify_flaws: bool = True):
advisories = list(advisories)
if not advisories:
self._logger.warning("No advisories to verify.")
Expand All @@ -890,9 +896,10 @@ async def verify_attached_bugs(self, advisories: Iterable[int], no_verify_blocki
"elliott",
f"--assembly={self.assembly}",
f"--group={self.group}",
"verify-attached-bugs",
"--verify-flaws"
"verify-attached-bugs"
]
if verify_flaws:
cmd.append("--verify-flaws")
if no_verify_blocking_bugs:
cmd.append("--no-verify-blocking-bugs")
async with self._elliott_lock:
Expand Down

0 comments on commit e1c9233

Please sign in to comment.