Skip to content

Conversation

zahin-mohammad
Copy link
Contributor

@zahin-mohammad zahin-mohammad commented Sep 25, 2025

  • updates from lerna 5 to lerna 8
  • enables local nx cache

TICKET: WP-6096

@zahin-mohammad zahin-mohammad changed the title feat: upgrade to lerna 6 feat: upgrade lerna and enable local cache Sep 25, 2025
@zahin-mohammad zahin-mohammad force-pushed the WP-6096/nx-cache branch 2 times, most recently from 3f24a23 to 7c42600 Compare September 25, 2025 20:51
@zahin-mohammad zahin-mohammad marked this pull request as ready for review September 25, 2025 20:51
@zahin-mohammad zahin-mohammad requested review from a team as code owners September 25, 2025 20:51
@zahin-mohammad zahin-mohammad added SKIP_CACHE Do not use cache for installs and removed SKIP_CACHE Do not use cache for installs labels Sep 25, 2025
louib
louib previously approved these changes Sep 25, 2025
Copy link
Contributor

@mukeshsp mukeshsp left a comment

Choose a reason for hiding this comment

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

Please fix the conflicts

@pranavjain97
Copy link
Contributor

@claude

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR upgrades Lerna from version 5 to version 8 and enables local caching using Nx integration to improve development and CI performance.

  • Upgraded Lerna from v5.5.0 to v8.2.4 to take advantage of newer features and improvements
  • Enabled Nx integration in Lerna for task caching and dependency management
  • Added comprehensive caching configuration for builds and tests in both local development and CI environments

Reviewed Changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Updated Lerna version and added cache cleanup script
nx.json Added complete Nx configuration with caching rules for builds and tests
lerna.json Enabled Nx integration and removed deprecated useWorkspaces option
.github/workflows/ci.yml Added Nx cache restore steps and environment variables for CI optimization
CLAUDE.md Added comprehensive documentation for test caching and CI caching behavior
.prettierignore Excluded Nx workspace data from formatting
modules/express/test/unit/clientRoutes/externalSign.ts Added test cleanup to remove generated files
modules/express/encryptedPrivKeys.json Removed test artifact file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@zahin-mohammad zahin-mohammad marked this pull request as draft September 26, 2025 16:49
@zahin-mohammad zahin-mohammad force-pushed the WP-6096/nx-cache branch 3 times, most recently from da696b4 to 6d28f71 Compare September 27, 2025 17:35
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@zahin-mohammad zahin-mohammad force-pushed the WP-6096/nx-cache branch 3 times, most recently from 2932f13 to 97f57ba Compare September 27, 2025 18:04
pranavjain97
pranavjain97 previously approved these changes Sep 29, 2025
pranavjain97
pranavjain97 previously approved these changes Sep 30, 2025
@shenbenson shenbenson requested a review from Copilot September 30, 2025 17:36
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

ISSUE:
- GitHub Actions were failing due to NX cache configuration problems
- Copilot feedback identified redundant exclusions in nx.json production named input
- GitHub Actions cache keys had problematic negation pattern (!modules/*/package-lock.json)

SOLUTION:
- Fix NX cache configuration: remove redundant exclusions in nx.json production named input
- Fix GitHub Actions cache keys: remove problematic negation pattern from all cache keys
- Remove explicit NX dependency (Lerna 8 provides NX integration automatically)

TECHNICAL DETAILS:
- The production named input had redundant exclusions already covered by default input
- GitHub Actions hashFiles() function doesn't handle negation patterns reliably
- Lerna 8 includes NX integration, making explicit nx dependency unnecessary

VERIFICATION:
- NX cache functionality works correctly
- GitHub Actions cache keys function properly
- Cache restoration steps complete successfully in CI

TICKET: WP-6096
…endency conflicts

ISSUE:
- Babylonlabs package (@bitgo/babylonlabs-io-btc-staking-ts) was failing to build
- Root cause: Lerna 8 upgrade introduced newer minimatch versions (9.x-10.x) that
  conflicted with older @types/glob@7.2.0 interface expectations
- Error: Type 'IOptions' is not assignable to type 'IOptions' in dts-bundle-generator

SOLUTION:
- Add @types/glob@^8.1.0 locally to babylonlabs package (compatible with newer minimatch versions)
- Keep dts-bundle-generator at original version ^9.3.1 (no version bump needed)
- Use local dependency approach to keep fix targeted to affected package only

TECHNICAL DETAILS:
- Lerna 8 brings in minimatch@9.x-10.x via NX integration
- @types/glob@7.2.0 expected minimatch@7.x-8.x interface
- @types/glob@8.1.0 is compatible with minimatch@9.x-10.x
- Local dependency prevents affecting other packages in the monorepo

VERIFICATION:
- Babylonlabs package builds successfully from clean cache
- Other packages remain unaffected
- dts-bundle-generator works correctly with updated type definitions

TICKET: WP-6096
…variable

- Add NX_CACHE_FILES environment variable to reduce duplication
- Update all three cache key patterns to use env.NX_CACHE_FILES
- Improves maintainability and reduces copy-paste errors
- Addresses Copilot feedback on cache key pattern duplication

TICKET: WP-6096
@zahin-mohammad zahin-mohammad merged commit c66ec15 into master Sep 30, 2025
23 of 24 checks passed
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.

6 participants