Skip to content

Conversation

Amxx
Copy link
Collaborator

@Amxx Amxx commented Aug 22, 2025

Overview

Use a dual tag: latest + dev

graph LR
  5.3["5.3 (audited)"] --dev--> 5.4["5.4 (audited)"] --dev--> 5.5["5.5 (unaudited)"] --dev--> 5.6["5.6 (unaudited)"] --dev--> 5.7["5.7 (audited)"] --dev--> 5.8["5.8 (unaudited)"]
  5.3 --latest--> 5.4 --latest--> 5.7
  
Loading

At each point, dev points to the latest version (audited or not), which latest (which npm serves by default) points to the latest audited version.

If the latest version was audited, then both latest and dev will point to the same version.

How does the users get the package

If a user wants to get the latest audited release:

  • npm i @openzeppelin/contracts
  • npm i @openzeppelin/contracts@latest

If a user wants to get the latest release (audited or not):

  • npm i @openzeppelin/contracts@dev

If a user wants to get the latest release candidate (might not exist, might correspond to an unaudited version):

  • npm i @openzeppelin/contracts@next

Changes to the release process

  • (automatic) release next version with with dev tag instead of latest <= THIS PR
  • (manual) move the latest tag when an audited release is published

Summary by Sourcery

Build:

  • Change release script to tag new packages as ‘dev’ instead of ‘latest’

@Amxx Amxx requested a review from a team as a code owner August 22, 2025 12:36
Copy link

changeset-bot bot commented Aug 22, 2025

⚠️ No Changeset found

Latest commit: 99dd90c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

sourcery-ai bot commented Aug 22, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Implements a dual npm dist-tag strategy by defaulting new releases to the "dev" tag (instead of "latest"), reserving "latest" for audited versions which are promoted manually.

Flow diagram for new release tagging process

flowchart TD
    A["New release detected"] --> B{"Is prerelease?"}
    B -- Yes --> C["Tag as 'next'"]
    B -- No --> D{"Is version > latest audited?"}
    D -- Yes --> E["Tag as 'dev'"]
    D -- No --> F["Tag as patch (manual tag)"]
Loading

File-Level Changes

Change Details Files
Update default release tag in packaging script to use "dev"
  • Replace echo "latest" with echo "dev" in dist_tag function
scripts/release/workflow/pack.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Amxx Amxx added this to the 5.5 milestone Sep 9, 2025
@Amxx
Copy link
Collaborator Author

Amxx commented Sep 9, 2025

@coderabbitai review

Copy link

coderabbitai bot commented Sep 9, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

1 similar comment
Copy link

coderabbitai bot commented Sep 9, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

coderabbitai bot commented Sep 9, 2025

Walkthrough

The release workflow changes adjust the dist_tag selection logic: when the local PACKAGE_JSON_VERSION is greater than the latest published version, the tag now resolves to "dev" instead of "latest". The prerelease branch behavior remains returning "next", and the fallback tag for older versions remains "tmp". No other logic or outputs in the script were modified, and there are no changes to exported or public interfaces.

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly captures the primary change by indicating that new releases will be tagged with “dev,” which directly reflects the main logic modification in the pack.sh script.
Description Check ✅ Passed The description thoroughly outlines the dual tagging scheme, illustrates it with a diagram, and details how users and the release process are affected, all of which are directly relevant to the changes in the release script.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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 (3)
scripts/release/workflow/pack.sh (3)

10-11: Guard against unset PRERELEASE under set -u.

If PRERELEASE is not exported by the workflow, this will hard-fail. Safer to default to false.

-  if [ "$PRERELEASE" = "true" ]; then
+  if [ "${PRERELEASE:-false}" = "true" ]; then

7-8: Make LATEST_NPM_VERSION resolution resilient (first publish / network hiccups).

npm info can 404 or transiently fail, which would currently abort the script. Defaulting to 0.0.0 keeps the flow robust.

-  LATEST_NPM_VERSION="$(npm info "$PACKAGE_JSON_NAME" version)"
+  LATEST_NPM_VERSION="$(npm info "$PACKAGE_JSON_NAME" version 2>/dev/null || echo 0.0.0)"
+  LATEST_NPM_VERSION="${LATEST_NPM_VERSION:-0.0.0}"

23-25: Quote $GITHUB_OUTPUT to avoid pathname expansion/whitespace bugs.

Minor safety improvement; behavior is otherwise unchanged.

-echo "tarball_name=$TARBALL" >> $GITHUB_OUTPUT
-echo "tarball=$(pwd)/$TARBALL" >> $GITHUB_OUTPUT
-echo "tag=$(dist_tag)" >> $GITHUB_OUTPUT
+echo "tarball_name=$TARBALL" >> "$GITHUB_OUTPUT"
+echo "tarball=$(pwd)/$TARBALL" >> "$GITHUB_OUTPUT"
+echo "tag=$(dist_tag)" >> "$GITHUB_OUTPUT"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between efdc7cd and 99dd90c.

📒 Files selected for processing (1)
  • scripts/release/workflow/pack.sh (1 hunks)
🔇 Additional comments (1)
scripts/release/workflow/pack.sh (1)

12-14: Switching the new-release tag to "dev" matches the stated release policy.

This aligns with the PR objective: new publications advance the "dev" tag while "latest" is moved manually upon audit. No functional regressions in this block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant