Repository navigation
Description
chant should render the product pipeline for AWS CodePipeline, as ci: codepipeline beside the forge that hosts the repository. AWS-heavy and regulated teams are often required to run delivery inside their AWS accounts.
Part of #5351. Precedent: ci: prow (#5170).
The shape: a CI system, not a forge
CodePipeline hosts no pull requests. The repository stays on GitHub, GitLab or Bitbucket, reached through a CodeConnections connection, so the plan note, the comment commands and the approvals still go through that forge's API.
chant already models this split:
CiSystem(packages/core/src/ci-system.ts) isgithub | gitlab | forgejo | prow.ci: prowruns a GitHub repository's jobs (lexicons/prow/src/forge-jobs.ts).
This issue adds codepipeline the same way.
What exists
- The aws lexicon already types the resources involved:
AWS::CodePipeline::PipelineandWebhook;AWS::CodeBuild::Project,FleetandReportGroup;AWS::CodeConnections::Connection;AWS::CodeStarConnections::RepositoryLink.
- CodePipeline V2 pipelines take git triggers on push and on pull-request events: opened, updated, and closed as merged. Filters are on branch and file path. The branch filter for a pull request applies to the destination branch. The source action supports GitHub, GitHub Enterprise Server, GitLab.com, GitLab self-managed and Bitbucket Cloud.
What it should be
-
A generator in the aws lexicon renders chant's pipeline jobs into:
- a V2 pipeline, with a PR trigger and a push trigger on the default branch;
- a CodeBuild project per job, with its buildspec;
- the connection reference.
It writes them as a chant stack, so the pipeline is itself declared and diffed.
chant build --components --generate codepipelineandchant run --generate codepipelinepick it, as they do for prow. -
Each forge combination is either supported or refused by name (
codepipelineForgeProblem, asprowForgeProblemdoes). GitLab self-managed and Bitbucket depend on ci generators: Bitbucket Pipelines #5346. -
Comment commands: CodePipeline triggers on no comment event. Either a webhook from the forge starts an execution with the command as a variable, or comment commands are refused with a remedy. Decide which.
-
Identity:
- the job runs as the CodeBuild project's role, so cloud credentials need no OIDC exchange;
- the plan and apply roles stay separate, as the other generators keep them;
- the forge token for posting the note comes from Secrets Manager, named by ARN.
-
Signing: CodeBuild has no OIDC token that public Sigstore accepts, as far as found. A release on CodePipeline needs
release.signingwithkms(release.signing: KMS, key and private Sigstore modes, and signing on Forgejo #5458). The renderer says so instead of rendering a keyless step that fails. -
The release pipeline (
chant release workflow) renders for codepipeline too, with the release scan (release publish: scan every artifact before the stage, with a pinned scanner, under supply-chain #5446) and the pinned tool installs. -
ci-detect.tsrecognises a CodeBuild run (CODEBUILD_BUILD_ID).
Done when
-
Golden files for the pull-request and release pipelines, with GitHub as the forge.
-
A fake-forge test posts a plan note and approves from a CodeBuild-shaped environment.
-
A docs page for CodePipeline lists what works, the supported forges, and what is refused.
-
The aws lexicon exports a floor for the generator in
src/chant-floors.ts. -
Adds its row to the forge matrix in
ci/your-forge.mdxand its line toconcepts/forges-ci-and-wardens.mdx(docs: forges, CI systems and wardens, with a feature matrix and why only forges get a warden #5461).
Activity