Match publish forms#690
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Publications/Mirrors publish flows so the “publish” forms behave more consistently across sources (mirrors vs local repositories), including aligning required fields and read-only behavior, and then adjusts mocks/tests to match the updated UI behavior.
Changes:
- Extend publication “new publish” form values and validation to support mirror-specific fields (
distribution,architectures), and expose a dedicated mirror validation schema. - Update the mirror publish forms/blocks to show/edit contents in the “new” flow and lock contents in the “existing publication” flow.
- Update MSW mocks and several component tests to reflect new data shapes and changed UI output (counts/links/columns).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/mocks/publications.ts | Expands publication mock data (extra publications + gpgKey) to exercise updated UI and count scenarios. |
| src/features/publications/types/PublishValues.ts | Adds optional distribution and architectures to support mirror publish form needs. |
| src/features/publications/index.ts | Re-exports the new mirror-specific validation schema. |
| src/features/publications/constants.ts | Introduces VALIDATION_SCHEMA_NEW_MIRROR for mirror publication creation. |
| src/features/publications/components/PublicationsList/PublicationsList.test.tsx | Updates assertions for sources now appearing multiple times. |
| src/features/publications/components/AssociatedPublicationsList/AssociatedPublicationsList.test.tsx | Updates expectations for table columns and duplicate source rendering/pagination behavior. |
| src/features/publications/components/AddPublicationForm/constants.ts | Removes “Select source type” placeholder; keeps form validation shape aligned with updated UX. |
| src/features/publications/components/AddPublicationForm/AddPublicationForm.tsx | Defaults source type to Mirror, refactors source selection logic, and aligns signing key/distribution read-only behavior. |
| src/features/publications/components/AddPublicationForm/AddPublicationForm.test.tsx | Updates signing-key field expectation for local repository selection. |
| src/features/publication-targets/components/PublicationTargetList/PublicationTargetList.test.tsx | Adjusts expectations for publication counts and empty-state rendering. |
| src/features/mirrors/components/PublishMirrorForm/components/PublishMirrorNewForm/PublishMirrorNewForm.tsx | Adds editable Distribution + selectable Architectures block and uses mirror-specific validation. |
| src/features/mirrors/components/PublishMirrorForm/components/PublishMirrorExistingForm/PublishMirrorExistingForm.tsx | Aligns labels and passes the selected publication into the contents block. |
| src/features/mirrors/components/PublishMirrorForm/components/PublishMirrorContentsBlock/PublishMirrorContentsBlock.tsx | Locks contents display based on the existing publication instead of the mirror. |
| src/features/mirrors/components/MirrorPublicationsLink/MirrorPublicationsLink.test.tsx | Updates expected publication count displayed in the link. |
| src/features/local-repositories/components/PublishLocalRepositorySidePanel/components/PublishRepositoryExistingForm/PublishRepositoryExistingForm.tsx | Minor string formatting cleanup for read-only tooltips. |
marqode
left a comment
There was a problem hiding this comment.
LGTM, a few nit-picky comments
| await waitFor(() => { | ||
| expect(screen.getAllByText("1 publication")).toHaveLength(3); | ||
| expect(screen.getByText("1 publication")).toBeInTheDocument(); | ||
| expect(screen.getAllByText("2 publications")).toHaveLength(2); |
There was a problem hiding this comment.
Same as above, if it's not too hard could be worth filtering the mock data to get these numbers instead of hardcoding them.
There was a problem hiding this comment.
there's a lot of cases where this is a problem and I have another PR which also changes the mocks and affects some of these, so i'll address these separately
e5165ee to
11febf2
Compare
| <ReadOnlyField | ||
| label="Signing GPG key" | ||
| value={formik.values.signingKey} | ||
| tooltipMessage="The signing key can't be changed for signature-preserving mirrors." | ||
| /> |
There was a problem hiding this comment.
well this suggestion is definitely not the right thing to do, but I think it might be worth getting Dani's opinion on this tomorrow
Summary
Summarize the changes made in this pull request. Include any relevant context or background information that would help reviewers understand the purpose and scope of the changes.
Release Impact
Pick the target branch (see RELEASES.md for the full model):
dev— internal testing → publishes toppa-build-devmain— next beta → publishes toppa-buildrelease/YY.MM— point release on a maintained cycle → publishes toppa-build-YY.MM(and toppa-build-stableif this is the currently-promoted branch). Specify cycle:release/____Change type (tick one):
Checklist
pnpm changeset(orpnpm changeset --emptyif no CHANGELOG line is warranted) and committed the resulting.mdfile. Required for PRs targetingmainandrelease/*; enforced by theChangeset checkworkflow.scripts/).Versioning Reminder
Important
Landscape UI uses CalVer (
YY.MM.Point.Build). Version derivation by branch:main/point/*→YY.MM.0.<run>-betadev→YY.MM.0.<run>-devrelease/YY.MM→YY.MM.1.<run>(cycle pinned by branch name)