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

fix: prerelease command #1532

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix: prerelease command #1532

wants to merge 2 commits into from

Conversation

rodrigopavezi
Copy link
Member

@rodrigopavezi rodrigopavezi commented Dec 13, 2024

Description of the changes

This is an attempt to fix the prerelease. When running locally I see this version output.

Changes:
 - @requestnetwork/advanced-logic: 0.48.0 => 0.48.1-next.0
 - @requestnetwork/currency: 0.22.0 => 0.22.1-next.0
 - @requestnetwork/data-access: 0.39.0 => 0.39.1-next.0
 - @requestnetwork/data-format: 0.19.4 => 0.19.5-next.0
 - @requestnetwork/epk-cipher: 0.4.0 => 0.4.1-next.0
 - @requestnetwork/epk-decryption: 0.7.4 => 0.7.5-next.0
 - @requestnetwork/epk-signature: 0.9.4 => 0.9.5-next.0
 - @requestnetwork/ethereum-storage: 0.39.0 => 0.39.1-next.0
 - @requestnetwork/integration-test: 0.39.0 => 0.39.1-next.0 (private)
 - @requestnetwork/lit-protocol-cipher: 0.4.0 => 0.4.1-next.0
 - @requestnetwork/multi-format: 0.22.0 => 0.22.1-next.0
 - @requestnetwork/payment-detection: 0.48.0 => 0.48.1-next.0
 - @requestnetwork/payment-processor: 0.51.0 => 0.51.1-next.0
 - @requestnetwork/request-client.js: 0.53.0 => 0.53.1-next.0
 - @requestnetwork/request-logic: 0.38.0 => 0.38.1-next.0
 - @requestnetwork/request-node: 0.39.0 => 0.39.1-next.0
 - @requestnetwork/smart-contracts: 0.42.0 => 0.42.1-next.0
 - @requestnetwork/thegraph-data-access: 0.45.0 => 0.45.1-next.0
 - @requestnetwork/toolbox: 0.15.4 => 0.15.5-next.0 (private)
 - @requestnetwork/transaction-manager: 0.39.0 => 0.39.1-next.0
 - @requestnetwork/types: 0.48.0 => 0.48.1-next.0
 - @requestnetwork/usage-examples: 0.32.4 => 0.32.5-next.0 (private)
 - @requestnetwork/utils: 0.48.0 => 0.48.1-next.0
 - @requestnetwork/web3-signature: 0.8.4 => 0.8.5-next.0

Summary by CodeRabbit

  • New Features

    • Introduced a new nightly testing job that runs daily at 22:00.
  • Improvements

    • Simplified publishing commands in the package.json scripts for manual and automated prerelease processes.
  • Bug Fixes

    • Updated job dependencies in the CI/CD pipeline for improved execution order.

Copy link
Contributor

coderabbitai bot commented Dec 13, 2024

Warning

Rate limit exceeded

@rodrigopavezi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 24 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between fceec69 and a01119a.

📒 Files selected for processing (1)
  • package.json (1 hunks)

Walkthrough

The pull request introduces modifications to the .circleci/config.yml and package.json files, focusing on the configuration of CircleCI jobs and publishing scripts. The next-release job's command has been simplified by removing multiple flags, and a new test-nightly job has been added to the workflows section. Additionally, scripts related to publishing in package.json have been updated to streamline their commands. These changes affect job dependencies and the release process in the CI/CD pipeline.

Changes

File Change Summary
.circleci/config.yml - Updated next-release job command to simplify publishing packages by removing multiple flags.
- Added test-nightly job scheduled to run daily at 22:00, dependent on the successful completion of the build job.
- Updated job dependencies in build-and-test workflow.
package.json - Modified publish-manual-prerelease script to remove unnecessary flags, simplifying the command.
- Updated publish-prerelease script to streamline the command by removing several flags.

Possibly related PRs

  • refactor: circle ci scripts  #1510: Modifies the .circleci/config.yml file, including changes to the next-release job, directly related to the main PR's modifications.
  • fix: next release #1517: Updates the .circleci/config.yml file, addressing the next-release job and adding an environment variable that aligns with the main PR's changes.
  • fix: next release job #1529: Further updates the next-release job in the .circleci/config.yml, indicating a direct connection to the main PR's job configuration changes.

Suggested reviewers

  • alexandre-abrioux
  • sstefdev
  • aimensahnoun
  • MantisClone

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.

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)

Line range hint 290-296: Review the nightly test workflow configuration

The nightly test workflow is well-structured with:

  1. Proper scheduling at 22:00 daily
  2. Correct branch filtering for master
  3. Appropriate job dependencies

However, consider adding timeout settings for the nightly tests to prevent hung jobs.

  test-nightly:
    docker:
      - *node_image
      - *ipfs_image
      - *ganache_image
      - *postgres_image
      - *graph_image
+   no_output_timeout: 30m
    working_directory: *working_directory

Also applies to: 347-367

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 23628d0 and fceec69.

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

28-29: Verify impact of removed publishing flags

The removal of several flags from both publishing scripts might have unintended consequences:

  1. --conventional-commits: Might affect version bumping consistency
  2. --exact: Could allow floating versions
  3. --no-verify-access: Might cause npm registry access issues
✅ Verification successful

Removed flags are safely handled by other configurations

The removal of the flags appears to be safe because:

  1. --conventional-commits is still present in the main publish-npm script, which maintains version bumping consistency for production releases
  2. --exact is not critical for prerelease versions as they are tagged with next and won't affect production dependencies
  3. --no-verify-access removal is safe as npm registry access can be verified through standard authentication

The prerelease scripts are specifically designed for development/testing purposes (using --no-push and next tag), so the removed flags won't impact production releases.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if conventional commits are being used in the repository
# and if exact versions are enforced in package.json files

# Check if conventional commits are used in recent commits
echo "Checking recent commit messages for conventional commit format..."
git log -n 10 --pretty=format:"%s" | grep -E "^(feat|fix|docs|style|refactor|perf|test|chore|revert|build|ci)(\(.+\))?: .+"

# Check if exact versions are used in dependencies
echo -e "\nChecking for non-exact versions in package.json files..."
fd -e json -x jq -r '.dependencies,.devDependencies,.peerDependencies | select(. != null) | to_entries[] | select(.value | startswith("^") or startswith("~")) | .key + ": " + .value' {} \;

Length of output: 679


Script:

#!/bin/bash
# Let's try a different approach to verify the impact

# 1. Check for lerna.json configuration
echo "=== Checking lerna.json configuration ==="
cat lerna.json

# 2. Check for any npm or yarn configuration files that might enforce versioning
echo -e "\n=== Checking for npm/yarn configuration files ==="
fd -e npmrc -e yarnrc -e yarnrc.yml

# 3. Look for commit message configuration
echo -e "\n=== Checking for commit message configuration files ==="
fd -g '*commit*' -g '.czrc' -g '*lint*' -t f

# 4. Check package.json for any relevant configuration
echo -e "\n=== Checking package.json configuration ==="
cat package.json | jq '{
  "commitlint": .commitlint,
  "config": .config,
  "husky": .husky,
  "dependencies": .dependencies,
  "devDependencies": .devDependencies
}'

Length of output: 1618


Script:

#!/bin/bash
# Let's check for commit hooks and lint configurations

# Check for husky configuration
echo "=== Checking for husky configuration ==="
fd -g '.husky' -t d -x ls -la {}

# Check for commitlint configuration file
echo -e "\n=== Checking for commitlint configuration ==="
fd -g 'commitlint.config.js' -g '.commitlintrc*'

# Check for lint-staged configuration
echo -e "\n=== Checking for lint-staged configuration ==="
cat package.json | jq '.["lint-staged"]'

# Check for version-related scripts in package.json
echo -e "\n=== Checking version-related scripts ==="
cat package.json | jq '.scripts | with_entries(select(.key | test("version|publish|release")))'

Length of output: 1416

.circleci/config.yml (1)

Line range hint 290-296: Ensure consistent publishing behavior across CI and local environments

The publishing command in CircleCI matches the simplified version in package.json, which is good for consistency. However, verify that the environment variables and npm authentication are properly set up for the new simplified command.

✅ Verification successful

NPM authentication and publishing configuration is properly set up

The verification shows that:

  1. NPM authentication is correctly configured using NPM_TOKEN in the CI environment
  2. The token is properly set in .npmrc before publishing
  3. The publishing command in CI matches the publish-prerelease script in the root package.json
  4. The force publish calculation is consistent between CI and package.json scripts
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if NPM_TOKEN is properly set in CircleCI context

# Check if the context exists and contains NPM_TOKEN
echo "Verifying NPM_TOKEN in CircleCI context..."
gh api -X GET "/orgs/${CIRCLE_PROJECT_USERNAME}/contexts" | jq '.[] | select(.name == "protocol-release")'

Length of output: 265


Script:

#!/bin/bash
# Let's verify the npm authentication setup in the CI configuration
rg -A 5 "NPM_TOKEN|npm.*token" .circleci/config.yml

# Also check for any npm authentication steps in the workflow
rg "npm.*auth" .circleci/config.yml

# Check the publishing job configuration
rg -A 10 "publish:" .circleci/config.yml

Length of output: 496


Script:

#!/bin/bash
# Let's check the complete workflow and job configuration for the publishing step
rg -B 5 -A 15 "jobs:" .circleci/config.yml

# Also check package.json for any npm-related scripts
fd package.json --exec cat {} | jq '.scripts'

Length of output: 11283

package.json Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

2 participants