feat(#6002): add --signoff flag to github setup command - #6004
feat(#6002): add --signoff flag to github setup command#6004fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
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
|
🤖 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
Labels: PR modifies CLI install/setup code in internal/cli/ and adds a new flag to the github setup command |
| @@ -360,6 +362,16 @@ func runGitHubSetupPerRepo(ctx context.Context, client forge.Client, printer *ui | |||
| } | |||
There was a problem hiding this comment.
[medium] architectural-coherence
The github setup command uses an explicit opt-in --signoff flag with hard-failure when identity is unavailable, while github sync-scaffold (github.go:1094) automatically attempts sign-off and degrades gracefully. This creates inconsistent behavior across CLI commands for the same sign-off concern.
Suggested fix: Consider aligning with the graceful-degradation pattern used in sync-scaffold, or add a code comment explaining why opt-in with hard-failure is preferred for setup.
|
|
||
| // Resolve Signed-off-by trailer when --signoff is set. | ||
| var signOffTrailer string | ||
| if cfg.signoff { |
There was a problem hiding this comment.
[low] error-handling
The error message says 'git user identity' but the identity is resolved via the GitHub API (GetAuthenticatedUserIdentity calls GET /user), not from local git config. A user with local git config but a GitHub App token would find this guidance misleading.
Suggested fix: Consider rewording to: --signoff requires a GitHub user identity (name and email) -- this is not available for GitHub App tokens.
| @@ -69,6 +69,7 @@ type githubSetupConfig struct { | |||
| runtime string | |||
There was a problem hiding this comment.
[low] naming-convention
The new struct field signoff uses single-word naming, while the parameter signOffTrailer in the same change uses camelCase. Go convention would favor signOff for a two-word concept, though signoff as a single compound word (matching git --signoff) is defensible.
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)