Skip to content

test(#829): upgrade stage workflow permissions to YAML-parsed assertions - #861

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/829-yaml-stage-perms-assertions
Open

test(#829): upgrade stage workflow permissions to YAML-parsed assertions#861
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/829-yaml-stage-perms-assertions

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown

Summary

Upgrade permissions assertions in six stage workflow tests (TestTriageWorkflowContent, TestCodeWorkflowContent, TestReviewWorkflowContent, TestFixWorkflowContent, TestRetroWorkflowContent, TestPrioritizeWorkflowContent) from assert.Contains string matching to YAML-parsed structural checks using yaml.Unmarshal + assert.Equal, matching the pattern established by the shim tests in PR fullsend-ai#5786.

Changes

  • Replace assert.Contains(t, s, "actions: write") chains with yaml.Unmarshal into typed structs and assert.Equal on full permission maps for all six stage tests
  • Add debounce job least-privilege assertion (permissions: {}) in the retro workflow test
  • No new dependencies — yaml.v3 is already imported in the file

Testing

  • go test ./internal/scaffold/... passes (98 tests, 0 failures)
  • go vet ./internal/scaffold/... passes
  • All six upgraded tests use yaml.Unmarshal + assert.Equal for permissions — no remaining assert.Contains for permissions values

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Tests added/updated for new or modified logic

Closes #829

Post-script verification

  • Branch is not main/master (agent/829-yaml-stage-perms-assertions)
  • Secret scan passed (gitleaks — c887fc47c59d8b87b5282ca44044d2933d30df41..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

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
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 2, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:43 AM UTC · Completed 9:55 AM UTC
Commit: 2358c90 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Aug 2, 2026
@guyoron1

guyoron1 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

/fs-fix

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 2, 2026

Copy link
Copy Markdown
Author

🤖 Finished Fix · ✅ Success · Started 10:32 AM UTC · Completed 10:37 AM UTC
Commit: 2358c90 · View workflow run →

@fullsend-ai-coder

Copy link
Copy Markdown
Author

🔧 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):

  1. CI test job failure (make lint-all → pinact error on .github/workflows/fullsend.yaml:52): The pinact error ('action can't be pinned') is on .github/workflows/fullsend.yaml which uses @main instead of a SHA pin. This is a pre-existing issue in a protected path (.github/) unrelated to this PR's changes. The PR only modifies internal/scaffold/scaffold_test.go. The fix agent must not modify protected .github/ files.
  2. CI e2e job failure (GCP WIF auth credential injection): The e2e failure is an infrastructure issue: google-github-actions/auth failed because the GCP workload identity provider secret is not injected (likely a fork/secrets-access issue). This is unrelated to the PR's code changes.

Tests: passed

Decision points
  • No code changes made because both CI failures are pre-existing infrastructure issues in protected paths, unrelated to the PR's test file changes (alternatives: Fix pinact error in .github/workflows/fullsend.yaml; rationale: .github/ is a protected path that the fix agent must not modify. The PR's actual code changes (YAML-parsed permission assertions) are correct — all 6 tests pass, go vet is clean, gofmt reports no issues.)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

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 stale label to reset the inactivity timer.

@github-actions github-actions Bot added the stale label Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade stage workflow test permissions assertions from assert.Contains to YAML-parsed structural checks

1 participant