Skip to content

release: v4.5.3 (sync main into develop_v4) - #658

Merged
karancs06 merged 15 commits into
develop_v4from
sync-stage-v4-develop-v4
Sep 29, 2026
Merged

karancs06 merged 15 commits into
develop_v4from
sync-stage-v4-develop-v4

Conversation

@karancs06

@karancs06 karancs06 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Live Preview SDK v4.5.3

Summary

Fixes an unhandled promise rejection in the Visual Builder discussion-highlights messaging, and brings the v4.5.2 release commits from main back into develop_v4 so all branches line up again. This PR carries the v4.5.3 version bump; it promotes through develop_v4, then stage_v4 (#653), then a final stage_v4 to main PR.

What's changed

Fixes

  • Discussion-highlight events no longer raise an unhandled promise rejection when the Visual Builder side has no listener mounted for them (fix(visual-builder): handle rejection when discussion highlights has no listener #652). The new ignoreMissingListener helper in src/visualBuilder/utils/postMessageErrors.ts swallows the library's missing-listener rejection and logs a console warning for any other send failure. Both send sites use it: useVariantsPostMessageEvent and useRecalculateVariantDataCSLPValues.

Tests

  • New specs cover the error helper and both send sites, including the split between an ignored missing listener and a warned real failure.

Synced from main (v4.5.2 release)

  • Release workflow fixes from fix(release): restore build before publish and the alpha dist-tag #650: the package builds on prepack so dist ships in the published tarball, prereleases publish under the alpha dist-tag, and the retired alpha-publish workflow file is removed.
  • CI: vitest-coverage-report-action pinned to a commit sha.
  • CHANGELOG restored to the released history from main.

Chores

  • Version bump to 4.5.3; CHANGELOG regenerated via auto-changelog (the pending fix now has its own v4.5.3 section).
  • README CDN snippet pinned to @contentstack/live-preview-utils@4.5.3.

Release path

  • Merge this PR into develop_v4
  • Merge release: v4.5.3 (Develop v4 -> stage v4) #653 (develop_v4 to stage_v4)
  • Open and merge the stage_v4 to main PR
  • Create GitHub Release v4.5.3 from main (tag created via the Release UI), which triggers the npm-publish workflow
  • Verify @contentstack/live-preview-utils@4.5.3 on npm and that https://esm.sh/@contentstack/live-preview-utils@4.5.3 resolves

🤖 Generated with Claude Code

kirtesh-cstk and others added 13 commits September 11, 2026 14:44
v4.5.1 was published with only package.json, README.md and LICENSE. The
package has no JS in it, so every consumer build fails on import while
main, module, types and exports all point into dist/.

The publish workflow dropped its `npm run build` step when it was
rewritten on 15 Sept. Nothing else builds before publish: there is no
prepack or prepublishOnly script, and with no `files` field npm falls
back to .gitignore, which excludes dist. No build means an empty package.

Hooking the build to prepack fixes it for every publish path rather than
just the one workflow, so a later workflow edit cannot silently drop it
again. A failing build now fails the publish instead of shipping nothing.

Co-Authored-By: Claude <noreply@anthropic.com>
When npm-alpha-publish.yml was folded into this workflow the publish-alpha
job came out identical to publish, losing the `--tag alpha` the old
workflow had. An alpha release would move the `latest` dist-tag to the
prerelease and hand it to every consumer on a caret range.

This also restores the alpha channel as a rehearsal for a real publish:
cut a prerelease, install it, confirm it resolves, then cut the release,
all without touching `latest`.

Co-Authored-By: Claude <noreply@anthropic.com>
A version tag is mutable, so the action owner or anyone who compromises
that account can change what runs in CI without the ref changing here.
Pinning to the commit sha behind v2.13.0 keeps the same code and removes
that path.

Co-Authored-By: Claude <noreply@anthropic.com>
…-publish

fix(release): restore build before publish and the alpha dist-tag
Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 05:20
@karancs06
karancs06 requested review from a team as code owners September 29, 2026 05:20
@snyk-io

snyk-io Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

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 review overview

🟡 Changes recommended

Alpha tags such as v4.5.2-alpha.0 currently enter the regular publish job and can move npm’s latest tag.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Syncs the v4.5.2 release changes from main into develop_v4.

Changes:

  • Updates README and changelog for v4.5.2.
  • Restores package builds during publishing.
  • Consolidates alpha publishing and pins the coverage action.
File Description
README.md Pins the CDN example to v4.5.2.
package.json Builds distribution files during prepack.
CHANGELOG.md Restores released history and formatting.
.github/​workflows/​unit-test.yml Pins the coverage action SHA.
.github/​workflows/​npm-publish.yml Consolidates release and alpha publishing.
.github/​workflows/​npm-alpha-publish.yml Removes the retired standalone alpha workflow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/npm-publish.yml
kirtesh-cstk
kirtesh-cstk previously approved these changes Sep 29, 2026

@kirtesh-cstk kirtesh-cstk 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.

LGTM

@hitesh-shetty-cstk hitesh-shetty-cstk 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.

Automated review

Critical journey at risk: the release and publish path for @contentstack/live-preview-utils. As the merged workflow stands, cutting a prerelease moves npm's latest dist-tag onto it, so anyone installing the package or upgrading on a caret range picks up a prerelease build.

What this changes: This is a merge of main into develop_v4 after v4.5.2 shipped through a release branch. No source files move. What lands is the README CDN pin at 4.5.2, a CHANGELOG.md reset to the released history from main, the coverage action pinned to a commit sha, prepack added so dist is built into the published tarball, and the v4.5.2 release-workflow rewrite, which folds alpha publishing into npm-publish.yml and deletes the standalone alpha workflow. The changelog entries for the pending discussion-highlights fix are removed here, but the version script runs auto-changelog -p, which rebuilds the file from git history, so those entries return at the next release.

The release-workflow rewrite is not new code, but it is new to this branch and this is the first review it gets on develop_v4. Two parts of it are already proven in production: dropping NODE_AUTH_TOKEN in favour of OIDC trusted publishing shipped both v4.5.1 and v4.5.2 from main. The alpha split has never run, because no alpha release exists.

Business impact: A prerelease published under latest reaches every consumer on a caret range on their next install, with no action on their part. The failure is silent at publish time: the workflow succeeds, the package appears on npm, and the dist-tag is simply pointing at the wrong build.

Security: Nothing beyond what the scanners cover in the dependency or code-scanning sense, and Snyk is clean on this head. One supply-chain note the scanners do not reach: both publish jobs run an unpinned npm install -g npm@latest inside a job that holds id-token: write and signs the published artifact. Flagged inline as should-fix.

Flow

flowchart TD
    R[GitHub Release published] --> G{"endsWith(release.name, '-alpha')"}:::changed
    G -->|false| P[publish job]:::changed
    G -->|true| A[publish-alpha job]:::changed
    P --> PL["npm publish --provenance, dist-tag latest"]
    A --> AL["npm publish --tag alpha, dist-tag alpha"]
    N["prerelease named v4.6.0-alpha.0"] --> G
    N -.->|name has a numeric suffix, so the guard passes| P
    X[removed: push to alpha branch or tag]:::changed -.->|no longer a trigger| A
    classDef changed fill:#fff3cd,stroke:#d39e00
Loading

Findings: 2 blocker, 2 should fix, 0 nit. All four are inline, and all four are on the release workflow. The blocker overlaps with what Copilot reported on this head; the inline comment adds the concrete release name that triggers it and a fix that does not depend on parsing the tag.

Reviewer candidates:

  • @Aravind-Kumar-cstk authored the September rewrite of npm-publish.yml that moved it to OIDC trusted publishing, which is the file carrying both blockers.
  • @Deepak-Kharah authored every prior commit to npm-publish.yml on the base branch, including the current publishing setup.

@kirtesh-cstk authored the commit that added the publish-alpha job being ported here and knows the intent behind it best. That review is already in, so this is not a request, but the blocker is specifically about whether that job can ever fire, and it would be worth a word before merge.

Not covered: The workflow was not run. A release event cannot be exercised without cutting a real release, so the alpha path is analysed from the expression and the repo's release-naming history rather than observed. Nothing was verified on the npm registry side, including which npm version the package's trusted-publishing configuration requires. No build or test run.

Automated review by Claude Code. A human review is still required.


Generated by Claude Code

Comment thread .github/workflows/npm-publish.yml
Comment thread .github/workflows/npm-publish.yml
Comment thread .github/workflows/npm-publish.yml
Comment thread .github/workflows/npm-alpha-publish.yml
karancs06 and others added 2 commits September 29, 2026 10:55
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 29, 2026 05:26
@karancs06 karancs06 changed the title Sync main into develop_v4 after the v4.5.2 release release: v4.5.3 (sync main into develop_v4) Sep 29, 2026
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68.26% 2564 / 3756
🔵 Statements 67.12% 2605 / 3881
🔵 Functions 65.66% 461 / 702
🔵 Branches 62.58% 1547 / 2472
File CoverageNo changed files found.
Generated in workflow #925 for commit 697a526 by the Vitest Coverage Report Action

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 review overview

🔵 Needs a closer look

Alpha releases can incorrectly execute the stable publish job and move npm’s latest tag.

Review effort: Balanced
Findings: 1 High severity

Open (1)

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

LGTM

@kirtesh-cstk kirtesh-cstk 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.

LGTM

@karancs06
karancs06 merged commit a220c07 into develop_v4 Sep 29, 2026
11 checks passed
@karancs06
karancs06 deleted the sync-stage-v4-develop-v4 branch September 29, 2026 06:16
This was referenced Sep 29, 2026
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.

7 participants