Skip to content

Conversation

@alexandre-abrioux
Copy link
Contributor

@alexandre-abrioux alexandre-abrioux commented Mar 3, 2025

Fixes #1503

Issue

The current next-release job is broken:

  • It works once after a proper release, publishing a -next.0 version (see an example here) ;
  • But since we do not commit the prerelease versions to our package.json files, the following CI run also attempts to create the same -next.0 version and cannot publish it. (see an example here)
    lerna ERR! E403 You cannot publish over the previously published versions: 0.19.10-next.0.

Description of the changes

I've added the --canary option (documentation here) to append the commit hash on prerelease versions. This option also takes care of incrementing the prerelease number from versions already existing on NPM.

The next prerelease should be:

Found 21 packages to publish:
 - @requestnetwork/advanced-logic => 0.53.1-next.2132+d60677ed
 - @requestnetwork/currency => 0.27.1-next.2132+d60677ed
 - @requestnetwork/data-access => 0.44.1-next.2132+d60677ed
 - @requestnetwork/data-format => 0.19.10-next.2132+d60677ed
 - @requestnetwork/epk-cipher => 0.9.1-next.2132+d60677ed
 - @requestnetwork/epk-decryption => 0.7.10-next.2132+d60677ed
 - @requestnetwork/epk-signature => 0.9.10-next.2132+d60677ed
 - @requestnetwork/ethereum-storage => 0.44.1-next.2132+d60677ed
 - @requestnetwork/lit-protocol-cipher => 0.9.1-next.2132+d60677ed
 - @requestnetwork/multi-format => 0.27.1-next.2132+d60677ed
 - @requestnetwork/payment-detection => 0.53.1-next.2132+d60677ed
 - @requestnetwork/payment-processor => 0.56.1-next.2132+d60677ed
 - @requestnetwork/request-client.js => 0.58.1-next.2132+d60677ed
 - @requestnetwork/request-logic => 0.43.1-next.2132+d60677ed
 - @requestnetwork/request-node => 0.44.1-next.2132+d60677ed
 - @requestnetwork/smart-contracts => 0.47.1-next.2132+d60677ed
 - @requestnetwork/thegraph-data-access => 0.50.1-next.2132+d60677ed
 - @requestnetwork/transaction-manager => 0.44.1-next.2132+d60677ed
 - @requestnetwork/types => 0.53.1-next.2132+d60677ed
 - @requestnetwork/utils => 0.53.1-next.2132+d60677ed
 - @requestnetwork/web3-signature => 0.8.10-next.2132+d60677ed

Summary by CodeRabbit

  • Chores
    • Simplified the publishing process during release steps for a more streamlined workflow.
    • Updated pre-release publishing scripts with enhanced options to improve consistency and reduce complexity.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2025

Walkthrough

This pull request simplifies the prerelease publishing workflow. In the CircleCI configuration, the next-release job now runs a Yarn script (publish-prerelease) instead of a complex Lerna publish command with JSON parsing logic. In the package.json, both the publish-manual-prerelease and publish-prerelease scripts have been updated to include the --canary and --no-git-tag-version flags, while still determining which packages have changed using Lerna. These changes streamline the command structure for publishing prereleases.

Changes

File(s) Change Summary
.circleci/config.yml Updated the next-release job command from a complex Lerna invocation to a simple yarn run publish-prerelease command, removing the logic for determining FORCE_PUBLISH.
package.json Modified the publish-manual-prerelease and publish-prerelease scripts to include the --canary and --no-git-tag-version flags, with adjustments to handle changed packages via Lerna.

Sequence Diagram(s)

sequenceDiagram
  participant CI as CircleCI
  participant Yarn as Yarn Script
  participant Shell as Shell Process
  participant Lerna as Lerna CLI

  CI->>Yarn: Run `yarn run publish-prerelease`
  Yarn->>Shell: Execute publish-prerelease script
  Shell->>Lerna: Run `lerna changed --json`
  Lerna-->>Shell: Return list of changed packages
  Shell->>Lerna: Execute `lerna publish --canary prerelease --no-git-tag-version ...`
  Lerna-->>Shell: Publish prerelease packages
Loading

Possibly related PRs

Suggested reviewers

  • kevindavee
  • leoslr
  • sstefdev
  • MantisClone
  • aimensahnoun

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.
  • @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.

@alexandre-abrioux alexandre-abrioux marked this pull request as ready for review March 3, 2025 17:53
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 (2)
package.json (1)

29-29: Streamlined Prerelease Publish Script with Dynamic Package Selection
The "publish-prerelease" script has been updated to incorporate the --canary and --no-git-tag-version flags while still dynamically computing the list of packages to force publish using the output from lerna changed --json and jq. This simplification should help eliminate conflicts by ensuring each prerelease version is unique.

If there are any edge cases where jq might not behave as expected (for example, if no packages have changed), you might consider adding error handling or a fallback mechanism.

.circleci/config.yml (1)

300-302: Simplified CI Publish Command
The publish step in the next-release job has been simplified to use the command yarn run publish-prerelease instead of a more complex inline script. This change not only streamlines the CI configuration but also ensures consistency with the updated publishing scripts in package.json.

Be sure to verify in your CI logs that this simplification does not inadvertently impact the detection of changed packages or the versioning strategy.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a5dbaa0 and d60677e.

📒 Files selected for processing (2)
  • .circleci/config.yml (1 hunks)
  • package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-and-test
🔇 Additional comments (1)
package.json (1)

28-28: Enhanced Manual Prerelease Publish Script
The "publish-manual-prerelease" script now includes the --canary and --no-git-tag-version flags. This ensures that prerelease versions are uniquely identified (by appending the commit hash) and that no Git tags are automatically created during the process, which aligns well with the improved CI flow.

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.

Nice! Thanks for taking the time to look into this 🙏

@MantisClone MantisClone linked an issue Mar 3, 2025 that may be closed by this pull request
@alexandre-abrioux alexandre-abrioux merged commit 2b7c969 into master Mar 4, 2025
12 checks passed
@alexandre-abrioux alexandre-abrioux deleted the fix-next-release branch March 4, 2025 09:13
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.

Fix -next releases in requestNetwork SDK

4 participants