Skip to content

Warn on failed parent team updates and don't count them as changes - #310

Draft
parkerbxyz wants to merge 1 commit into
mainfrom
parkerbxyz-warn-on-failed-parent-team-update
Draft

parkerbxyz wants to merge 1 commit into
mainfrom
parkerbxyz-warn-on-failed-parent-team-update

Conversation

@parkerbxyz

@parkerbxyz parkerbxyz commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Part of #6

If GitHub rejects a parent team update with a 422, update_team logged the error only at debug level and returned false. sync_team ignored that and counted the parent as changed anyway, so the run looked like it worked unless you ran with --debug.

Changes

  • update_team now logs a rescued Octokit::UnprocessableEntity as a warning, with the error message from GitHub.
  • sync_team uses the value update_team returns, so a failed parent update doesn't count as a change. If member or maintainer changes succeed, sync_team still returns true.

Tests

  • Updated the update_team 422 test to expect a warning.
  • Added a sync_team test where only the parent changes and the update fails. It expects no change to be reported.
  • Added a sync_team test 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_team bug in #309 is also handled separately.

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
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.

1 participant