Fixed Koenig demo build in CI - #29179
Conversation
WalkthroughThis change adds a new Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin-x-settings:test:acceptance |
✅ Succeeded | 9m 44s | View ↗ |
nx run @tryghost/koenig-lexical:test:acceptance |
✅ Succeeded | 2m 27s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
nx run @tryghost/activitypub:test:acceptance |
✅ Succeeded | 47s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 10s | View ↗ |
nx run ghost-admin:test |
✅ Succeeded | 3s | View ↗ |
nx run ghost:build:assets |
✅ Succeeded | 2s | View ↗ |
nx run ghost:build:tsc |
✅ Succeeded | 9s | View ↗ |
Additional runs (2) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-08 16:34:01 UTC
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@koenig/koenig-lexical/package.json`:
- Around line 149-157: The build:demo target is sharing the same output
directory as the regular build target, which can cause artifacts and cached
output to overwrite each other. Update the build:demo configuration in
package.json to use a separate outputs path, and make sure the build:demo
target’s output directory is distinct from the one used by the main build script
while keeping the existing dependsOn and cache settings intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3157b85d-cd63-43e7-905f-7ed3dfe2174f
📒 Files selected for processing (1)
koenig/koenig-lexical/package.json
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c93bb0525
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ref #29179 (comment) - the demo build inlines VITE_TENOR_API_KEY/VITE_KLIPY_API_KEY via import.meta.env, so a cached build would be reused even after the workflow's secret values change, silently deploying stale GIF provider config unless the env vars were added to the target's cache inputs - it also shared its declared `dist` output with the `build` target, letting the two cached targets clobber each other's restored artifacts - the demo build takes ~4s and only runs in the deploy workflow, so caching buys nothing; keeping just the `^build` dependency avoids both hazards
ref https://linear.app/ghost/issue/BER-3774/ - the Koenig Demo deploy workflow failed on main after the monorepo merge: `nx run @tryghost/koenig-lexical:build:demo` ran vite directly without compiling the workspace kg-* packages it imports, so `@tryghost/kg-default-nodes` (whose entry points are built output) could not be resolved - only the `build` target inherits `dependsOn: ["^build"]` from nx.json targetDefaults; the differently-named `build:demo` target inherited nothing, so its upstream packages were never built in the fresh CI checkout - the target is deliberately left uncached: the demo build inlines VITE_TENOR_API_KEY/VITE_KLIPY_API_KEY via import.meta.env and writes to the same dist dir as the `build` target, so caching could ship stale GIF provider config and lets the two targets clobber each other's restored outputs
973138c to
59707d0
Compare

ref https://linear.app/ghost/issue/BER-3774/
The Koenig Demo deploy workflow has been failing on main since the Koenig monorepo merge, so https://koenig.ghost.org is not receiving updates. The build step failed with Rolldown unable to resolve
@tryghost/kg-default-nodesbecause that package's entry points are compiled output (build/esm/) that never gets built in the workflow's fresh checkout.Only the
buildtarget inheritsdependsOn: ["^build"]from the nx.json target defaults — the differently-namedbuild:demotarget inherits nothing, sonx run @tryghost/koenig-lexical:build:demoran vite directly without first compiling the workspacekg-*packages it imports. This worked in the standalone Koenig repo's pages workflow but was missed in the merge.Fixed by giving
build:demoits own Nx target config with^build, matching the existingdev:integratedandtest:acceptancetargets. The target is deliberately left uncached: the demo build inlinesVITE_TENOR_API_KEY/VITE_KLIPY_API_KEYviaimport.meta.envand writes to the samedistdir as thebuildtarget, so caching could ship stale GIF provider config after the secrets change and lets the two cached targets clobber each other's restored outputs. It's a ~4s build that only runs in the deploy workflow, so caching buys nothing anyway.Verified against the exact CI steps (filtered frozen-lockfile install +
nx run @tryghost/koenig-lexical:build:demo) both with and without the Nx cache.