Repository navigation
Add RPM repository and remote pages (upstream #370) with the fork's URL and save rules - #19
Merged
Merged
Conversation
(cherry picked from commit ec82c8a)
…ns tabs (cherry picked from commit 87c2c75)
(cherry picked from commit 6a4de80)
(cherry picked from commit 36bfea9)
(cherry picked from commit b031f50)
… hide Ansible-only private option (cherry picked from commit 8dbc84c)
(cherry picked from commit 7e5eb65)
(cherry picked from commit db2fc62)
…review fixes (cherry picked from commit ed815ce)
(cherry picked from commit 264705a)
(cherry picked from commit c27d50b)
The RPM add page used its own save path: it published new repositories by default, kept a single repository version, and on any distribution error retried with a random numeric suffix, so a failed or conflicting create could leave an unexpected, differently named distribution behind. It now uses the same createRepository flow as the file and deb pages. A new repository keeps every version and is not autopublished (the form says what ticking the box does). A distribution is created only when the box is ticked, after the name and base path were checked, and a refused distribution is reported once and never retried under another name. A blank "versions kept per package" is sent as 0, which keeps all versions.
The repository form showed "Make private" for file, deb and rpm repositories too, although only the ansible serializer has that field. Ticking it there sent a value the server ignores or refuses. The checkbox is now rendered for ansible only. The tests also cover the RPM-only autopublish checkbox starting unticked.
The RPM repository page built its URL from a distribution's base path and showed a single guess, and the Distributions tab built every command line the same way, so the page could show a URL the server does not serve. The Details tab listed the Autopublish row twice. The page now loads every distribution that serves the repository (bound to it, to one of its publications or to one of its versions) and shows the base_url the server reports for each. A distribution with nothing to serve is marked "Not served", a failed load is shown instead of "None", the Distributions tab lists the loaded distributions with a command line that uses the server URL, and Details has one Autopublish row.
Open the RPM repository and remote pages against the throwaway Pulp and look for the fields that only RPM has: autopublish (unticked on a new repository), the retained package versions and the download policy.
The detail page and its Details and Distributions tabs imported through the api, actions and utilities barrels, which the lint rules warn about because a barrel pulls in unrelated modules. Import from the specific files, as the file repository pages do.
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.
What this changes
Takes the RPM repository and remote pages from the upstream pull request
pulp#370 and brings them to the rules the file and deb pages already
follow. Content of the upstream pull request taken: head commit
c27d50b2bc1542514063ef7d5b778970a5364c4d.Upstream commits
11 of the 12 upstream commits are cherry-picked with
-x: each keeps its upstream author and has a"(cherry picked from commit ...)" line naming the upstream commit. Conflicts were resolved in favour
of the fork's existing code (the RPM distribution API file, and the plugin lookup table where the
RPM remote API was added). The upstream diff was read in full before anything was fetched or built:
it changes only TypeScript under
src/and the README, no dependency, lockfile, script, workflow orconfig, and every request goes through the existing Pulp API wrapper.
The one commit that only touched the Cypress smoke tests is skipped, because the fork has no
Cypress; its assertions are ported to the Playwright smoke test (see below).
Commits added on top of the picks
says what ticking it does; a new repository keeps every version; a distribution is created only
when the box is ticked, after the name and base path were checked; a refused distribution is
reported once and never retried under another name; a blank "versions kept per package" is sent as
0 (keep all).
field their serializer does not have.
with the base_url the server reports (never a URL built from the base path), a distribution with
nothing to serve is marked "Not served", a failed load is shown instead of "None", and Details has
one Autopublish row.
autopublish (unticked), retained package versions and download policy fields of the add forms.
Delete, sync, revert and update for RPM keep the upstream behaviour for now.
How it is tested
npx vitest run src/containers/rpm-repository src/components/repository-form.test.tsx(request sequences of the create page, served URL, "Not served" and single Autopublish row,
private only for ansible)
npm test && npm run lint:ts && npm run lint:e2e && npx prettier -l . && npx eslint src/ config/ e2e/ scripts/ && npx ls-lint && node scripts/check-public.mjs --all