fix(github): answer a control command the schema change already satisfies - #970
Draft
aparajon wants to merge 1 commit into
Draft
fix(github): answer a control command the schema change already satisfies#970aparajon wants to merge 1 commit into
aparajon wants to merge 1 commit into
Conversation
…fies Reissuing a control command is how an operator confirms the first one landed. A cancel on an already-cancelled schema change, or a stop on an already-stopped one, answered with a failure comment carrying a support-channel link and logged a warning — sending someone who got exactly what they asked for to look for an incident that does not exist. Control errors now distinguish a request the apply's state already satisfies from one the operator must reissue differently. A satisfied request gets an informational reply with no support escalation, an INFO log, and its own "satisfied" value on the control-operation metric so repeat commands do not inflate the rejection rate operators alert on. Every control command routes through the same path, so any operation that can be issued twice is covered. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves operator UX and telemetry for repeated control commands by distinguishing “already in the requested state” from genuine rejections/failures. It adds a “satisfied” classification for control-operation conflicts so the webhook can respond informationally (without support escalation language) and the control-operation metric can exclude this expected confirmation traffic from the rejection rate.
Changes:
- Add a “satisfied” variant to the shared control-operation HTTP error type, plus helpers to detect it and to classify control errors for metrics.
- Update the webhook control-command lifecycle to post an informational “Nothing to …” comment (and log at INFO) when a command is already satisfied.
- Add integration and unit tests covering repeat stop/cancel on already-stopped/cancelled schema changes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/webhook/templates/issue_comment.go | Adds a dedicated template for “control command already satisfied” replies without support-channel framing. |
| pkg/webhook/control.go | Detects satisfied control-operation errors and posts the informational reply + INFO log instead of routing through rejection handling. |
| pkg/webhook/control_integration_test.go | Adds an integration test ensuring repeat stop/cancel on settled applies replies informationally and does not create new control requests. |
| pkg/api/control_handlers.go | Introduces satisfied control-error classification, a shared metric-status helper, and returns satisfied conflicts for already-cancelled/stopped states. |
| pkg/api/control_handlers_test.go | Adds unit coverage for satisfied classification, wrapping behavior, HTTP status, and metric-status mapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Why this matters
Reissuing a control command is how an operator confirms one landed. Today the second
cancelon a cancelled schema change comes back as a failure comment carrying a support-channel link — routing someone who already got exactly what they asked for toward an incident that does not exist. The same rejection also ticks the metric operators alert on, so ordinary confirming traffic inflates the rejection rate.What it does
satisfiedclassification to the shared control-error type, for a rejection whose cause is the operator's own intent already being the apply's state. It carries the same conflict status — the request still cannot proceed — but callers can tell it apart from a request the operator must reissue differently.stopon a stopped apply answers the same way.satisfiedvalue, so a repeat command no longer counts as a rejection.🤖 Generated with Claude Code