Skip to content

chore: pin @sistent/sistent exact in meshery-extensions dependency bump#1727

Merged
marblom007 merged 3 commits into
masterfrom
chore/save-exact-meshery-extensions-bump
Jul 22, 2026
Merged

chore: pin @sistent/sistent exact in meshery-extensions dependency bump#1727
marblom007 merged 3 commits into
masterfrom
chore/save-exact-meshery-extensions-bump

Conversation

@marblom007

@marblom007 marblom007 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Problem

Every @sistent/sistent bump PR this workflow opens against layer5labs/meshery-extensions gets the identical Copilot/Gemini review comment asking to pin the dependency to an exact version — see meshery-extensions#4300, and every prior bump-sistent-bot PR before it.

meshery-extensions pins externalized dependencies (packages shared as runtime singletons with Meshery UI, including @sistent/sistent) to exact versions in ui/package.json — unlike meshery/meshery, meshery-cloud, and layer5, which all use caret ranges for the same packages. The plain npm install @sistent/sistent@X in the bump-meshery-extensions job writes a caret by default, silently breaking that repo's convention on every release.

Fix

Add --save-exact to the bump-meshery-extensions job's npm install, matching the job's existing --legacy-peer-deps per-repo customization. The other three jobs (bump-meshery, bump-layer5, bump-meshery-cloud) are untouched — their target repos use caret ranges by convention, so this would be an unwanted change there.

This is a second line of defense. The primary fix lives in meshery-extensions itself (ui/.npmrc with save-exact=true, plus a new CI check that fails the build if any externalized dependency is ever range-pinned again, regardless of source) — see layer5labs/meshery-extensions#4301.

Test plan

  • python3 -c "import yaml; yaml.safe_load(...)" — workflow YAML still parses
  • Diff is a single-line addition (--save-exact) to one job; no other jobs touched

Summary by CodeRabbit

  • Chores
    • Improved release automation by strictly validating the resolved release version against SemVer 2.0.0 before triggering downstream bump jobs.
    • Standardized dependency installation in bump workflows to use the runtime release version value and ensure consistent behavior.
    • Pinned the dependency to the exact version in the mesh extensions bump to maintain runtime singleton consistency and version alignment.

meshery-extensions pins externalized deps (shared runtime singletons
with Meshery UI) to exact versions, unlike meshery, meshery-cloud, and
layer5, which use caret ranges for the same packages. This bot's plain
npm install wrote a caret, breaking that convention and triggering
the same Copilot/Gemini review comment on every sistent release
(e.g. meshery-extensions#4300). Add --save-exact to the
bump-meshery-extensions job only; the other jobs' conventions are
unaffected.

meshery-extensions also gets a belt-and-suspenders ui/.npmrc with
save-exact=true and a CI check (validate-mesheryui-compatibility.js)
enforcing this regardless of which caller runs npm install.

Signed-off-by: Ahmed Jamil <197998703+CodeAhmedJamil@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 03:47
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the area/ci Continuous integration | Build and release label Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 278e5f81-deb3-4f34-b304-1d8129f3dac1

📥 Commits

Reviewing files that changed from the base of the PR and between 65dc0a1 and 2729c6d.

📒 Files selected for processing (1)
  • .github/workflows/notify-dependents.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/notify-dependents.yml

📝 Walkthrough

Walkthrough

The dependent notification workflow strictly validates release_version before downstream jobs and uses the resolved shell variable for Sistent installations. The Meshery Extensions job also pins Sistent exactly with --save-exact.

Changes

Dependent release version workflow

Layer / File(s) Summary
Validate resolved release version
.github/workflows/notify-dependents.yml
The release-version resolution step applies strict SemVer validation and fails for invalid values.
Use validated version in bump jobs
.github/workflows/notify-dependents.yml
Downstream bump jobs install @sistent/sistent using $RELEASE_VERSION; Meshery Extensions adds --save-exact and documents the runtime singleton requirement.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: pinning @sistent/sistent to an exact version in the meshery-extensions bump workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/save-exact-meshery-extensions-bump

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/notify-dependents.yml:
- Line 128: Update the npm install command in the workflow step to validate
RELEASE_VERSION against a strict semver pattern before use and safely quote the
validated value in the shell command. Reject invalid workflow_dispatch input
before invoking npm, while preserving the existing exact-version installation
behavior.
🪄 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 Plus

Run ID: d07dea9d-cbd9-4c6f-959e-5eca025b0198

📥 Commits

Reviewing files that changed from the base of the PR and between ddf0945 and 533ae8c.

📒 Files selected for processing (1)
  • .github/workflows/notify-dependents.yml

Comment thread .github/workflows/notify-dependents.yml Outdated
The bump jobs interpolated ${{ env.RELEASE_VERSION }} directly into the
`npm install` command line, so the Actions template engine pasted the value
into the shell script before bash ever saw it. The value reaches that point
unvalidated: the workflow_dispatch input is free text, and a git refname may
legally contain $, backticks, parentheses and quotes.

Fix at the source rather than at the four call sites:

- The info job now validates the resolved version against an anchored semver
  pattern and fails closed. It is the single choke point every bump job reads
  from, so one check covers all of them.
- The branch-name fallback regex was unanchored, so it also matched (and then
  used wholesale) strings that merely contained something version-shaped -
  e.g. `release/v0.21.40` was accepted as a version and handed to npm.
  Anchoring it fixes that latent bug and closes the injection path together.
- All four `run:` steps now reference the job-level env var as a quoted shell
  variable instead of a template expansion.

zizmor reports 8 template-injection findings on this file before the change
and 0 after.

Signed-off-by: Ahmed Jamil <197998703+CodeAhmedJamil@users.noreply.github.com>
@marblom007

Copy link
Copy Markdown
Contributor Author

Addressed the one actionable review item (CodeRabbit's template-injection finding on notify-dependents.yml) in 65dc0a1 — fixed at the resolver rather than the call site, so all four bump jobs are covered rather than just the one line flagged. Details in the thread reply.

Acknowledging the two informational bot comments for completeness: Gemini reported it cannot review these file types (no action available), and the CodeRabbit walkthrough is a summary with all five pre-merge checks passing (no action required).

Out-of-scope note for maintainers: zizmor also reports pre-existing unpinned-uses (12) and dangerous-triggers (1) findings on this file, and test-meshery-integration.yml:71 plus release.yml:193 interpolate templates into shell/JS in the same style. None are attacker-reachable the way the fixed one was, and release.yml is release infrastructure I'm deliberately not touching in a chore PR. Worth a dedicated hardening pass.

@copilot review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/notify-dependents.yml:
- Line 39: Strengthen the SEMVER_RE validation in the workflow so it enforces
the full SemVer grammar: reject leading zeroes in numeric components, numeric
prerelease identifiers with leading zeroes, and empty prerelease or build
identifiers such as consecutive dots. Use a strict parser or equivalent anchored
regex while preserving acceptance of valid SemVer values before the npm install
steps.
🪄 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 Plus

Run ID: 7ba5bd7f-ba03-4637-86e1-b582fa9bc6a1

📥 Commits

Reviewing files that changed from the base of the PR and between 533ae8c and 65dc0a1.

📒 Files selected for processing (1)
  • .github/workflows/notify-dependents.yml

Comment thread .github/workflows/notify-dependents.yml Outdated
The first pass used a permissive pattern that accepted 01.2.3, 1.2.3-01 and
1.2.3..rc. None of those carry shell metacharacters, so the injection fix held,
but a validation gate that accepts values its own name says are invalid is a
trap for the next reader - and these would have reached npm and failed there
instead of here, with a worse error.

Use the canonical SemVer 2.0.0 grammar from semver.org, transcribed to POSIX
ERE and assembled from named parts so it stays readable: no leading zeroes in
numeric identifiers, no empty prerelease or build identifiers.

Verified by extracting the info job's script from the workflow and running it:
11 valid versions accepted; 15 malformed values and 7 shell-injection payloads
rejected, across all three resolution paths (dispatch input, branch name, API
fallback). zizmor still reports 0 template-injection findings on this file.

Signed-off-by: Ahmed Jamil <197998703+CodeAhmedJamil@users.noreply.github.com>
@marblom007

Copy link
Copy Markdown
Contributor Author

Second round addressed in 2729c6d — SemVer gate now enforces the full grammar. Details in the thread.

@copilot review

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

Labels

area/ci Continuous integration | Build and release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants