Skip to content

feat: chant migrate --use-composites (Node patterns) #92

@lex00

Description

@lex00

Today the transformer emits raw Job + Image + Cache + script for every workflow. This issue adds a pattern-recognition layer that rewrites recognised step sequences into composite calls.

chant migrate <...> --emit ts --use-composites

v1 covers Node shapes only:

  • Checkout + SetupNode + npm/yarn/pnpm/bun ci + build + testNodePipeline({...})
  • Checkout + SetupNode + npm/yarn/pnpm/bun ci + test (no build) → NodeCI({...})
  • Package manager detected from installCommand (npm ci / yarn install / pnpm install / bun install).

The recogniser runs on the GitLab IR (post-transform), not the GitHub IR. Off by default — --use-composites opts in. Pattern recognisers are pure IR rewrites with their own unit tests.

Follow-ups (separate issues): Python (PythonPipeline), Docker (DockerBuild), Go, deploy-environment shapes.

Done when

  • pattern-recognisers.ts lands with the Node patterns above.
  • --use-composites flag wired through CLI.
  • Output for lexicons/github/examples/node-ci/ produces a NodePipeline() call (compare against lexicons/gitlab/examples/node-pipeline/).
  • When the pattern doesn't match cleanly, falls back to raw constructors with no NeedsReview (deterministic).

Depends on: #85, #89.

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