Skip to content

Migrate CI from Artifactory to AWS CodeArtifact - #493

Merged
adamrasheed merged 4 commits into
stagingfrom
uxe-626-codeartifact-migration
Aug 11, 2026
Merged

Migrate CI from Artifactory to AWS CodeArtifact#493
adamrasheed merged 4 commits into
stagingfrom
uxe-626-codeartifact-migration

Conversation

@adamrasheed

@adamrasheed adamrasheed commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Problem

Artifactory has been decommissioned. Every CI job on this repo failed at pnpm install:

CERT_HAS_EXPIRED  request to https://artifactory.corp.mongodb.com/artifactory/api/npm/leafygreen-ui/@lg-private/canvas-header/-/@lg-private/canvas-header-3.0.1.tgz failed, reason: certificate has expired

Per the migration page: brownout 10 Aug 2026, full shutdown 14 Sep 2026.

This repo is the last piece of the LeafyGreen estate still pointed at Artifactory — mongodb/leafygreen-ui and 10gen/leafygreen-ui-private are already migrated.

Changes

  • .github/workflows/on-pr.yml — replaced the JFROG_AUTH-based Set .npmrc step in all three jobs (lint, types, build) with aws-actions/configure-aws-credentials + a CodeArtifact login step. Auth is via OIDC role assumption, not static keys — so there are no new secrets to provision. Needs the id-token: write permission, added at the workflow level.
  • scripts/login-codeartifact.sh (new) — resolves the CodeArtifact registry endpoint and writes npm auth config. Modelled on the equivalent scripts in leafygreen-ui and leafygreen-ui-private, so all three repos share one shape. Skips aws sso login when CI is set.
  • pnpm-lock.yaml — the 5 @lg-private entries had Artifactory tarball URLs baked into their resolution maps, so pnpm went straight to the dead host regardless of registry config. Dropped the tarball: field from those entries; pnpm now derives the URL from @lg-private:registry. All integrity hashes are unchanged, and CI confirms CodeArtifact's tarballs verify against them.
  • package.json — added pnpm login:codeartifact for local dev.
  • README.md — replaced the stale "log into Artifactory" instructions.

@lg-private packages live in CodeArtifact domain mongodb (owner 271346171620), repository leafygreen-ui.

Role provisioned by DevProd under DEVPROD-41210:
arn:aws:iam::271346171620:role/aws-codeartifact-design-github-actions

Test plan

  • Configure AWS credentials and Login to CodeArtifact pass via OIDC
  • pnpm install resolves @lg-private from CodeArtifact
  • Build, Lint, and Types all green
  • No artifactory / jfrog references remain under .github/ or in the lockfile

Follow-ups (not in this PR)

  • on-leafygreen-release.yml runs pnpm install with no registry auth at all, so it will fail the same way on @lg-private. Needs the same two steps.
  • The types job installs dependencies but never runs tsc — it's been a no-op. Left alone to keep this PR to the infra fix.
  • The JFROG_AUTH, JFROG_EMAIL, JFROG_PASSWORD, and JFROG_USERNAME secrets on this repo are now dead and can be deleted.
  • Local dev against CodeArtifact needs AWS SSO access to account 271346171620 (via this MANA group); CI does not, since it uses OIDC.

adamrasheed and others added 4 commits August 7, 2026 14:43
Artifactory has been decommissioned and is returning 503s, breaking every
CI job at `pnpm install` while fetching @lg-private packages.

Replaces the JFROG_AUTH-based .npmrc setup in all three on-pr jobs with
AWS CodeArtifact auth, mirroring the pattern already used in
mongodb/leafygreen-ui and 10gen/leafygreen-ui-private. Adds
scripts/login-codeartifact.sh so CI and local dev share one path.

Requires AWS_CODEARTIFACT_ACCESS_KEY_ID and AWS_CODEARTIFACT_SECRET_ACCESS_KEY
to be added as repo secrets before CI will pass.

Ref: https://wiki.corp.mongodb.com/spaces/DBDEVPROD/pages/314681038/Migration+from+Artifactory+to+AWS+CodeArtifact
DevProd provisioned an IAM role instead of static keys. Use
role-to-assume with the required id-token permission, and pass
--domain-owner on the CodeArtifact calls per Vitalii's example
(DEVPROD-41210).
The 5 @lg-private entries had artifactory tarball URLs baked into
their resolutions, so pnpm went straight to the dead host regardless
of the registry config. Removing the tarball field lets pnpm derive
the URL from @lg-private:registry (now CodeArtifact) while the
integrity hashes still verify the contents.
@adamrasheed
adamrasheed marked this pull request as ready for review August 11, 2026 14:58
Copilot AI lite review requested due to automatic review settings August 11, 2026 14:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates this repo’s CI and local developer workflow from the decommissioned Artifactory npm registry to AWS CodeArtifact (via GitHub Actions OIDC role assumption), and updates lockfile/docs to prevent pnpm from hard-resolving Artifactory tarball URLs.

Changes:

  • Update .github/workflows/on-pr.yml to assume an AWS role via OIDC and run a CodeArtifact login step before pnpm install.
  • Add scripts/login-codeartifact.sh and expose it via pnpm login:codeartifact for local developer auth.
  • Remove Artifactory tarball URLs from affected @lg-private/* entries in pnpm-lock.yaml, and update README.md instructions accordingly.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/login-codeartifact.sh Adds a CodeArtifact auth/login script that configures npm/pnpm registry + token.
.github/workflows/on-pr.yml Switches CI auth from JFrog/Artifactory to AWS CodeArtifact via OIDC role assumption.
pnpm-lock.yaml Removes baked-in Artifactory tarball URLs so pnpm derives tarballs from the configured registry.
package.json Adds login:codeartifact script for local developer auth.
README.md Updates developer setup and troubleshooting guidance for CodeArtifact.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +42 to +43
CODEARTIFACT_ENDPOINT_JSON=$(aws codeartifact get-repository-endpoint --domain $DOMAIN --domain-owner $DOMAIN_OWNER --repository $REPOSITORY --format npm)
CODEARTIFACT_REGISTRY=$(echo "$CODEARTIFACT_ENDPOINT_JSON" | jq -r '.repositoryEndpoint')
Comment on lines +55 to +56
npm config set "$SCOPE:registry=$CODEARTIFACT_REGISTRY"
npm config set "$CODEARTIFACT_REGISTRY_URI:_authToken=$CODEARTIFACT_AUTH_TOKEN"
@adamrasheed
adamrasheed added this pull request to the merge queue Aug 11, 2026
Merged via the queue into staging with commit ef16228 Aug 11, 2026
11 checks passed
@adamrasheed
adamrasheed deleted the uxe-626-codeartifact-migration branch August 11, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants