[tasks/github] Catch ResourceGoneException in message collection#3723
Draft
devs6186 wants to merge 1 commit intoaugurlabs:mainfrom
Draft
[tasks/github] Catch ResourceGoneException in message collection#3723devs6186 wants to merge 1 commit intoaugurlabs:mainfrom
devs6186 wants to merge 1 commit intoaugurlabs:mainfrom
Conversation
Repos with GitHub Issues disabled return HTTP 410, which raises ResourceGoneException in paginate_resource(). Only UrlNotFoundException (404) was caught, so message collection would crash on those repos and mark core as errored. Added ResourceGoneException to the except clause so the comment URL is skipped and collection continues normally. Fixes augurlabs#3710 Signed-off-by: devs6186 <[email protected]>
MoralCode
requested changes
Feb 24, 2026
Comment on lines
-127
to
+128
| except UrlNotFoundException: | ||
| logger.info(f"{task_name}: PR or issue comment url of {comment_url} returned 404. Skipping.") | ||
| except (UrlNotFoundException, ResourceGoneException) as e: | ||
| logger.info(f"{task_name}: Skipping {comment_url}: {e}") |
Collaborator
There was a problem hiding this comment.
this is a good start but i think we can do better by checking for missing pr/issue messages sooner
I think its worth either:
- checking a few urls and if all of them are 404, then just skip all the rest of the message collection
- checking this sooner and returning from the function earlier/sooner
Collaborator
|
marking draft because contributor indicated on slack that this was being abandoned |
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.
Changeset
ResourceGoneExceptionto the import fromgithub_data_accessinmessages.pyexcept UrlNotFoundExceptionclause to also catchResourceGoneExceptionNotes
Repos that have GitHub Issues disabled return HTTP 410 when you try to fetch comment URLs, which raises
ResourceGoneExceptioninpaginate_resource(). OnlyUrlNotFoundException(404) was being caught, so message collection would crash on those repos and mark core collection as errored. The fix skips those URLs the same way 404s are already skipped, so collection continues normally for the rest of the repo.The
ResourceGoneExceptionclass is already defined ingithub_data_access.pyand is already excluded from the tenacity retry logic there, so catching it here is the natural completion of that design.Related issues/PRs
Description
This PR fixes #3710
Notes for Reviewers
Two-line change: one import addition and one except clause extension. The log message now includes the exception string so it's clear whether it was a 404 or a 410.
Signed commits