Repository navigation
π Stop the in-progress sweep stripping workflow-model stage labels - #18518
Conversation
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. Evidence bundle `#185188d1f29b` sha256:26b86e30a5f78ba879ead70e8a31752dcc52a921a59ab82642586090a25d6fcc β download from the dashboard or `hivectl review evidence #18518`. |
A repository bound to a workflow model derives its stage through the model; TechDocs 'Accepted' (number 20) wears stage/020-claimed. The in-progress sweep read that as a claim, found no start mark and removed it; the stage sync re-added it two seconds later, every cycle (cncf/techdocs#395, ~298 flips). The sweep now leaves a trigger label the bound model derives for the issue alone and never withholds the issue for it (a live start mark still withholds). The default FactSink derives through the same per-repository model lookup as the sweeps, installed from the reconciler's options. Fixes #18434 Signed-off-by: Andy Anderson <andy@clubanderson.com>
The client-hook guard requires every Set* hook to be applied where the client is (re)built, so a rebuilt client keeps it (#9614). Signed-off-by: Andy Anderson <andy@clubanderson.com>
e989744 to
8d1f29b
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@nate-double-u FYI, this is the fix for the label flapping you reported in #18434. |
Root cause
On a repository bound to a workflow model, the issue stage comes from the model. The TechDocs model's Accepted state has lifecycle number 20, which maps to the built-in
stage/020-claimedlabel. Two writers disagreed about that label on every enumeration cycle:SweepInProgressIssuestreatsstage/020-claimedas a claim trigger. It found nohive:claimstart mark, so it removed the label directly ("start mark lapsed").SyncIssueStageLabelsWithderived the issue through the bound model again (Accepted, number 20) and re-addedstage/020-claimed.On cncf/techdocs#395 this produced roughly 298 remove/add pairs, one every 15 minutes. The event log shows each removal followed by the re-add 1 to 3 seconds later.
The default out-of-cycle
FactSinkwas a second writer with the same problem: it was built withoutWorkflowFor, so a claim or release fact on a model-bound repo derived the built-in stage, and the next sweep would revert it.Fix
SweepInProgressIssuesasks the bound model (non-hive-default) whether it derives the trigger label for this issue's state. If it does, the label belongs to the model and is not a claim. The sweep never strips it and does not withhold the issue for it. A live start mark still withholds, and a fetch error still fails closed.StageReconcilerstores itsWorkflowForlookup on the client (SetStageWorkflowFor). The defaultFactSinkderives through the same lookup as the sweeps, so every writer reaches the same answer.issueStageInputFromis factored out ofIssueStageInputsso the sweep builds the same facts the stage sync does.Tests
TestModelOwnedStageLabel_ReconcileIsIdempotentruns in-progress sweep plus stage reconcile four times on a model-bound issue at a number-20 state. The first cycle adds the label once. After that there are no adds or removes, and the issue is never withheld.TestModelOwnedStageLabel_UnboundOrOtherStateStillClears: on an unbound repo, or when the model derives a different stage, a lapsed label is still cleared.Not in this PR
The label still reads "claimed" for a state that means "waiting on the reviewer". Giving model states their own
stage/*names needs new plumbing across the label family (Plan, Current, the Store's Stage enum, dashboard bands), so it is deliberately left out here.Fixes #18434
π€ Generated with Claude Code