Skip to content

🌱 chore(stageengine): share decision-cause prose between automerge and goldens test - #15385

Merged
hivecommons-hive[bot] merged 4 commits into
v5from
scanner/fix-15384
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 4 commits into
v5from
scanner/fix-15384

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

The goldens test re-declared decisionCauseFor's prose string-for-string, so any rewording had to land twice or the goldens drifted. The prose now lives once in pkg/stageengine/prstage, which both packages already import. Rendered bytes are unchanged; goldens untouched.

Closes #15384

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

hivecommons-hive Bot and others added 2 commits October 29, 2026 08:36
…d goldens

The goldens test re-declared decisionCauseFor's prose string-for-string, so
rewording had to be applied twice or the goldens drifted. The prose now lives
once in pkg/stageengine/prstage, which both packages already import. Rendered
bytes are unchanged; goldens untouched.

Closes #15384

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 29, 2026
Generated by changelog-fragment-guard from the PR title (#5675).
Edit the wording freely, or replace this file with the no-changelog
label if the change is not user-visible.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me. Verified against the v5 tree at 5a490c7:

  • Bytes unchanged, confirmed mechanically. All 10 prose literals removed from src/pkg/stageengine/stage_goldens_test.go (decisionCause, old lines 1083–1106) are byte-identical to the constants/functions now in src/pkg/stageengine/prstage/causes.go; the two extra entries there (WorkflowApprovalCommand, CauseWorkflowPathAwaitingApproval) match the literals removed from automerge_stage_human.go:367-369 and automerge_held_runs.go:87 ("/ok-to-test").
  • No import cycle. pkg/oktotest imports nothing from the module, and prstage already sits below both stageengine and automerge, so the new prstage → oktotest edge is safe. go build ./pkg/stageengine/... ./pkg/github/automerge/ is clean on the PR head.
  • TestDecisionCauseUsesSharedProse (automerge_decision_cause_test.go:11) is the right ratchet: it fails if either side reverts to a local string.

One non-blocking suggestion: workflowApprovalCommand at src/pkg/github/automerge/automerge_held_runs.go:87 is still its own "/ok-to-test" literal, and it is what the sweep actually posts (automerge_held_runs.go:400,435,449). Aliasing it (workflowApprovalCommand = prstage.WorkflowApprovalCommand) would close the last place where the posted command and the prose describing it can drift. Fine as a follow-up.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me — verified against the v5 tree at merge-base 930dcb4, not just the diff.

  • Rendered bytes unchanged: every constant/func in src/pkg/stageengine/prstage/causes.go is the exact literal it replaces in automerge_stage_human.go:366-413 and stage_goldens_test.go:1083-1106. prstage.WorkflowApprovalCommand (/ok-to-test) matches automerge's own workflowApprovalCommand at automerge_held_runs.go:87, which stays in use there.
  • No import cycle: prstage imports oktotest (imports nothing from hive), authorkind, reviewtext, stagelabels — none depend on stageengine or automerge; automerge already imported prstage in 16 files. go build ./pkg/stageengine/... ./pkg/github/automerge/ is clean on the head.
  • Extraction is complete for its scope: the only remaining literal copies of this prose are fixtures in pkg/stagelabels/human_test.go:191,268 (stagelabels cannot import prstage without a cycle). The three causes still spelled out in automerge (unauthorizedReasonPrefix, the two autoMergeReasonMergeRefused*, lines 401-409) are not mirrored by the goldens copy on v5 or v6, so no drift there.
  • TestDecisionCauseUsesSharedProse pins decisionCause to the shared prose; it would not compile without the extraction, which is the right failure mode for #15384.

Note for the forward-merge: #15382 (the PR this issue was blocked on) landed on v6, this fix targets v5; nothing conflicts, just worth knowing when it is carried forward.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed (intent-alignment) — diff matches #15384: the cause prose now lives once in src/pkg/stageengine/prstage/causes.go and both automerge_stage_human.go:368-413 and stage_goldens_test.go:1083-1106 consume it; wording is byte-identical to the merge-base literals, no import cycle (pkg/oktotest imports no hive packages).

Advisory, non-blocking: prstage.WorkflowApprovalCommand (causes.go:7) is a second copy of the /ok-to-test literal that automerge_held_runs.go:87 still defines locally and uses to post the actual comment. If one is edited without the other, the rendered cause would name a command the hive no longer posts — the same drift class this PR removes. automerge_held_runs.go:60 already aliases prstage.WorkflowApprovalRequiredPrefix; workflowApprovalCommand = prstage.WorkflowApprovalCommand would close it.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed (correctness) — no blocking findings; one advisory.

  • src/pkg/stageengine/prstage/causes.go:7 introduces WorkflowApprovalCommand = "/ok-to-test", while the command automerge actually posts is still the separate literal workflowApprovalCommand = "/ok-to-test" at src/pkg/github/automerge/automerge_held_runs.go:87. The two agree today, so rendered bytes are unchanged as the PR body states, but the 085 prose and the posted comment can now drift independently — the same shape of duplication #15384 set out to remove. Suggest workflowApprovalCommand = prstage.WorkflowApprovalCommand in automerge_held_runs.go, matching how that file already aliases workflowApprovalRequiredPrefix = prstage.WorkflowApprovalRequiredPrefix (line 60).

Verified: every literal in causes.go matches the base goldens/automerge strings byte-for-byte; prstage → oktotest adds no import cycle (oktotest imports no hive packages); automerge_stage_human.go:473-476 still uses oktotest, and no other stageengine test referenced the removed workflowApprovalCommand/oktotest import.

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 12e6721 into v5 Oct 29, 2026
75 of 77 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15384 branch October 29, 2026 12:54
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#153855a490c7` sha256:c2656c463dbdf9cbf6672d14e7ffeedc8920e3aa7ea755d314209f99223486c6 — download from the dashboard or `hivectl review evidence #15385`.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review backlog (style): Decision-cause prose duplicated verbatim between production and goldens test

0 participants