Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bfcadf8
fix: pass_host resets to default when editing upstream nodes (#3294)
DSingh0304 Feb 3, 2026
d7575d2
Merge branch 'apache:master' into fix/pass-host-reset
DSingh0304 Feb 3, 2026
6143d34
chore: update generated route tree
DSingh0304 Feb 3, 2026
a5461c0
chore: ensure route tree matches current environment
DSingh0304 Feb 3, 2026
c3aec7b
fix: update test files to ensure proper functionality and add type sa…
DSingh0304 Feb 15, 2026
fe7ce23
fix: refactor route detail forms to use useSuspenseQuery and improve …
DSingh0304 Mar 18, 2026
c1c29d2
Potential fix for pull request finding
DSingh0304 Mar 18, 2026
bf859db
fix: add loading skeleton to RouteDetailForm and improve service data…
DSingh0304 Mar 18, 2026
62a045d
Replaced useQuery with useSuspenseQuery & Added Suspense with Skeleton
DSingh0304 Mar 18, 2026
4d8d919
Improved readibility
DSingh0304 Mar 18, 2026
96fe08c
Merge branch 'apache:master' into fix/pass-host-reset
DSingh0304 Mar 18, 2026
a838e0f
Merge branch 'apache:master' into fix/pass-host-reset
DSingh0304 Mar 19, 2026
401e258
fix: resolve the must-fix issue regarding the UX regression
DSingh0304 Mar 22, 2026
8e301b3
fix(upstream): apply Suspense boundary to UpstreamDetailForm to preve…
DSingh0304 Mar 22, 2026
dac340c
style(stream-routes): use consistent Skeleton Suspense fallback for d…
DSingh0304 Mar 22, 2026
6e0093e
test(e2e): remove global beforeAll upstream deletion to avoid race co…
DSingh0304 Mar 22, 2026
e8e5fd7
perf: useMemo for formDefaults in upstream and route detail pages
DSingh0304 Mar 22, 2026
43d7843
fix: resolve E2E test failures by improving form synchronization and …
DSingh0304 Mar 23, 2026
d138d9e
Fixed lint error in util.ts: The fix was typing produceVarsToAPI's re…
DSingh0304 Mar 25, 2026
195f583
Updated the function signature to accept APISIXType['Route'] to match…
DSingh0304 Mar 27, 2026
3043033
Merge branch 'apache:master' into fix/pass-host-reset
DSingh0304 Mar 27, 2026
4bb48ed
fix(upstream): stabilize node state sync and resolve E2E timeouts
DSingh0304 Mar 30, 2026
7953c82
Merge branch 'apache:master' into fix/pass-host-reset
DSingh0304 Apr 3, 2026
e3a2559
Merge branch 'master' into fix/pass-host-reset
DSingh0304 Apr 14, 2026
c6dd3be
fix: resolve merge artifacts and syntax errors in detail pages
DSingh0304 Apr 14, 2026
437a3d1
Update routeTree.gen.ts
DSingh0304 Apr 14, 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
47 changes: 32 additions & 15 deletions e2e/tests/routes.clear-upstream-field.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ import { uiDeleteRoute } from '@e2e/utils/ui/routes';
import { uiFillUpstreamRequiredFields } from '@e2e/utils/ui/upstreams';
import { expect, type Page } from '@playwright/test';

import { deleteAllRoutes, getRouteReq } from '@/apis/routes';
import { deleteAllServices, postServiceReq } from '@/apis/services';
import { deleteAllUpstreams, postUpstreamReq } from '@/apis/upstreams';
import { getRouteReq } from '@/apis/routes';
import { postServiceReq } from '@/apis/services';
import { postUpstreamReq } from '@/apis/upstreams';
import { API_ROUTES, API_SERVICES, API_UPSTREAMS } from '@/config/constant';
import type { APISIXType } from '@/types/schema/apisix';

test.describe.configure({ mode: 'serial' });

const upstreamName = randomId('test-upstream');
const serviceName = randomId('test-service');
const routeNameForUpstreamId = randomId('test-route-upstream-id');
Expand All @@ -42,6 +45,7 @@ const upstreamNodes: APISIXType['UpstreamNode'][] = [

let testUpstreamId: string;
let testServiceId: string;
const createdRouteIds = new Set<string>();

// Common helper functions
async function fillBasicRouteFields(
Expand Down Expand Up @@ -130,11 +134,6 @@ async function editRouteAndAddUpstream(
}

test.beforeAll(async () => {
// Clean up existing resources
await deleteAllRoutes(e2eReq);
await deleteAllServices(e2eReq);
await deleteAllUpstreams(e2eReq);

// Create a test upstream for testing upstream_id scenario
const upstreamResponse = await postUpstreamReq(e2eReq, {
name: upstreamName,
Expand All @@ -150,10 +149,24 @@ test.beforeAll(async () => {
testServiceId = serviceResponse.data.value.id;
});

test.afterEach(async () => {
await Promise.all(
Array.from(createdRouteIds).map((routeId) =>
e2eReq.delete(`${API_ROUTES}/${routeId}`).catch(() => {
// Ignore cleanup errors so tests can proceed; route may already be deleted.
})
)
);
createdRouteIds.clear();
});

test.afterAll(async () => {
await deleteAllRoutes(e2eReq);
await deleteAllServices(e2eReq);
await deleteAllUpstreams(e2eReq);
await e2eReq.delete(`${API_SERVICES}/${testServiceId}`).catch(() => {
// Ignore cleanup errors; resource may already be deleted.
});
await e2eReq.delete(`${API_UPSTREAMS}/${testUpstreamId}`).catch(() => {
// Ignore cleanup errors; resource may already be deleted.
});
});

test('should clear upstream field when upstream_id exists (create and edit)', async ({
Expand Down Expand Up @@ -189,7 +202,8 @@ test('should clear upstream field when upstream_id exists (create and edit)', as
});

await test.step('verify upstream field is cleared after creation', async () => {
await verifyRouteData(page, 'upstream_id', testUpstreamId);
const routeId = await verifyRouteData(page, 'upstream_id', testUpstreamId);
createdRouteIds.add(routeId);
});

await test.step('edit route and add upstream configuration again', async () => {
Expand All @@ -201,7 +215,8 @@ test('should clear upstream field when upstream_id exists (create and edit)', as
});

await test.step('verify upstream field is still cleared after editing', async () => {
await verifyRouteData(page, 'upstream_id', testUpstreamId);
const routeId = await verifyRouteData(page, 'upstream_id', testUpstreamId);
createdRouteIds.add(routeId);
await uiDeleteRoute(page);
});
});
Expand Down Expand Up @@ -240,7 +255,8 @@ test('should clear upstream field when service_id exists (create and edit)', asy
});

await test.step('verify upstream field is cleared after creation', async () => {
await verifyRouteData(page, 'service_id', testServiceId);
const routeId = await verifyRouteData(page, 'service_id', testServiceId);
createdRouteIds.add(routeId);
});

await test.step('edit route and add upstream configuration again', async () => {
Expand All @@ -252,7 +268,8 @@ test('should clear upstream field when service_id exists (create and edit)', asy
});

await test.step('verify upstream field is still cleared after editing', async () => {
await verifyRouteData(page, 'service_id', testServiceId);
const routeId = await verifyRouteData(page, 'service_id', testServiceId);
createdRouteIds.add(routeId);
await uiDeleteRoute(page);
});
});
2 changes: 2 additions & 0 deletions e2e/tests/routes.crud-all-fields.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { e2eReq } from '@e2e/utils/req';
import { test } from '@e2e/utils/test';
import {
uiClearMonacoEditor,
uiEnsureSettingsClosed,
uiFillMonacoEditor,
uiGetMonacoEditor,
uiHasToastMsg,
Expand Down Expand Up @@ -47,6 +48,7 @@ test.beforeAll(async () => {
});

test('should CRUD route with all fields', async ({ page }) => {
await uiEnsureSettingsClosed(page);
test.slow();

const varsSection = page.getByRole('group', { name: 'Match Rules' }).getByText('Vars').locator('..');
Expand Down
10 changes: 7 additions & 3 deletions e2e/tests/upstreams.crud-required-fields.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,23 @@ import {
} from '@e2e/utils/ui/upstreams';
import { expect } from '@playwright/test';

import { deleteAllRoutes } from '@/apis/routes';
import { deleteAllUpstreams } from '@/apis/upstreams';
import type { APISIXType } from '@/types/schema/apisix';

const upstreamName = randomId('test-upstream');
const nodes: APISIXType['UpstreamNode'][] = [
{ host: 'test.com' },
{ host: 'test2.com', port: 80 },
{ host: 'test.com', port: 80, weight: 100 },
{ host: 'test2.com', port: 80, weight: 100 },
];

test.beforeAll(async () => {
await deleteAllRoutes(e2eReq);
await deleteAllUpstreams(e2eReq);
});

test('should CRUD upstream with required fields', async ({ page }) => {

await upstreamsPom.toIndex(page);
await upstreamsPom.isIndexPage(page);

Expand Down Expand Up @@ -156,7 +159,8 @@ test('should CRUD upstream with required fields', async ({ page }) => {
});

await test.step('delete upstream in detail page', async () => {
await page.getByRole('button', { name: 'Delete' }).click();
// Delete the upstream
await page.getByRole('button', { name: 'Delete', exact: true }).first().click();

await page
.getByRole('dialog', { name: 'Delete Upstream' })
Expand Down
Loading
Loading