Skip to content

fix(#2591): add Signed-off-by trailer to scaffold PR commits - #2595

Merged
ifireball merged 2 commits into
mainfrom
agent/2591-scaffold-signoff
Jun 24, 2026
Merged

ifireball merged 2 commits into
mainfrom
agent/2591-scaffold-signoff

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

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

Post-script verification

  • Branch is not main/master (agent/2591-scaffold-signoff)
  • Secret scan passed (gitleaks — b72eb4d0c4f6732bfd37001abe7a7806779349fa..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

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
@github-actions

github-actions Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

E2E tests are running

Authorization passed for this commit. See the E2E Tests workflow for results.

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 7:51 AM UTC · Completed 8:03 AM UTC
Commit: 469affc · View workflow run →

@codecov

codecov Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.18519% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/cli/github.go 33.33% 2 Missing and 2 partials ⚠️
internal/cli/admin.go 75.00% 1 Missing and 1 partial ⚠️
internal/forge/github/github.go 90.47% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

Looks good to me

Previous run

Review

Findings

Medium

  • [api-contract] internal/forge/github/github.go:1365 — 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.
    Remediation: Only wrap with forge.ErrNotFound for HTTP 403/404 responses. For other errors, return the underlying error without the ErrNotFound sentinel — check the error type after c.get and only prepend ErrNotFound for APIError with status 403 or 404.

Labels: PR fixes DCO sign-off for scaffold commits created during org setup/install.

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the review comment for full details.

if err != nil {
return nil, fmt.Errorf("get authenticated user identity: %w: %w", forge.ErrNotFound, err)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[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.

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment component/install CLI install and app setup type/bug Confirmed defect in existing behavior labels Jun 24, 2026
@ifireball

Copy link
Copy Markdown
Member

/fs-fix

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 8:24 AM UTC · Completed 8:32 AM UTC
Commit: 6bd5f3a · View workflow run →

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

Copy link
Copy Markdown
Contributor Author

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

  1. GetAuthenticatedUserIdentity wraps all errors with ErrNotFound (internal/forge/github/github.go): Scoped ErrNotFound wrapping to only HTTP 403/404 APIError responses. Other errors (network failures, 5xx, rate limits) are now returned without the ErrNotFound sentinel, allowing callers to distinguish permanent from transient failures. Added test verifying non-permission errors (400) are not wrapped as ErrNotFound.

Tests: passed

Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:35 AM UTC · Completed 8:46 AM UTC
Commit: 45803b4 · View workflow run →

@ifireball ifireball added the ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push) label Jun 24, 2026
@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge and removed requires-manual-review Review requires human judgment labels Jun 24, 2026
@ifireball
ifireball added this pull request to the merge queue Jun 24, 2026
Merged via the queue into main with commit 1e86875 Jun 24, 2026
24 checks passed
@ifireball
ifireball deleted the agent/2591-scaffold-signoff branch June 24, 2026 09:30
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 9:35 AM UTC · Completed 9:47 AM UTC
Commit: 45803b4 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #2595 — Add Signed-off-by trailer to scaffold PR commits

Overall 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

Time (UTC) Event
07:18 Issue #2591 created
07:19 Triage agent ran, applied ready-to-code
07:27 Code agent dispatched
07:48 PR #2595 opened (21 min code time)
08:03 Review agent posted 1 medium finding: GetAuthenticatedUserIdentity wraps all errors as ErrNotFound
08:21 Human triggered /fs-fix
08:32 Fix agent resolved finding in 1 iteration
08:46 Review agent approved
09:20 Human approved
09:30 PR merged

What went well

  • Review quality: The review agent caught a real API contract issue — blanket sentinel error wrapping that would mask transient failures. This is a high-value finding.
  • Fix efficiency: The fix agent scoped ErrNotFound wrapping to HTTP 403/404 responses and added a regression test, all in one iteration.
  • Reasonable scope: 279 additions across 10 files with tests covering the new forge interface method, workflows layer, and CLI wiring.

Observations (already tracked)

  • Redundant fix dispatches: 3 fix workflow runs occurred despite only 1 visible /fs-fix comment. Fix runs 2 and 3 appear triggered by cascading events. This class of issue is tracked by #766 (dispatch-layer dedup) and #893 (reduce redundant dispatches from non-code events).
  • Post-merge review dispatch: A review run was dispatched at 09:38, 8 minutes after merge. Tracked by #1439 (skip review dispatch when PR closed/merged) and #1870 (skip dispatch when action is 'closed').
  • Low coverage on CLI wiring: internal/cli/github.go had 33% patch coverage, though this is expected for CLI wiring code that's hard to unit test.

No new proposals — the improvement opportunities identified are already well-covered by existing open issues.

ifireball pushed a commit to ifireball/fullsend that referenced this pull request Jun 24, 2026
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
ifireball added a commit to ifireball/fullsend that referenced this pull request Jun 24, 2026
…old-signoff

fix(fullsend-ai#2591): add Signed-off-by trailer to scaffold PR commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/install CLI install and app setup ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push) ready-for-merge All reviewers approved — ready to merge type/bug Confirmed defect in existing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fullsend github setup PR is not signing commits

1 participant