Repository navigation
Warn on failed parent team updates and don't count them as changes - #310
Draft
parkerbxyz wants to merge 1 commit into
Draft
parkerbxyz wants to merge 1 commit into
parkerbxyz wants to merge 1 commit into
Conversation
update_team now logs a rejected (422) update as a warning with the error from GitHub instead of a debug message. sync_team uses the value update_team returns, so a failed parent update is no longer reported as a change. Other successful changes still make sync_team return true. Part of #6
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.
Part of #6
If GitHub rejects a parent team update with a
422,update_teamlogged the error only at debug level and returnedfalse.sync_teamignored that and counted the parent as changed anyway, so the run looked like it worked unless you ran with--debug.Changes
update_teamnow logs a rescuedOctokit::UnprocessableEntityas a warning, with the error message from GitHub.sync_teamuses the valueupdate_teamreturns, so a failed parent update doesn't count as a change. If member or maintainer changes succeed,sync_teamstill returnstrue.Tests
update_team422test to expect a warning.sync_teamtest where only the parent changes and the update fails. It expects no change to be reported.sync_teamtest where the parent update fails but a member is added. It expects a change to be reported.Not included
This PR doesn't detect or handle pending parent team requests, and it doesn't check the parent after updating it. We haven't confirmed how the GitHub API behaves in that case. The
read_teambug in #309 is also handled separately.