Skip to content

πŸ› Fix SHA hold exemptions and dashboard controls - #18870

Closed
Karibhou wants to merge 2 commits into
hivecommons:v5from
Karibhou:fix/18866-needs-sha
Closed

Karibhou wants to merge 2 commits into
hivecommons:v5from
Karibhou:fix/18866-needs-sha

Conversation

@Karibhou

Copy link
Copy Markdown
Contributor

Fixes #18866

  • Exempt trusted authors and reports naming concrete code paths; preserve an authorized SHA override across sweeps.
  • Show blocking control labels and release guidance in the issue tracker, with a permission-gated SHA override that does not release other holds.
  • Add regression coverage and update operator documentation.

Verification: targeted dashboard Node tests; a local mocked SHA-sweep scenario; gofmt check. Go tests were not run under repository agent policy.

β€” hive: backend=omp model=openai-codex/gpt-6.1-terra

Honor reporter and path exemptions and persist authorized SHA overrides.

Hive-Run: hivecommons#18866
Hive-Plan: needs-sha hold exemptions and dashboard signal
Hive-Spec: issue-18866#acceptance
Signed-off-by: Karibhou <Karibhou@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 18, 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 clubanderson 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 Nov 18, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

@Karibhou this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • coverage
  • test
  • test (rest 1/4)
    Review asks:
  • the review swarm requested changes

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (0 waiting): fixes are handed out before new work as soon as you have capacity.

Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>

@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.

Correctness review at head 5a97f97 (contract: #18866). One in-scope finding.

Path exemption is far too loose: it re-opens the gate for external reporters. shaHoldBodyHasPath (src/pkg/github/client.go, inline) calls normalizeCitedPath on every whitespace token (src/pkg/github/close_on_merge.go:837). That function only checks the file extension against citedPathExtensions, so it accepts bare tokens such as Node.js, package.json, config.yaml, main.go, Dockerfile or Makefile. None of these needs a directory or any link to the repo. An external report like "the build fails with Node.js 20" or "my config.yaml is ignored" therefore counts as "names concrete code paths". It is exempted and its needs-sha is released. This breaks the acceptance criterion "External kind/bug reports without a SHA are still held". TestSHAHoldBodyHasPath only covers prose with no extension, so it misses this.

Requested change: for the SHA exemption, accept only a token that contains a / (a directory-qualified path) or a bare token that is in citedPathBasenames and written in backticks. Add negative tests for Node.js and config.yaml. For example:

-		if _, ok := normalizeCitedPath(token); ok {
-			return true
-		}
+		if p, ok := normalizeCitedPath(token); ok && strings.Contains(strings.TrimSuffix(p, "/"), "/") {
+			return true
+		}

Not verified: item 2 of the issue (auto-attach a SHA) is not implemented. It is worded "may", so I treat it as optional. I did not check whether hive/sha-override is touched by other label-management code.

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

Comment thread src/pkg/github/client.go
for _, token := range strings.Fields(body) {
token = strings.Trim(token, "`\"'()[]<>,;.")
if _, ok := normalizeCitedPath(token); ok {
return true

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.

Bare tokens such as Node.js or config.yaml pass normalizeCitedPath, so an external report that only mentions them is exempted from the SHA gate. Require a /-qualified path (see the suggested diff in the summary).

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

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

CI is red on this head (test (rest 1/4), plus test/coverage); I could not isolate the failing test from the log, so that needs the author's eyes before anything else.

One verified behaviour to confirm is intended: the exemption at src/pkg/github/client.go:4818 uses shaHoldBodyHasPath, which accepts any token that normalizeCitedPath (close_on_merge.go:837) accepts β€” including a bare basename or any token ending in a known extension. So an issue from any reporter, trusted or not, that merely mentions e.g. README.md skips the SHA gate and has the sweep-owned label removed. Per the PR body this is the intent ("reports naming concrete code paths"); flagging only because it makes the gate much weaker for untrusted reporters than the OWNER/MEMBER/COLLABORATOR exemption does. Open question, not a defect.

Checked: the new override_sha branch in handleRepoItemHold runs after canToggleRepoHold, so the override is permission-gated; releaseExemptSHAHold only removes labels whose provenance it verified.

@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
#18874 πŸ› Withhold the contributor nudge for a head the hive adopts anyway same files src/docs/operator-reference/README.md
#18873 πŸ› needs-sha: exempt owner/detailed issues, overrideable waiver, visible hold on the row CONFLICT src/docs/labels-and-control-signals/glossary-and-operations.md (conflict)
src/docs/labels-and-control-signals/reference.md (conflict)
src/docs/operator-reference/README.md (conflict)
src/docs/scale-envelope.md (conflict)
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_build.go (conflict)
src/pkg/dashboard/static-src/js/tracker-actions.js (conflict)
src/pkg/dashboard/static-src/js/tracker-row-strip.js
src/pkg/dashboard/static/index.html (conflict)
src/pkg/github/client.go (conflict)
src/pkg/github/sha_hold_soft_test.go (conflict)

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 18, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson asked the hive to adopt this pull request now, without waiting for its author's hive. The hive opens its own PR carrying the author's commits and sign-off unchanged on the pass now running; this PR closes when that copy merges.

@hivecommons-hive hivecommons-hive Bot added the adoption/supersede Owner-delegate request: adopt now in supersede mode label Nov 18, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Superseded by hive: re-authored as #18879 with the same commits and sign-off because CI stayed red and the author was unavailable. This PR is closed; if #18879 fails, hive reopens it.

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

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. hive/superseded Closed by Hive: a different merged PR already landed this change 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.

πŸ› needs-sha hold blocks owner-filed bugs and gives no dashboard signal

1 participant