Skip to content

feat: drop dev branch and improve release notes#637

Open
ThomasRalee wants to merge 1 commit intodevfrom
feat/drop-dev-branch-and-improve-release-notes
Open

feat: drop dev branch and improve release notes#637
ThomasRalee wants to merge 1 commit intodevfrom
feat/drop-dev-branch-and-improve-release-notes

Conversation

@ThomasRalee
Copy link
Copy Markdown
Collaborator

@ThomasRalee ThomasRalee commented Apr 8, 2026

Summary by CodeRabbit

  • Chores
    • Modernized publishing workflow to support multiple release types (canary, beta, production) and manual dispatch with validation.
    • Broadened publishing scope and automated creation/pushing of version tags and GitHub Releases after publish.
    • Removed deprecated manual stable publish workflow and related npm release scripts.
    • Added commit-keyword-driven bump selection for minor releases.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

📝 Walkthrough

Walkthrough

Publish workflow behavior moved to master: manual dispatch supports explicit release types, commit-message detection can bump minor vs patch, workflow now creates/pushes git tags and GitHub Releases post-publish, deprecated stable workflow removed, and related npm release scripts deleted.

Changes

Cohort / File(s) Summary
Publish Pipeline
.github/workflows/publish.yaml, .github/workflows/package-bump.yaml
Expanded trigger scope to run on all branches and added workflow_dispatch release_type input; logic branches early for dispatch vs push, detects release-minor in commits for minor bumps, determines dist-tags/version args, pushes v<version> git tags (when missing), and creates GitHub Releases (master-only). Docs/comments updated to reference master.
Removed Deprecated Workflow
.github/workflows/stable.yaml
Deleted the previously disabled "Publish stable (DEPRECATED)" workflow file.
Package script cleanup
package.json
Removed release:patch, release:minor, and patch npm scripts that previously ran local lerna versioning and publishes.

Sequence Diagram(s)

sequenceDiagram
    actor Dev as Developer
    participant GH as GitHub (Push / Dispatch)
    participant Actions as GitHub Actions / publish workflow
    participant Git as Git (tags)
    participant NPM as npm Registry
    participant GHRel as GitHub Releases
    participant Slack as Slack

    rect rgba(200,230,201,0.5)
    Dev->>GH: push / workflow_dispatch (release_type)
    end

    GH->>Actions: trigger publish workflow
    Actions->>Actions: determine release type (dispatch vs commit message)
    Actions->>Actions: run versioning & build
    Actions->>NPM: publish packages (dist-tag)
    Actions->>Git: create & push v<version> tag (if missing & master)
    Actions->>GHRel: create release for v<version> (if master & not exists)
    Actions->>Slack: broadcast publish notification
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped from dev to master gate,
Chose minor or patch by commit's fate,
Tags I plant — v gleam,
Releases bloom and pipelines stream,
Scripts retired, I thump — celebrate! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references 'drop dev branch' but the changes show workflows now run on all branches and reference 'master' instead of 'dev'. The title only partially captures the actual scope of changes, which is broader than just dropping the dev branch.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/drop-dev-branch-and-improve-release-notes

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

Copy link
Copy Markdown

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/publish.yaml (1)

266-273: ⚠️ Potential issue | 🔴 Critical

Update downstream branch targets in .github/workflows/package-bump.yaml before triggering package bumps on prod releases.

Verification shows all 9 downstream package-bump target branches are currently missing or inaccessible. The workflow will fail on the first prod release if these branches don't exist. Confirm which branches are active in each downstream repo and update the branch targets accordingly (currently targets a mix of master, dev, and staging).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/publish.yaml around lines 266 - 273, The
"trigger-package-bumps" workflow invokes .github/workflows/package-bump.yaml for
prod releases but that downstream workflow's branch targets are
incorrect/missing; open package-bump.yaml and update the nine downstream branch
targets to the actual active branches for each downstream repo (replace any
incorrect uses of master/dev/staging), then verify each downstream repository
has the referenced branch and adjust the branch names or create branches as
needed so the job guarded by needs.publish.outputs.publish_type == 'latest' can
run successfully.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/publish.yaml:
- Around line 235-256: The "Create GitHub Release" step (using VERSION/TAG, git
tag/git push and gh release create) runs after npm publish which can leave npm
ahead of git if tagging/pushing fails; fix by making tag creation and git push
idempotent and move it before the irreversible publish (or add a dedicated
pre-publish job): ensure the workflow creates and pushes the TAG (use git tag
"$TAG" and git push origin "$TAG" or git push --follow-tags) before any publish
steps, and keep the gh release create step separate and tolerant (check gh
release view "$TAG" before create) so re-runs won't cause extra versions; update
the "Create GitHub Release" step into a pre-publish "Create and Push Tag" job or
reorder steps to persist git state prior to publishing.
- Around line 15-29: Add a workflow-level concurrency block to
.github/workflows/publish.yaml so release runs queue instead of racing: under
the top-level (same level as on and workflow_dispatch) add a concurrency key
(e.g. concurrency: group: 'publish-release' or use a stable expression like
'publish-${{ github.repository }}' and set cancel-in-progress: false) to
serialize executions that run lerna version / npm publish / tag pushes / GitHub
Releases; ensure the concurrency group is stable across push and
workflow_dispatch invocations (refer to workflow_dispatch and release_type) so
overlapping release runs cannot compute the same next version.

---

Outside diff comments:
In @.github/workflows/publish.yaml:
- Around line 266-273: The "trigger-package-bumps" workflow invokes
.github/workflows/package-bump.yaml for prod releases but that downstream
workflow's branch targets are incorrect/missing; open package-bump.yaml and
update the nine downstream branch targets to the actual active branches for each
downstream repo (replace any incorrect uses of master/dev/staging), then verify
each downstream repository has the referenced branch and adjust the branch names
or create branches as needed so the job guarded by
needs.publish.outputs.publish_type == 'latest' can run successfully.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 694c8725-423e-4827-a159-ad54d41ec640

📥 Commits

Reviewing files that changed from the base of the PR and between d88946d and d13e5e0.

📒 Files selected for processing (4)
  • .github/workflows/package-bump.yaml
  • .github/workflows/publish.yaml
  • .github/workflows/stable.yaml
  • package.json
💤 Files with no reviewable changes (2)
  • .github/workflows/stable.yaml
  • package.json

@ThomasRalee ThomasRalee force-pushed the feat/drop-dev-branch-and-improve-release-notes branch from d13e5e0 to 2858292 Compare April 8, 2026 03:31
Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/publish.yaml:
- Around line 56-61: The workflow allows workflow_dispatch to run on tags
causing detached-HEAD failures and leaves TYPE/DIST_TAG/VERSION_ARGS unset for
unknown release_type; update the job condition to require startsWith(github.ref,
'refs/heads/') for manual dispatch paths (so workflow_dispatch runs must target
a branch), add an explicit branch/ref validation before invoking lerna
version/git push (guard the lerna/version/push steps with a check that
github.ref startsWith 'refs/heads/'), and add a final else branch when parsing
inputs.release_type to explicitly fail with a helpful error or set safe defaults
for TYPE, DIST_TAG and VERSION_ARGS if release_type is unrecognized so
downstream steps cannot proceed silently.
- Around line 199-208: The workflow currently only checks for local tags using
git rev-parse and can skip pushing a missing remote tag, causing gh release
create to auto-create a tag on the wrong commit; update the "Create and push
release tag" step that sets VERSION/TAG so it verifies the tag on the remote
(use git ls-remote --exit-code origin "refs/tags/$TAG" or equivalent) and only
creates/pushes the local tag when the remote tag is absent, and also add the
--verify-tag flag to the gh release create invocation so gh release create will
fail if the tag is not present on the remote.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9edfb0ef-d6e9-4d8e-804f-527f76f4ac00

📥 Commits

Reviewing files that changed from the base of the PR and between d13e5e0 and 2858292.

📒 Files selected for processing (4)
  • .github/workflows/package-bump.yaml
  • .github/workflows/publish.yaml
  • .github/workflows/stable.yaml
  • package.json
💤 Files with no reviewable changes (2)
  • .github/workflows/stable.yaml
  • package.json
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/package-bump.yaml

Comment on lines +56 to +61
github.ref == 'refs/heads/master' ||
contains(github.event.head_commit.message, 'canary') ||
contains(github.event.head_commit.message, 'beta')
contains(github.event.head_commit.message, 'beta') ||
github.event_name == 'workflow_dispatch'
) &&
!(github.ref == 'refs/heads/dev' && github.event_name == 'workflow_dispatch')
!(github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch' && inputs.release_type != 'prod')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/publish.yaml

Repository: InjectiveLabs/injective-ts

Length of output: 12507


Validate that manual dispatch releases target a branch, and handle unknown release types.

workflow_dispatch runs can target any git ref (branch or tag), but lines 56–61 admit all manual runs without ref validation. Lines 122–129 (canary and beta handlers) skip branch checking entirely—only prod validates at line 115. This allows a canary or beta dispatch on a tag to reach lerna version and git push at lines 193–197, where it fails against a detached HEAD. Additionally, an unknown release_type leaves TYPE, DIST_TAG, and VERSION_ARGS unset, causing silent failures downstream.

Add startsWith(github.ref, 'refs/heads/') to the job condition (line 59), validate branch refs before lerna version, and add an explicit else clause to catch unrecognized release_type values.

🛠️ Proposed fix
       (
         github.ref == 'refs/heads/master' ||
         contains(github.event.head_commit.message, 'canary') ||
         contains(github.event.head_commit.message, 'beta') ||
-        github.event_name == 'workflow_dispatch'
+        (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/'))
       ) &&
       !(github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch' && inputs.release_type != 'prod')
...
           # Handle workflow_dispatch input
           if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
             RELEASE_TYPE="${{ inputs.release_type }}"
             if [[ "$RELEASE_TYPE" == "prod" ]]; then
               if [[ "$BRANCH" != "refs/heads/master" ]]; then
                 echo "::error::prod releases can only be triggered from the master branch"
                 exit 1
               fi
@@ -127,6 +127,10 @@ run: |
             elif [[ "$RELEASE_TYPE" == "beta" ]]; then
               TYPE="beta"
               DIST_TAG="beta"
               VERSION_ARGS="prerelease --preid beta --force-publish --force-git-tag --no-changelog --yes --no-push"
+            else
+              echo "::error::Unsupported release_type: $RELEASE_TYPE"
+              exit 1
             fi
             echo "type=$TYPE" >> $GITHUB_OUTPUT
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/publish.yaml around lines 56 - 61, The workflow allows
workflow_dispatch to run on tags causing detached-HEAD failures and leaves
TYPE/DIST_TAG/VERSION_ARGS unset for unknown release_type; update the job
condition to require startsWith(github.ref, 'refs/heads/') for manual dispatch
paths (so workflow_dispatch runs must target a branch), add an explicit
branch/ref validation before invoking lerna version/git push (guard the
lerna/version/push steps with a check that github.ref startsWith 'refs/heads/'),
and add a final else branch when parsing inputs.release_type to explicitly fail
with a helpful error or set safe defaults for TYPE, DIST_TAG and VERSION_ARGS if
release_type is unrecognized so downstream steps cannot proceed silently.

Comment on lines +199 to +208
- name: Create and push release tag
if: github.ref == 'refs/heads/master'
run: |
VERSION=$(node -p "require('./packages/sdk-ts/package.json').version")
TAG="v${VERSION}"

if ! git rev-parse --verify "refs/tags/$TAG" >/dev/null 2>&1; then
git tag "$TAG"
git push origin "$TAG"
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cd /tmp/repo && find . -name "publish.yaml" -type f | head -5

Repository: InjectiveLabs/injective-ts

Length of output: 129


🏁 Script executed:

# First, let's find the publish workflow file
fd -t f "publish.yaml" | head -1

Repository: InjectiveLabs/injective-ts

Length of output: 52


🏁 Script executed:

# Read the workflow file to check the actual content at the mentioned lines
if [ -f ".github/workflows/publish.yaml" ]; then
  cat -n .github/workflows/publish.yaml | sed -n '195,215p'
fi

Repository: InjectiveLabs/injective-ts

Length of output: 967


🏁 Script executed:

# Also check the lines around 250-263
if [ -f ".github/workflows/publish.yaml" ]; then
  cat -n .github/workflows/publish.yaml | sed -n '245,268p'
fi

Repository: InjectiveLabs/injective-ts

Length of output: 1023


🌐 Web query:

gh release create --verify-tag flag documentation

💡 Result:

In GitHub CLI (gh), the --verify-tag flag for gh release create means:

  • By default, if the tag you pass doesn’t exist, gh release create <tag> will auto-create the tag from the repository’s default branch (or from --target if you provide it).
  • With --verify-tag, gh will abort instead of creating the release if the tag doesn’t already exist in the repo. [1]

Official documentation: gh release create manual page. [1]

Example

gh release create v1.2.3 --verify-tag

Sources: [1] (cli.github.com)

Citations:


🌐 Web query:

git ls-remote check remote tags documentation

💡 Result:

To check remote tags with git ls-remote, the official documentation is the git-ls-remote man page. It explains the key options:

  • List all tags on a remote:

    git ls-remote --tags origin

    [1]

  • Check whether a specific tag exists on the remote (by fully-qualified refname):

    git ls-remote origin refs/tags/<tag-name>

    [5]

  • Avoid “double lines” for annotated tags (where you might otherwise see both refs/tags/v1.0 and refs/tags/v1.0^{}) by adding --refs:

    git ls-remote --tags --refs origin

    [1]

Docs: Git - git-ls-remote Documentation (official) [1]

Sources: [1] [5]


🏁 Script executed:

# Check gh release create help for --verify-tag option
gh release create --help 2>&1 | grep -A 5 "verify-tag" || echo "Flag not found in help"

Repository: InjectiveLabs/injective-ts

Length of output: 707


🏁 Script executed:

# Verify git ls-remote syntax for checking remote tags
man git-ls-remote 2>&1 | grep -A 10 "exit-code" || git ls-remote --help 2>&1 | head -50

Repository: InjectiveLabs/injective-ts

Length of output: 167


Add --verify-tag flag to gh release create and verify remote tag before pushing.

The current code only checks for local tags (line 205). If a local tag exists but the remote tag doesn't, the push is skipped. Then gh release create without --verify-tag auto-creates the tag from the default branch's current state, tying the release to the wrong commit.

Add --verify-tag to the release creation step (line 259) to abort if the tag doesn't already exist on the remote. Additionally, check that the tag exists on the remote before deciding to push:

Proposed fix
       - name: Create and push release tag
         if: github.ref == 'refs/heads/master'
         run: |
           VERSION=$(node -p "require('./packages/sdk-ts/package.json').version")
           TAG="v${VERSION}"

-          if ! git rev-parse --verify "refs/tags/$TAG" >/dev/null 2>&1; then
-            git tag "$TAG"
-            git push origin "$TAG"
+          if ! git ls-remote --exit-code origin "refs/tags/$TAG" >/dev/null 2>&1; then
+            if ! git rev-parse --verify "refs/tags/$TAG" >/dev/null 2>&1; then
+              git tag "$TAG"
+            fi
+            git push origin "$TAG"
           fi
...
           if ! gh release view "$TAG" >/dev/null 2>&1; then
             gh release create "$TAG" \
+              --verify-tag \
               --title "$TAG" \
               --generate-notes \
               --latest
           fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/publish.yaml around lines 199 - 208, The workflow
currently only checks for local tags using git rev-parse and can skip pushing a
missing remote tag, causing gh release create to auto-create a tag on the wrong
commit; update the "Create and push release tag" step that sets VERSION/TAG so
it verifies the tag on the remote (use git ls-remote --exit-code origin
"refs/tags/$TAG" or equivalent) and only creates/pushes the local tag when the
remote tag is absent, and also add the --verify-tag flag to the gh release
create invocation so gh release create will fail if the tag is not present on
the remote.

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.

1 participant