Automate SDK bump PRs, and fix the CODEOWNERS and CDN updater bugs - #101
Open
ritz078 wants to merge 3 commits into
Open
Automate SDK bump PRs, and fix the CODEOWNERS and CDN updater bugs#101ritz078 wants to merge 3 commits into
ritz078 wants to merge 3 commits into
Conversation
The CODEOWNERS file referenced @PSPDFKit/nickel, a team that does not exist, so no review was ever auto-requested. Point it at @PSPDFKit/web, which has write access to this repository. The CDN updater keyed its map on "gatsby" while the directory is "gatsbyjs", and omitted nuxtjs and the Salesforce README entirely. Those three files were left pinned at 1.8.0, 1.3.0 and 1.0.0 while every other example moved to 1.18.0. Correct the key, add the missing entries, and validate all paths before writing so a moved file fails the run instead of silently half-updating an example. Both scripts now take the target version as a required argument instead of resolving @latest at install time, so a release landing mid-run cannot produce a bump whose title and lockfiles disagree.
Adds a daily workflow that checks the npm latest dist-tag, bumps every example, and opens a pull request. @PSPDFKit/web is requested for review through CODEOWNERS rather than by the workflow, so no token needs permission to resolve org teams. Detection refuses to act twice on the same release: it exits when the repository is already on the version, when the branch exists, or when a pull request for it was opened before, so a bump closed without merging is not reopened on the next run. Prereleases are rejected outright, so nightly builds never trigger a bump. Biome and the e2e suite run inside the job before the pull request is opened. A pull request created with GITHUB_TOKEN does not trigger the Biome or Playwright workflows, and main requires no status checks, so a bump would otherwise arrive with nothing having verified it. A failing suite still opens the pull request, as a draft, with the report attached. pnpm is pinned to 10 because pnpm 11 stops reading the pnpm.overrides field in package.json, which would silently drop the security overrides added in #98.
ritz078
requested review from
a team,
MahmoudElsayad and
vladimir-tikhonov-nutrient
August 27, 2026 08:13
|
Don't trust to fix to others my privacy i am the real codeowner so please
don't trust anyone or someone or any devices
rocheel
…On Thu, Aug 27, 2026, 4:13 PM Ritesh Kumar ***@***.***> wrote:
What
Automates the Nutrient SDK version bump, and fixes three bugs found while
building it that were already affecting the repository.
*The automation.* A daily workflow checks the npm latest dist-tag, bumps
every example, and opens a PR. @PSPDFKit/web is requested for review
through
CODEOWNERS, so no token needs permission to resolve org teams. It can also
be
run on demand via workflow_dispatch, optionally against a specific
version.
Detection refuses to act twice on the same release: it exits when the repo
is
already on that version, when the branch exists, or when a PR for it was
opened
before, so a bump closed without merging is not reopened the next day.
Prereleases are rejected outright, so nightly builds never trigger a bump.
Biome and the e2e suite run *inside the job*, before the PR is opened. A
PR
created with GITHUB_TOKEN does not trigger the Biome or Playwright
workflows,
and main requires no status checks, so a bump would otherwise arrive with
nothing having verified it. A failing suite still opens the PR, as a
draft, with
the Playwright report attached.
*The bugs it uncovered.*
1.
.github/CODEOWNERS pointed at @PSPDFKit/nickel, which does not exist,
so
no review was ever auto-requested. GitHub's codeowners/errors API
reported
Unknown owner on line 2. Now @PSPDFKit/web, which has write access.
2.
update-nutrient-in-cdn.js keyed its map on gatsby while the directory
is
gatsbyjs, and omitted nuxtjs and the Salesforce README entirely. Those
three files sat at 1.8.0, 1.3.0 and 1.0.0 while every other example
moved to
1.18.0. The script now also validates all paths before writing, so a
moved
file fails the run instead of half-updating an example.
3.
Both update scripts resolved @latest at install time despite AGENTS.md
documenting a version argument. A release landing mid-run could
produce a
bump whose title and lockfiles disagreed. The version is now a required
argument.
pnpm is pinned to 10 in the workflow: pnpm 11 no longer reads the
pnpm.overrides field in package.json, which would silently drop the
security
overrides added in #98
<#98>.
Type
- New framework example
- Update existing example
- SDK version bump
- Bug fix
- Repo infrastructure (CI, scripts, docs)
Checklist
- npm run format passes (Biome) — biome ci ., 138 files, no fixes
- Example has start and start:e2e scripts — n/a, no new example
- SERVER_DIR=examples/<name> npm run test passes — n/a, no example
changed
- README.md included — n/a, no new example
- Uses current pinned @nutrient-sdk/viewer version — unchanged by this
PR
Verification
Detection was exercised against real repository state:
Scenario Result
Repo at 1.18.0, npm at 1.21.0 should_update=true
Explicit 1.18.0 (already current) false — already on 1.18.0
1.20.0, which has in-flight PR #100
<#100> false —
branch already exists
1.21.0-nightly.20260827 exits 1, refuses
The CDN fix was checked by running the updater across every example with a
sentinel version: all nine files updated, no stragglers. Removing a mapped
file
aborts the run leaving git status clean, confirming no partial write.
codeowners/errors reports 1 error on main and 0 on this branch.
Not yet exercised: a full end-to-end workflow run. Worth a
workflow_dispatch
after merge, before relying on the schedule.
Follow-ups, deliberately not in this PR
- examples/salesforce has a postinstall that rewrites the .page file
to npm
latest, ignoring the pinned version. Harmless today only because the
CDN
script runs after it.
- pnpm.overrides needs to move to pnpm-workspace.yaml before anyone
upgrades
to pnpm 11.
- The first automated bump will cross 1.18.0 → 1.21.0. Recommend
merging this
first, then letting the workflow open that bump as its own PR.
------------------------------
You can view, comment on, or merge this pull request online at:
#101
Commit Summary
- 030d6ef
<030d6ef>
Fix CODEOWNERS and make SDK version bumps explicit
- 835de78
<835de78>
Open a pull request automatically on each SDK release
File Changes
(6 files
<https://github.com/PSPDFKit/nutrient-web-examples/pull/101/files>)
- *M* .github/CODEOWNERS
<https://github.com/PSPDFKit/nutrient-web-examples/pull/101/files#diff-3d36a1bf06148bc6ba1ce2ed3d19de32ea708d955fed212c0d27c536f0bd4da7>
(2)
- *A* .github/workflows/update-nutrient-sdk.yml
<https://github.com/PSPDFKit/nutrient-web-examples/pull/101/files#diff-96781902728754210ed73341e233bdd1eb029f6b079d0876f4b42799b1bda225>
(140)
- *M* AGENTS.md
<https://github.com/PSPDFKit/nutrient-web-examples/pull/101/files#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9>
(9)
- *A* scripts/check-nutrient-update.sh
<https://github.com/PSPDFKit/nutrient-web-examples/pull/101/files#diff-36b0250e1d7d5d3f42e64086362dd467ac78dffd99e2bb514b82412752a5e2b0>
(56)
- *M* scripts/update-nutrient-in-cdn.js
<https://github.com/PSPDFKit/nutrient-web-examples/pull/101/files#diff-680cb0550fb5a87e3fd5bb0aff1b0a12ba844322ee543ad0e2197122227c1083>
(56)
- *M* scripts/update-nutrient-in-examples.sh
<https://github.com/PSPDFKit/nutrient-web-examples/pull/101/files#diff-7995d2fa6b7addac9f1ba5df5d974fe12660dcb6be58cb09faf279540f1dcb91>
(20)
Patch Links:
- https://github.com/PSPDFKit/nutrient-web-examples/pull/101.patch
- https://github.com/PSPDFKit/nutrient-web-examples/pull/101.diff
—
Reply to this email directly, view it on GitHub
<#101?email_source=notifications&email_token=CJZCP3A5GYPPLJVFU4FR5RL5L7US5A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DGNZTHE4DENBQGOTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CJZCP3HUEOBQSNOICZLAXXT5L7US5AVCNFSNUABFKJSXA33TNF2G64TZHM4TCOBRGIYTQOBTHNEXG43VMU5TKMRWGUZTSMBYGQ2KC5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CJZCP3DCHLJ7VWRUCAXELJD5L7US5A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DGNZTHE4DENBQGOTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVJTG633UMVZF62LPOM>
and Android
<https://github.com/notifications/mobile/android/CJZCP3BQH6KU2LHJOEPSVTD5L7US5A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DGNZTHE4DENBQGOTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
ritz078
removed request for
a team,
MahmoudElsayad and
vladimir-tikhonov-nutrient
August 27, 2026 08:32
ritz078
marked this pull request as draft
August 27, 2026 08:32
Refuse to reopen a closed bump, fail loudly when a run stops part-way, and reject a CDN map key or file that matches nothing. Exempt the salesforce README, whose version is an illustration rather than a pin.
ritz078
marked this pull request as ready for review
August 27, 2026 09:05
ritz078
enabled auto-merge (squash)
August 27, 2026 09:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⚡ TL;DR
A new
@nutrient-sdk/viewerrelease now opens its own bump PR, already formatted and e2e-tested, instead of waiting for someone to notice. Two silent bugs that let stale versions sit in the repo for months are fixed along the way.🎯 What this improves
@PSPDFKit/nickel, a team that does not exist, so GitHub silently requested nobody on every PR in this repo.examples/gatsbyjssat eight minor versions behind because of a one-character typo nothing was checking.🔧 What changed
npm run update-nutrient-version; the CDN updater keyed one example asgatsbywhile the directory isgatsbyjs, so that entry was never looked up and never updated; CODEOWNERS named a nonexistent team..github/workflows/update-nutrient-sdk.ymlruns daily (and onworkflow_dispatch, optionally against a given version).scripts/check-nutrient-update.shdecides whether to act and refuses to start a bump already in flight.update-nutrient-in-cdn.jsrejects a map key matching no directory, rejects a mapped file that is missing, and rejects a replace that matched nothing. A workflow-level grep then catches any example carrying a CDN tag that the map does not know about at all.🔍 Root cause
cdnOcurrencesis a hand-maintained map from example name to file list. A key that matches no directory is simply never looked up, so thegatsby/gatsbyjstypo produced no error, no warning, and no diff.examples/nuxtjshad a second variant of the same failure: it was absent from the map entirely./pspdfkit-web@([0-9]+.[0-9]+.[0-9]+)?/gmade the version group optional, so a file with no version still "matched", got rewritten byte-identical, and was reported as updated.@PSPDFKit/nickelreviewed nothing and said nothing.🤔 Why
examples/for CDN tags, removing the hand-maintained list entirely. Rejected for this PR: it trades a small include-list for an exclude-list (examples/salesforce/README.mddocuments the CDN URL with a worked@1.0.0example and must never be bumped), and it rewrites a script this PR is already changing. Worth doing separately.GITHUB_TOKENdoes not trigger the Biome or Playwright workflows, andmainrequires no status checks, so the bump would otherwise arrive with no signal at all.🧪 How to test
gatsbyjskey togatsbyand it now refuses to run:node scripts/update-nutrient-in-cdn.js webpack 9.9.9 # Keys matching no example directory: gatsbynpx @biomejs/biome@1.9.4 ci . ./scripts/check-biome-version.shgh pr createstep fails with a permissions error.nuxtjsis on 1.3.0 andgatsbyjson 1.8.0. This PR does not bump them; it makes the next scheduled run bump them and fail loudly if it cannot.examples/only:pnpm run formatwrites unsafe Biome fixes repository-wide, so the commit step usesgit add -u examples/and discards the rest.update-nutrient-in-examples.shstill hard-codes its 20 example directories. A new example is silently never bumped, which is the same class of drift this PR fixes in the CDN map. Left out because generalizing it changes which examples get bumped (wasm-benchmarkpins a range deliberately) and needs its own verification.