Skip to content

[quality] make pkg/dashboard copilot SDK-helper probe tests hermetic - #7535

Merged
clubanderson merged 1 commit into
v4from
quality/test-sdk-helper-hermetic
Sep 18, 2026
Merged

clubanderson merged 1 commit into
v4from
quality/test-sdk-helper-hermetic

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Makes the copilot SDK-helper probe tests in pkg/dashboard hermetic.

Claimed ground (exactly): src/pkg/dashboard/cli_models.go (test seam only — copilotSDKHelperPath const→var + setCopilotSDKHelperPathForTest, mirroring the knowledge.SetBaseDirForTest convention), src/pkg/dashboard/cli_models_sdk_severity_test.go, src/pkg/dashboard/cli_models_sdk_test.go, plus a changelog.d entry. Disjoint from open PRs #7523 (pkg/dashboard/api.go), #7510, #7527, #7520.

What was broken: TestProbeCopilotModelsSDK_AbsentHelperYieldsSentinel and TestProbeCopilotModelsSDK_HelperNotInstalled exec'd whatever lived at the production path /usr/local/bin/copilot-models.mjs. They handled helper-absent (assert sentinel) and helper-works (skip), but not the third state — helper installed without stored copilot auth, the normal state on live agent hosts — where the helper exits 1 (Not authenticated), the sentinel check fatals, and the whole pkg/dashboard suite goes red. HelperNotInstalled also ran a real ~3s network probe when the helper existed.

Change:

Verified: full pkg/dashboard suite green (was red on this host), go vet clean, on v4 @ e74d45e.

Related Issue

Closes #7534


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

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

TestProbeCopilotModelsSDK_AbsentHelperYieldsSentinel and
TestProbeCopilotModelsSDK_HelperNotInstalled exec'd whatever lived at the
production helper path (/usr/local/bin/copilot-models.mjs). They handled two
states — helper absent (assert sentinel) or helper works (skip) — but not the
third: helper installed without stored copilot auth, the normal state on live
agent hosts, where the helper exits 1 ('Not authenticated'), the sentinel
check fatals, and the entire pkg/dashboard suite goes red.

Fix: copilotSDKHelperPath becomes a var with an in-package test seam
(setCopilotSDKHelperPathForTest, mirroring knowledge.SetBaseDirForTest).
Both tests repoint it at a nonexistent temp path so the absence assertion
holds on every host, and a new TestProbeCopilotModelsSDK_FailingHelperIsNotAbsent
covers the present-but-failing exec path (#7365's signature) with a stub
script, hermetically. No production behavior change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: hive-quality[bot] <hive-quality[bot]@users.noreply.github.com>
@kubestellar-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 automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 18, 2026
@kubestellar-hive kubestellar-hive Bot added quality testing agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI labels Sep 18, 2026
@clubanderson
clubanderson merged commit 24a67b0 into v4 Sep 18, 2026
58 of 63 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-sdk-helper-hermetic branch September 18, 2026 03:51
@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

clubanderson added a commit that referenced this pull request Sep 18, 2026
Carries v4 e74d45e..201c69c (v4.54.2, v4.55.0, v4.55.1) into v5,
including #7510 (cmd/hive domain extraction), #7532 (manager.go split),
#7527/#7528 (review routing + breadth-first slots), #7523 (token-access
audit backport of v5 #6303), #7515 (branch-protection facts on blocked
PR pills), #7535, #7539, #7520.

Resolution notes:
- cmd/hive, pkg/agent: declaration-level 3-way merge against base
  ff7630e; v5 seams (spokeStatePath, SetHubPushedDashboardURL,
  applyModeUnscheduledAlert, mutation boundary, runDuplicateSweepIfDue)
  preserved. F24 tombstone intact.
- pkg/github/client.go: v5 fetchPRs signature (RepoPRBreakdown) + v4
  BaseRef/prBaseRef; added Client.requiredStatusCheckContexts shim so
  v4's protection_facts.go compiles against v5, where the sweep lives in
  pkg/github/automerge.
- pkg/github/token_access_audit{,_test}.go: v4 side (its backport of
  v5's own #6303, now using testutil.Eventually).
- pkg/github/automerge/f3_trusted_merger_source_test.go: v4's
  f3ReadPackage path adjusted one level deeper for v5's subpackage.
- pkg/review/prompts.go: v4 routing instruction + mentionableAuthor
  added; v5's #6212 deletion of dead BuildPerspectivePrompts /
  BuildSequentialPrompt kept.
- pkg/agent tests: v4's normalizeModelName cases rewritten against v5's
  normalizeModelNameForBackend (v5 removed the wrapper in #5795).
- docs/knowledge-curator.md: v5 promotion-only body + v4's
  knowledge.git_sources section (code exists on v5). roadmap.md: v4
  rows. api-reference.md: v5 table, citations re-resolved (--fix).
- .github/workflows/v2-ci.yml: v5 UID-isolation step + v4's fuller
  audit-log step comment.

Refs #7463

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Approved by a Hive merger/owner for auto-merge on green CI copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI hold quality size/M Denotes a PR that changes 30-99 lines, ignoring generated files. testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] pkg/dashboard SDK-helper probe tests are non-hermetic: fail on any host with an unauthenticated copilot-models helper

1 participant