Skip to content

πŸ› Never auto-close epics or parents a person reopened - #18871

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
fix/18869-parent-autoclose-reopen
Nov 18, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
fix/18869-parent-autoclose-reopen

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #18869

  • Parents labelled epic (any case) or hold are never auto-closed unless repos.<repo>.parent_autoclose: epics_too; false disables parent auto-close for the repo; default true keeps closing plain decomposed parents.
  • A parent a non-bot reopened after a hive auto-close (marker comment or bot close) is never re-closed, under any config value. Derived from the timeline (durable across restarts); the read happens only when all children are confirmed closed, a no-reopen verdict is cached 30 min and a reopen verdict forever; unreadable timeline fails closed.
  • Tests cover EPIC stays open, human reopen never re-closed, hive-created parent still closes, config values. Docs: stage-labels.md, operator-reference.

Follow-up: dashboard pill 'kept open: reopened by ' not included (needs dashboard row plumbing); decision is logged.

πŸ€– Generated with Claude Code

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@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 kellyaa 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 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. labels Nov 18, 2026
@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.

PR Title Relation Files
#18870 πŸ› Fix SHA hold exemptions and dashboard controls same files src/docs/operator-reference/README.md
#18868 ✨ Sandbox Jobs: authenticated GitHub reads via a read-only hive relay same files src/pkg/dashboard/settings_parity_allowlist.txt

@hivecommons-hive
hivecommons-hive Bot merged commit 8ce72d8 into v5 Nov 18, 2026
96 of 97 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/18869-parent-autoclose-reopen branch November 18, 2026 03:40
@hivecommons-hive

hivecommons-hive Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#18871a194936` sha256:a9f0f22ddeb80bd0a2654e1228b31fd343a08c73f09fc2fa92270067d74846fc β€” download from the dashboard or `hivectl review evidence #18871`.

merged by Hive trusted-author auto-merge: author clubanderson holds role owner and GitHub permission admin on repo; CI green at a194936.

Review findings from reviewer-2 (folded here because this head already carries its hive review):

One verified defect: the 30‑minute "no reopen" cache can let the sweep re‑close a parent a person reopens right after a hive auto‑close, which is the case this PR exists to stop (#18869). Details are on the line thread. Everything else I read (label/config exemption order, fail‑closed on an unreadable timeline, issueEventFrom populating Body/ActorIsBot for commented/closed/reopened) looks correct to me.

Findings not on a changed line

  • src/pkg/github/decomposed_parents.go:402: Stale negative verdict defeats the rule. parentKeptOpenBy caches "no reopen" for parentReopenNegativeTTL (30m) immediately before this close runs, and nothing invalidates that entry after a successful CloseIssue. If a person reopens the parent within 30 minutes of the auto-close (the common case), the next sweep sees all children closed, hits the cached negative, and closes it again; the timeline is only re-read once the TTL lapses. Suggested fix: drop the entry on a successful close, e.g. parentReopenMu.Lock(); delete(parentReopenCache, strings.ToLower(owner+"/"+name)+"#"+strconv.Itoa(in.Number)); parentReopenMu.Unlock() next to store.Forget(key), plus a test that closes, reopens as a human, and asserts the second sweep keeps it open. Severity: medium.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One verified defect in the reopen guard (inline); the epic/hold/config exemptions read correctly to me.

The negative-verdict cache (decomposed_parents.go:451, :471, :483) is never invalidated when the hive closes the parent. The sequence: the sweep checks the timeline, finds no reopen, caches "no reopen" for 30 min, then closes the parent. If a person reopens it within that window, the next sweep reads the cache and re-closes the parent, which is the case #18869 is meant to prevent. The tests reset the cache and never exercise close followed by reopen inside the TTL.

β€” hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.326

parentReopenMu.Lock()
v, ok := parentReopenCache[key]
parentReopenMu.Unlock()
if ok && (v.by != "" || time.Since(v.checked) < parentReopenNegativeTTL) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A cached "no reopen" verdict (by == "") is honoured for 30 min even after this sweep closes the parent. A person who reopens within that window is not seen, and the next cycle re-closes the parent. Fix: drop the cache entry for the key once the close succeeds in closeDecomposedParent, or don't cache a negative verdict when the close proceeds. A test that closes, reopens via the fake timeline and sweeps again would fail without it.

@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing

9 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the mutation/acknowledged label to accept this.

File Line Mutation
src/pkg/github/decomposed_parents.go 451 ARITHMETIC_BASE
src/pkg/github/decomposed_parents.go 476 CONDITIONALS_NEGATION
src/pkg/github/decomposed_parents.go 477 ARITHMETIC_BASE
src/pkg/github/decomposed_parents.go 477 ARITHMETIC_BASE
src/pkg/github/decomposed_parents.go 496 CONDITIONALS_NEGATION
src/pkg/github/decomposed_parents.go 496 CONDITIONALS_NEGATION
src/pkg/github/decomposed_parents.go 498 CONDITIONALS_NEGATION
src/pkg/github/decomposed_parents.go 500 CONDITIONALS_NEGATION
src/pkg/github/decomposed_parents.go 500 CONDITIONALS_NEGATION

Verdict: uncovered (#17349).

@clubanderson

Copy link
Copy Markdown
Member Author

@joerunde FYI: this is the fix for the hive closing epics (torch-spyre/spyre-inference#756 was closed by the parent auto-close sweep five times, including twice right after a maintainer reopened it and asked it to stop). It is merged to v5 as 8ce72d8. After this, the sweep never closes an issue labelled EPIC or hold and never re-closes a parent a human reopened; repos can switch it off with repos..parent_autoclose: false. It reaches your hive with the next hive build, which I will roll out for you. Until then, keep the sub-issue you added on #756 and please do not close or reopen it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

πŸ› Parent auto-close closes epics and ignores a maintainer's reopen (torch-spyre/spyre-inference#756)

1 participant