feat(migrate): improve GitHub Actions README Generator migration behavior#110
feat(migrate): improve GitHub Actions README Generator migration behavior#110
Conversation
5606f85 to
ad7754d
Compare
neilime
left a comment
There was a problem hiding this comment.
@copilot when migration have several same mapping marker it should merge them into a single one.
By example:
<!-- start branding -->
Brand stuff
<!-- end branding -->
<!-- start title -->
Header here
<!-- end title -->Should be migrated to:
<!-- header:start -->
Brand stuff
Header here
<!-- header:end -->
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #110 +/- ##
==========================================
+ Coverage 86.07% 86.56% +0.49%
==========================================
Files 70 70
Lines 4230 4303 +73
Branches 945 963 +18
==========================================
+ Hits 3641 3725 +84
+ Misses 580 569 -11
Partials 9 9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Implemented section merging for consecutive sections with the same mapping. Now when See commit 6751cf8 for the implementation with test coverage. |
- Fix mapping: Both branding and title now map to header (was: branding->badges) - Remove unsupported markers: Content markers with no mapping are removed while preserving content - Add missing sections: Empty secrets section marker added after outputs section - Update existing tests to reflect correct behavior Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
- Added comprehensive tests for edge cases - Fixed regex pattern escaping for linter compliance - Validate unsupported marker removal preserves content - Validate missing secrets section insertion after outputs - All migration adapters pass tests Co-authored-by: neilime <314088+neilime@users.noreply.github.com> Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
6751cf8 to
899ff44
Compare
…le section When multiple sections map to the same target section (e.g., both 'branding' and 'title' map to 'header'), they are now merged into a single section instead of creating separate sections. Example: <!-- start branding -->Brand stuff<!-- end branding --> <!-- start title -->Header here<!-- end title --> Now becomes: <!-- header:start --> Brand stuff Header here <!-- header:end --> Instead of two separate header sections. Co-authored-by: neilime <314088+neilime@users.noreply.github.com> Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
899ff44 to
39c0ca8
Compare
…rator Add concise documentation about the new section merging functionality: - Updated migration coverage to mention smart section merging - Added example showing branding + title sections merging into single header - Kept documentation concise and focused on the new feature Co-authored-by: neilime <314088+neilime@users.noreply.github.com> Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
eca5026 to
df440ab
Compare
This PR addresses four critical issues with the GitHub Actions README Generator migration adapter that were causing incorrect migration behavior:
Issues Fixed
1. Incorrect Section Mapping
The
brandingsection was incorrectly mapped tobadgesinstead ofheader. Bothbrandingandtitlesections should map to the sameheadersection according to the tool's intended behavior.Before:
After:
2. Unsupported Markers Not Removed
Non-supported markers (like
contents) were being preserved in the migrated output instead of being removed while keeping their content. This cluttered the migrated files with invalid markers.Before:
After:
3. Missing Required Sections
The migration wasn't adding missing supported section markers. For example, if a file had no
secretssection, the migrated file should automatically include emptysecretsmarkers after theoutputssection.Before:
After:
4. Section Merging for Same Mappings
When multiple sections map to the same target section (e.g., both
brandingandtitlemap toheader), they are now merged into a single section instead of creating separate sections.Before:
Would become:
After (New Behavior):
Implementation Details
sectionMappingsinGitHubActionReadmeGeneratorMigrationAdapterAbstractMigrationAdapter.processMarkerMappings()to return empty string for unmapped sections instead of preserving original markersaddMissingSections()method that intelligently inserts missing supported sections in appropriate positionsmergeConsecutiveSections()method that detects and merges consecutive sections with the same target mappingTesting
Added comprehensive test coverage including:
brandingandtitlecorrectly map toheadersecretssections are automatically added afteroutputsAll 20 migration adapter tests pass, confirming that the changes don't break existing migration tools (actdocs, auto-doc, action-docs).
Fixes #109.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.