feat(migrate): filter branches by last-analysis date (#583) - #591
okorach-sonar wants to merge 3 commits into
Conversation
Splits three over-15 methods into smaller named helpers, no behavior change: toExtractConfig's per-shape switch cases (extract), the per-project goroutine body in runImportProjectData (migrate), and the per-table blocks in renderMarkdownWarnings (report/summary). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds --branch_analyzed_after (YYYY-MM-DD) to extract, migrate, and transfer, plus a matching branch_analyzed_after config field with top-level/source/target precedence. Only branches analyzed on or after the cutoff are selected; the project's main branch is always kept, force-included with a logged warning (and a new "Force-Included Main Branches" report table) when the filter would otherwise exclude every branch. Warns when the cutoff is more than 730 days old. Transfer resolves the two phases independently rather than merging them, since extract and migrate are meant to be able to use different cutoffs. Updates the mandatory smoke suite (flag registration, exit-code matrix, live pipeline args, report-accuracy check) and documentation per CLAUDE.md. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Splits three over-15 methods into smaller named helpers, no behavior change: toExtractConfig's per-shape switch cases (extract), the per-project goroutine body in runImportProjectData (migrate), and the per-table blocks in renderMarkdownWarnings (report/summary). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
fc96b7a to
74ec0c9
Compare
|
|
gitar auto-apply:on |
…ss warnings Co-authored-by: Olivier K <161828284+okorach-sonar@users.noreply.github.com>
Code Review ✅ No issues found 3 closed / 3 findings🟡 Medium risk · Branch-selection filters alter extract, migrate, and transfer behavior across phases Adds ✅ 3 closed✅ Bug: Extract-side force-main warning never reaches the report
✅ Quality: transfer logs the staleness advisory twice, unlabeled
✅ Quality: TROUBLESHOOTING.md sample shows a report heading that never renders
Review coverage🧪 Functional validation 9 of 9 objectives covered 📋 Rules No rules evaluated 🤖 Auto-approval Not enabled · Set up Implementation Status ✅ 9 of 9 objectives covered✅ #583 - 9 of 9 objectives coveredThis PR implements filtering branches by last-analysis date across extract, migrate, and transfer via CLI flags and configuration files, including main-branch force-inclusion reporting, format validation, and staleness warnings. ✅ 9 covered here
Options ✅ Auto-apply✅ Auto-apply is on → Gitar will commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |



Summary
--branch_analyzed_after YYYY-MM-DDtoextract,migrate, andtransfer, plus a matchingbranch_analyzed_afterconfig-file field with top-level/source/targetprecedence (a phase block, even set to"", always wins over the top-level value). Only branches whose last analysis is on or after the cutoff are selected.migration_summary.md/PDF as a new "Force-Included Main Branches" table.transfer, the two phases resolve independently rather than being merged/OR'd (unlikemigrate_history) — the issue's own examples require extract and migrate to be able to use different cutoffs. The single CLI flag sets both sides identically; the config file is the only way to differ them.--branches/regexp filter (Provide a means to chose branches that will be migrated, based on the branch name #582, not yet implemented) via an independent, chainable predicate — nothing from Provide a means to chose branches that will be migrated, based on the branch name #582 is implemented here.ADVANCED-CONFIG.md+ 5 other docs, JSON schema, example config) per this repo'sCLAUDE.md.Test plan
go build ./... && go vet ./... && go test ./...— all greenmake smoke-fast(Tier 0) — 40/40 passedmake smoke(Tiers 0/1/3) — 41/41 passedSMOKE_ALLOW_DESTRUCTIVE=1 make smoke-full(Tier 2, destructive) — not run in this environment (no staging SonarQube Server/Cloud credentials available); please run before mergingextract,migrate, andtransfer--exclude_branchesfilter, and transfer's no-cross-side-leakage guaranteeCloses #583.
🤖 Generated with Claude Code