fix(github): ignore 404 when collecting unfinished pull requests (#9140) - #9145
Merged
Merged
Conversation
Contributor
Author
|
@klesh hey so this is the one issue that you have assigned to me, applied the approach we discussed earlier in that thread, hope this helps!! |
Contributor
Author
|
hey @klesh sorry for asking it here but the link to the slack discussion is expired i think can you guide me towards a working one |
klesh
approved these changes
Sep 18, 2026
Contributor
|
Good work. Thanks for your contribution. |
Contributor
Try the following one please: https://join.slack.com/t/devlake-io/shared_invite/zt-47ktd6ws4-BdpD0M4W4eaJl8tGwH7Clw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When collecting unfinished pull request details (
CollectUnfinishedDetailsinpr_collector.go), DevLake iterates over previously collected open PRs (state != 'closed' OR merged = false) and queries:GET /repos/{owner}/{repo}/pulls/{number}If a PR has since been deleted, scrubbed (e.g., credential leak removal), or made inaccessible on GitHub, GitHub returns HTTP
404 Not Found.Without an
AfterResponsehook,ApiAsyncClientretries the endpoint 3 times and then terminates the entire subtask with:Retry exceeded 3 times...Consequently, all subsequent syncs fail on the same unavailable PR, causing data collection for newer PRs to halt and repository dashboards to become stale.
This PR adds
AfterResponse: ignoreHTTPStatus404toCollectUnfinishedDetailsinpr_collector.go. The hook returnsapi.ErrIgnoreAndContinuewhen GitHub responds with HTTP404, allowing the collector to gracefully skip unavailable PRs and continue collecting the remaining pull requests.Does this close any open issues?
Closes #9140
Screenshots
N/A
Other Information
cicd_job_collector.go).plugins/github/tasks/shared_test.gocoveringignoreHTTPStatus404andignoreHTTPStatus422.