Skip to content

fix(github-artifacts): Better pagination and retry on missing artifacts#190

Merged
BYK merged 2 commits into
masterfrom
byk/fix/github-artifact-missing
Mar 25, 2021
Merged

fix(github-artifacts): Better pagination and retry on missing artifacts#190
BYK merged 2 commits into
masterfrom
byk/fix/github-artifact-missing

Conversation

@BYK

@BYK BYK commented Mar 22, 2021

Copy link
Copy Markdown
Member

GitHub sometimes takes a few minutes until it lists freshly uploaded artifacts on its API. This PR adds a retry mechanism when we cannot find any artifacts for the given revision. It also improves the pagination mechanism to no scan artifacts beyond the revision's commit date to shorten lookup times.

Fixes #182.

GitHub sometimes takes a few minutes until it lists freshly uploaded artifacts on its API. This PR adds a retry mechanism when we cannot find any artifacts for the given revision. It also improves the pagination mechanism to no scan artifacts beyond the revision's commit date to shorten lookup times.

Fixes #182.
@BYK
BYK requested a review from jan-auer March 22, 2021 20:47
@BYK

BYK commented Mar 22, 2021

Copy link
Copy Markdown
Member Author

This is a draft because I don't know how to test this without screwing something up.

Comment thread src/artifact_providers/github.ts
@BYK
BYK marked this pull request as ready for review March 24, 2021 21:34
@BYK

BYK commented Mar 24, 2021

Copy link
Copy Markdown
Member Author

Tested this locally and it works (at least the happy path). It is hard to test the flaky GitHub scenario so we'll have to wait for that one.

@BYK
BYK enabled auto-merge (squash) March 24, 2021 21:35

@jan-auer jan-auer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An overall different approach could be to query workflow runs for the release branch and then using the run id query the artifacts for this single run.

Comment thread src/artifact_providers/github.ts
@BYK
BYK merged commit f9febcd into master Mar 25, 2021
@BYK
BYK deleted the byk/fix/github-artifact-missing branch March 25, 2021 07:54
@BYK

BYK commented Mar 25, 2021

Copy link
Copy Markdown
Member Author

An overall different approach could be to query workflow runs for the release branch and then using the run id query the artifacts for this single run.

Ah, I actually checked that API but didn't look at the parameters to see it allowed filtering based on branch name and trigger. That said I think it would still be a challenge to scan all the runs and get relevant artifacts so our "happy path" would end up making more requests and more complex.

However, if we consider tying status checks to artifacts, we can tell Craft to get an artifact from a specific workflow run. This may cause some brittle config as a downside but might be worth exploring.

BYK added a commit that referenced this pull request Apr 9, 2021
This PR reverts #177 as not only it did not address the issue it
was intending to fix, it introduced delays in where we actually
expect a 404 response. It also caused a weird failure where we
threw an error due to a 404 response which should have been ignored:
https://github.com/getsentry/publish/runs/2281793805?check_suite_focus=true#step:8:59

The retry issue was resolved via #190.
BYK added a commit that referenced this pull request Apr 9, 2021
This PR reverts #177 as not only it did not address the issue it
was intending to fix, it introduced delays in where we actually
expect a 404 response. It also caused a weird failure where we
threw an error due to a 404 response which should have been ignored:
https://github.com/getsentry/publish/runs/2281793805?check_suite_focus=true#step:8:59

The retry issue was resolved via #190.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GH Artifact provider: Unable to retrieve artifact list for revision

3 participants