Skip to content

test(bundle): drive pullRequestOwners' rename and base-tip-fallback arms and tide's fork 403 diagnosis arms through dist/index.js - #328

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-bundle-pr-owners-fork-arms
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-bundle-pr-owners-fork-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds one file, __tests__/bundle/pullRequestOwnersArms.test.ts (7 tests; nothing else touched — no helpers.ts, fakeGithub.ts, source or dist/ change). It runs the committed dist/index.js against the fake GitHub for arms no bundle suite reached:

issue_comment /approve on a pull request — src/utils/pullRequestOwners.ts

  • a file listed with previous_filename (rename) is owned under both names: bob, approver of sdk/moved.go, leaves the pull request NOT APPROVED because olm/moved.go (olm/OWNERS, carol, no_parent_owners) is still unapproved; approve: #1 is not approved; nobody approves olm/moved.go
  • GET /branches/master → 500: ::warning::could not read the tip of master; reading OWNERS at snapshotsha, the tree is read once at pull.base.sha (snapshotsha), never at basesha, and bob's approval still lands (L82–83)

schedule lgtm job, fork pull request whose merge is refused with 403 — src/plugins/tide.ts explainForkWorkflows, src/utils/comments.ts createCommentOnce

  • a bot comment already carrying <!-- prow-github-actions/fork-workflows: <sha7> --> → no POST …/comments, pull request still skipped (comments.ts L58–60)
  • the same marker quoted by a human → the bot explains once more (isBotUser guard)
  • POST …/comments → 500 → ::warning::could not comment on pr #2 about the workflow files: Error: could not add comment: …, still skipped, exit 0 (tide.ts L280, comments.ts L34)
  • no .github/workflows/ file in the compare or the pull request's files → could not merge pr #2: Resource not accessible by integration, exit 1, no comment read (tide.ts L265)
  • GET /compare/{head}...master → 500 → diagnosis dropped, same plain merge failure, no pulls/2/files read (tide.ts L261–262)

Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3, npm run test:coverage:e2e, 142 → 149 bundle tests):

  • src/utils/comments.ts e2e lines 70 % → 100 %
  • src/plugins/tide.ts e2e lines 81.02 % → 83.07 %; L261, 262, 265, 280 now hit
  • src/utils/pullRequestOwners.ts L82–83 now hit (75.86 % → 79.31 % lines). L73–74 still report 0 hits, but that is a source-map artefact, not a gap: the remapped report records the L74 arrow function called 38× while its ternary statement/branch shows [0, 0] on every run, including the [f.filename] path every existing bundle test takes. The rename behaviour is asserted through the notifier instead.
  • unit coverage of the three files is already 100 %; npx eslint clean; npx tsc --noEmit clean

Not claimed: pullRequestOwners.ts L95–96 (#291's max_request_count case reaches requested_reviewers) and L55–56 (resetPullRequestOwnersCache, test-only).

Disjoint from every open held bundle PR: #289/#322 (tide gate and merge-queue arms), #318 (lgtmBinding failure arms, the stale-lgtm comment read failing), #320 (owners.ts probes), #286 (approve.github_review).

Related Issue

Closes #327


Filed by quality agent (hold-gated mode). Human review required.

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

…rms and tide's fork-workflows 403 arms through dist/index.js

Adds __tests__/bundle/pullRequestOwnersArms.test.ts: seven runs of the
committed bundle against the fake GitHub for arms no bundle suite reached.

/approve on a pull request (src/utils/pullRequestOwners.ts):
- a renamed file is owned under its previous name too: bob's approval of
  sdk/moved.go leaves olm/moved.go (olm/OWNERS, carol) unapproved
- GET /branches/master answering 500 falls back to pull.base.sha with a
  warning; OWNERS are read from the snapshot tree

schedule lgtm job, fork pull request refused with 403 (src/plugins/tide.ts
explainForkWorkflows, src/utils/comments.ts createCommentOnce):
- the explaining comment is posted once per head: a bot comment carrying
  the marker suppresses it, a human comment quoting it does not
- a refused comment is a warning; the pull request is still skipped
- no workflow files on either side, or an unreadable compare, leave the
  403 a plain merge failure

Signed-off-by: quality <quality@hive.kubestellar.io>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 5, 2026 13:46
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 5, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind failing-test or /kind cleanup.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

build-test is red here for the shared cause tracked in #294, not this diff: run 37319380181 on 0768757 passes all 81 test files and exits 1 on the single ERR_TLS_CERT_ALTNAME_INVALID unhandled error from __tests__/issueCommentTest/meow.test.ts; the twin run on the same SHA (37319152655) is green. The fix is #287. Deferring until that lands; no retries on this PR.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: unknown

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

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

Labels

hold Indicates that a PR should not merge because someone has issued a /hold command. needs-kind

Projects

None yet

0 participants