Skip to content

(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

https://gitlab.com/gitlab-com/customer-success/professional-services-group/professional-services-delivery/gitlab-professional-services/Quebec-Inc-SM-to-GitLab.com/SOW-3343/-/issues/3

Files Added/Modified

Following the established pattern from other package type implementations:

  1. congregate/migration/gitlab/api/composer.py - ComposerPackagesApi class with GitLab Composer API methods
  2. congregate/migration/meta/api_models/composer_package.py - ComposerPackage data model
  3. 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.0 vs v4.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:

  1. Try original pipeline ref (tag/branch)
  2. Create missing version tags when needed
  3. 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

Merge request reports

Loading