Skip to content

Fix the outcome reporting and scope of the repository delete flow - #37

Merged
aevnsvi merged 5 commits into
mainfrom
review-fixes-delete-flow
Nov 2, 2026
Merged

aevnsvi merged 5 commits into
mainfrom
review-fixes-delete-flow

Conversation

@aevnsvi

@aevnsvi aevnsvi commented Nov 2, 2026

Copy link
Copy Markdown

Fixes five defects found in review of the delete flow and its tests.

  • A task status that cannot be read (proxy error, dropped connection) is now reported as "outcome unknown, check the task" with the task link, for repository and distribution delete, create-distribution and revert. It was reported as a definite failure although the server had accepted the request.
  • Cancel, the close button and Escape are disabled while a delete runs, so the report of a partial failure stays visible. A delete that finishes later closes only the dialog of its own repository.
  • The delete removes exactly the distributions the dialog showed. The distribution listing keeps only rows that name the repository themselves (the server filters are not trusted), and a distribution that appeared after the dialog opened is reported, not deleted, and keeps the repository.
  • The dialog says "nothing was deleted" only when the listing failed. Any other error after the delete started says that some distributions or the repository may already have been removed. Page updates after a successful delete can no longer turn it into a failed delete.
  • The "keeps Sync enabled" test waits for the running-task check to finish before asserting, so it can fail; it also asserts the task filter and covers the file plugin.

Every fix has a test that fails without it; the membership checks and the shown-set check were mutation-checked.

A rejected poll of a task status (proxy error, dropped connection, refused
status request) used to propagate as an ordinary error, so the delete dialog
said "Not removed", the create flow said the distribution "was not created"
and the revert said "Failed to revert", all after the server had accepted the
request and the work may well have been done.

waitForTask now rejects with a TaskUnknown (a TaskPending carrying the task
href) when a status request fails. Delete, create-distribution and revert
report "outcome unknown, check the task" with the task link and never claim a
failure.
While the distributions and the repository were being removed (minutes with
the default polling), Cancel, the close button and Escape stayed active.
Closing unmounted the dialog, so the report of a partial failure (what was
removed and what was not) went to a component that no longer existed, and a
run that finished later closed whichever repository dialog was open by then.

DeleteModal takes isCancelDisabled, which the repository dialog sets while
deleting; the report stays on screen and Cancel works again once the run has
reported. A finished delete now closes only the dialog of its own repository.
The delete dialog read every rejection of the delete as "the distributions
could not be listed, so nothing was deleted". The action behind it also ran
the page updates after the repository was removed (alert, closing the dialog,
reloading the list), so a failure of any of those produced a false statement
about a repository that no longer exists.

The utility now rejects only with DeleteNotStarted, and only when the listing
failed. The dialog says "nothing was deleted" for that error alone; any other
error gets a message that some distributions or the repository may already
have been removed. The page updates after a successful delete run
independently and can no longer reject the delete.
The dialog listed the distributions when it opened, but the delete listed them
again at confirmation and removed whatever came back. A distribution created
or pointed at the repository in between was deleted without ever having been
shown or its content guard flagged. The sets to delete also came from server
side filters alone: Pulp ignores a query parameter a plugin does not know, so
a missing repository filter would have answered with every distribution of the
plugin.

The listing now keeps only rows that name the repository themselves
(repository on a distribution, repository_version on a publication). The
delete takes the listing the dialog showed and removes exactly those that
still serve the repository; a distribution that appeared since is not deleted,
is reported by name, and keeps the repository.
The test asserted that Sync is enabled right after the task list request was
issued, before the answer was applied, so it passed whether the mock answered
with a running task or with an empty list. It now waits for the check to
finish before asserting that no warning is shown and Sync is enabled, asserts
the task filter (waiting and running tasks of the repository), and runs for the
file plugin too.
@aevnsvi
aevnsvi merged commit 96a8616 into main Nov 2, 2026
6 of 7 checks passed
@aevnsvi
aevnsvi deleted the review-fixes-delete-flow branch November 2, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant