Repository navigation
fix: consolidate branch identity into name - #19284
Merged
DanRibbens merged 10 commits intoNov 11, 2026
Merged
DanRibbens merged 10 commits into
DanRibbens merged 10 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 1
Please check the settings in the CodeRabbit UI or the
|
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
DanRibbens
force-pushed
the
fix/branch-name-only-19112
branch
from
November 4, 2026 18:23
87c26ee to
e815f13
Compare
DanRibbens
marked this pull request as ready for review
November 4, 2026 18:40
Written with AI ## Description Anonymous visits such as `/admin/categories?branch=Test` could throw Forbidden during admin initialization before reaching login or first-user setup. Initialize anonymous admin requests on `main` so the existing authentication redirects and views can run. Stacked on #19284; targets `fix/branch-name-only-19112` to isolate this fix. ## Changes - Resolve branch access after user read-access validation, falling back to `main` for anonymous requests. - Preserve branch permission enforcement for authenticated requests. - Add regression coverage for anonymous admin and authentication routes and failed user read access. ## Test Plan - Passed 35 unit tests across `initAdminContext`, `getRequestBranch`, and `handleAuthRedirect`. - Formatting and diff checks pass. Lint reports one existing context naming warning. - Browser verification remains outstanding; localhost:3000 was not running. - Accessibility assessment considered WCAG 2.4.3 (A, focus order) and 3.3.8 (AA, accessible authentication). Rendered focus and screen-reader verification remain outstanding.
Written with AI ## Description The canonical-document browser test could click a stale main-branch list row after the URL changed but before the selected branch finished rendering. Wait for the branch document's title before opening its edit view. Based on #19284 (`fix/branch-name-only-19112`). The URL encoding assertion fix and build-safe changed-document link expression are already in that base; this PR contains only the list-readiness assertion. ## Test Plan - Reproduced the stale-list failure before adding the content-readiness assertion. - The five targeted TanStack Start browser cases passed during development: four unsaved-change branch switches and the canonical-document edit test. - `pnpm run build:all` passes on the rebased branch under Node 24.22.1. - Diff checks pass.
Written with AI ## Description Opening an autosaved collection create page can render only the admin header after a document's slug was changed in a draft. The latest draft no longer contains the original slug, but the stored collection row still reserves it in its unique index. Slug generation previously checked only the latest draft, reused the reserved fallback, and caused the server document renderer to swallow a uniqueness error. Check stored collection rows as well as latest drafts when determining whether a unique value is available. The checks retain branch, locale, access, trash, transaction isolation, and current-document exclusion behavior. Based on and targeting #19284 (`fix/branch-name-only-19112`). ## Changes - Check both stored values and draft values before generating or accepting a unique slug. - Match the reported localized native-slug setup in the branching draft fixture. - Add integration regressions and browser coverage on main and a named branch, including regular and autosaved create forms. ## Test Plan - Reproduced the same `slug` uniqueness error and blank create page before the fix on both main and a named branch. - SQLite unique-slug draft integration suite: 9 passed, 1 MongoDB-only test skipped. - MongoDB unique-slug draft integration suite: 10 passed. - Isolated SQLite browser create-form regressions: 8 passed. - Core TypeScript check passed after building the translations declaration dependency. - Changed-file formatting, lint, and diff checks passed; lint reports existing warnings elsewhere in the browser spec. - Browser assertions verify visible, editable, named title inputs (limited WCAG 1.3.1, 3.3.2, and 4.1.2 evidence). No markup, styling, or keyboard interaction code changes. Manual visual and assistive-technology verification was not performed. Checks ran under Node 22.23.1; the repository declares Node >=24.22.1.
Written with AI ## Description Merging a draft post with untranslated French and German fields fails with six validation errors: `title`, `content`, and `slug` are each `null` in both locales. The merge precheck applies published-field requirements even though normal draft saves allow incomplete content. Make the default merge precheck respect draft validation settings for collections and globals. This PR targets `fix/branch-name-only-19112` and is stacked on #19284. ## Changes - Validate incomplete drafts as partial data, omitting null field values from a validation-only copy while preserving them in the actual merge write. - Handle nested groups, tabs, arrays, and blocks without relaxing validation of malformed nonempty values or entities with `drafts.validate: true`. - Add regression coverage for untranslated drafts, global drafts, clearing required draft fields without changing published content, and strict validation. ## Test Plan - Reproduced the six reported errors against an isolated copy of the demo SQLite database; the fixed validator returns no validation errors. - SQLite integration coverage: 22 passed, 2 skipped across draft validation, merge validation, draft merges, and nested docs merges. - MongoDB integration coverage: 24 passed across the same suites. - Core Payload TypeScript check passed. - `pnpm lint` passed. - `pnpm build` passed. - Formatting and diff checks passed. Validation used Node 24.22.1. Existing lint/build warnings remain.
This was referenced Nov 4, 2026
Written with AI ## Description A branch draft can save incomplete or wrongly typed JSON while `drafts.validate` is disabled, but merge preflight rejects that same saved content. Make the default preflight follow the target write's draft-validation setting instead of applying stricter input-schema validation during merge. Published locales still receive structural checks, even when another locale makes the overall write a draft. Validate stored collection content as update data because merge promotes existing branch rows through update operations; this also avoids rejecting published rich text for missing create-input properties that ordinary publishing accepted. Targets `fix/branch-name-only-19112` (#19284). Custom merge validators, ordinary write validation, hooks, access control, dependencies, and database constraints still apply. ## Changes - Skip default structural validation for draft candidates when ordinary draft validation is disabled, respecting each locale's `_status`. - Check promoted collection rows as partial update data and remove the validation-only null-stripping workaround. - Cover saved collection/global draft JSON, draft edits over published content, explicit draft validation, and published candidates. - Verify two branch-created English publications leave untranslated locales as drafts, and an existing document preserves published English alongside an incomplete French draft. - Strengthen the mixed-locale global regression to assert publication statuses and preservation of existing published Spanish content. - Match the supplied test project's nonlocalized slug configuration in the draft-validation fixture. ## Test Plan - Reproduced successful draft saves followed by rejected merge previews before the fix. - Draft-validation, merge-validation, merge-access, and dependency-preflight integration coverage passed on SQLite and MongoDB. - Six focused published/mixed-locale checks passed on each database. - Core Payload TypeScript check passed. - Targeted lint passed with an existing unused-variable warning in the global test file; formatting and diff checks passed. Separate merge-execution defects found during broader testing remain outside this PR: later non-default-locale edits can be lost when merging branch-created drafts, and global merges can materialize fallback content in untranslated locales.
Written with AI ## Description When a content branch merge fails, show which document and field need fixing alongside the existing error message: `Unique Doc / #4 / slug: Value must be unique` Preserve collection/global, document ID, optional locale, and field-path context through both streamed and HTTP merge failures. Keep the error visible in the merge dialog so the user can close it, correct the document, and retry. Targets the branch behind #19284. Shared Zod validation, validation acceptance rules, and Lexical/MCP tests are unchanged. Schema-message localization and configured field-label resolution are deferred to [PYLD-5204](https://linear.app/figma/issue/PYLD-5204/localize-shared-schema-validation-errors-using-the-request-language) and draft #19486; they do not block this PR. ## Changes - Retain structured write-time field errors and the available source document context, avoiding incorrect attribution of nested-operation errors. - Render the configured collection/global label, document ID, optional locale, and existing field path before the original error message. No field-label resolution is added. - Keep validation and write failures in the dialog, without reporting a completed or empty merge. Unexpected private errors remain generic in client responses. - Exercise real uniqueness failures through integration tests and a browser regression. Consolidate mocked endpoint error cases into branching integration suites that run across the database matrix; retain the focused stream-cancellation unit test. Remove the custom editorial-validation fixture. Uniqueness conflicts are still detected during the actual write; adding preview-time uniqueness checks is separate work. ## Test Plan All checks below ran without #19486: - Merge endpoint cancellation unit test: 1 passed. The eight added mocked endpoint cases are consolidated into integration coverage. - Chromium merge-dialog component tests: 12 passed, including the exact `Unique Doc / #4 / slug: Value must be unique` presentation. - Merge write-error integration suite: 10 passed per adapter on MongoDB, PostgreSQL, and SQLite (30 total), covering real uniqueness failures, source/change IDs, locale preservation and request-language messages, unexpected private errors with debug enabled, and nested-operation attribution for HTTP and streaming responses. The suite uses `db: all` for the CI adapter matrix. - Branching REST integration suite: 13 passed per adapter on MongoDB, PostgreSQL, and SQLite (39 total), including public access-error messages and status codes. - SQLite/Chromium e2e: the real uniqueness conflict displays document/field context, remains dismissible, and leaves the pending change available (1 passed). Used the repository’s `--no-turbo` Webpack option because Turbopack cannot resolve dependencies linked outside this isolated worktree. - Core and UI TypeScript checks passed after building project references in the original implementation. Consolidation follow-up: targeted lint, formatting, and `git diff --check` passed. The broader `test/branching/tsconfig.json` typecheck does not pass; checking the unmodified PR head confirmed existing generated-type, adapter-declaration, and missing-import errors, with the added fixtures encountering the same generated-type constraint. - Diff audit: 11 files; no changes to the shared entity-input-schema validator, Lexical, MCP, branch preview validation, or branching test config/shared fixtures. - Local checks used Node 22.23.1; the repository declares Node >=24.22.1. Other database variants were not rerun locally. ### Accessibility assessment Assessed WCAG 2.2 A/AA error identification (3.3.1), correction guidance (3.3.3), and status messages (4.1.3). Chromium component and real-browser assertions verify document/field identification, the error alert, correction guidance, and dismissal. The existing keyboard controls and focus handling are unchanged. Exact screen-reader announcements and manual visual/assistive-technology verification remain unverified; no conformance claim.
) Written with AI ## Description Publishing an inherited page on a content branch can fail with `UNIQUE constraint failed: pages_blocks_content.id` on SQLite. The editor submits main’s existing block and array IDs after the document has been forked, but those IDs were also used as database primary keys. Store logical array/block IDs separately from database primary keys for branchable SQL collections and globals, allowing main and branch copies to retain the same logical IDs. This PR targets `fix/branch-name-only-19112` and contains only the branch-specific schema changes and publishing regression coverage. ## Prerequisite Depends on #19483, which targets `main` and preserves caller-owned input during database writes. Its deep-copy implementation and input-preservation regression have been removed from this PR’s incremental diff. Merge #19483 and propagate it through the feature stack before merging this PR. On the current base without that prerequisite, the nested-publish regressions fail because logical row IDs are lost during writes. Validation with the prerequisite is recorded below. ## Changes - Store logical array/block IDs separately from generated database primary keys for branchable SQL collections and globals, using the existing version-table mechanism. - Add an adapter-independent integration suite covering direct publication and autosave followed by publication of inherited localized blocks with nested arrays. Verify persisted IDs, isolation of main, merge preflight/execution, and preservation of the other locale. - Add schema coverage confirming branchable entities use separate logical IDs while excluded collections retain their existing schema. Existing SQL databases require a schema/data migration that preserves existing logical row IDs and nested relationships. The regression tests use fresh schemas; migration of existing databases is not covered here. ## Test Plan - After extraction: schema unit suite passed (9 tests). - With only #19483’s production deep-copy fix temporarily applied for validation: both nested-publish integration cases passed on SQLite and PostgreSQL (2 cases per adapter). The prerequisite overlay was removed afterward and is not part of this PR’s diff. - Confirmed both SQLite cases fail on the current base without #19483, losing logical block/array IDs. - Targeted production/schema unit-file lint and formatting passed; `git diff --check` passed. - Diff audit: 7 files remain, with no changes under `packages/drizzle/src/transform/write`. - The integration suite uses `db: 'all'` for the existing database matrix. Other adapter variants were not rerun after this extraction. - Local checks used Node 22.23.1; the repository declares Node >=24.22.1.
DanRibbens
merged commit Nov 11, 2026
aaca937
into
feat/content-branching-review/15-docs-and-translations
290 of 293 checks passed
This was referenced Nov 11, 2026
This was referenced Nov 11, 2026
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.
Written with AI
Description
Branches currently have a display name and a separate generated slug. This change uses one required, unique
namefor selector search, saved preferences, query parameters, and branch operations. Names remain immutable after creation because branch state stores the identifier directly.This is a follow-up to #19112 and targets
feat/content-branching-review/15-docs-and-translationsso the consolidation can be reviewed separately.Changes
Test Plan
Checks ran under Node 22.23.1; the repository declares Node >=24.22.1. Existing build/lint warnings remain.