Repository navigation
Conversation
…RUNNER_TEMP staging
…ant structure test
…iant scaffolding test
…ediation in CI guide
…n guard to template portion
uf-divisor
left a comment
There was a problem hiding this comment.
Review: fix(ci): stage Node coverage under $RUNNER_TEMP outside hidden path
Council verdict: APPROVE WITH ADVISORIES — 6 of 7 reviewers returned APPROVE; divisor-gaze-testing returned APPROVE WITH ADVISORIES carrying two LOW test-quality advisories (inline below). No CRITICAL or HIGH findings. CI is fully green (Unit + Integration ×2, E2E ×2, MegaLinter, Gaze AI Report, CI OK), and pre-flight passed with every local tool category covered by passing CI.
The change moves the Node scaffold's coverage staging to $RUNNER_TEMP/gaze-artifact and the upload to ${{ runner.temp }}/gaze-artifact, which resolves the actions/upload-artifact v4.4.0+ hidden-path exclusion that left the v2.7.0 Node scaffold uploading nothing (#446). The artifact layout contract (coverage/ at the root of the coverage-out artifact) is preserved, the Go and Python scaffolds are untouched, and the new TestNodeWorkflow_StagedUploadContract executes the rendered staging step end-to-end against the resolved upload path. The OpenSpec change record, the regenerated golden file, and the consumer docs (including the v2.7.0 remediation) are all in place.
Two non-blocking advisories on the new guard follow inline.
This review was generated by /uf.review-pr (AI-assisted).
| // component, which the template can neither cause nor fix. No | ||
| // template-controlled component may begin with ".". | ||
| templateControlledPath := strings.TrimPrefix(resolvedUploadPath, runnerTemp) | ||
| for _, component := range strings.Split(templateControlledPath, string(filepath.Separator)) { |
There was a problem hiding this comment.
[LOW · test-quality] TestNodeWorkflow_StagedUploadContract asserts the staged file's existence (os.Stat on the resolved upload path) but not its content, so a truncation or corruption of coverage-final.json during staging would still pass the guard. The staging step's observable contract is location and content preservation. Reading the staged bytes back and comparing them against the synthetic source (e.g. os.ReadFile + bytes.Equal) would cover the other half of that contract.
| jobs, ok := doc["jobs"].(map[string]any) | ||
| if !ok { | ||
| t.Fatalf("jobs missing or not a mapping: %v", doc["jobs"]) | ||
| } |
There was a problem hiding this comment.
[LOW · test-quality] The hidden-component invariant is asserted only positively: the test scans the resolved upload path below the runner root for dot-prefixed components, but no automated case feeds a synthetic hidden path — the pre-fix .gaze-artifact shape — and asserts the guard rejects it. Task 3.2's red/green check exercised this manually, and the result is argued in comments rather than retained as a regression case. A subtest that constructs a hidden candidate path and asserts the scan flags it would pin the guard's negative detection capability against future reintroduction.
Summary
Fixed the Node variant of
gaze init --ciso the scaffolded workflow passes as-is. The staging/upload steps now use$RUNNER_TEMP/gaze-artifact(outside the workspace and outside any hidden path) instead of the hidden.gaze-artifactdirectory thatactions/upload-artifactv4.4.0+ excludes by default. Updated the Node golden file, test pins, docs Node bullets with staging root and v2.7.0 remediation, and added an executed staging guard (red/green verified) that asserts staged files land at the resolved upload path with no hidden components. Go/Python templates, Go golden file, version floor, andinternal/quality/quality.gountouched per epic rules.Closes #446
Epic: #449 — non-Go (external analyzer) follow-ups after v2.7.0. Website gate: unbound-force/website#495.
How to Test
npm run coverage && ls "$RUNNER_TEMP/gaze-artifact/coverage/coverage-final.json"— after running coverage in a Node workspace, the scaffoldedmkdir -p "$RUNNER_TEMP/gaze-artifact" && cp -r coverage "$RUNNER_TEMP/gaze-artifact/"places files wherepath: ${{ runner.temp }}/gaze-artifactuploads with no hidden components.go test -run TestNodeWorkflow_StagedUploadContract ./internal/scaffold -count=1 -v— the executed staging guard (proves staging lands at upload path, asserts workspace cleanliness, guards hidden components on template-controlled portion).go test -run TestRenderCIWorkflowTemplate_VariantYAMLStructure -count=1 ./internal/scaffold— stageRun/uploadPath pins.coverage-outartifact — it still carriescoverage/at its root.How to Demo
Run
gaze init --ciin a Node repository (withpackage.json, nogo.mod) and inspect.github/workflows/gaze-ai-report.yml:mkdir -p "$RUNNER_TEMP/gaze-artifact" && cp -r coverage "$RUNNER_TEMP/gaze-artifact/"path: ${{ runner.temp }}/gaze-artifactwithif-no-files-found: error.gaze-artifactdirectory appears in the workspace; the artifactcoverage-outstill containscoverage/coverage-final.jsonat its root.Alternatively:
go test -run TestNodeWorkflow_StagedUploadContract -count=1 -v ./internal/scaffold— the guard executes the scaffolded staging command against a synthetic workspace.Key Files Changed
internal/scaffold/assets/ci/gaze-ai-report-node.yml— staging/upload moved to$RUNNER_TEMP/gaze-artifact/${{ runner.temp }}/gaze-artifactinternal/scaffold/testdata/golden-gaze-ai-report-node.yml— regenerated golden fileinternal/scaffold/ci_test.go— updated Node variant pins + addedTestNodeWorkflow_StagedUploadContractexecuted staging guard (workspace cleanliness + hidden-component check on template portion)docs/guides/ci-integration.md— Node bullet names$RUNNER_TEMPstaging root and v2.7.0 remediationdocs/reference/cli/init.md— Node bullet names$RUNNER_TEMPstaging rootopenspec/changes/gaze-init-ci-node-scaffolded-workflow-up/— spec, tasks, proposal, designNo changes to Go/Python templates, Go golden file,
minWorkflowTag,validate-workflow-floor.sh, orinternal/quality/quality.goper epic rules.Known Issues
None — spec review (APPROVE WITH ADVISORIES, 1 iteration, 3 advisories) and code review (APPROVE WITH ADVISORIES, 1 iteration, 2 LOW advisories) both applied at 7587e27. All 13/13 tasks complete across 5 phases. CI replicated locally:
go build,go test -race -count=1 -short 22/22,golangci-lint 0,gaze reportthresholds (CRAPload 23/38, GazeCRAPload 6/6),e2e TestRunSelfCheck 7/7,markdownlint 0.This PR was generated by /uf.finale (AI-assisted).