feat(#6002): add --signoff flag to github setup command - #6004
Conversation
|
🤖 Finished Review · ✅ Success · Started 1:10 PM UTC · Completed 1:27 PM UTC Commit: |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ReviewFindingsMedium
Low
Previous runReviewFindingsMedium
Low
Previous run (2)ReviewFindingsMedium
Previous run (3)ReviewFindingsMedium
Low
Previous run (4)ReviewFindingsMedium
Low
Previous run (5)ReviewFindingsMedium
Low
Previous run (6)ReviewFindingsMedium
Low
Previous run (7)ReviewFindingsMedium
Low
Previous run (8)ReviewFindingsMedium
Low
Previous run (9)ReviewFindingsMedium
Low
Previous run (10)ReviewFindingsMedium
Low
Labels: PR modifies CLI install/setup code in internal/cli/ and adds a new flag to the github setup command |
|
/fs-fix Rebase onto main and address all review comments on this PR. |
|
🤖 Finished Fix · ✅ Success · Started 9:33 AM UTC · Completed 9:50 AM UTC Commit: |
🔧 Fix agent — iteration 1 (human-triggered)Addressed 8 of 9 review findings with code fixes. Rebased onto main. Disagreed with 1 (naming convention: signoff is intentionally single-word to match git --signoff). Key changes: extracted scaffoldOptions struct, added org-target validation for --signoff, added empty name/email guard and newline stripping, extracted shared FormatSignOffTrailer helper, rewrote error messages, added architectural comment, and extracted test helper. Fixed (8):
Disagreed (1):
Tests: passed Decision points
Next steps:
|
- Extract scaffoldOptions struct for applyPerRepoScaffold to reduce positional parameter count (10 → 8 + struct) - Add --signoff to per-repo-only flag validation so it is rejected for org targets like --config and --config-hash - Guard against empty name/email in identity before formatting the Signed-off-by trailer - Strip newline characters from identity fields to prevent trailer injection via crafted profile names - Extract shared FormatSignOffTrailer helper in forge package to deduplicate formatting between github setup and WorkflowsLayer - Reword error message: "git user identity" → "GitHub user identity" since identity is resolved via the GitHub API, not local git config - Add comment explaining why setup hard-fails on missing identity (unlike sync-scaffold which gracefully degrades) - Extract newSignoffTestSetup helper to reduce test duplication - Add tests for org-target rejection and empty identity fields Addresses review feedback on #6004
44ab7c2 to
6840bed
Compare
|
🤖 Finished Review · ✅ Success · Started 9:51 AM UTC · Completed 10:06 AM UTC Commit: |
|
/fs-fix Rebase onto main and address the open review thread on |
|
🤖 Finished Fix · ✅ Success · Started 10:22 AM UTC · Completed 10:32 AM UTC Commit: |
- Extract scaffoldOptions struct for applyPerRepoScaffold to reduce positional parameter count (10 → 8 + struct) - Add --signoff to per-repo-only flag validation so it is rejected for org targets like --config and --config-hash - Guard against empty name/email in identity before formatting the Signed-off-by trailer - Strip newline characters from identity fields to prevent trailer injection via crafted profile names - Extract shared FormatSignOffTrailer helper in forge package to deduplicate formatting between github setup and WorkflowsLayer - Reword error message: "git user identity" → "GitHub user identity" since identity is resolved via the GitHub API, not local git config - Add comment explaining why setup hard-fails on missing identity (unlike sync-scaffold which gracefully degrades) - Extract newSignoffTestSetup helper to reduce test duplication - Add tests for org-target rejection and empty identity fields Addresses review feedback on #6004
Strip < and > from the name field in FormatSignOffTrailer to prevent malformed Signed-off-by trailers when a forge user's display name contains angle brackets. Addresses review feedback on #6004
🔧 Fix agent — iteration 2 (human-triggered)Rebased branch onto main and addressed the open review thread: FormatSignOffTrailer now strips angle brackets from the name field in addition to newline characters, preventing malformed trailers from crafted display names. Fixed (1):
Tests: passedNext steps:
|
6840bed to
df0ded5
Compare
|
🤖 Finished Review · ✅ Success · Started 10:33 AM UTC · Completed 10:49 AM UTC Commit: |
|
/fs-fix Address the open review thread on |
|
🤖 Finished Fix · ✅ Success · Started 11:14 AM UTC · Completed 11:22 AM UTC Commit: |
🔧 Fix agent — iteration 3 (human-triggered)Addressed the open review thread: FormatSignOffTrailer now strips angle brackets from the email field too, using a single shared sanitize replacer for both fields. Added test coverage for the new behavior. Fixed (2):
Tests: passedNext steps:
|
Use a single sanitize replacer for both name and email fields, stripping \n, \r, <, and > from both. Previously angle brackets were only stripped from the name field, leaving the email vulnerable to malformed trailers (e.g. <<user@example.com>>). Addresses review feedback on #6004
- Extract scaffoldOptions struct for applyPerRepoScaffold to reduce positional parameter count (10 → 8 + struct) - Add --signoff to per-repo-only flag validation so it is rejected for org targets like --config and --config-hash - Guard against empty name/email in identity before formatting the Signed-off-by trailer - Strip newline characters from identity fields to prevent trailer injection via crafted profile names - Extract shared FormatSignOffTrailer helper in forge package to deduplicate formatting between github setup and WorkflowsLayer - Reword error message: "git user identity" → "GitHub user identity" since identity is resolved via the GitHub API, not local git config - Add comment explaining why setup hard-fails on missing identity (unlike sync-scaffold which gracefully degrades) - Extract newSignoffTestSetup helper to reduce test duplication - Add tests for org-target rejection and empty identity fields Addresses review feedback on #6004
Strip < and > from the name field in FormatSignOffTrailer to prevent malformed Signed-off-by trailers when a forge user's display name contains angle brackets. Addresses review feedback on #6004
221e4c8 to
3ad1b7f
Compare
Use a single sanitize replacer for both name and email fields, stripping \n, \r, <, and > from both. Previously angle brackets were only stripped from the name field, leaving the email vulnerable to malformed trailers (e.g. <<user@example.com>>). Addresses review feedback on #6004
Move identity resolution (--signoff) before the dry-run exit in runGitHubSetupPerRepo so that --dry-run --signoff validates the token's identity up front instead of silently skipping the check. Add a dry-run output line showing the Signed-off-by trailer that would be appended. Addresses review feedback on #6004
FormatSignOffTrailer now returns (string, error) and rejects inputs that become empty after stripping newlines and angle brackets. This closes the edge case where raw values pass the pre-sanitization emptiness check in github.go but produce an empty name or email after sanitization (e.g. a name consisting entirely of newlines). All callers updated: github.go propagates the error, WithSignOff silently omits the trailer (best-effort builder path). Addresses review feedback on #6004
|
🤖 Finished Review · ✅ Success · Started 5:53 PM UTC · Completed 6:10 PM UTC Commit: |
Repos that enforce DCO (Developer Certificate of Origin) reject scaffold commits from `fullsend github setup` because they lack a Signed-off-by trailer. This adds a `--signoff` flag that resolves the authenticated user's identity and appends the trailer to the scaffold commit message. When --signoff is set: - Resolves the user's name and email via the forge API - Appends "Signed-off-by: Name <email>" to the commit message - Errors if identity cannot be resolved (e.g. bot tokens) When --signoff is omitted (default), behavior is unchanged — no trailer is appended. This ensures autonomous agent commits remain exempt from DCO per project policy. Note: pre-commit could not run in sandbox (network restriction). Closes #6002
- Extract scaffoldOptions struct for applyPerRepoScaffold to reduce positional parameter count (10 → 8 + struct) - Add --signoff to per-repo-only flag validation so it is rejected for org targets like --config and --config-hash - Guard against empty name/email in identity before formatting the Signed-off-by trailer - Strip newline characters from identity fields to prevent trailer injection via crafted profile names - Extract shared FormatSignOffTrailer helper in forge package to deduplicate formatting between github setup and WorkflowsLayer - Reword error message: "git user identity" → "GitHub user identity" since identity is resolved via the GitHub API, not local git config - Add comment explaining why setup hard-fails on missing identity (unlike sync-scaffold which gracefully degrades) - Extract newSignoffTestSetup helper to reduce test duplication - Add tests for org-target rejection and empty identity fields Addresses review feedback on #6004
Strip < and > from the name field in FormatSignOffTrailer to prevent malformed Signed-off-by trailers when a forge user's display name contains angle brackets. Addresses review feedback on #6004
Use a single sanitize replacer for both name and email fields, stripping \n, \r, <, and > from both. Previously angle brackets were only stripped from the name field, leaving the email vulnerable to malformed trailers (e.g. <<user@example.com>>). Addresses review feedback on #6004
Move identity resolution (--signoff) before the dry-run exit in runGitHubSetupPerRepo so that --dry-run --signoff validates the token's identity up front instead of silently skipping the check. Add a dry-run output line showing the Signed-off-by trailer that would be appended. Addresses review feedback on #6004
FormatSignOffTrailer now returns (string, error) and rejects inputs that become empty after stripping newlines and angle brackets. This closes the edge case where raw values pass the pre-sanitization emptiness check in github.go but produce an empty name or email after sanitization (e.g. a name consisting entirely of newlines). All callers updated: github.go propagates the error, WithSignOff silently omits the trailer (best-effort builder path). Addresses review feedback on #6004
3ad1b7f to
d4bf64b
Compare
|
🤖 Finished Review · ✅ Success · Started 7:46 AM UTC · Completed 8:03 AM UTC Commit: |
|
🤖 Review · Commit: |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Marta Anon <manon@redhat.com>
e075229 to
8f9a921
Compare
|
🤖 Finished Review · ✅ Success · Started 8:32 AM UTC · Completed 8:46 AM UTC Commit: |
|
🤖 Finished Retro · ✅ Success · Started 8:55 AM UTC · Completed 9:20 AM UTC Commit: |
Retro: PR #6004 —
|
Summary
--signoffflag tofullsend github setupthat appends aSigned-off-bytrailer to scaffold commits, enabling compatibility with repos that enforce DCO checks--signoffis set, the user's identity (name + email) is resolved via the forge API; if unavailable (e.g. bot tokens), the command errors with a clear message--signoff(default), behavior is unchanged — no trailer is appended, keeping autonomous agent commits exempt per project DCO policyContext
Repos like kubearchive/kubearchive enforce DCO via a Probot app. When
fullsend github setupcreates scaffold commits without aSigned-off-bytrailer, the DCO check fails and maintainers must manually amend and force-push to add the trailer. This was reported in kubearchive/kubearchive PRs #2001 and #2021.Testing
TestRunGitHubSetupPerRepo_SignoffAddsTrailer— verifies the trailer is present in the commit message when--signoffis setTestRunGitHubSetupPerRepo_WithoutSignoffOmitsTrailer— verifies no trailer when--signoffis omittedTestRunGitHubSetupPerRepo_SignoffMissingIdentity— verifies error when identity cannot be resolved (bot token)TestRunGitHubSetupPerRepo_SignoffDirect— verifies trailer works in--directmodeTestApplyPerRepoScaffold_WithSignOff/_WithoutSignOff— unit tests for theapplyPerRepoScaffoldfunctionapplyPerRepoScaffoldtests updated and passingCloses #6002
Post-script verification
agent/6002-signoff-flag)87fd13d4b2ee4c004303313c02526713ce7bc847..HEAD)