Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded NX to version 20 #22258

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cmraible
Copy link
Collaborator

@cmraible cmraible commented Feb 21, 2025

ref https://nx.dev/blog/announcing-nx-20

  • NX version 20 has a new database backed cache, which is supposedly a bit faster.
  • I'm also hopeful this might help with some flakiness with running NX in Docker, but it's a good idea to stay up to date regardless.

Copy link
Contributor

coderabbitai bot commented Feb 21, 2025

Walkthrough

The pull request updates the project's configuration and environment scripts across multiple files. The package.json file has been modified to update the version of the nx package in devDependencies from 19.8.14 to 20.4.6. In the .github/scripts/dev.js file, the line setting the environment variable NX_DISABLE_DB to "true" has been removed, which changes the script's behavior regarding database connections during execution. Additionally, the .github/workflows/ci.yml file has had the environment variable NX_REJECT_UNKNOWN_LOCAL_CACHE removed, which may affect local caching behavior in the CI workflow. The overall structure and logic of the scripts and workflows remain unchanged, with no new functionalities introduced.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4dc0e5 and 17bf6ac.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • .github/scripts/dev.js (0 hunks)
  • .github/workflows/ci.yml (0 hunks)
  • package.json (1 hunks)
💤 Files with no reviewable changes (2)
  • .github/scripts/dev.js
  • .github/workflows/ci.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (16)
  • GitHub Check: Unit tests (Node 22.13.1)
  • GitHub Check: Unit tests (Node 20.11.1)
  • GitHub Check: Regression tests (Node 20.11.1, sqlite3)
  • GitHub Check: Unit tests (Node 18.12.1)
  • GitHub Check: Signup-form tests
  • GitHub Check: Regression tests (Node 20.11.1, mysql8)
  • GitHub Check: Database tests (Node 20.11.1, sqlite3)
  • GitHub Check: Database tests (Node 22.13.1, mysql8)
  • GitHub Check: Lint
  • GitHub Check: Database tests (Node 20.11.1, mysql8)
  • GitHub Check: i18n
  • GitHub Check: Ghost-CLI tests
  • GitHub Check: Database tests (Node 18.12.1, mysql8)
  • GitHub Check: Admin tests - Chrome
  • GitHub Check: Comments-UI tests
  • GitHub Check: Admin-X Settings tests

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cmraible cmraible marked this pull request as draft February 21, 2025 00:49
@cmraible cmraible force-pushed the upgrade-nx-to-version-20 branch from fb0e045 to 94dd09d Compare February 21, 2025 01:50
@@ -316,7 +316,6 @@ async function handleStripe() {
debug('at least one command provided');

debug('resetting nx');
process.env.NX_DISABLE_DB = "true";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With this line, NX kept reverting to the "legacy" cache and logging a warning. I haven't seen any issue with removing this

@@ -17,7 +17,6 @@ env:
~/.cache/ms-playwright/
CACHED_BUILD_PATHS: |
${{ github.workspace }}/ghost/*/build
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
Copy link
Collaborator Author

@cmraible cmraible Feb 21, 2025

Choose a reason for hiding this comment

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

This option is no longer needed (or supported) with the database backed cache, see https://nx.dev/deprecated/legacy-cache

@cmraible cmraible marked this pull request as ready for review February 21, 2025 02:44
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
package.json (1)

121-123: Lint-Staged Configuration:
Reintroducing lint-staged for *.js files is a useful step to ensure code quality before commits. Consider later expanding this configuration to include additional file types (such as TypeScript) if your project grows in that direction.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb0e045 and 94dd09d.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • .github/scripts/dev.js (0 hunks)
  • .github/workflows/ci.yml (0 hunks)
  • package.json (1 hunks)
💤 Files with no reviewable changes (2)
  • .github/scripts/dev.js
  • .github/workflows/ci.yml
🔇 Additional comments (10)
package.json (10)

1-8: Metadata and Project Info:
The metadata section (lines 1–8) is clearly defined with proper project details. The use of "ghost-monorepo" and version "0.0.0-private" aligns with internal release conventions.


9-12: Workspaces Configuration:
The workspaces array is maintained accurately, ensuring that the project structure remains well defined for package management.


13-18: Monorepo Configuration:
The monorepo section is well structured with clear fields for public visibility, internal package settings, repository URL, and scope. This organization supports the overall monorepo setup effectively.


19-21: ESLint Ignore Settings:
The ESLint ignore configuration is concise and covers the necessary patterns (e.g., ignoring node_modules). This setup should help maintain consistent linting outcomes.


22-57: Scripts Section:
The scripts block has been comprehensively reorganized and continues to cover building, testing, and deployment workflows. Given the upgrade to NX v20, please verify that commands (such as nx run and nx run-many) work as expected under the new version. Running end-to-end tests in CI would help confirm compatibility with the enhanced cache features.


58-64: Resolutions Section:
The resolutions are clearly stated and remain consistent. No issues are apparent here, and the block effectively locks dependency versions as needed.


65-83: Renovate Configuration Enhancements:
The renovate section now includes a "rebaseWhen": "never" property and an expanded "ignoreDeps" list. These changes aim to refine automated dependency updates. It’s important to verify that these configuration updates align with your dependency management strategy and do not inadvertently skip critical updates.


84-87: Renovate Ignore Paths:
The newly added "ignorePaths" array excludes directories like "test" and the specific package.json in ghost/admin/lib/koenig-editor, which should reduce noise from unnecessary dependency scanning.


88-119: Renovate Package Rules:
The introduction of detailed package rules—for example, grouping Ember-related and CSS-related packages—improves dependency management granularity. Please confirm that the rule disabling updates for some CSS packages is intentional, ensuring that it won’t block essential security or functionality updates.


124-138: DevDependencies and NX Upgrade:
The critical upgrade here is the update of "nx" from version "19.8.14" to "20.4.6". Since NX v20 introduces a new database-backed cache and has improvements targeting Docker usage, please perform thorough validation to ensure that none of the existing workflows (both local and CI) are disrupted by this change.

@cmraible cmraible force-pushed the upgrade-nx-to-version-20 branch from e4dc0e5 to 17bf6ac Compare February 21, 2025 19:01
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