build: improve release DAG artifact freshness - #418
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: e09054d The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
This PR refactors the release/CI orchestration so Moon owns the visible release DAG and all release-related consumers share a single canonical “public packages” manifest. It also lets the fresh-app journey reuse already-built release tarballs to avoid rebuilding artifacts twice in CI.
Changes:
- Centralize the public release package list in
scripts/release-manifest.mjsand reuse it across release packing, changeset validation, and tarball verification. - Move release prerequisite build steps into Moon task deps (release prep/build tasks) and simplify
scripts/release.mjsby removing nestedmoon runcalls. - Add journey support for
--tarballs-dir/JOURNEY_TARBALLS_DIRso CI can reuse snapshot tarballs.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/release/moon.yml | Adds release DAG tasks for cleaning/building public packages and wires release deps into pack/snapshot/publish. |
| scripts/release.mjs | Removes embedded UI and public package build side-effects; relies on Moon deps for release readiness. |
| scripts/release-manifest.mjs | New canonical manifest for public release packages/dirs/build targets. |
| scripts/release-clean.mjs | New cleaner for public package dist/ artifacts used by the release build DAG. |
| scripts/release-artifacts.mjs | Switches to manifest-driven package lists and adds a pre-pack check for required dist/ output. |
| scripts/check.mjs | Runs the release snapshot phase via moon run release:snapshot (with forwarded args). |
| scripts/check-changesets-status.mjs | Derives the Changesets fixed-group validation package list from the release manifest. |
| packages/sdk-vue/moon.yml | Adds build-release task with release-graph deps. |
| packages/sdk-svelte/moon.yml | Adds build-release task with release-graph deps. |
| packages/sdk-solid/moon.yml | Adds build-release task with release-graph deps. |
| packages/sdk-react/moon.yml | Adds build-release task with release-graph deps. |
| packages/sdk-qwik/moon.yml | Adds build-release task with release-graph deps. |
| packages/sdk-nuxt/moon.yml | Adds build-release task with release-graph deps. |
| packages/sdk-next/moon.yml | Adds build-release task with release-graph deps. |
| packages/sdk-core/moon.yml | Adds build-release task with release-graph deps. |
| packages/sdk-angular/moon.yml | Adds build-release task with release-graph deps. |
| packages/components/moon.yml | Adds build-release task and ensures required build deps (tokens/styles) are built. |
| packages/api/moon.yml | Adds build-release task and wires it to codegen. |
| apps/login-ui/moon.yml | Adds build-release task and wires it to release component deps. |
| apps/cli/tsdown.config.ts | Updates docs to reference cli:build-release as the production telemetry-stamp build path. |
| apps/cli/tests/unit/scripts/verify-tarballs.test.ts | Uses the manifest package dirs instead of duplicating the list in-test. |
| apps/cli/tests/unit/scripts/release-manifest.test.ts | New test suite validating manifest ↔ Changesets fixed group ↔ Moon task existence. |
| apps/cli/tests/unit/scripts/release-artifacts.test.ts | Adds coverage for “packing requires dist output” guard. |
| apps/cli/tests/unit/scripts/local-registry.test.ts | Adds coverage for using prebuilt tarballs without triggering release rebuild. |
| apps/cli/tests/unit/scripts/check-changesets-status.test.ts | Derives expected fixed-group list from the manifest to prevent drift. |
| apps/cli/moon.yml | Adds cli:build-release task stamping production telemetry channel for release builds. |
| apps/cli/AGENTS.md | Updates agent guidance to reflect new release build path for production telemetry stamping. |
| apps/cli-journey-e2e/scripts/verify-tarballs.mjs | Uses the manifest package dirs instead of maintaining a duplicated list. |
| apps/cli-journey-e2e/scripts/run-options.test.mjs | Extends arg parsing tests for --tarballs-dir. |
| apps/cli-journey-e2e/scripts/run-options.mjs | Adds --tarballs-dir option parsing. |
| apps/cli-journey-e2e/scripts/run-local.mjs | Plumbs tarballs-dir option/env into registry prep as prebuiltTarballsDir. |
| apps/cli-journey-e2e/scripts/local-registry.mjs | Skips rebuild when prebuiltTarballsDir is set; copies/verifies/publishes provided tarballs. |
| apps/cli-journey-e2e/README.md | Documents --tarballs-dir and JOURNEY_TARBALLS_DIR. |
| apps/cli-journey-e2e/AGENTS.md | Documents CI reuse of prebuilt tarballs and updates required package list text. |
| .github/workflows/ci.yml | Runs journey using snapshot tarballs via --tarballs-dir dist/release/${version}/npm. |
| .changeset/release-dag-artifact-freshness.md | Adds an empty changeset describing release/CI wiring-only changes. |
…-dag-ci-artifacts # Conflicts: # scripts/release.mjs # tools/release/moon.yml
## Summary - Add a direct Moon dependency from `cli:build-release` to `cli:test` so the production-stamped CLI build cannot clean and rewrite `apps/cli/dist` while Vitest is exercising oclif command discovery from that same directory. - Keep the CLI Vitest global setup self-contained by asserting that the tsdown-built command files exist and `oclif commands --json` discovers `status` before any test files run. - Remove the runtime 127 retry from the in-process CLI test helper so the test harness fails fast instead of masking a graph/order problem. ## Validation - `moon run cli:build-release` (runs `cli:test` before the production CLI build; captured log shows `cli:test` 101 files / 672 tests passed and `cli:build-release` completed) - `moon run cli:typecheck` - `moon run cli:lint` - `node scripts/check-changesets-status.mjs --base origin/main --summary` - `corepack pnpm exec changeset status --since origin/main` - `git diff --check origin/main...HEAD` ## Release notes / changeset Empty changeset added: `.changeset/cli-build-release-dag.md`. This changes package-local Moon build wiring under `@zitadel/cli`, but no shipped CLI behavior changes and no package bump is planned. ## Notes - The broader problem is the Moon graph/shared-output ordering, not the PATH-sensitive server lifecycle prober. - Blame points to the interaction between the original CLI Vitest global setup from `0547b8c3` / #319 and the release build DAG from `b0ba758a` / #418, which introduced `cli:build-release` as a CI-visible production build that cleans the same `apps/cli/dist` directory. - Live open-PR check: PR #463 reproduced the `status` exit-127 class with `cli:build`, `cli:test`, and `cli:build-release` all building CLI dist in the same full-pr graph. PR #462 and the older filtered failed logs did not show this oclif/status signature.
Summary
scripts/release-manifest.mjsso release packing, changeset validation, tarball verification, and journey registry setup consume one package list.moon runcalls fromscripts/release.mjs.--tarballs-dirinstead of rebuilding release tarballs a second time.Validation
moon task release:pack --jsonmoon task release:snapshot --jsonmoon task release:publish --jsonmoon task release:build-public-packages --jsonmoon run cli:testmoon run release:packmoon run workspace:check -- --only releasemoon run workspace:journey -- --framework nextcorepack pnpm exec changeset status --since origin/maingit diff --cached --checkRelease notes / changeset
.changeset/release-dag-artifact-freshness.mdNotes