Skip to content

Commit

Permalink
handle old builds
Browse files Browse the repository at this point in the history
  • Loading branch information
aliciaaevans committed Apr 2, 2024
1 parent 9bb8c89 commit 2e6824d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions images/bot/src/bioconda_bot/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
async def make_artifact_comment(session: ClientSession, pr: int, sha: str) -> None:
artifactDict = await fetch_pr_sha_artifacts(session, pr, sha)

comment = "Package(s) built are ready for inspection:\n\n"
comment += "Arch | Package | Zip File / Repodata | CI | Instructions\n"
comment += "-----|---------|---------|-----|---------\n"
header = "Package(s) built are ready for inspection:\n\n"
header += "Arch | Package | Zip File / Repodata | CI | Instructions\n"
header += "-----|---------|---------|-----|---------\n"

comment = ""
# Table of packages and zips
for [ci_platform, artifacts] in artifactDict.items():
if ci_platform == "azure":
Expand All @@ -38,6 +39,11 @@ async def make_artifact_comment(session: ClientSession, pr: int, sha: str) -> No
comment += compose_circlci_comment(artifacts)
elif ci_platform == "github-actions":
comment += compose_gha_comment(artifacts)
if len(comment) == 0:
comment = ( "No artifacts found on the most recent builds. "
"Either the builds failed, the artifacts have been removed due to age, or the recipe was blacklisted/skipped.")
else:
comment = header + comment

# Table of containers
imageHeader = "***\n\nDocker image(s) built:\n\n"
Expand Down
2 changes: 1 addition & 1 deletion images/bot/src/bioconda_bot/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def fetch_azure_zip_files(session: ClientSession, buildId: str) -> [(str,
log("contacting azure %s", url)
async with session.get(url) as response:
# Sometimes we get a 301 error, so there are no longer artifacts available
if response.status == 301:
if response.status == 301 or response.status == 404:
return artifacts
res = await response.text()

Expand Down

0 comments on commit 2e6824d

Please sign in to comment.