fix(plugin-cli): preserve profile extensions on publish#1920
Conversation
🦋 Changeset detectedLatest commit: 7292a25 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | 7292a25 | Jul 10 2026, 03:16 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-do | 7292a25 | Jul 10 2026, 03:17 PM |
3de643a
into
feat/delegated-release-service
There was a problem hiding this comment.
Review: LGTM
This PR fixes the right problem in the right place. After the profile record gained an extensions map for delegated-release policy and forward-compatible extension entries, the publish path's stampLastUpdated canonicaliser was re-emitting only the known scalar/profile fields and dropping extensions. The fix adds extensions to the explicit whitelist, preserving the map verbatim when a later release bumps lastUpdated.
What I checked
- Approach: The change is surgical:
stampLastUpdatednow carriesextensionsthrough on the applyWrites update path, matching the existingupdate-packagespread-preservation behavior. This keeps the canonicalising step that strips stray top-level keys from earlier experimental shapes, while protecting the intentionally-openextensionscontainer. - Lexicon match:
com.emdashcms.experimental.package.profiledefinesextensionsas optionalunknown, so preserving the keyed map passes both local and server-side validation. - Tests: The new publish test seeds a profile with both the delegated-release extension and an unknown forward-compatible extension, runs
publishReleasefor a later version, and asserts the map survives. The update-package test is likewise tightened to assert extensions survive an edit. Both tests exercise the actualMockPdsapplyWrites/putRecord paths. - Changeset: A patch changeset is present for
@emdash-cms/plugin-cliand describes the user-visible fix. - AGENTS.md concerns: No admin UI strings, no SQL, no route/auth/locale changes. Formatting uses tabs and the diff stays scoped to the publish/update-package boundary.
The implementation is correct and the regression coverage is appropriate. No blocking issues.
What does this PR do?
Fixes subsequent
emdash-plugin publishcalls dropping existing package-profile extensions while bumpinglastUpdated.The publish path now retains the valid keyed extensions map, including the delegated-release policy extension and unknown forward-compatible extension entries.
update-packagealready preserved this data; its regression coverage now makes that guarantee explicit.Related to #1908 and #1918.
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain.i18n and a new Discussion are not applicable: no admin UI is changed, and this fixes data loss introduced by the newly merged record extension contract.
AI-generated code disclosure
Screenshots / test output
pnpm buildpasses with existing virtual-import and deliberate test-pluginevalwarningspnpm --filter @emdash-cms/plugin-cli typecheckpassespnpm lintpasses with 0 warnings/errorsgit diff --checkpass