Skip to content

Commit 17cea9c

Browse files
ci: fix the cleanup script which stopped working for Pages projects (#11401)
Something about the `per_page` parameter seems to cause the listing of Pages projects to respond with a 400 Bad Request. Removing it and going with the default seems fine.
1 parent 1acd43d commit 17cea9c

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

tools/e2e/__tests__/common.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ describe("listTmpE2EProjects()", () => {
4646
.intercept({
4747
path: `/client/v4/accounts/${MOCK_CLOUDFLARE_ACCOUNT_ID}/pages/projects`,
4848
query: {
49-
per_page: 100,
5049
page: 1,
5150
},
5251
})
@@ -80,7 +79,6 @@ describe("listTmpE2EProjects()", () => {
8079
.intercept({
8180
path: `/client/v4/accounts/${MOCK_CLOUDFLARE_ACCOUNT_ID}/pages/projects`,
8281
query: {
83-
per_page: 100,
8482
page: 2,
8583
},
8684
})
@@ -136,7 +134,6 @@ describe("listTmpKVNamespaces()", () => {
136134
path: `/client/v4/accounts/${MOCK_CLOUDFLARE_ACCOUNT_ID}/storage/kv/namespaces`,
137135
method: "GET",
138136
query: {
139-
per_page: 100,
140137
page: 1,
141138
},
142139
})
@@ -171,7 +168,6 @@ describe("listTmpKVNamespaces()", () => {
171168
path: `/client/v4/accounts/${MOCK_CLOUDFLARE_ACCOUNT_ID}/storage/kv/namespaces`,
172169
method: "GET",
173170
query: {
174-
per_page: 100,
175171
page: 2,
176172
},
177173
})
@@ -219,7 +215,6 @@ describe("listTmpDatabases()", () => {
219215
path: `/client/v4/accounts/${MOCK_CLOUDFLARE_ACCOUNT_ID}/d1/database`,
220216
method: "GET",
221217
query: {
222-
per_page: 100,
223218
page: 1,
224219
},
225220
})
@@ -258,7 +253,6 @@ describe("listTmpDatabases()", () => {
258253
path: `/client/v4/accounts/${MOCK_CLOUDFLARE_ACCOUNT_ID}/d1/database`,
259254
method: "GET",
260255
query: {
261-
per_page: 100,
262256
page: 2,
263257
},
264258
})
@@ -312,7 +306,7 @@ describe("listTmpE2EWorkers()", () => {
312306
.get("https://api.cloudflare.com")
313307
.intercept({
314308
path: `/client/v4/accounts/${MOCK_CLOUDFLARE_ACCOUNT_ID}/workers/scripts`,
315-
query: { per_page: 100, page: 1 },
309+
query: { page: 1 },
316310
method: "GET",
317311
})
318312
.reply(

tools/e2e/common.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ async function apiFetchResponse(
8686
});
8787

8888
if (response.status >= 400) {
89+
console.error(
90+
"API Fetch failed",
91+
response.status,
92+
response.statusText,
93+
await response.text()
94+
);
8995
throw { url, init, response };
9096
}
9197

@@ -132,7 +138,6 @@ async function apiFetchList<T>(path: string, queryParams = {}): Promise<T[]> {
132138
{ method: "GET" },
133139
{
134140
page,
135-
per_page: 100,
136141
...queryParams,
137142
}
138143
);

0 commit comments

Comments
 (0)