Skip to content

feat(config): CLI Migration Scanner — CI workflow + audit gap fixes (roadmap v1.8.0 #60) - #4240

Merged
makr-code merged 3 commits into
developfrom
copilot/implement-cli-migration-scanner
Mar 15, 2026
Merged

makr-code merged 3 commits into
developfrom
copilot/implement-cli-migration-scanner

Conversation

Copilot AI commented Mar 15, 2026 •

Copy link
Copy Markdown
Contributor

Delivers the CI gate and closes two coverage gaps found during audit of the pre-existing CLI Migration Scanner implementation (tools/config_migration_scanner.cpp, src/config/config_migration_scanner_impl.h, tests/test_config_migration_scanner.cpp).

Description

All 6 functional acceptance criteria were already met — binary, flags (--root, --output, --dry-run, --fix), output fields, .bak backups, exit code 1 on overdue paths, and benchmark (BM_ScanTree_10K). Two gaps remained:

Gap 1 — CI workflow (cli-migration-scanner-ci.yml)

  • New workflow triggering on changes to the scanner sources, running ConfigMigrationScannerFocusedTests across gcc-12, gcc-13, clang-15 and smoke-testing the config_migration_scanner binary (--help)
  • cmake/CMakeLists.txt was missing from path filters — the binary CMake target is defined there; omitting it meant target definition changes would never trigger CI. Fixed.

Gap 2 — Missing dry-run stdout assertion

FixFileDryRunDoesNotModifyFile verified file content and absence of .bak but did not assert the required [dry-run] Would update: message is printed — the spec says the mode "prints what would be renamed". Added FixFileDryRunPrintsWouldUpdateMessage:

std::ostringstream oss;
std::streambuf* old = std::cout.rdbuf(oss.rdbuf());
bool ok = cms::fixFile(f, matches, /*dry_run=*/true);
std::cout.rdbuf(old);

EXPECT_NE(oss.str().find("[dry-run]"), std::string::npos);
EXPECT_NE(oss.str().find(f.string()), std::string::npos);

Test count: 45 → 46.

Type of Change

  • Bug fix
  • New feature
  • Refactoring
  • Documentation
  • Other:

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

📚 Research & Knowledge (wenn applicable)

  • Diese PR basiert auf wissenschaftlichen Paper(s) oder Best Practices?
    • Falls JA: Research-Dateien in /docs/research/ angelegt?
    • Falls JA: Im Modul-README unter "Wissenschaftliche Grundlagen" verlinkt?
    • Falls JA: In /docs/research/implementation_influence/ eingetragen?

Relevante Quellen:

  • Paper:
  • Best Practice:
  • Architecture Decision:

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • No new warnings introduced
Original prompt

This section details on the original issue you should resolve

<issue_title>CLI Migration Scanner</issue_title>
<issue_description>### Context

This issue implements the roadmap item 'CLI Migration Scanner' for the config domain. It is sourced from the consolidated roadmap under 🟠 High Priority — Near-term (v1.5.0 – v1.8.0) and targets milestone v1.8.0.

Primary detail section: CLI Migration Scanner

Goal

Deliver the scoped changes for CLI Migration Scanner in src/config/ and complete the linked detail section in a release-ready state for v1.8.0.

Detailed Scope

CLI Migration Scanner

Priority: High
Target Version: v1.8.0

Implement a CLI tool (tools/config_migration_scanner) that scans a deployment directory tree for files referencing legacy config paths and outputs a migration report (current path → new path, deprecation status, removal deadline).

Implementation Notes:

  • [x] New binary target in tools/config_migration_scanner.cpp; links against config_path_resolver only (minimal dependencies).
  • [x] Accepts --root <dir> (default .) and --output {text,json,csv} flags; scans .yaml, .json, .toml, .ini, .env files recursively.
  • [x] For each discovered legacy path reference, outputs: file, line, legacy_path, new_path, deprecated_date, removal_date, migration_guide_url (from PathMappingMetadata).
  • [x] --dry-run mode: prints what would be renamed without modifying files.
  • [x] --fix mode: rewrites file contents replacing legacy path strings with new paths (with backup .bak files).
  • [x] Returns exit code 1 if any paths past removal_date are found (usable as a CI gate).

Performance Targets:

  • Scan of 10,000 config files (avg 100 lines each) completes in < 5 s on a single thread.
  • --fix mode for 500 files rewrites in < 10 s (bounded by disk I/O).

Acceptance Criteria

  • New binary target in tools/config_migration_scanner.cpp; links against config_path_resolver only (minimal dependencies).
  • Accepts --root <dir> (default .) and --output {text,json,csv} flags; scans .yaml, .json, .toml, .ini, .env files recursively.
  • For each discovered legacy path reference, outputs: file, line, legacy_path, new_path, deprecated_date, removal_date, migration_guide_url (from PathMappingMetadata).
  • --dry-run mode: prints what would be renamed without modifying files.
  • --fix mode: rewrites file contents replacing legacy path strings with new paths (with backup .bak files).
  • Returns exit code 1 if any paths past removal_date are found (usable as a CI gate).
  • Scan of 10,000 config files (avg 100 lines each) completes in < 5 s on a single thread.
  • --fix mode for 500 files rewrites in < 10 s (bounded by disk I/O).

Relationships

References

  • src/ROADMAP.md
  • src/config/FUTURE_ENHANCEMENTS.md#cli-migration-scanner
  • Source key: roadmap:60:config:v1.8.0:cli-migration-scanner

Generated from the consolidated source roadmap. Keep the roadmap and issue in sync when scope changes.

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Implement CLI migration scanner for config domain feat(config): add CLI Migration Scanner CI workflow (roadmap v1.8.0 #60) Mar 15, 2026
Copilot AI requested a review from makr-code March 15, 2026 09:11
Copilot AI changed the title feat(config): add CLI Migration Scanner CI workflow (roadmap v1.8.0 #60) feat(config): CLI Migration Scanner — CI workflow + audit gap fixes (roadmap v1.8.0 #60) Mar 15, 2026
@makr-code
makr-code marked this pull request as ready for review March 15, 2026 10:13
@makr-code
makr-code merged commit 2085004 into develop Mar 15, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI Migration Scanner

2 participants