Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
afc7b0e
Show the last page, not an empty list, when the page is past the end
aevnsvi Nov 21, 2026
492632a
Create a repository under its trimmed name
aevnsvi Nov 21, 2026
ab725b0
Report the object permissions as loading while the index is read again
aevnsvi Nov 21, 2026
3c2256a
Check the session for a refused roles read unless the request says it…
aevnsvi Nov 21, 2026
e4778ff
Keep a dot-only name in one path segment when filling a route
aevnsvi Nov 21, 2026
99a0837
Refuse a bounded run with a limit below one
aevnsvi Nov 21, 2026
65c0bbd
Register every object of a parallel e2e create before the clean-up st…
aevnsvi Nov 21, 2026
bbeda2d
Prove the bulk e2e list holds only this run's repositories before sel…
aevnsvi Nov 21, 2026
4c624d7
Derive the UI root of the scale spec's moves from the run's base URL
aevnsvi Nov 21, 2026
fa4953f
Handle both timing waits of the scale spec whatever the trigger does
aevnsvi Nov 21, 2026
ee245a7
Show a delete outcome task without a link when its address holds no t…
aevnsvi Nov 21, 2026
2f831af
Stop the descriptor forms from advertising an Enter submit they never…
aevnsvi Nov 21, 2026
bb7539c
Keep the selected count and say why when no bulk action is allowed
aevnsvi Nov 21, 2026
6809a98
Send each repository address once when reading repositories in chunks
aevnsvi Nov 21, 2026
7afa411
Report an error when the signed-in user has no address of their own
aevnsvi Nov 21, 2026
95fd133
Translate the bulk toolbar note into Spanish, French, Dutch, Japanese…
aevnsvi Nov 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 51 additions & 12 deletions e2e/remote/bulk.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ import { type Locator, type Page, expect, test } from '@playwright/test';
import { getDistributionsFileFileListUrl } from '@pulp-ui/sdk/file/distributions-file';
import { getRemotesFileFileListUrl } from '@pulp-ui/sdk/file/remotes-file';
import { getRepositoriesFileFileListUrl } from '@pulp-ui/sdk/file/repositories-file';
import { type PulpObject, TestObjects, runId } from '../support/api';
import { clickSidebar, listTable } from '../support/framework-list';
import {
type PulpObject,
TestObjects,
allSettled,
runId,
} from '../support/api';
import { clickSidebar, listTable, shownNames } from '../support/framework-list';
import { title } from '../support/sign-in';

// The bulk actions of the file repository list against a real server, on
Expand Down Expand Up @@ -44,7 +49,7 @@ test.beforeAll(async () => {
// repository has a remote of its own, because syncing the same content
// through one remote in two repositories at once made one of the two tasks
// fail on the server.
withRemote = (await Promise.all(
withRemote = (await allSettled(
['a', 'b'].map(async (suffix) => {
const remote = await objects.create(REMOTES, {
name: objects.name(`remote-${suffix}`),
Expand All @@ -64,17 +69,51 @@ test.beforeAll(async () => {

test.afterAll(async () => {
test.setTimeout(180_000);
await objects.cleanUp();
// objects is not set when opening the API context failed in beforeAll, and
// that failure must not be hidden by a second one here.
await objects?.cleanUp();
});

// The names of the repositories this test made or checks, as the list shows
// them in the order of the names.
const namesOf = (rows: PulpObject[]): string[] =>
rows.map(({ name }) => name as string).sort();

// Waits until the rows shown are exactly the expected ones, every one of them
// an object of this run. Select-all followed by Delete or Sync acts on every
// row shown, so nothing is selected before the list is proven to hold this
// run's objects alone: a filter that did not apply would otherwise reach the
// seeded lab repositories.
async function expectOnlyRunRows(
page: Page,
expected: string[],
): Promise<void> {
for (const name of expected) {
expect(
name.startsWith(objects.prefix),
`${name} is an object of this run`,
).toBe(true);
}
await expect
.poll(async () => (await shownNames(page, 'Repositories')).sort(), {
message: "the rows shown must be this run's repositories and no others",
})
.toEqual([...expected].sort());
}

// The list narrowed to the repositories of this run whose name starts with
// `stem`, with its rows shown.
async function openRun(page: Page, stem: string): Promise<void> {
// `stem`, with the expected rows shown and no others.
async function openRun(
page: Page,
stem: string,
expected: PulpObject[],
): Promise<void> {
await page.goto(
`file/repositories?name__icontains=${encodeURIComponent(objects.name(stem))}`,
);
await expect(title(page, 'Repositories')).toBeVisible();
await expect(listTable(page, 'Repositories', { rows: true })).toBeVisible();
await expectOnlyRunRows(page, namesOf(expected));
}

const tick = (page: Page, name: string) =>
Expand Down Expand Up @@ -106,7 +145,7 @@ test('a label added to two repositories and removed from three is reported row b
const key = labelKey();
const [a, b] = withRemote;

await openRun(page, '');
await openRun(page, '', [a, b, withoutRemote]);
for (const row of [a, b]) {
await tick(page, row.name as string);
}
Expand Down Expand Up @@ -186,7 +225,7 @@ test('a sync of three repositories starts one task for each that has a remote an
page,
}) => {
test.setTimeout(180_000);
await openRun(page, '');
await openRun(page, '', [...withRemote, withoutRemote]);
await page
.getByRole('checkbox', { name: 'Select all repositories on this page' })
.check();
Expand Down Expand Up @@ -231,7 +270,7 @@ test('a sync of three repositories starts one task for each that has a remote an
});

async function makeRepositories(stem: string, count: number) {
return Promise.all(
return allSettled(
Array.from({ length: count }, (_, index) =>
objects.create(REPOSITORIES, {
name: objects.name(`${stem}-${index + 1}`),
Expand All @@ -252,7 +291,7 @@ test('a bulk delete shows each repository as removed in the result table', async
test.setTimeout(180_000);
const doomed = await makeRepositories('delete-here', 2);

await openRun(page, 'delete-here');
await openRun(page, 'delete-here', doomed);
await page
.getByRole('checkbox', { name: 'Select all repositories on this page' })
.check();
Expand Down Expand Up @@ -280,7 +319,7 @@ test('a bulk delete that ends after the user has left the list reports on the sc
page,
}) => {
test.setTimeout(180_000);
await makeRepositories('delete-away', 2);
const away = await makeRepositories('delete-away', 2);

// Two screens of the application in a row, so that going back is a move
// inside it and the run goes on in the page.
Expand All @@ -292,7 +331,7 @@ test('a bulk delete that ends after the user has left the list reports on the sc
await box.fill(objects.name('delete-away'));
await box.press('Enter');
await expect(listTable(page, 'Repositories', { rows: true })).toBeVisible();
await expect(page.locator('tbody tr')).toHaveCount(2);
await expectOnlyRunRows(page, namesOf(away));

await page
.getByRole('checkbox', { name: 'Select all repositories on this page' })
Expand Down
98 changes: 57 additions & 41 deletions e2e/remote/list-scale.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type Page, expect, test } from '@playwright/test';
import { apiContext } from '../support/api';
import { baseUrl } from '../support/env';
import {
type ListKind,
clickSidebar,
expectedRepositories,
listTable,
Expand Down Expand Up @@ -94,17 +96,51 @@ async function fresh(page: Page, group: string): Promise<void> {

// Moves inside the application to an address, as following a link does: the
// page is not loaded again, so what the application has read stays in its
// cache.
// cache. The address is below the UI root of the run, which the page must be
// under; a page anywhere else is a mistake of the test and fails here, not as
// a missing table later.
async function moveTo(page: Page, address: string): Promise<void> {
await page.evaluate((to) => {
// an address below the UI root, whichever screen the page is on
const root = window.location.pathname.slice(
0,
window.location.pathname.indexOf('/ui/') + '/ui/'.length,
);
window.history.pushState({}, '', `${root}${to}`);
const root = new URL(baseUrl()).pathname;
const here = new URL(page.url()).pathname;
if (!here.startsWith(root)) {
throw new Error(`the page is at ${here}, not under the UI root ${root}`);
}

await page.evaluate((target) => {
window.history.pushState({}, '', target);
window.dispatchEvent(new PopStateEvent('popstate', { state: {} }));
}, address);
}, `${root}${address}`);
}

// Times how long a list takes to show its rows and then to settle every column
// that reads for itself, from the moment `trigger` is called. Both waits are
// started before the trigger and both are always handled: a trigger that fails
// must not leave a wait behind that rejects unhandled later, when its timeout
// runs out, and is reported as a second, misleading failure.
async function timeLoad(
page: Page,
kind: ListKind,
trigger: () => Promise<unknown>,
): Promise<{ rows: number; columns: number }> {
const start = performance.now();
const timeUntil = (settled: { rows?: boolean; columns?: boolean }) =>
listTable(page, kind, settled)
.waitFor()
.then(() => elapsed(start));
const waits = Promise.allSettled([
timeUntil({ rows: true }),
timeUntil({ rows: true, columns: true }),
]);

await trigger();
const [rows, columns] = await waits;
if (rows.status === 'rejected') {
throw rows.reason;
}
if (columns.status === 'rejected') {
throw columns.reason;
}
return { rows: rows.value, columns: columns.value };
}

const requestsOf = (page: Page) => {
Expand Down Expand Up @@ -163,19 +199,9 @@ test.describe('@scale the file lists at 1000 or more repositories', () => {
const requests = requestsOf(page);
const link = page.locator('[data-cy=pulp-menu-item-file-repositories]');

const start = performance.now();
const shown = listTable(page, 'Repositories', { rows: true })
.waitFor()
.then(() => elapsed(start));
const settled = listTable(page, 'Repositories', {
rows: true,
columns: true,
})
.waitFor()
.then(() => elapsed(start));
await link.click();
rows.push(await shown);
columns.push(await settled);
const timed = await timeLoad(page, 'Repositories', () => link.click());
rows.push(timed.rows);
columns.push(timed.columns);
await settle(page);
requests.stop();

Expand Down Expand Up @@ -208,19 +234,11 @@ test.describe('@scale the file lists at 1000 or more repositories', () => {
await fresh(page, 'Repositories');
const requests = requestsOf(page);

const start = performance.now();
const shown = listTable(page, 'Repositories', { rows: true })
.waitFor()
.then(() => elapsed(start));
const settled = listTable(page, 'Repositories', {
rows: true,
columns: true,
})
.waitFor()
.then(() => elapsed(start));
await moveTo(page, 'file/repositories?page_size=500');
rows.push(await shown);
columns.push(await settled);
const timed = await timeLoad(page, 'Repositories', () =>
moveTo(page, 'file/repositories?page_size=500'),
);
rows.push(timed.rows);
columns.push(timed.columns);
await settle(page);
requests.stop();

Expand Down Expand Up @@ -427,12 +445,10 @@ test.describe('@scale the file lists at 1000 or more repositories', () => {

for (let run = 0; run < RUNS; run += 1) {
await fresh(page, 'Remotes');
const start = performance.now();
const settled = listTable(page, 'Remotes', { rows: true, columns: true })
.waitFor()
.then(() => elapsed(start));
await page.locator('[data-cy=pulp-menu-item-file-remotes]').click();
remotes.push(await settled);
const timed = await timeLoad(page, 'Remotes', () =>
page.locator('[data-cy=pulp-menu-item-file-remotes]').click(),
);
remotes.push(timed.columns);
}

judge('L5 repository Details tab shown', detail, BUDGET.detail);
Expand Down
4 changes: 3 additions & 1 deletion e2e/remote/sync-progress.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ test.beforeAll(async () => {

test.afterAll(async () => {
test.setTimeout(180_000);
await objects.cleanUp();
// objects is not set when opening the API context failed in beforeAll, and
// that failure must not be hidden by a second one here.
await objects?.cleanUp();
});

async function repositoryWithRemote(suffix: string): Promise<string> {
Expand Down
15 changes: 15 additions & 0 deletions e2e/support/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,21 @@ function url(pathOrHref: string): string {
return pathOrHref.startsWith('/') ? pathOrHref : `${API_BASE}${pathOrHref}`;
}

// Waits for every job, then rethrows the first failure. Used for creates that
// run side by side: `Promise.all` would report the first failure at once while
// the other creates are still running, and an object whose task finishes after
// the clean-up has started would never be registered and stay on the server.
export async function allSettled<T>(jobs: Promise<T>[]): Promise<T[]> {
const results = await Promise.allSettled(jobs);
const failure = results.find(
(result): result is PromiseRejectedResult => result.status === 'rejected',
);
if (failure) {
throw failure.reason;
}
return results.map((result) => (result as PromiseFulfilledResult<T>).value);
}

// The objects of one spec file on one deployment. Create them through this
// class, call cleanUp() in afterAll.
export class TestObjects {
Expand Down
2 changes: 1 addition & 1 deletion locale/en.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions locale/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -9599,6 +9599,10 @@ msgstr "You have been signed out of Pulp."
msgid "You may not do this on the following, so nothing is sent for them:"
msgstr "You may not do this on the following, so nothing is sent for them:"

#: src/framework/bulk/bulk-menu.tsx
msgid "You may not take a bulk action on the selected rows."
msgstr "You may not take a bulk action on the selected rows."

#: src/containers/login/login.tsx
msgid "Your password was changed. Sign in with the new password."
msgstr "Your password was changed. Sign in with the new password."
Expand Down
2 changes: 1 addition & 1 deletion locale/es.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions locale/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -9598,6 +9598,10 @@ msgstr "Se ha cerrado su sesión de Pulp."
msgid "You may not do this on the following, so nothing is sent for them:"
msgstr "No tiene permiso para hacerlo en lo siguiente, por lo que no se envía nada para ello:"

#: src/framework/bulk/bulk-menu.tsx
msgid "You may not take a bulk action on the selected rows."
msgstr "No tiene permiso para realizar una acción en bloque sobre las filas seleccionadas."

#: src/containers/login/login.tsx
msgid "Your password was changed. Sign in with the new password."
msgstr "Se cambió su contraseña. Inicie sesión con la nueva contraseña."
Expand Down
2 changes: 1 addition & 1 deletion locale/fr.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions locale/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -9598,6 +9598,10 @@ msgstr "Vous avez été déconnecté de Pulp."
msgid "You may not do this on the following, so nothing is sent for them:"
msgstr "Vous n'avez pas le droit de le faire sur les éléments suivants, rien n'est donc envoyé pour eux :"

#: src/framework/bulk/bulk-menu.tsx
msgid "You may not take a bulk action on the selected rows."
msgstr "Vous n'avez pas le droit d'effectuer une action groupée sur les lignes sélectionnées."

#: src/containers/login/login.tsx
msgid "Your password was changed. Sign in with the new password."
msgstr "Votre mot de passe a été modifié. Connectez-vous avec le nouveau mot de passe."
Expand Down
2 changes: 1 addition & 1 deletion locale/ja.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions locale/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -9598,6 +9598,10 @@ msgstr "Pulp からログアウトされました。"
msgid "You may not do this on the following, so nothing is sent for them:"
msgstr "次の項目に対してはこの操作を行う権限がないため、それらには何も送信されません:"

#: src/framework/bulk/bulk-menu.tsx
msgid "You may not take a bulk action on the selected rows."
msgstr "選択した行に対して一括操作を行う権限がありません。"

#: src/containers/login/login.tsx
msgid "Your password was changed. Sign in with the new password."
msgstr "パスワードが変更されました。新しいパスワードでログインしてください。"
Expand Down
2 changes: 1 addition & 1 deletion locale/ko.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions locale/ko.po
Original file line number Diff line number Diff line change
Expand Up @@ -9598,6 +9598,10 @@ msgstr "Pulp에서 로그아웃되었습니다."
msgid "You may not do this on the following, so nothing is sent for them:"
msgstr "다음 항목에 대해서는 이 작업을 수행할 수 없으므로 해당 항목에는 아무것도 전송되지 않습니다:"

#: src/framework/bulk/bulk-menu.tsx
msgid "You may not take a bulk action on the selected rows."
msgstr "선택한 행에 대해 일괄 작업을 수행할 수 없습니다."

#: src/containers/login/login.tsx
msgid "Your password was changed. Sign in with the new password."
msgstr "비밀번호가 변경되었습니다. 새 비밀번호로 로그인하세요."
Expand Down
2 changes: 1 addition & 1 deletion locale/nl.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions locale/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -9598,6 +9598,10 @@ msgstr "U bent afgemeld bij Pulp."
msgid "You may not do this on the following, so nothing is sent for them:"
msgstr "U mag dit niet doen voor het volgende, dus er wordt niets voor verzonden:"

#: src/framework/bulk/bulk-menu.tsx
msgid "You may not take a bulk action on the selected rows."
msgstr "U mag geen bulkactie uitvoeren op de geselecteerde rijen."

#: src/containers/login/login.tsx
msgid "Your password was changed. Sign in with the new password."
msgstr "Uw wachtwoord is gewijzigd. Log in met het nieuwe wachtwoord."
Expand Down
2 changes: 1 addition & 1 deletion locale/zh.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions locale/zh.po
Original file line number Diff line number Diff line change
Expand Up @@ -9598,6 +9598,10 @@ msgstr "您已退出 Pulp。"
msgid "You may not do this on the following, so nothing is sent for them:"
msgstr "您无权对以下项目执行此操作,因此不会为它们发送任何内容:"

#: src/framework/bulk/bulk-menu.tsx
msgid "You may not take a bulk action on the selected rows."
msgstr "您无权对所选行执行批量操作。"

#: src/containers/login/login.tsx
msgid "Your password was changed. Sign in with the new password."
msgstr "您的密码已更改。请使用新密码登录。"
Expand Down
1 change: 0 additions & 1 deletion src/descriptors/python/distribution-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ export const PythonDistributionEdit = ({
failure={failure?.general}
failureTitle={t`Distribution "${name}" could not be updated`}
onChange={change}
onSubmit={save}
/>
)}
</ModalBody>
Expand Down
Loading
Loading