Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ permissions: {}

jobs:
dispatch:
# #7895: forks inherit this file but not repository variables, so an
# unset FULLSEND_MINT_URL skips agent jobs without a runner or a
# failed check. Re-onboard sets the variable and the same file runs.
if: >-
(github.event_name != 'pull_request_target' && github.event_name != 'pull_request_review'
vars.FULLSEND_MINT_URL != ''

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

1. Fork skip behavior lacks operator guidance 📘 Rule violation ⚙ Maintainability

dispatch and stop-fix now require vars.FULLSEND_MINT_URL, but the PR does not update the
repository-variable guidance required by docs/contributing/documentation.md. When that variable is
absent, both jobs skip silently, while the existing operations guide does not explain that the
variable now controls whether they run.
Agent Prompt
## Issue description
The per-repo workflow now skips both agent jobs when the mint URL repository variable is absent, but the operations guidance does not describe this behavior.

## Fix Focus Areas
- internal/scaffold/fullsend-repo/templates/shim-per-repo.yaml[34-39]
- internal/scaffold/fullsend-repo/templates/shim-per-repo.yaml[70-74]
- docs/guides/getting-started/operations.md[80-106]

## Recommended Fix
Update the relevant operations guidance to explain that an unset repository-level FULLSEND_MINT_URL silently skips both jobs, and clarify the documented org-level variable exception.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

&& (github.event_name != 'pull_request_target' && github.event_name != 'pull_request_review'
|| github.event.pull_request.head.ref != 'fullsend/scaffold-install')
&& (github.event_name != 'issue_comment'
|| (startsWith(github.event.comment.body, '/fs-')
Expand Down Expand Up @@ -66,7 +70,8 @@ jobs:
# hatch) is made in the step below, so a maintainer whose author_association
# is not MEMBER (e.g. private org membership) is not filtered out (ADR 0054).
if: >-
github.event_name == 'issue_comment'
vars.FULLSEND_MINT_URL != ''
&& github.event_name == 'issue_comment'
&& github.event.issue.pull_request
&& github.event.comment.user.type != 'Bot'
&& github.event.comment.body == '/fs-fix-stop'
Expand Down
23 changes: 23 additions & 0 deletions internal/scaffold/scaffold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,29 @@ func TestShimPerRepoTemplateContent(t *testing.T) {
}, pr.Jobs.StopFix.Permissions, "stop-fix job permissions")
}

// TestShimPerRepoSkipsWhenMintURLUnset verifies forks of enrolled repos
// do not run agent jobs (#7895). GitHub does not copy repository
// variables to forks, so FULLSEND_MINT_URL is empty there.
func TestShimPerRepoSkipsWhenMintURLUnset(t *testing.T) {
content, err := FullsendRepoFile("templates/shim-per-repo.yaml")
require.NoError(t, err)

var wf struct {
Jobs map[string]struct {
If string `yaml:"if"`
} `yaml:"jobs"`
}
require.NoError(t, yaml.Unmarshal(content, &wf))

const gate = "vars.FULLSEND_MINT_URL != ''"
for _, job := range []string{"dispatch", "stop-fix"} {
cond := wf.Jobs[job].If
require.NotEmpty(t, cond, "%s job must have an if condition", job)
assert.Contains(t, cond, gate,
"%s job must skip when FULLSEND_MINT_URL is unset", job)
}
}

// TestShimStopFixAuthorization verifies the stop-fix job authorizes the
// /fs-fix-stop command via the collaborator permission API (ADR 0054) rather
// than author_association. See issue #5421: author_association grants
Expand Down
Loading