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

refactor: circle ci scripts #1510

Merged
merged 46 commits into from
Dec 10, 2024
Merged

refactor: circle ci scripts #1510

merged 46 commits into from
Dec 10, 2024

Conversation

rodrigopavezi
Copy link
Member

@rodrigopavezi rodrigopavezi commented Dec 5, 2024

Problem

The next release is not working on Circle Ci due to out-of-memory issues. Furthermore, it does not use lerna for running build and tests.

Changes

  • Use lerna to run tests - eliminate the need to update CircleCI when adding new tests
  • Simplify test structure
  • Use --since master to run tests for only changed code.
  • Make consistent the local publish scripts

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new lint:check target for improved linting processes.
    • Added a new lint:ci script for comprehensive linting checks.
  • Improvements

    • Streamlined testing process by simplifying test scripts across multiple packages.
    • Consolidated multiple test jobs into a single test job in the CI configuration.
    • Enhanced testing setup for the lit-protocol-cipher package with new dependencies.
    • Updated NODE_OPTIONS for better memory management in CI configuration.
    • Modified lint:check script to exclude the specs directory during checks.
    • Updated the test script for the lit-protocol-cipher package for a more straightforward execution.

It will have releases as such

Subject: SDK next release fix
Question: @tech-team would you agree to start releasing version like the following?

 Changes:
  - @requestnetwork/advanced-logic: 0.47.0 => 0.48.0-next.0
  - @requestnetwork/currency: 0.21.0 => 0.22.0-next.0
  - @requestnetwork/data-access: 0.38.0 => 0.39.0-next.0
  - @requestnetwork/data-format: 0.19.3 => 0.19.4-next.0
  - @requestnetwork/epk-cipher: 0.3.0 => 0.4.0-next.0
  - @requestnetwork/epk-decryption: 0.7.3 => 0.7.4-next.0
  - @requestnetwork/epk-signature: 0.9.3 => 0.9.4-next.0
  - @requestnetwork/ethereum-storage: 0.38.0 => 0.39.0-next.0
  - @requestnetwork/integration-test: 0.38.3 => 0.38.4-next.0 (private)
  - @requestnetwork/lit-protocol-cipher: 0.3.0 => 0.4.0-next.0
  - @requestnetwork/multi-format: 0.21.0 => 0.22.0-next.0
  - @requestnetwork/payment-detection: 0.47.0 => 0.48.0-next.0
  - @requestnetwork/payment-processor: 0.50.0 => 0.51.0-next.0
  - @requestnetwork/request-client.js: 0.52.0 => 0.53.0-next.0
  - @requestnetwork/request-logic: 0.37.0 => 0.38.0-next.0
  - @requestnetwork/request-node: 0.38.0 => 0.39.0-next.0
  - @requestnetwork/smart-contracts: 0.41.0 => 0.42.0-next.0
  - @requestnetwork/thegraph-data-access: 0.44.0 => 0.45.0-next.0
  - @requestnetwork/toolbox: 0.15.3 => 0.15.4-next.0 (private)
  - @requestnetwork/transaction-manager: 0.38.0 => 0.39.0-next.0
  - @requestnetwork/types: 0.47.0 => 0.48.0-next.0
  - @requestnetwork/usage-examples: 0.32.3 => 0.32.4-next.0 (private)
  - @requestnetwork/utils: 0.47.0 => 0.48.0-next.0
  - @requestnetwork/web3-signature: 0.8.3 => 0.8.4-next.0

Copy link
Contributor

coderabbitai bot commented Dec 5, 2024

Walkthrough

The changes in this pull request primarily involve modifications to the CircleCI configuration, task dependencies in nx.json, and updates to the package.json files across several packages. The CircleCI configuration introduces a new environment variable, renames jobs, consolidates test jobs into a single job, and updates the workflow. The nx.json file adds a new linting target and reorganizes task dependencies. The package.json files adjust linting scripts and dependencies, enhancing the testing setup and streamlining processes.

Changes

File Path Change Summary
.circleci/config.yml - Added environment variable NODE_OPTIONS: '--max-old-space-size=4096'
- Renamed job build to install
- Consolidated multiple test jobs into one test job
- Updated next-release job's branch filter to 'fix/next-release'
nx.json - Added new target lint:check
- Updated build target dependencies to include lint:check
- Simplified test target dependencies to only depend on build
- Updated cacheable operations to include lint:check
package.json - Updated lint script to use Lerna
- Added new script lint:ci
- Updated lint:check script to use Lerna
- Modified test script to remove concurrency option
packages/lit-protocol-cipher/package.json - Updated test script to a simplified jest command
- Added @types/jest, jest, and ts-jest to devDependencies
packages/request-logic/package.json - Modified lint:check script to exclude specs directory during linting

Possibly related PRs

  • fix: next release #1517: This PR adds the environment variable NODE_OPTIONS: '--max-old-space-size=4096' to the .circleci/config.yml, which is directly related to the changes made in the main PR that also introduced this environment variable in the same configuration file.

Suggested reviewers

  • alexandre-abrioux
  • kevindavee
  • sstefdev
  • aimensahnoun

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6ac59b7 and e8c8179.

📒 Files selected for processing (1)
  • package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

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. (Experiment)
  • @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.

@rodrigopavezi rodrigopavezi changed the title Fix/next release fix: next release Dec 5, 2024
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7686ed9 and d122efa.

📒 Files selected for processing (1)
  • .circleci/config.yml (2 hunks)
🔇 Additional comments (1)
.circleci/config.yml (1)

9-10: Memory allocation increase looks good!

The addition of NODE_OPTIONS with 4GB memory allocation is a reasonable solution to address the out-of-memory issues in CircleCI.

Let's verify the memory settings are sufficient by checking the CircleCI job logs for any memory-related warnings or errors:

✅ Verification successful

Memory allocation increase is appropriate and well-placed

The 4GB memory allocation is justified based on the codebase analysis:

  • The project is a monorepo with multiple packages that need to be built
  • There's an extensive build chain with numerous workspace packages being compiled
  • All test and build jobs inherit from the node_image configuration, ensuring consistent memory settings across the pipeline
  • The memory setting is particularly important for operations like:
    • Concurrent builds of multiple TypeScript packages
    • Smart contract compilation and type generation
    • Integration tests that run multiple packages together
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for memory-related issues in recent CircleCI builds

# Use GitHub API to fetch recent CircleCI build logs
gh api graphql -f query='
{
  repository(owner: "RequestNetwork", name: "requestNetwork") {
    pullRequest(number: 1510) {
      commits(last: 1) {
        nodes {
          commit {
            statusCheckRollup {
              contexts(last: 100) {
                nodes {
                  ... on CheckRun {
                    name
                    text
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}' | jq -r '..|.text? | select(.)' | grep -iE "heap|memory|javascript heap out of memory"

Length of output: 561


Script:

#!/bin/bash
# Let's verify the CircleCI configuration for memory settings and their usage across jobs

# First, let's see all jobs that might be affected by this NODE_OPTIONS setting
rg "<<: \*node_image" .circleci/config.yml -A 5

# Also check for any existing memory-related settings
rg -i "memory|heap|node_options" .circleci/config.yml

# Let's also check the size of build artifacts to understand memory requirements
rg "build|dist|compile" .circleci/config.yml -A 2

Length of output: 5712

.circleci/config.yml Outdated Show resolved Hide resolved
@MantisClone
Copy link
Member

What does canary do?

@rodrigopavezi
Copy link
Member Author

What does canary do?
@MantisClone
https://github.com/lerna/lerna/tree/main/libs/commands/publish#--canary

It will conflict with --conventional-prerelease and produce the currently broken versioning

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

🧹 Outside diff range and nitpick comments (1)
.circleci/config.yml (1)

119-180: LGTM: Test job consolidation improves pipeline efficiency

The consolidation of multiple test jobs into a single job with proper service dependencies and test result storage is a good improvement. However, consider the following enhancement:

Consider using CircleCI's test splitting feature to parallelize the tests while maintaining the consolidated structure:

 test:
    docker:
      - *node_image
      - *ipfs_image
      - *ganache_image
      - *postgres_image
      - *graph_image
    resource_class: large
+   parallelism: 4
    working_directory: *working_directory
    steps:
      - attach_workspace:
          at: *working_directory
      - run:
          name: 'Deploy test contract from smart-contracts'
          command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
      - run: *step_graph_deploy
      - run:
          name: 'Start request-node'
          command: 'yarn start:request-node'
          background: true
      - run: *step_wait_for_node
      - run:
          name: 'Test all'
-         command: 'yarn test'
+         command: |
+           TESTFILES=$(circleci tests glob "packages/*/test/**/*.test.ts" | circleci tests split --split-by=timings)
+           yarn test $TESTFILES
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b3fcbde and 8c5a243.

📒 Files selected for processing (1)
  • .circleci/config.yml (5 hunks)
🔇 Additional comments (2)
.circleci/config.yml (2)

Line range hint 244-280: LGTM: Workflow configuration properly maintains all necessary jobs and dependencies

The workflow configuration correctly:

  • Maintains proper job dependencies
  • Preserves the next-release job configuration
  • Keeps the nightly workflow intact

9-10: LGTM: Memory allocation increase addresses OOM issues

The addition of NODE_OPTIONS: '--max-old-space-size=4096' aligns with the PR objective to resolve out-of-memory issues during the build process.

Let's verify if 4GB is sufficient for the build process:

✅ Verification successful

Based on the analysis of the package.json scripts and build configurations, I can now provide a final response:

Memory allocation of 4GB is appropriate for the build process

The codebase shows characteristics that justify the 4GB memory allocation:

  • Monorepo structure with multiple packages using Lerna
  • Concurrent TypeScript compilation across packages
  • Complex test suites including blockchain interactions
  • Multiple UMD and CommonJS builds
  • Resource-intensive operations like GraphQL codegen

The 4GB limit is a standard and sufficient allocation for these types of operations, especially considering:

  • Tests are run with --concurrency=1 in the root package.json
  • Some test suites use --maxWorkers=1 to limit resource usage
  • Build processes are properly segregated into distinct steps
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for memory-related build failures in recent CircleCI runs

# Search for memory-related errors in build logs
gh api -X GET /repos/RequestNetwork/requestNetwork/actions/runs \
  --jq '.workflow_runs[] | select(.conclusion == "failure") | .id' | \
  while read -r run_id; do
    gh api -X GET "/repos/RequestNetwork/requestNetwork/actions/runs/$run_id/jobs" \
      --jq '.jobs[] | select(.conclusion == "failure") | .steps[] | select(.conclusion == "failure") | .name + ": " + .conclusion'
done

Length of output: 147


Script:

#!/bin/bash
# Let's try a different approach to check for memory-related issues
# 1. Look for any memory-related configurations in the codebase
# 2. Check for memory-related comments or discussions in the config

# Search for memory-related configurations
echo "=== Memory configurations across the codebase ==="
rg -i "max.*space.*size|memory.*limit|heap.*size" -g "!package-lock.json"

# Search for memory-related comments in CircleCI config
echo -e "\n=== Memory-related comments in CircleCI config ==="
rg -i "# .*memory|// .*memory" .circleci/config.yml

# Check if there are other similar memory configurations
echo -e "\n=== Other NODE_OPTIONS configurations ==="
rg "NODE_OPTIONS" -g "!package-lock.json"

Length of output: 496


Script:

#!/bin/bash
# Let's check the build and test job configurations to understand the memory requirements

# Look at the test commands and build steps
echo "=== Build and test configurations ==="
rg "npm (run |test|build)" .circleci/config.yml -A 2

# Check package.json scripts to understand the complexity of build/test operations
echo -e "\n=== Package.json scripts ==="
fd package.json --exec cat {} | jq -r '.scripts // empty'

# Look for any previous memory configurations that might have been removed
echo -e "\n=== Git history for memory configurations ==="
git log -p .circleci/config.yml | rg -i "memory|node_options" -C 2

Length of output: 9741

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: 2

🧹 Outside diff range and nitpick comments (2)
nx.json (1)

11-13: Review dependency chain implications

The new dependency chain (test → build → lint → ^lint) establishes stricter quality gates but might increase CI time. Consider:

  1. Running lint in parallel with build where possible
  2. Ensuring fast feedback by failing early on lint errors

Also applies to: 15-15, 18-18

.circleci/config.yml (1)

102-163: Test job consolidation looks comprehensive but consider monitoring execution time.

The consolidation of test jobs simplifies the workflow, but it might impact the ability to parallelize tests and could make debugging failures more challenging.

Consider:

  1. Monitoring total execution time compared to previous parallel execution
  2. Adding test timing metrics to identify bottlenecks
  3. Implementing test result aggregation for better visibility
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1fde94a and 7a1a993.

📒 Files selected for processing (4)
  • .circleci/config.yml (6 hunks)
  • nx.json (1 hunks)
  • package.json (1 hunks)
  • packages/request-logic/package.json (1 hunks)
🔇 Additional comments (5)
nx.json (1)

6-6: Verify impact of removing "clean" from cacheableOperations

While adding "lint" to cacheableOperations is beneficial for CI performance, removing "clean" might lead to stale artifacts affecting builds.

package.json (2)

21-24: LGTM: Improved lint management structure

The new linting structure using Lerna provides better organization and consistency across packages.


Line range hint 1-85: Missing NODE_OPTIONS configuration mentioned in PR objectives

The PR objectives mention adding NODE_OPTIONS='--max-old-space-size=4096' to address memory issues, but this configuration is not present in the package.json.

Consider adding a cross-platform solution by:

  1. Adding an .env file with the memory configuration
  2. Setting it in the npm/yarn configuration
  3. Documenting the memory requirements in the README
.circleci/config.yml (2)

Line range hint 220-255: Workflow structure is well-organized with proper dependencies.

The consolidated test job is correctly positioned as a dependency for other jobs, maintaining the logical flow of the CI pipeline.

Let's verify the workflow execution order:

✅ Verification successful

Workflow dependencies are correctly configured and maintain proper execution order

The verification confirms that:

  • The consolidated test job is correctly positioned as a prerequisite for lint, test-usage-examples, and test-toolbox jobs
  • The next-release job properly depends on the test job and maintains its branch filtering for master
  • The nightly workflow is independent and properly configured with its cron schedule
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check recent workflow execution patterns

# Check workflow execution times and success rates
gh api repos/RequestNetwork/requestNetwork/actions/workflows \
  --jq '.workflows[] | select(.name == "build-and-test") | .id' \
  | while read -r workflow_id; do
    gh api repos/RequestNetwork/requestNetwork/actions/workflows/$workflow_id/runs \
      --jq '.workflow_runs[] | select(.conclusion != null) | {status: .conclusion, duration: (.updated_at | fromdate - (.created_at | fromdate))}'
done

Length of output: 146


Script:

#!/bin/bash
# Let's verify the workflow structure and dependencies directly from the config file

# Check the workflow structure and job dependencies
cat .circleci/config.yml | grep -A 30 "build-and-test:"

# Also check for any other workflow definitions that might interact
cat .circleci/config.yml | grep -A 10 "workflows:"

Length of output: 986


9-10: Memory and resource configuration looks appropriate.

The addition of NODE_OPTIONS with 4GB memory limit and large resource class should help address the out-of-memory issues.

Let's verify the memory requirements:

Also applies to: 65-65

✅ Verification successful

Memory configuration is appropriate for the project's build requirements

The verification shows that:

  1. The CircleCI config sets NODE_OPTIONS='--max-old-space-size=4096' (4GB)
  2. The project uses multiple TypeScript builds across packages (lerna-based monorepo)
  3. Complex build processes including:
    • Concurrent package builds
    • Multiple test suites
    • UMD and CommonJS builds
    • Smart contract compilation
    • GraphQL codegen

The 4GB heap size is a reasonable default for this type of monorepo with multiple TypeScript packages and complex build processes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check build memory usage patterns in recent builds

# Check for memory-related errors in recent builds
gh api repos/RequestNetwork/requestNetwork/actions/runs \
  --jq '.workflow_runs[] | select(.conclusion == "failure") | .id' \
  | while read -r run_id; do
    gh api repos/RequestNetwork/requestNetwork/actions/runs/$run_id/jobs \
      --jq '.jobs[] | select(.conclusion == "failure") | .steps[].name + ": " + .steps[].conclusion'
done

Length of output: 139


Script:

#!/bin/bash
# Let's try a different approach to verify memory-related configurations and issues

# Check for any memory-related configurations in the CircleCI config
echo "Checking CircleCI memory configurations:"
rg -A 2 -B 2 "memory|heap|NODE_OPTIONS" .circleci/config.yml

# Look for build-related scripts that might indicate memory requirements
echo -e "\nChecking package.json scripts:"
fd package.json --exec cat {} | jq '.scripts'

# Check for other memory-related configurations in the project
echo -e "\nChecking for other memory configurations:"
rg -l "max-old-space-size" --type yaml --type json

Length of output: 10093

packages/request-logic/package.json Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
Copy link
Member

@MantisClone MantisClone left a comment

Choose a reason for hiding this comment

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

Approved 👍
Okay to use resource: large 🙆

I'm not sure why it's failing with error:

ERR! lerna Unknown argument: reporters

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: 1

🧹 Outside diff range and nitpick comments (1)
.circleci/config.yml (1)

272-272: Incorrect workflow comment

The comment "Lerna will run lint, build and test" is misleading as these steps are executed separately in the workflow, not automatically by Lerna.

Consider updating the comment to:

-  ## Lerna will run lint, build and test
+  ## Build, lint and test workflow
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 683efd7 and f8f850f.

📒 Files selected for processing (1)
  • .circleci/config.yml (7 hunks)
🧰 Additional context used
📓 Learnings (1)
.circleci/config.yml (2)
Learnt from: MantisClone
PR: RequestNetwork/requestNetwork#1510
File: .circleci/config.yml:80-81
Timestamp: 2024-12-09T23:23:12.207Z
Learning: There are no circular dependencies among the packages via TypeScript project references.
Learnt from: rodrigopavezi
PR: RequestNetwork/requestNetwork#1510
File: .circleci/config.yml:0-0
Timestamp: 2024-12-06T10:32:50.647Z
Learning: It's acceptable to exclude the following packages from unit tests in CI: `@requestnetwork/smart-contracts`, `@requestnetwork/payment-detection`, `@requestnetwork/payment-processor`, and `@requestnetwork/integration-test`.
🔇 Additional comments (2)
.circleci/config.yml (2)

Line range hint 8-9: LGTM: Memory limit increase addresses OOM issues

The addition of NODE_OPTIONS: '--max-old-space-size=4096' aligns with the PR objective of resolving out-of-memory problems during the build process.


108-115: Well-organized test segregation

The test exclusions are well-structured, separating unit tests from integration tests that require additional services. This organization aligns with the accepted practice of excluding certain packages from unit tests.

.circleci/config.yml Outdated Show resolved Hide resolved
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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f8f850f and 4b5338f.

📒 Files selected for processing (1)
  • .circleci/config.yml (7 hunks)
🧰 Additional context used
📓 Learnings (1)
.circleci/config.yml (2)
Learnt from: MantisClone
PR: RequestNetwork/requestNetwork#1510
File: .circleci/config.yml:80-81
Timestamp: 2024-12-09T23:23:12.207Z
Learning: There are no circular dependencies among the packages via TypeScript project references.
Learnt from: rodrigopavezi
PR: RequestNetwork/requestNetwork#1510
File: .circleci/config.yml:0-0
Timestamp: 2024-12-06T10:32:50.647Z
Learning: It's acceptable to exclude the following packages from unit tests in CI: `@requestnetwork/smart-contracts`, `@requestnetwork/payment-detection`, `@requestnetwork/payment-processor`, and `@requestnetwork/integration-test`.
🔇 Additional comments (5)
.circleci/config.yml (5)

Line range hint 8-9: LGTM: Memory limit configuration addresses OOM issues

The addition of NODE_OPTIONS: '--max-old-space-size=4096' directly addresses the out-of-memory problems mentioned in the PR objectives.


63-63: LGTM: Build optimizations look good

The changes improve build performance:

  • Using large resource class provides more resources for memory-intensive operations
  • Using --since master optimizes build time by only building changed packages, which is safe given the absence of circular dependencies

Also applies to: 80-81


108-116: LGTM: Test consolidation with appropriate exclusions

The test consolidation with package exclusions aligns with the documented acceptable exclusions for unit tests.


129-129: LGTM: Integration test improvements

Good improvements to integration test reliability:

  • Using large resource class ensures sufficient resources
  • Running request-node in background with wait step ensures service readiness

Also applies to: 170-172


Line range hint 275-307: LGTM: Workflow changes maintain proper job sequencing

The workflow changes:

  • Maintain proper job dependencies
  • Ensure all tests pass before next-release
  • Preserve nightly test workflow

.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4b5338f and 5db9b2a.

📒 Files selected for processing (1)
  • .circleci/config.yml (7 hunks)
🧰 Additional context used
📓 Learnings (1)
.circleci/config.yml (2)
Learnt from: MantisClone
PR: RequestNetwork/requestNetwork#1510
File: .circleci/config.yml:80-81
Timestamp: 2024-12-09T23:23:12.207Z
Learning: There are no circular dependencies among the packages via TypeScript project references.
Learnt from: rodrigopavezi
PR: RequestNetwork/requestNetwork#1510
File: .circleci/config.yml:0-0
Timestamp: 2024-12-06T10:32:50.647Z
Learning: It's acceptable to exclude the following packages from unit tests in CI: `@requestnetwork/smart-contracts`, `@requestnetwork/payment-detection`, `@requestnetwork/payment-processor`, and `@requestnetwork/integration-test`.
🔇 Additional comments (5)
.circleci/config.yml (5)

Line range hint 8-8: LGTM: Memory limit increase addresses OOM issues

The addition of NODE_OPTIONS: '--max-old-space-size=4096' aligns with the PR objective of fixing out-of-memory problems during the build process.


63-63: LGTM: Build optimization with selective package building

The changes optimize the build process by:

  • Using large resource class for better performance
  • Using --since master flag to build only changed packages and their dependencies

Also applies to: 80-81


108-116: LGTM: Test job consolidation with appropriate exclusions

The test job consolidation with package exclusions is well-structured and aligns with the documented requirements. The excluded packages are: request-client.js, smart-contracts, payment-detection, payment-processor, and integration-test.


Line range hint 198-226: LGTM: Comprehensive nightly test configuration

The nightly test configuration is well-structured with:

  • Complete environment setup (node, ipfs, ganache, postgres, graph)
  • Specific integration tests for erc20 and btc
  • Appropriate scheduling (daily at 22:00)

260-260: LGTM: Well-structured release workflow

The release workflow is properly configured with:

  • Correct dependency ordering (lint, build, all tests)
  • Release triggered only on master branch
  • Required context for protocol release

Also applies to: 279-292

.circleci/config.yml Outdated Show resolved Hide resolved
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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 5db9b2a and 7c3836e.

📒 Files selected for processing (1)
  • .circleci/config.yml (7 hunks)
🧰 Additional context used
📓 Learnings (1)
.circleci/config.yml (2)
Learnt from: MantisClone
PR: RequestNetwork/requestNetwork#1510
File: .circleci/config.yml:80-81
Timestamp: 2024-12-09T23:23:12.207Z
Learning: There are no circular dependencies among the packages via TypeScript project references.
Learnt from: rodrigopavezi
PR: RequestNetwork/requestNetwork#1510
File: .circleci/config.yml:0-0
Timestamp: 2024-12-06T10:32:50.647Z
Learning: It's acceptable to exclude the following packages from unit tests in CI: `@requestnetwork/smart-contracts`, `@requestnetwork/payment-detection`, `@requestnetwork/payment-processor`, and `@requestnetwork/integration-test`.
🔇 Additional comments (4)
.circleci/config.yml (4)

Line range hint 8-8: LGTM: Memory limit increase addresses OOM issues

Setting NODE_OPTIONS='--max-old-space-size=4096' is appropriate for resolving the out-of-memory problems mentioned in the PR objectives.


80-81: LGTM: Selective build strategy approved

Using --since master for builds has been previously discussed and approved, as there are no circular dependencies among packages.


108-116: LGTM: Test organization and package exclusions

The test organization and package exclusions align with the established guidelines.


Line range hint 260-292: LGTM: Workflow dependencies are properly configured

The workflow configuration:

  • Maintains proper job dependencies
  • Ensures all tests pass before next-release
  • Preserves nightly testing

.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 629d90e and 6ac59b7.

📒 Files selected for processing (1)
  • package.json (1 hunks)
🔇 Additional comments (3)
package.json (3)

21-23: LGTM: Changes align with previous review suggestions.

The updated linting scripts properly delegate to package-level scripts via Lerna, as previously suggested.


27-27: LGTM: Aligned with suggested publish command format.

The publish-npm script now matches the suggested format from the CircleCI config and release tools.


28-29: Verify the force publish approach for prereleases.

The publish-prerelease script uses a complex approach with jq to force publish changed packages. While this aligns with the PR's goal of fixing next release issues, we should verify:

  1. The shell command substitution for FORCE_PUBLISH
  2. The impact of force publishing on package versioning
✅ Verification successful

Let me try a different approach to verify the package.json scripts.


Based on the examination of package.json and lerna.json, I can now provide a final response:

The force publish approach for prereleases is appropriate and well-structured

The implementation is correct because:

  • The monorepo uses independent versioning (lerna.json: "version": "independent")
  • The force publish script correctly identifies changed packages using lerna changed --json
  • The jq command properly formats the package names into a comma-separated list
  • The prerelease flags (--conventional-prerelease, --preid next, --dist-tag next) ensure proper version bumping and npm tagging
  • The safety flags (--no-git-tag-version, --no-push) prevent unintended git operations
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the changed packages detection logic

# Test 1: Check if jq command works as expected
echo "Test 1: Verify jq command output format"
$(yarn bin)/lerna changed --json | jq '. | map(.name) | join(",")'

# Test 2: List all packages that would be force published
echo "Test 2: List packages affected by force publish"
$(yarn bin)/lerna changed --json | jq '. | map(.name)'

Length of output: 2040


Script:

#!/bin/bash
# Let's examine the package.json and lerna.json configuration

# Check package.json content
echo "Package.json content:"
cat package.json

# Check lerna.json if exists
echo -e "\nLerna.json content (if exists):"
if [ -f lerna.json ]; then
    cat lerna.json
fi

# List all package directories to understand the monorepo structure
echo -e "\nPackage directories:"
find . -name "package.json" -not -path "*/node_modules/*"

Length of output: 4555

package.json Show resolved Hide resolved
@rodrigopavezi
Copy link
Member Author

Test reports are being uploaded.

Screenshot 2024-12-10 at 13 22 48

package.json Outdated Show resolved Hide resolved
Co-authored-by: MantisClone <david.huntmateo@request.network>
@MantisClone MantisClone merged commit efcf1c6 into master Dec 10, 2024
3 of 4 checks passed
@MantisClone MantisClone deleted the fix/next-release branch December 10, 2024 18:07
This was referenced Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

5 participants