Skip to content

feat: ActionMapping registry + Tier 1 mappings #87

@lex00

Description

@lex00

Today the transformer (#85) drops every uses: step it doesn't recognise into a NeedsReview provenance record. This issue adds a typed registry so the 14 most-used marketplace actions translate cleanly.

type ActionMapping = {
  uses: string;                      // "actions/checkout"
  majorVersions?: string[];          // ["v3", "v4"] — match all if omitted
  apply: (step: GitHubStep, ctx: MigrationContext) => MappingResult;
};

type MappingResult =
  | { kind: "delete"; reason: string }
  | { kind: "image"; image: GitLabImage }      // job-level image substitution
  | { kind: "script"; lines: string[] }
  | { kind: "service"; service: GitLabService }
  | { kind: "needsReview"; reason: string };

Tier 1 (from the upstream skill's references/marketplace-actions.md):

Action Mapping
actions/checkout delete
actions/setup-node image: node:<v>
actions/setup-python image: python:<v>
actions/setup-java image: eclipse-temurin:<v>
actions/setup-go image: golang:<v>
actions/setup-ruby image: ruby:<v>
actions/cache cache: keyword (handled at job level)
actions/upload-artifact artifacts: keyword
actions/download-artifact needs:artifacts: or removed when adjacent stages
docker/build-push-action script + services: docker:dind
docker/login-action script (docker login)
docker/setup-buildx-action script + services: docker:dind
docker/setup-qemu-action script (docker run tonistiigi/binfmt)
actions/github-script needsReview

Done when

  • lexicons/gitlab/src/migrate/from-github/action-mappings.ts exports an ActionMapping[] covering all 14.
  • Each mapping has a unit test with before/after fixtures.
  • Transformer (feat: GitHub→GitLab IR transformer #85) consults the registry; misses produce a needsReview provenance record with the action name.
  • Action-level mappings can return job-level effects (image, services, cache) — the transformer applies these correctly.

Depends on: #85. Blocks: #88.

Inspired by

gitlab-org/ci-cd/github-actions-to-gitlab-cireferences/marketplace-actions.md Tier 1 section. Each chant ActionMapping is a direct port of that file's before/after examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions