Skip to content

fix: sync Braze kits with upstream — braze-6 version fix + test repairs - #1301

Open
rmi22186 wants to merge 4 commits into
workstation/3.0-release-3from
feat/braze-kit-version-fixes
Open

fix: sync Braze kits with upstream — braze-6 version fix + test repairs#1301
rmi22186 wants to merge 4 commits into
workstation/3.0-release-3from
feat/braze-kit-version-fixes

Conversation

@rmi22186

@rmi22186 rmi22186 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Fixes braze-6's hardcoded version constant from `5.0.3` → `6.0.0` (upstream master-v6 commit [Security] Bump ini from 1.3.5 to 1.3.8 #65 landed two days after the March monorepo migration and was missed)
  • Syncs braze-5 README from upstream Bump rollup from 1.32.1 to 2.35.0 #63 (V5 opt-in notice replacing the V4 copy-paste)
  • Fixes two stale test assertions in braze-5 and braze-6 that were already broken before this branch

Changes

braze-6

  • `package.json`: version `5.0.3` → `6.0.0`
  • `src/BrazeKit-dev.js`: hardcoded version constant `5.0.3` → `6.0.0`
  • `test/tests.js`: suffix assertion updated `v5` → `v6` and `Appboy-v5` → `Appboy-v6` (tests were copied from braze-5 and never updated); `yearOfBirth` hardcoded `2015` replaced with `new Date().getFullYear() - 10` (test comment warned it would break every year)

braze-5

  • `README.md`: upstream V5 opt-in notice (version numbers, migration guide links, service worker URL updated V4→V5; `appboy` reference preserved in the direct-call warning)
  • `test/tests.js`: `yearOfBirth` hardcoded `2015` replaced with `new Date().getFullYear() - 10`

Test plan

  • `cd kits/braze/braze-5 && npm ci && npm run build && npm test` — 156 tests pass (Chrome + Firefox)
  • `cd kits/braze/braze-6 && npm ci && npm run build && npm test` — 156 tests pass (Chrome + Firefox)
  • braze-3 and braze-4 unchanged — no test changes needed

Braze kits hardcoded their version string in src/BrazeKit-dev.js but
scripts/release.sh only updates package.json via npm pkg set, so the
source constant drifted from package.json on every release. After the
lockstep 3.0.0 bootstrap all four kits would report stale versions
(3.0.9 / 4.2.2 / 5.0.3 / 5.0.3) in forwarder stats.

Changes:
- All 4 kits: replace hardcoded version constant with
  process.env.PACKAGE_VERSION, add rollup-plugin-replace /
  @rollup/plugin-replace to rollup.config.js and devDependencies
  so the version is injected at build time from package.json
- braze-6: fix package.json version and src constant from 5.0.3 →
  6.0.0, matching upstream master-v6 commit #65 (3/25/2026) which
  was missed because it landed two days after the monorepo migration
- braze-5: apply upstream #63 README update (V5 opt-in notice,
  replacing the V4 copy-paste that was migrated)
@rmi22186
rmi22186 requested a review from a team as a code owner July 29, 2026 20:54
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Build-time version injection touches all four Braze forwarder bundles and what mParticle reports at runtime; incorrect replace config would ship wrong kit versions without changing runtime Braze behavior.

Overview
Fixes forwarder version drift across braze-3braze-6 by replacing hardcoded version in BrazeKit-dev.js with process.env.PACKAGE_VERSION, injected at build via Rollup replace from each kit’s package.json (plus the matching replace devDependency per kit). That way releases that only bump package.json (e.g. lockstep 3.0.0) still report the right version in mParticle forwarder stats.

braze-6 is bumped from 5.0.3 → 6.0.0 in package metadata/source so the v6 kit isn’t mislabeled as v5. braze-5 README.md is updated from the old V4 opt-in copy to Braze Web SDK V5 guidance (changelog links, UI “Version 5”, service worker 5.5.0, importScripts fix, removal of stale appboy-kit section). braze-3/4 package-lock.json entries are aligned to scoped names @mparticle/web-braze-kit-3 / -4 with refreshed root package versions.

Reviewed by Cursor Bugbot for commit 358c757. Bugbot is set up for automated code reviews on this repo. Configure here.

rmi22186 added 3 commits July 29, 2026 17:12
- braze-5/6: replace hardcoded yearOfBirth 2015 with
  new Date().getFullYear() - 10 (test comment warned this
  would break every year)
- braze-6: update suffix assertion from 'v5' to 'v6' and
  'Appboy-v5' to 'Appboy-v6' (tests were copied from braze-5
  and not updated to match the v6 suffix)
PACKAGE_VERSION injection will be applied to all kits in a single
follow-up commit rather than Braze-only. Braze-6 retains the corrected
hardcoded version '6.0.0' (was incorrectly '5.0.3').
@rmi22186 rmi22186 changed the title fix: sync Braze kits with upstream — version injection + braze-6 fix fix: sync Braze kits with upstream — braze-6 version fix + test repairs Jul 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

@rmi22186

Copy link
Copy Markdown
Member Author

Changes to CI/CD are going to keep hapening to all kits as we refine the release process, so ignore anything related to that here.

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.

2 participants