feat(#3376): differentiate scaffold PR titles for upgrades vs installs - #6003
Conversation
|
🤖 Finished Review · ✅ Success · Started 1:09 PM UTC · Completed 1:27 PM UTC Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsLow
Previous runReviewFindingsMedium
Low
Labels: PR modifies scaffold installation metadata generation in internal/repos, internal/layers, and internal/cli Previous run (2)ReviewFindingsMedium
Low
|
|
/fs-fix Rebase the branch onto main, then address the review findings:
|
|
🤖 Finished Fix · ✅ Success · Started 9:12 AM UTC · Completed 9:26 AM UTC Commit: |
- Consolidate duplicate constants: remove defaultScaffoldBranch from commit.go in favor of repos.DefaultScaffoldBranch; export ScaffoldBumpBranchPrefix and use it in isKnownScaffoldBranch. - Reduce CommitScaffoldFiles parameter count: accept repos.ScaffoldPRMetadata as a single parameter instead of 4 separate positional string args (commitMsg, prTitle, prBody, scaffoldBranch). - Accept optional pre-fetched guard state in BuildScaffoldPRMetadata via ScaffoldMetadataOpts.GuardInstalled so batch callers can skip the redundant GetRepoVariable API call. - Accept optional pre-fetched old version in BuildScaffoldPRMetadata via ScaffoldMetadataOpts.OldVersion so upgrade callers can skip the duplicate GetFileContent call. - Fix regex prerelease character class: add hyphens to versionCommentPattern ([a-zA-Z0-9.] → [a-zA-Z0-9.-]); add test for v1.0.0-alpha-1. Addresses review feedback on #6003
🔧 Fix agent — iteration 1 (human-triggered)Addressed all 5 review findings. Rebased branch onto main. Consolidated duplicate constants between layers and repos packages. Reduced CommitScaffoldFiles from 4 positional string args to a single ScaffoldPRMetadata struct. Added optional pre-fetched guard state and old version to BuildScaffoldPRMetadata via variadic ScaffoldMetadataOpts. Fixed regex to match hyphenated prerelease versions. All existing and new tests pass. Fixed (5):
Tests: passedNext steps:
|
ca8438e to
d4d9854
Compare
|
🤖 Finished Review · ✅ Success · Started 9:27 AM UTC · Completed 9:45 AM UTC Commit: |
|
/fs-fix Rebase onto main, then address the review agent's inline comments. |
|
🤖 Finished Fix · ✅ Success · Started 10:17 AM UTC · Completed 10:27 AM UTC Commit: |
Scaffold PRs previously used "chore: initialize fullsend per-repo installation" for both fresh installs and version upgrades, creating misleading git history. Now the scaffold commit function detects whether the target repo already has fullsend installed (via the guard variable) and formats PR metadata accordingly: - Fresh installs retain "initialize" language in title and body - Upgrades use "chore: bump fullsend from vX to vY" with version info extracted from the existing workflow file - Branch names differentiate: fullsend/scaffold-install for installs, fullsend/bump-vX.Y.Z for upgrades New BuildScaffoldPRMetadata helper in internal/repos centralizes the detection and metadata generation, replacing hardcoded strings in four scaffold commit closures across admin.go and repos.go. CommitScaffoldFiles now accepts a scaffoldBranch parameter so callers can override the default branch name. isKnownScaffoldBranch recognizes fullsend/bump-* branches for stale PR cleanup. Closes #3376
- Consolidate duplicate constants: remove defaultScaffoldBranch from commit.go in favor of repos.DefaultScaffoldBranch; export ScaffoldBumpBranchPrefix and use it in isKnownScaffoldBranch. - Reduce CommitScaffoldFiles parameter count: accept repos.ScaffoldPRMetadata as a single parameter instead of 4 separate positional string args (commitMsg, prTitle, prBody, scaffoldBranch). - Accept optional pre-fetched guard state in BuildScaffoldPRMetadata via ScaffoldMetadataOpts.GuardInstalled so batch callers can skip the redundant GetRepoVariable API call. - Accept optional pre-fetched old version in BuildScaffoldPRMetadata via ScaffoldMetadataOpts.OldVersion so upgrade callers can skip the duplicate GetFileContent call. - Fix regex prerelease character class: add hyphens to versionCommentPattern ([a-zA-Z0-9.] → [a-zA-Z0-9.-]); add test for v1.0.0-alpha-1. Addresses review feedback on #6003
- Unexport DefaultScaffoldPRBody → defaultScaffoldPRBody (only used within the repos package) - Pass pre-fetched guard state via ScaffoldMetadataOpts in runPerRepoInstall to skip redundant GetRepoVariable API call - Pass pre-fetched guard state in repos.go upgrade closure (repos in the upgrade path are already known to be installed) - Fix inaccurate comment in applyPerRepoScaffold claiming it is only called from the vendor path (also called from github.go) Addresses review feedback on #6003
🔧 Fix agent — iteration 2 (human-triggered)Addressed 8 of 9 review findings (5 were already fixed in iteration 1, 3 new fixes applied). Disagreed with 1 finding (threading oldVersion through the commit callback requires signature changes beyond this PR's scope). Rebased onto origin/main as requested. Fixed (8):
Disagreed (1):
Tests: passedNext steps:
|
d4d9854 to
ee574b3
Compare
|
🤖 Finished Review · ✅ Success · Started 10:29 AM UTC · Completed 11:02 AM UTC Commit: |
|
🤖 Finished Retro · ❌ Failure · Started 11:43 AM UTC · Completed 12:00 PM UTC Commit: |
Summary
Scaffold PRs previously used "chore: initialize fullsend per-repo installation" for both fresh installs and version upgrades, producing misleading git history and PR titles. This PR adds version-aware metadata generation so upgrade PRs clearly describe the version transition.
Changes
BuildScaffoldPRMetadatahelper ininternal/repos/scaffold_metadata.go: detects whether the target repo already has fullsend installed (via the guard variable) and extracts the existing version from the workflow file's traceability comment. Returns appropriate commit message, PR title, PR body, and branch name.CommitScaffoldFilesgains ascaffoldBranchparameter ininternal/layers/commit.go: callers can now override the defaultfullsend/scaffold-installbranch name. Empty string preserves the existing default.isKnownScaffoldBranchupdated to recognizefullsend/bump-*branches, enabling stale PR cleanup when switching between install and upgrade branches.internal/cli/admin.goandinternal/cli/repos.goto use the new helper instead of hardcoded strings.Validation criteria
fullsend/scaffold-installvsfullsend/bump-v0.28.0Testing
BuildScaffoldPRMetadatacovering fresh install, upgrade with both versions, upgrade with new version only, upgrade with no versions, guard=false, guard check errordetectExistingVersioncovering version found, no version, file not found, prereleaseCommitScaffoldFileswith custom branch name, empty branch fallback, and upgrade branch closing old install PRisKnownScaffoldBranchtest updated for bump branchesscaffoldBranchparametergo vetclean,gofmtclean, secret scan cleanChecklist
Closes #3376
Post-script verification
agent/3376-scaffold-upgrade-titles)63cd2688887a6b6f37c980fc876a4a94615d7079..HEAD)