feat(api): default operator claiming to the operation level#431
Draft
Kiran01bm wants to merge 1 commit into
Draft
feat(api): default operator claiming to the operation level#431Kiran01bm wants to merge 1 commit into
Kiran01bm wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR flips operator drivers to default to operation-level claiming (via apply_operations / FindNextApplyOperation) by making operator_claim_operations a tri-state *bool and centralizing the nil-means-on behavior in ServerConfig.ShouldClaimOperations(). This aligns the default operator execution path with the multi-deployment-ready operation-scoped driver flow while preserving an explicit fallback to legacy apply-level claiming.
Changes:
- Change
ServerConfig.OperatorClaimOperationsfromboolto*booland introduceShouldClaimOperations()(nil/unset defaults totrue). - Route operator recovery branching through
ShouldClaimOperations()instead of directly reading the config field. - Update unit/integration tests to explicitly set
operator_claim_operations: falsewhere they require the legacy apply-level claim path, and add config accessor/YAML coverage.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/api/operator.go | Switch operator claiming branch to use config.ShouldClaimOperations() for nil-safe default-on behavior. |
| pkg/api/handlers_test.go | Force legacy apply-level claiming in tests that mock the apply-level claim path. |
| pkg/api/config.go | Convert OperatorClaimOperations to *bool and add ShouldClaimOperations() with default-on semantics. |
| pkg/api/config_test.go | Add unit + YAML tests covering ShouldClaimOperations() defaulting and opt-out behavior. |
| integration/workflow_test.go | Update integration test server config construction for the new *bool field type. |
| integration/operator_test.go | Explicitly select apply-level claiming for the stale-apply scenario that requires it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Make operation-level claiming (FindNextApplyOperation) the default so new deployments adopt the multi-deployment-ready drive path without explicit config. operator_claim_operations is now a tri-state pointer: unset means operation-level, explicit false preserves apply-level claiming.
5d11a1d to
03af67a
Compare
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.
What
Make operation-level claiming the default for operator drivers. The
operator_claim_operationssetting becomes a tri-state pointer:apply_operationslevel viaFindNextApplyOperationtrue→ same operation-level pathfalse→ fall back to apply-level claiming viaFindNextApplyA new
ShouldClaimOperations()accessor centralizes the nil-means-on logic.Why
The operation-level claim path is the foundation for multi-deployment applies.
While every apply still owns exactly one operation, the operation-scoped drive
resolves to the same work as the apply-scoped drive, so flipping the default is
behavior-preserving today while moving all new deployments onto the
multi-deployment-ready path without per-deployment config. The apply-level path
remains available via explicit
falsefor fallback.Flow
Before — drivers default to apply-level claiming:
After — drivers default to operation-level claiming:
References
Follow-up in the multi-deployment apply work stream; builds on the
operation-claim drive path landed in #429.