[tasks/init] Handle stale repo_git in augur_handle_task_failure#3724
Draft
devs6186 wants to merge 1 commit intochaoss:mainfrom
Draft
[tasks/init] Handle stale repo_git in augur_handle_task_failure#3724devs6186 wants to merge 1 commit intochaoss:mainfrom
devs6186 wants to merge 1 commit intochaoss:mainfrom
Conversation
When detect_github_repo_move updates the repo_git in the DB and then raises an exception, the failure handler was looking up the repo by the now-stale old URL, causing a NoResultFound that masked the original error. Switched to one_or_none() and return early with a warning when the repo is not found. Fixes chaoss#3421 Signed-off-by: devs6186 <devyanshsomvanshi@gmail.com>
Contributor
|
I like the core idea of this change, but I think the log message that is specifically related to the move detection may need some more work. marking as draft in case someone else wants to pick it up or a maintainer is interested in it. |
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
session.query(Repo).filter(...).one()to.one_or_none()inaugur_handle_task_failureNotes
When
detect_github_repo_move_coredetects that a repo has moved it updates the DB'srepo_gitto the new URL and then raises an exception. Theon_failureCelery handler then tries to look up the repo by the old URL, which no longer matches anything in the DB, so.one()raisesNoResultFound. This secondary exception masked the original one and showed up as a separate error in the worker logs.Using
.one_or_none()and returning early when the repo is not found avoids the crash. It's safe to skip the status update in this case because the repo-move handler already reset the collection state before raising.Related issues/PRs
Description
This PR fixes #3421
Notes for Reviewers
The fix is in
augur_handle_task_failurewhich is shared by bothAugurCoreRepoCollectionTaskandAugurSecondaryRepoCollectionTask(via inheritance), so both are covered.Signed commits