Skip to content

Cleaned up public app release scripts#29414

Open
acburdine wants to merge 1 commit into
mainfrom
feat/scripts-cleanup-pt2
Open

Cleaned up public app release scripts#29414
acburdine wants to merge 1 commit into
mainfrom
feat/scripts-cleanup-pt2

Conversation

@acburdine

Copy link
Copy Markdown
Member

ref https://linear.app/ghost/issue/PLA-235/consolidate-ci-scripts-into-monorepo-package

  • convert public app-related scripts to esm
  • simplify public-apps and infer cdn paths from defaults.json
  • dedupe code
  • remove unnecessary changelog generation for public app commits

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Public app automation now uses ESM entrypoints and shared metadata utilities. CDN purge matrices derive URLs from defaults.json, release commands update app and defaults versions before committing, and version-bump checks use shared app descriptors. CI invokes the new scripts with required dependencies, ship commands point to the new release runner, and Node test coverage plus script documentation were added.

Possibly related PRs

  • TryGhost/Ghost#29410: Modifies related CI and release-script wiring for the same public-app automation.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: cleanup of public app release scripts.
Description check ✅ Passed The description is directly related to the ESM conversion, CDN path simplification, deduplication, and changelog removal.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/scripts-cleanup-pt2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 17, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit b8db993

Command Status Duration Result
nx run @tryghost/admin:test:acceptance ❌ Failed 5m 17s View ↗
nx run-many -t test:unit -p @tryghost/adapter-b... ❌ Failed 2s View ↗
nx run ghost:test:integration ✅ Succeeded 2m 47s View ↗
nx run ghost:test:ci:integration ✅ Succeeded 4s View ↗
nx run ghost:test:e2e ✅ Succeeded 2m 30s View ↗
nx run @tryghost/koenig-lexical:test:acceptance ✅ Succeeded 2m 18s View ↗
nx run ghost:test:legacy ✅ Succeeded 1m 53s View ↗
nx run @tryghost/activitypub:test:acceptance ✅ Succeeded 43s View ↗
Additional runs (8) ✅ Succeeded ... View ↗

💡 Dealing with memory or CPU issues? See memory and CPU details with the resource usage add-on ↗.


☁️ Nx Cloud last updated this comment at 2026-07-17 02:31:29 UTC

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@scripts/check-app-version-bump.js`:
- Line 171: Replace the import.meta.main guard in the script entrypoint with a
Node.js-version-compatible check so the app-version consistency validation
always runs when executed directly, including on versions before 21.2.0. Keep
the existing check logic unchanged and avoid relying on import.meta.main.

In `@scripts/release-apps.js`:
- Around line 77-83: Update updatePackageJson to pass 4 as the JSON.stringify
indentation argument when writing package.json, preserving the repository’s
existing formatting and avoiding unrelated reformatting.
🪄 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: beaafa74-da4e-43aa-b038-739eb01f93d4

📥 Commits

Reviewing files that changed from the base of the PR and between 9fa9458 and 0b47d92.

📒 Files selected for processing (17)
  • .github/workflows/ci.yml
  • apps/admin-toolbar/package.json
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • scripts/README.md
  • scripts/build-public-apps-matrix.cjs
  • scripts/build-public-apps-matrix.js
  • scripts/check-app-version-bump.js
  • scripts/lib/public-apps.js
  • scripts/public-apps.json
  • scripts/release-apps.cjs
  • scripts/release-apps.js
  • scripts/test/build-public-apps-matrix.test.js
  • scripts/test/public-apps.test.js
💤 Files with no reviewable changes (2)
  • scripts/build-public-apps-matrix.cjs
  • scripts/release-apps.cjs

Comment thread scripts/check-app-version-bump.js
Comment thread scripts/release-apps.js
Comment on lines +77 to +83
async function updatePackageJson(newVersion) {
const newPackageJson = Object.assign({}, packageJson, {
version: newVersion
});

await writeFile(packageJsonPath, JSON.stringify(newPackageJson, null, 2) + '\n');
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Preserve the existing 4-space indentation in package.json.

The package.json files in this repository (e.g., apps/announcement-bar/package.json) use 4-space indentation. Hardcoding 2 spaces in JSON.stringify will reformat the entire file, creating unnecessary formatting churn and a noisy diff in the release commit. Update this to use 4 spaces to match the repository's convention.

♻️ Proposed fix
 async function updatePackageJson(newVersion) {
     const newPackageJson = Object.assign({}, packageJson, {
         version: newVersion
     });
 
-    await writeFile(packageJsonPath, JSON.stringify(newPackageJson, null, 2) + '\n');
+    await writeFile(packageJsonPath, JSON.stringify(newPackageJson, null, 4) + '\n');
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async function updatePackageJson(newVersion) {
const newPackageJson = Object.assign({}, packageJson, {
version: newVersion
});
await writeFile(packageJsonPath, JSON.stringify(newPackageJson, null, 2) + '\n');
}
async function updatePackageJson(newVersion) {
const newPackageJson = Object.assign({}, packageJson, {
version: newVersion
});
await writeFile(packageJsonPath, JSON.stringify(newPackageJson, null, 4) + '\n');
}
🤖 Prompt for 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.

In `@scripts/release-apps.js` around lines 77 - 83, Update updatePackageJson to
pass 4 as the JSON.stringify indentation argument when writing package.json,
preserving the repository’s existing formatting and avoiding unrelated
reformatting.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.17%. Comparing base (9fa9458) to head (b8db993).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #29414   +/-   ##
=======================================
  Coverage   74.17%   74.17%           
=======================================
  Files        1592     1592           
  Lines      139000   139000           
  Branches    16863    16861    -2     
=======================================
  Hits       103104   103104           
- Misses      34845    34877   +32     
+ Partials     1051     1019   -32     
Flag Coverage Δ
e2e-tests 76.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ref https://linear.app/ghost/issue/PLA-235/consolidate-ci-scripts-into-monorepo-package
- convert public app-related scripts to esm
- simplify public-apps and infer cdn paths from defaults.json
- dedupe code
- remove unnecessary changelog generation for public app commits
@acburdine
acburdine force-pushed the feat/scripts-cleanup-pt2 branch from 0b47d92 to b8db993 Compare July 17, 2026 02:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
scripts/check-app-version-bump.js (1)

154-161: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Avoid redundant file reads by extracting variables.

Currently, getPrVersion and getPrDefaultsVersion are called twice per app (once for the consistency check and once for the console log). Each call synchronously reads and parses package.json or defaults.json. Storing the results in local variables improves readability and avoids redundant I/O operations.

♻️ Proposed refactor
-        const error = checkAppConsistency(app, getPrVersion(app), getPrDefaultsVersion(app));
+        const prVersion = getPrVersion(app);
+        const prDefaultsVersion = getPrDefaultsVersion(app);
+        const error = checkAppConsistency(app, prVersion, prDefaultsVersion);

         if (error) {
             failedApps.push(error);
             continue;
         }

-        console.log(`${app.configKey} version consistency check passed (package.json ${majorMinor(getPrVersion(app))} = defaults.json ${getPrDefaultsVersion(app)})`);
+        console.log(`${app.configKey} version consistency check passed (package.json ${majorMinor(prVersion)} = defaults.json ${prDefaultsVersion})`);
🤖 Prompt for 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.

In `@scripts/check-app-version-bump.js` around lines 154 - 161, In the app
consistency-check loop, update the flow around checkAppConsistency to store
getPrVersion(app) and getPrDefaultsVersion(app) results in local variables, then
reuse those variables for both the consistency check and success log. Preserve
the existing error handling and log output.
🤖 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.

Nitpick comments:
In `@scripts/check-app-version-bump.js`:
- Around line 154-161: In the app consistency-check loop, update the flow around
checkAppConsistency to store getPrVersion(app) and getPrDefaultsVersion(app)
results in local variables, then reuse those variables for both the consistency
check and success log. Preserve the existing error handling and log output.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 61a8373f-ca53-4d78-8e5b-60a346aef5c2

📥 Commits

Reviewing files that changed from the base of the PR and between 0b47d92 and b8db993.

📒 Files selected for processing (20)
  • .github/workflows/ci.yml
  • apps/admin-toolbar/package.json
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • scripts/README.md
  • scripts/build-public-apps-matrix.cjs
  • scripts/build-public-apps-matrix.js
  • scripts/check-app-version-bump.js
  • scripts/lib/public-apps.js
  • scripts/lib/release-notes.js
  • scripts/lib/resolve-base-tag.js
  • scripts/lib/utils.js
  • scripts/public-apps.json
  • scripts/release-apps.cjs
  • scripts/release-apps.js
  • scripts/test/build-public-apps-matrix.test.js
  • scripts/test/public-apps.test.js
💤 Files with no reviewable changes (2)
  • scripts/build-public-apps-matrix.cjs
  • scripts/release-apps.cjs
🚧 Files skipped from review as they are similar to previous changes (10)
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • scripts/build-public-apps-matrix.js
  • scripts/test/public-apps.test.js
  • apps/announcement-bar/package.json
  • apps/admin-toolbar/package.json
  • scripts/release-apps.js
  • scripts/test/build-public-apps-matrix.test.js

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.

1 participant