Skip to content

feat(cli)!: add --direct flag to sync-scaffold, enroll, and unenroll - #2630

Merged
waynesun09 merged 3 commits into
mainfrom
agent/2625-pr-delivery-flags
Jun 29, 2026
Merged

feat(cli)!: add --direct flag to sync-scaffold, enroll, and unenroll#2630
waynesun09 merged 3 commits into
mainfrom
agent/2625-pr-delivery-flags

Conversation

@fullsend-ai-coder

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

Copy link
Copy Markdown
Contributor

sync-scaffold, enroll, and unenroll previously always pushed directly to
the default branch, bypassing branch protection and review. This change
adds a --direct flag to all three commands, making PR-based delivery
the default:

  • sync-scaffold defaults to PR delivery (matching setup), with
    --direct to opt into direct push. This command changes 29+ files,
    so review-by-default is appropriate.
  • enroll/unenroll also default to PR delivery. When delivered via PR,
    config.yaml is committed to a dedicated fullsend/enrollment-config
    branch (separate from the scaffold's fullsend/scaffold-install branch
    to prevent collision). The repo-maintenance workflow is not dispatched
    in PR mode — it runs automatically when the PR is merged.
  • --direct pushes changes to the default branch immediately, falling
    back to a PR if branch protection blocks the push.

Implementation details

  • New CommitFilesViaPR export in internal/layers/commit.go provides a
    simpler PR delivery path for same-owner repos (enrollment configs)
    without fork support. The existing CommitScaffoldFiles
    commitBranchAndPR path retains full fork support for scaffold installs.
  • Org variable visibility sync (syncOrgVariableVisibility) is skipped in
    PR mode — it only runs on direct push, since the change hasn't taken
    effect until the PR is merged.

Closes #2625

Post-script verification

  • Branch is not main/master (agent/2625-pr-delivery-flags)
  • Secret scan passed (gitleaks)
  • Pre-commit hooks passed
  • Tests passed

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

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

Site preview

Preview: https://25982ec4-site.fullsend-ai.workers.dev

Commit: 326792a0b06514697e9877da548ba0341585304c

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.77215% with 46 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/layers/commit.go 9.75% 37 Missing ⚠️
internal/cli/admin.go 75.00% 5 Missing and 3 partials ⚠️
internal/cli/github.go 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ralphbean ralphbean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Three notes inline, none blocking.

Comment thread internal/cli/github.go
Comment thread internal/cli/admin.go
Comment thread internal/cli/admin.go Outdated
@rh-hemartin

Copy link
Copy Markdown
Member

@ralphbean this PR is from the coder bot, you probably need to change this yourself

@rh-hemartin

Copy link
Copy Markdown
Member

/fs-fix Why introducing a --pr flag? Just make it the default and then have the --direct alternative.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 2:07 PM UTC · Completed 2:14 PM UTC
Commit: 2d8adb7 · View workflow run →

fullsend-ai-coder Bot added a commit that referenced this pull request Jun 26, 2026
…pr flag

Remove the --pr flag from sync-scaffold, enroll, and unenroll commands.
PR delivery is now the default for all three commands. Users who need
direct push can use --direct to opt out.

Addresses review feedback on #2630
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Made PR delivery the default for all commands (sync-scaffold, enroll, unenroll) and removed the --pr flag. Only --direct remains as the opt-out. Updated tests to verify --pr no longer exists and --direct is present.

Fixed (1):

  1. remove --pr flag, make PR delivery the default: Removed --pr flag from sync-scaffold, enroll, and unenroll commands. PR delivery is now the default for all three commands. The --direct flag remains as the opt-out for direct push. Mutual exclusivity checks removed since there is only one flag now.

Tests: passed

Updated by fullsend fix agent

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review Squad — 5 agents (Claude, Gemini, Codex)

3 new findings posted inline (MEDIUM+). 2 findings already covered by existing comments (static PR title at L2630, breaking change at github.go:991) — skipped.

Also: the PR description references a --pr flag and mutual exclusivity that don't exist in the implementation. All three commands default to PR delivery with only --direct as an override. Consider updating the description and title.

Comment thread internal/cli/admin.go
Comment thread internal/cli/admin.go
Comment thread internal/cli/admin.go
waynesun09 pushed a commit that referenced this pull request Jun 29, 2026
…pr flag

Remove the --pr flag from sync-scaffold, enroll, and unenroll commands.
PR delivery is now the default for all three commands. Users who need
direct push can use --direct to opt out.

Addresses review feedback on #2630
@waynesun09
waynesun09 force-pushed the agent/2625-pr-delivery-flags branch from b7b5e4a to 3504c39 Compare June 29, 2026 16:04
@waynesun09
waynesun09 force-pushed the agent/2625-pr-delivery-flags branch from 3504c39 to 2d03955 Compare June 29, 2026 16:12
@waynesun09 waynesun09 changed the title feat(cli): add --pr and --direct flags to sync-scaffold, enroll, and unenroll feat(cli): add --direct flag to sync-scaffold, enroll, and unenroll Jun 29, 2026
@waynesun09 waynesun09 changed the title feat(cli): add --direct flag to sync-scaffold, enroll, and unenroll feat!(cli): add --direct flag to sync-scaffold, enroll, and unenroll Jun 29, 2026

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All review findings addressed: branch collision fixed with dedicated fullsend/enrollment-config branch, variable sync guarded in PR mode, IsForbidden check added to commitViaPR, orphaned StepStart removed. Tests pass, rebased onto main.

@waynesun09
waynesun09 added this pull request to the merge queue Jun 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 29, 2026
@waynesun09
waynesun09 added this pull request to the merge queue Jun 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 29, 2026
@waynesun09
waynesun09 added this pull request to the merge queue Jun 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 29, 2026
@waynesun09
waynesun09 added this pull request to the merge queue Jun 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 29, 2026
@waynesun09
waynesun09 force-pushed the agent/2625-pr-delivery-flags branch from 2d03955 to 805dfa5 Compare June 29, 2026 18:57
@waynesun09 waynesun09 changed the title feat!(cli): add --direct flag to sync-scaffold, enroll, and unenroll feat(cli)!: add --direct flag to sync-scaffold, enroll, and unenroll Jun 29, 2026
fullsend-ai-coder Bot and others added 3 commits June 29, 2026 15:03
…unenroll

sync-scaffold, enroll, and unenroll previously always pushed directly to the
default branch, bypassing branch protection and review. This change adds
--pr and --direct flags to all three commands for explicit delivery control:

- sync-scaffold defaults to PR delivery (matching setup), with --direct
  to opt into direct push. This command changes 29+ files, so review-by-
  default is appropriate.
- enroll/unenroll default to direct push, with --pr to opt into PR
  delivery. These toggle a single config value, so the overhead of a PR
  is not warranted by default.
- --pr and --direct are mutually exclusive on all commands.

When --pr is used for enroll/unenroll, config.yaml is committed to the
fullsend/scaffold-install branch and delivered via PR using the same
CommitScaffoldFiles helper that setup uses. The repo-maintenance workflow
is not dispatched in PR mode — it runs automatically when the PR is merged.

Closes #2625
…pr flag

Remove the --pr flag from sync-scaffold, enroll, and unenroll commands.
PR delivery is now the default for all three commands. Users who need
direct push can use --direct to opt out.

Addresses review feedback on #2630
Address three review findings:

1. saveRepoConfigViaPR now uses fullsend/enrollment-config instead of
   sharing fullsend/scaffold-install with sync-scaffold, preventing
   unrelated scaffold and enrollment changes from colliding on the
   same branch and PR.

2. Skip syncOrgVariableVisibility in PR mode — variable visibility
   should not change until the enrollment config PR is merged.
   repo-maintenance reconciles on merge.

3. Remove duplicate godoc line on saveRepoConfig.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@waynesun09
waynesun09 force-pushed the agent/2625-pr-delivery-flags branch from 805dfa5 to 326792a Compare June 29, 2026 19:03
@waynesun09 waynesun09 added the ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push) label Jun 29, 2026
@waynesun09
waynesun09 added this pull request to the merge queue Jun 29, 2026
Merged via the queue into main with commit b8a6895 Jun 29, 2026
16 of 17 checks passed
@waynesun09
waynesun09 deleted the agent/2625-pr-delivery-flags branch June 29, 2026 19:54
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jun 29, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 8:00 PM UTC · Completed 8:10 PM UTC
Commit: 326792a · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #2630 — Add PR delivery flags to sync-scaffold, enroll, unenroll

Timeline

  1. Issue sync-scaffold, enroll, and unenroll push directly to default branch instead of creating PRs #2625 filed by waynesun09 requesting PR delivery support for three CLI commands, with differentiated defaults (sync-scaffold→PR, enroll/unenroll→direct).
  2. Triage agent reinforced the issue's recommended approach with differentiated defaults.
  3. Code agent (commit 386a6d6) faithfully implemented the triage recommendation: both --pr and --direct flags with differentiated defaults per command.
  4. ralphbean approved with 3 non-blocking notes: missing feat!: prefix for the breaking default-behavior change, stale godoc, and branch collision risk.
  5. rh-hemartin triggered /fs-fix with design feedback: remove --pr, just make PR delivery the default for everything.
  6. Fix agent (commit 71c97d8) successfully simplified the API per this feedback.
  7. Review squad posted 3 findings: branch collision (HIGH), variable sync in PR mode (MEDIUM), duplicate godoc (MEDIUM). Notably, the squad caught the variable-sync issue that the human reviewer had not flagged.
  8. Wayne Sun (human, commit 326792a) fixed all 3 review squad findings manually.
  9. PR merged after final human approval.

What went well

  • Review squad added real value. It caught 3 legitimate issues, including the variable-sync-in-PR-mode bug that the human reviewer missed. The HIGH-severity branch collision was correctly prioritized.
  • Fix agent handled a design pivot cleanly. When rh-hemartin asked to simplify the API (remove --pr, make PR the universal default), the fix agent executed the change correctly and updated tests.
  • Triage was thorough. The triage agent provided a well-structured recommendation with differentiated analysis per command.

Gaps observed (all covered by existing issues)

Gap Existing issue
PR description became stale after fix agent changed the approach #2418
Review agent didn't flag the missing ! breaking-change suffix on the commit/PR title, despite AGENTS.md explicitly requiring it #2105 (prefix enforcement) + #2566 (default-behavior change detection)
Review squad findings were fixed by a human rather than auto-dispatching the fix agent #2596
Code agent's initial commit had 41% patch coverage (vs 80% threshold) #1719 (run CI before pushing)

Assessment

This was a 3-iteration workflow (code → fix → human fix), which is above average but explainable. The first rework cycle was driven by a human design disagreement with the issue spec — not an agent failure. The code agent faithfully followed the triage recommendation, but a different human preferred a simpler API. The second rework cycle was driven by legitimate review findings that required code changes.

No new proposals are warranted — all identified gaps map to existing open issues. The workflow demonstrates the review squad providing value beyond what human review alone caught.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sync-scaffold, enroll, and unenroll push directly to default branch instead of creating PRs

3 participants