test(#829): upgrade stage workflow permissions to YAML-parsed assertions - #861
test(#829): upgrade stage workflow permissions to YAML-parsed assertions#861fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
Replace assert.Contains string-matching with yaml.Unmarshal + assert.Equal structural checks for permissions in all six stage workflow tests: triage, code, review, fix, retro, and prioritize. This follows the pattern established by the shim tests (TestShimWorkflowCallTemplateContent and TestShimPerRepoTemplateContent) in PR fullsend-ai#5786 and eliminates false-positive risk from string matching. The YAML-parsed approach pins assertions to exact structural locations and catches both additions and removals via full-map equality. The retro test additionally validates the debounce job's empty permissions (permissions: {}) as a least-privilege assertion. Note: pre-commit could not run due to network restrictions in the sandbox (exit 3, HTTP 403 on git fetch). Closes #829
|
🤖 Finished Review · ✅ Success · Started 9:43 AM UTC · Completed 9:55 AM UTC |
|
Looks good to me |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 10:32 AM UTC · Completed 10:37 AM UTC |
🔧 Fix agent — iteration 1 (human-triggered)No code changes needed. The review agent approved the PR. Both CI failures are pre-existing issues unrelated to this PR: (1) pinact SHA-pin error in .github/workflows/fullsend.yaml (protected path), and (2) GCP WIF credential injection failure (infrastructure). The PR's test changes are correct — all 6 upgraded tests pass locally. Disagreed (2):
Tests: passed Decision points
Next steps:
|
|
This pull request has been automatically marked as stale because it has not had any activity in the last month. It will be closed in 2 weeks if no further activity occurs. Remove the |
Summary
Upgrade permissions assertions in six stage workflow tests (
TestTriageWorkflowContent,TestCodeWorkflowContent,TestReviewWorkflowContent,TestFixWorkflowContent,TestRetroWorkflowContent,TestPrioritizeWorkflowContent) fromassert.Containsstring matching to YAML-parsed structural checks usingyaml.Unmarshal+assert.Equal, matching the pattern established by the shim tests in PR fullsend-ai#5786.Changes
assert.Contains(t, s, "actions: write")chains withyaml.Unmarshalinto typed structs andassert.Equalon full permission maps for all six stage testspermissions: {}) in the retro workflow testyaml.v3is already imported in the fileTesting
go test ./internal/scaffold/...passes (98 tests, 0 failures)go vet ./internal/scaffold/...passesyaml.Unmarshal+assert.Equalfor permissions — no remainingassert.Containsfor permissions valuesChecklist
!for breaking changes)Closes #829
Post-script verification
agent/829-yaml-stage-perms-assertions)c887fc47c59d8b87b5282ca44044d2933d30df41..HEAD)