Repository navigation
fix(#2591): add Signed-off-by trailer to scaffold PR commits - #2595
Conversation
The `fullsend github setup` command creates commits via the GitHub API without Signed-off-by trailers, causing DCO checks to reject the scaffold PR in orgs that enforce sign-off. This adds a `GetAuthenticatedUserIdentity` method to the forge Client interface that retrieves the authenticated user's display name and email. The WorkflowsLayer gains a `WithSignOff` builder method that appends a Signed-off-by trailer to all commit messages it produces (scaffold commit, activation commit). The CLI wiring calls GetAuthenticatedUserIdentity and configures the layer when the identity is available (PAT/OAuth tokens). For GitHub App installation tokens, the identity call fails gracefully and no trailer is appended — this is correct because autonomous agent commits are exempt from DCO per project policy. Note: pre-commit could not run in the sandbox (shellcheck_py network error during install). The post-script runs pre-commit authoritatively. Closes #2591
E2E tests are runningAuthorization passed for this commit. See the E2E Tests workflow for results. |
|
🤖 Finished Review · ✅ Success · Started 7:51 AM UTC · Completed 8:03 AM UTC |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
Looks good to me Previous runReviewFindingsMedium
Labels: PR fixes DCO sign-off for scaffold commits created during org setup/install. |
| if err != nil { | ||
| return nil, fmt.Errorf("get authenticated user identity: %w: %w", forge.ErrNotFound, err) | ||
| } | ||
|
|
There was a problem hiding this comment.
[medium] api-contract
GetAuthenticatedUserIdentity wraps ALL errors from c.get (network errors, 500s, rate-limit 429s, etc.) with forge.ErrNotFound. The interface docstring says 'Returns ErrNotFound when the identity cannot be determined (e.g., GitHub App installation tokens that cannot call /user).' This makes it impossible for callers to distinguish between 'the token type does not support /user' (expected, permanent) and 'transient network failure' (retryable). Currently all call sites only check err == nil so the practical impact is limited, but any future caller using forge.IsNotFound to decide retry behavior will be misled.
Suggested fix: Only wrap with forge.ErrNotFound for HTTP 403/404 responses. For other errors, return the underlying error without the ErrNotFound sentinel.
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 8:24 AM UTC · Completed 8:32 AM UTC |
Only wrap errors with forge.ErrNotFound for HTTP 403/404 responses (e.g., GitHub App installation tokens). Other errors (network failures, server errors) are returned without the ErrNotFound sentinel so callers can distinguish permanent from transient failures. Add test verifying non-permission errors are not wrapped as ErrNotFound. Addresses review feedback on #2595
🔧 Fix agent — iteration 1 (human-triggered)Addressed 1 review finding: scoped ErrNotFound wrapping in GetAuthenticatedUserIdentity to only 403/404 responses, with a new test for the non-permission error path. Fixed (1):
Tests: passed Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 8:35 AM UTC · Completed 8:46 AM UTC |
|
🤖 Finished Retro · ✅ Success · Started 9:35 AM UTC · Completed 9:47 AM UTC |
Retro: PR #2595 — Add Signed-off-by trailer to scaffold PR commitsOverall assessment: Workflow performed well. The pipeline handled this bug fix efficiently — issue to merge in ~2 hours with one review-fix iteration that addressed a legitimate API contract finding. Timeline
What went well
Observations (already tracked)
No new proposals — the improvement opportunities identified are already well-covered by existing open issues. |
Only wrap errors with forge.ErrNotFound for HTTP 403/404 responses (e.g., GitHub App installation tokens). Other errors (network failures, server errors) are returned without the ErrNotFound sentinel so callers can distinguish permanent from transient failures. Add test verifying non-permission errors are not wrapped as ErrNotFound. Addresses review feedback on fullsend-ai#2595
…old-signoff fix(fullsend-ai#2591): add Signed-off-by trailer to scaffold PR commits
The
fullsend github setupcommand creates commits via the GitHub API without Signed-off-by trailers, causing DCO checks to reject the scaffold PR in orgs that enforce sign-off.This adds a
GetAuthenticatedUserIdentitymethod to the forge Client interface that retrieves the authenticated user's display name and email. The WorkflowsLayer gains aWithSignOffbuilder method that appends a Signed-off-by trailer to all commit messages it produces (scaffold commit, activation commit). The CLI wiring calls GetAuthenticatedUserIdentity and configures the layer when the identity is available (PAT/OAuth tokens). For GitHub App installation tokens, the identity call fails gracefully and no trailer is appended — this is correct because autonomous agent commits are exempt from DCO per project policy.Note: pre-commit could not run in the sandbox (shellcheck_py network error during install). The post-script runs pre-commit authoritatively.
Closes #2591
Post-script verification
agent/2591-scaffold-signoff)b72eb4d0c4f6732bfd37001abe7a7806779349fa..HEAD)