(Feat) Adding composer package support
Overview
Adds Composer package migration support to congregate with comprehensive handling for different package creation scenarios. Being used in Aylo's Migration
Files Added/Modified
Following the established pattern from other package type implementations:
-
congregate/migration/gitlab/api/composer.py- ComposerPackagesApi class with GitLab Composer API methods -
congregate/migration/meta/api_models/composer_package.py- ComposerPackage data model -
congregate/migration/gitlab/packages.py- Updated PackagesClient with migrate_composer_packages method
Implementation Details
Standard Migration Pattern:
- Uses existing Git tags/branches from pipeline refs for package creation
- Handles version format differences (
4.0.0vsv4.0.0)
Edge Case Handling:
- Packages created from deleted feature branches are migrated using temporary branch approach
- Attempts commit SHA directly first (GitLab API limitation: returns 404 Tag Not Found)
- Falls back to temporary branch creation from commit SHA, then cleanup
Migration Approach:
- Try original pipeline ref (tag/branch)
- Create missing version tags when needed
- Temporary branch creation for deleted branch scenarios
Testing
- Successfully migrated 10/10 packages including edge cases
- Handles both existing and missing Git references
- Automatic cleanup of temporary branches
Tasks
-
Implement ComposerPackagesApi with tag/branch creation methods -
Add migrate_composer_packages method with multi-tier approach -
Handle deleted feature branch scenario -
Add temporary branch creation and cleanup -
Test with real migration scenario -
Update docs if needed (workflow, runbooks, README, migration metrics, etc.)
Acceptance Criteria
-
Composer packages migrate successfully for standard cases -
Edge cases (deleted branches) handled with fallback approach -
Package version names preserved correctly -
Temporary resources cleaned up properly -
Existing UTs pass locally. If you need help updating any tests, refer to our writing tests documentation
Edited by Annelise Denny