Skip to content

πŸ› contributor lane: recognise the cncf/prow-github-actions ok-to-test refusal - #18838

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/ok-to-test-refusal-wordings
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/ok-to-test-refusal-wordings

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

The contributor lane posts /ok-to-test on an admitted non-member fork PR once per head, and stops for good once the merge bot refuses the Hive App. It only recognised upstream Prow's refusal. Repositories that run Prow commands through cncf/prow-github-actions reply in different words, so the hive posted the command again on every new head, was refused every time, and never left the needs-human note asking a person to post it.

This PR recognises the action's refusal too. It also adds a wording-proof fallback: a command for an earlier head that had no effect after 10 minutes counts as refused, whatever the bot said or didn't say.

What happened

Each of these is a fork PR by a non-member. Every post was refused within a minute with exactly Cannot /ok-to-test because Error: hivecommons-hive[bot] is not a reviewer or approver for any changed file. None got a hive-ok-to-test-rejected note. Times are Eastern.

Cause

workflowApprovalCommentState (automerge_held_runs.go) set rejected only when a non-App comment contained Prow's Cannot trigger testing until a trusted user and @<app-login>.

cncf/prow-github-actions builds its reply as `Cannot ${command} because ${e}` (src/issueComment/trigger.ts, v3.5.0). The error names the commenter with no @ (src/utils/auth.ts). Neither condition matched, and each new head carried no per-head marker yet, so the lane posted again.

What changed

  • Both refusal forms (okToTestRefusal):

    • Prow's phrase with @<app>, as before;
    • a reply that opens Cannot /ok-to-test because and names the App login, with or without @.

    Either must name the App, so a refusal of a contributor's own /ok-to-test does not count. As with Prow's check, the author is not restricted beyond not being the App. The reader serves the fork lane and the same-repo held-runs path, so both pick it up.

  • The notes quote the wording that matched. Prow's note is byte-identical to before.

  • Fallback, fork lane only (okToTestUnanswered): the command counts as refused when all of these hold:

    • the App's command for an earlier head is at least workflowApprovalGrace (10m) old;
    • the PR still has no ok-to-test label (the trigger plugin's label persists across pushes);
    • Prow reported no presubmit status on that head (prowPresubmitStatusPresent).

    Then the lane does not post again and leaves the one note, which says the earlier post had no effect rather than quoting a refusal. A failed status lookup counts as "a presubmit is present", so nothing is concluded from evidence it could not read.

  • Reused, not added: markWorkflowApprovalUntrusted, the hive-ok-to-test-rejected note and skipped=prow-rejects-bot-commands. No new setting, label or marker.

  • Docs: hive-merge.md (the paragraph that promised the stop for Prow's wording only) and fork-pr-presubmit-stall-runbook.md name both wordings and the fallback.

Not in this PR

  • When the first /ok-to-test is posted is unchanged. So is the same-repo hive-ok-to-test workflow route.
  • The held-runs path gets the new wording but not the fallback. It already stops on a Prow-managed repository without the workflow.
  • Making the App a trusted user of a repository's Prow (OWNERS). That is each repository's configuration.
  • [scanner] Contributor lifecycle notices as one upserted hive:contributor comment; ok-to-test ack as a reactionΒ #18608 (turning the ok-to-test acknowledgement into a reaction, with a comment kept only for rejections) relies on rejections being detected. It does not touch the detection, so this PR is not a duplicate of it.

Tests

  • TestOkToTestRefusal:
    • Prow's wording with and without @<app>;
    • the action's wording with a bare login and in a different case;
    • the action refusing another commenter;
    • another command's refusal;
    • the wording quoted mid-comment;
    • an unknown App login.
  • TestContributorLaneStopsProwOkToTestAfterProwActionsRefusal: across two runs (a restart), exactly one note, quoting the action's wording.
  • TestContributorLaneTreatsUnansweredProwOkToTestAsRefused:
    • an earlier post past the grace with no effect gets no new post and one note;
    • a post inside the grace still posts;
    • an earlier head with a Prow presubmit still posts and leaves no note;
    • the ok-to-test label present gets nothing.
  • TestTrySweepSelfAuthoredPRStopsOkToTestAfterProwActionsRefusal: the same-repo path stops on the action's wording and its note quotes it.
  • The fixture serves commits/<sha>/statuses for earlier heads (earlierStatuses).

Only gofmt -l was run locally (AGENTS.md bans local go test/go build/go vet); CI runs the tests.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

… refusal

The lane stopped posting /ok-to-test only on upstream Prow's
"Cannot trigger testing until a trusted user" reply naming @<app>.
cncf/prow-github-actions answers "Cannot /ok-to-test because Error:
<app> is not a reviewer or approver ..." with no @, so the hive posted
the command again on every head and never left the needs-human note
(projectbluefin/chairlift#802, projectbluefin/utah#1274, hivecommons#1313).

Recognise both forms (naming the App), quote the matched wording in the
notes, and in the fork lane treat a command for an earlier head that is
past the 10m grace with no ok-to-test label and no Prow presubmit on
that head as refused, whatever the bot said.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 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 hanthor 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

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

βœ… Resolved: no conflicting open PRs or same-file overlaps remain against v6.

@hivecommons-hive
hivecommons-hive Bot merged commit 3bc2f50 into hivecommons:v6 Nov 17, 2026
81 of 82 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

Evidence bundle `#188384846de8` sha256:128aef0c277426bbd98846ed4865f33bf093b12ec03221b9c9f166ef06220817 β€” download from the dashboard or `hivectl review evidence #18838`.

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.

1 participant