@mparticle/web-sdk 3.29.0 → 3.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -144,14 +144,32 @@ This package comes with the NPM package [pre-commit](https://www.npmjs.com/packa
144
144
 
145
145
  ## Three-step release process (maintainers)
146
146
 
147
- Releases have separate v2 and v3 tracks. In GitHub Actions, choose the
148
- track-specific branch from the **Use workflow from** dropdown and run these
149
- workflows in order:
150
-
151
- 1. **Staging Release - Step 1: Prepare CDN Pre-Release, Publish NPM**
152
- (`staging-step-1.yml`): select `staging` for `track=v2`, or `v3-staging` for
153
- `track=v3`. This workflow builds and tests the track, creates and merges a
154
- generated release branch, runs semantic-release, and publishes the npm
147
+ V2 and V3 release with separate workflows: `staging-step-1.yml`,
148
+ `staging-step-2.yml` and `staging-step-3.yml` for v2, and
149
+ `v3-release-step-1.yml`, `v3-release-step-2.yml` and `v3-release-step-3.yml`
150
+ for v3.
151
+
152
+ During the switch to the V3 files, `staging-step-1.yml` keeps its `v3` track
153
+ and kit recovery. The first V3 release after the split still runs it from
154
+ `v3-staging` with `track=v3`, because `v3-release-step-1.yml` reaches `main`
155
+ only at that release's Step 3. If that release's kit publishing fails, resume
156
+ it with **Staging Release - Step 1** from `v3-staging` (`track=v3`,
157
+ `dryRun=false`, `resumeKitReleaseTag`). The same release runs Steps 2 and 3
158
+ with **Staging Release - Step 2** and **Staging Release - Step 3** from `main`,
159
+ because `v3-release-step-2.yml` and `v3-release-step-3.yml` also reach `main`
160
+ only at its Step 3. Once a V3 release has run on
161
+ `v3-release-step-1.yml`, a follow-up removes the `v3` track from
162
+ `staging-step-1.yml`. V2 runs the copies on `staging` and `master`, which this
163
+ split does not change.
164
+
165
+ In GitHub Actions, choose the version's branch from the **Use workflow
166
+ from** dropdown and run its workflows in order:
167
+
168
+ 1. **Step 1: Prepare CDN Pre-Release, Publish NPM**: run
169
+ **Staging Release - Step 1** (`staging-step-1.yml`) from `staging` with
170
+ `track=v2`, or **V3 Release - Step 1** (`v3-release-step-1.yml`) from
171
+ `v3-staging`. This workflow builds and tests the version, creates and
172
+ merges a generated release branch, runs semantic-release, and publishes the npm
155
173
  release. Before a new v3 release can advance, every existing kit `next` tag
156
174
  must match the core SDK's current `next` version. The one-time `3.0.0`
157
175
  bootstrap permits all kit tags to be absent so the first synchronized release
@@ -172,26 +190,27 @@ workflows in order:
172
190
  identical. `dryRun=true` previews the merge and semantic-release result
173
191
  without creating a branch or publishing; `dryRun=false` creates/pushes the
174
192
  release branch and publishes. If core publishes but kit publication cannot
175
- finish, rerun Step 1 from `v3-staging` with `track=v3`, `dryRun=false`, and
193
+ finish, rerun V3 Release - Step 1 from `v3-staging` with `dryRun=false` and
176
194
  `resumeKitReleaseTag` set to the exact Step 1 tag. Recovery validates that
177
195
  immutable tag and resumes kits without republishing core.
178
- 2. **Staging Release - Step 2: Publish SDK Release to Release Order Branch**
179
- (`staging-step-2.yml`, optional): select `master` for v2 or `main` for v3.
180
- Every run, dry runs included, rejects a `v2.x` tag dispatched from anything
181
- but `master` and a `v3.x` tag from anything but `main`. For `releaseTag`,
182
- enter the exact Git tag created by the successful Step 1 run (for example,
183
- `v2.80.0` or `v3.0.1`). Choose
196
+ 2. **Step 2: Publish SDK Release to Release Order Branch** (optional): run
197
+ **Staging Release - Step 2** (`staging-step-2.yml`) from `master` for v2, or
198
+ **V3 Release - Step 2** (`v3-release-step-2.yml`) from `main` for v3. Every
199
+ run, dry runs included, rejects the other version's tag and a dispatch from
200
+ any other branch. For `releaseTag`, enter the exact Git tag created by the
201
+ successful Step 1 run (for example, `v2.80.0` or `v3.0.1`). Choose
184
202
  `release-order-a`, `-b`, or `-c` as `releaseOrderBranch`. For v3, that
185
203
  logical choice maps to the corresponding `v3-release-order-*` branch.
186
204
  `dryRun=true` validates the exact candidate and fast-forward without
187
205
  pushing; `dryRun=false` promotes it.
188
- 3. **Staging Release - Step 3: Release to CDN and Synchronize Branches**
189
- (`staging-step-3.yml`): select `master` for v2 or `main` for v3, with the
190
- same per-track rule as Step 2. For `releaseTag`, enter the same exact Git
206
+ 3. **Step 3: Release to CDN and Synchronize Branches**: run
207
+ **Staging Release - Step 3** (`staging-step-3.yml`) from `master` for v2, or
208
+ **V3 Release - Step 3** (`v3-release-step-3.yml`) from `main` for v3, with
209
+ the same rule as Step 2. For `releaseTag`, enter the same exact Git
191
210
  tag created by the successful Step 1 run. The workflow verifies that the tag
192
- matches `package.json`, resolves to the current track staging head, and can
211
+ matches `package.json`, resolves to the version's current staging head, and can
193
212
  fast-forward every destination. It then uses one atomic push to synchronize
194
- the track's development branch, trunk (`master` or `main`), and all three
213
+ the version's development branch, trunk (`master` or `main`), and all three
195
214
  release-order branches; either every ref updates or none does. `dryRun=true`
196
215
  performs all validation without pushing. `dryRun=false` performs the atomic
197
216
  synchronization and releases the candidate to those destinations.
@@ -201,14 +220,75 @@ copy its release tag; optionally preview and run Step 2 for each needed
201
220
  release-order branch; finally run Step 3 with `dryRun=true`, then
202
221
  `dryRun=false`.
203
222
 
204
- Shadow v3 candidate packaging: when the `V3_PACKAGE_CANDIDATE` repository
205
- variable is `true`, a real `track=v3` Step 1 run also runs **Package V3
206
- candidate (shadow)** after the release. It packages the release tag's committed
207
- bundles into a `v3-candidate-<run id>-<run attempt>` artifact, kept for 7 days.
208
- It never runs for v2 or dry runs, has read-only access, and its failure does
209
- not fail the Step 1 run. It does keep the Step 1 run open until it finishes,
210
- so wait for the whole run to finish before starting Step 2 or Step 3. To turn
211
- it off, delete the variable or set it to anything other than `true`.
223
+ V3 candidate packaging, upload, and staging: a real **V3 Release - Step 1**
224
+ (`v3-release-step-1.yml`, `dryRun=false`) runs **Package V3 candidate
225
+ (shadow)** after the release to package the release tag's committed bundles
226
+ into a `v3-candidate-<run id>-<run attempt>` artifact (kept for 7 days). Once
227
+ **Publish V3 kits** and **Audit V3 kits on npm** have also succeeded, it runs
228
+ **Upload and stage V3 candidate**, which dispatches **V3 shadow
229
+ release: upload candidate** (`v3-shadow-candidate.yml`) on `main` with
230
+ `release_gate=true` and waits up to 120 minutes (the child jobs' 110-minute
231
+ ceiling plus 10 minutes of queue time, inside a 130-minute job timeout) for it
232
+ to succeed. A failed read of the child run's status (a 5xx or rate-limit reply)
233
+ is retried until that deadline. If the job fails, times out or is cancelled
234
+ before the child run completes, it cancels the child run. A refused cancel (a
235
+ 5xx or rate-limit reply) is retried with a doubling backoff (6 tries, 5 seconds
236
+ apart at first) until GitHub accepts it or the child run reads completed, first
237
+ by the wait step and then by the cleanup step. Release-gate dispatches for one
238
+ Step 1 run share one concurrency group (`v3-shadow-candidate-gate-STEP1_RUN_ID`),
239
+ so a re-run's child queues behind a leftover child instead of staging the same
240
+ build in parallel with it. A newer gate dispatch for the same Step 1 run takes
241
+ the group's single pending slot from an older pending one, which then fails its
242
+ own Step 1 wait. A manual dispatch with `release_gate=false` or a transition
243
+ `workflow_run` runs in another group, so it cannot displace a pending gate run.
244
+
245
+ If the dispatch request succeeds but its reply is lost or carries no
246
+ `workflow_run_id`, the job fails with no child run ID, so nothing cancels that
247
+ child. Before re-running Step 1, open the **V3 shadow release: upload
248
+ candidate** runs, find any run dispatched after the failed Step 1 run started,
249
+ and cancel it if it is still running. If it is missed, the shared concurrency
250
+ group still makes the re-run's child wait for it to finish.
251
+
252
+ Release-gate mode accepts both an in-progress `v3-release-step-1.yml`
253
+ parent run and one that has already
254
+ completed without being cancelled (so a maintainer can also dispatch
255
+ `v3-shadow-candidate.yml` manually with `release_gate=true` for repair after
256
+ Step 1 finishes), provided **Perform Release** and **Package V3 candidate
257
+ (shadow)** succeeded and one unexpired candidate artifact exists. Release-gate
258
+ mode also requires npm parity to pass: every package must be on npm with the
259
+ candidate's integrity. **Audit V3 kits on npm** only warns about a kit npm does
260
+ not show yet, and npm can take minutes to show a version it has accepted. So
261
+ while npm parity reads pending (a version npm does not show yet) or unavailable
262
+ (an `npm view` error or an unexpected reply), the candidate workflow reads npm
263
+ again with a doubling backoff (15 seconds at first, at most 2 minutes apart)
264
+ for up to 10 minutes, with a last read when the 10 minutes run out. A fail
265
+ reading (a published package with another integrity) fails the gate at once,
266
+ and a read stops at the first package that differs. A package still pending
267
+ or unavailable after the last read fails the gate instead of uploading. Each
268
+ `npm view` gets at most 30 seconds, and each read of every package at most 2
269
+ minutes. A package the read has no time left for reads unavailable. If `sleep`
270
+ fails between reads, the check fails instead of reading npm again at once. A
271
+ transition `workflow_run`, or a manual dispatch with `release_gate=false`,
272
+ reads npm once. The **Check the candidate against the release** job's
273
+ 25-minute timeout covers the 10 minutes, a last read of at most 2 minutes and
274
+ its other checks.
275
+ A failure in packaging, candidate verification, S3
276
+ upload, or `v3-staging` pointer staging fails the Step 1 release. In
277
+ release-gate mode, `V3_SHADOW_PODS` must include all five production pods
278
+ (`us1`, `us2`, `st1`, `eu1`, `au1`); `qa` is optional (if `qa` is listed in
279
+ `V3_SHADOW_PODS`, it runs in the same matrix and blocks the release on failure;
280
+ if `qa` is omitted from `V3_SHADOW_PODS`, only the five
281
+ production pods block the release and `qa` can run separately). Stage moves each
282
+ pod's `v3-staging` pointer independently in parallel, so if one pod fails, the
283
+ other pods have already moved to the new candidate; re-running failed jobs on
284
+ Step 1 (within the 7-day artifact window) re-runs **Upload and stage V3
285
+ candidate**, dispatches the candidate workflow again, and repairs the remaining
286
+ pods so every pod converges (`resumeKitReleaseTag` skips packaging and upload
287
+ as before). During the transition before a V3 release's Step 3 brings these
288
+ workflow updates to `main`, the shared **Staging Release - Step 1**
289
+ (`staging-step-1.yml`, `track=v3`) still uses the `V3_PACKAGE_CANDIDATE`
290
+ repository variable and the `workflow_run` trigger on `main`, so
291
+ `V3_PACKAGE_CANDIDATE` stays `true` until that transition release finishes.
212
292
 
213
293
  ### Recover an incomplete v3 kit publication
214
294
 
@@ -219,11 +299,20 @@ A real v3 Step 1 run can publish core and create the GitHub Release before all
219
299
  2. Copy the exact release tag from the failed Step 1 run.
220
300
  3. Use the failed job and its npm kit publish summary to identify any
221
301
  missing or rejected kits. Correct their npm or trusted-publisher configuration.
222
- 4. Dispatch **Staging Release - Step 1** from `v3-staging` with `track=v3`,
223
- `dryRun=false`, and `resumeKitReleaseTag` set to the failed run's exact tag.
302
+ 4. Dispatch **V3 Release - Step 1** from `v3-staging` with `dryRun=false`
303
+ and `resumeKitReleaseTag` set to the failed run's exact tag. If `main` has
304
+ no `v3-release-step-1.yml` yet (the first V3 release after the split),
305
+ dispatch **Staging Release - Step 1** from `v3-staging` with `track=v3`
306
+ and the same two inputs instead.
224
307
  5. Wait for recovery to verify core and all 33 kits at that version on `next`.
225
308
  Existing byte-identical packages are skipped and only missing kits publish.
226
- 6. Continue to Step 2 or Step 3 only after the recovery run is green.
309
+ 6. If the failed run was **V3 Release - Step 1**, it did not upload or stage
310
+ its candidate, because that job waits for the kits. Dispatch **V3 shadow
311
+ release: upload candidate** (`v3-shadow-candidate.yml`) on `main` with
312
+ `step1_run_id` set to the failed run's ID and `release_gate=true`, within
313
+ the candidate's 7 days.
314
+ 7. Continue to Step 2 or Step 3 only after the recovery run and the candidate
315
+ upload are green.
227
316
 
228
317
  If recovery reports that the tagged core version is missing from npm, stop the
229
318
  kit recovery. Semantic-release may have pushed the generated staging commit and
@@ -243,14 +332,23 @@ If core's `next` tag changes without a corresponding Step 1 Git tag, do not use
243
332
  the bootstrap exception or guess a recovery tag. Stop releases and reconcile
244
333
  the unexpected npm and Git state before continuing.
245
334
 
246
- Each track's trunk owns its own copy of the release workflows: `master` for v2
247
- and `main` for v3. The copies may differ, so a change to one track's release
248
- steps does not need a twin on the other trunk. Steps 2 and 3 run from the
249
- dispatching trunk, and the per-track rule above keeps each track on its own
250
- trunk's copy. GitHub executes Step 1 from the branch selected in the **Use
251
- workflow from** dropdown, so every `dryRun=false` Step 1 run rejects the
252
- release unless `staging-step-1.yml` on the staging branch is identical to its
253
- trunk's copy: `staging` to `master`, and `v3-staging` to `main`.
335
+ Each version's trunk owns its own copy of its release workflows: `master` for
336
+ v2 and `main` for v3. A change to one version's release steps does not need a
337
+ twin on the other trunk. Steps 2 and 3 run from the dispatching trunk, and the
338
+ rule above keeps each version on its own trunk's copy. GitHub executes Step 1
339
+ from the branch selected in the **Use workflow from** dropdown, so every
340
+ `dryRun=false` Step 1 run rejects the release unless its workflow on the
341
+ staging branch is identical to its trunk's copy: `staging-step-1.yml` on
342
+ `staging` to `master`'s, and `v3-release-step-1.yml` on `v3-staging` to
343
+ `main`'s. During the switch to the V3 files, a `track=v3` run of
344
+ `staging-step-1.yml` from `v3-staging` must match `main`'s copy instead.
345
+
346
+ npm trusted publishing names the workflow file that publishes each package:
347
+ `staging-step-1.yml` publishes v2 of `@mparticle/web-sdk`, and
348
+ `v3-release-step-1.yml` publishes v3 of `@mparticle/web-sdk` and every kit in
349
+ `kits/publish-matrix.json`. Until a V3 release has run on
350
+ `v3-release-step-1.yml`, each of those packages keeps `staging-step-1.yml` as a
351
+ trusted publisher too, so the first V3 release after the split can publish.
254
352
 
255
353
  ## Support
256
354