Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 2f5f7ab

Browse files
authored
Merge pull request #8237 from systeminit/fix/clover/gcp/verbs
fix(clover): gcp pull http method from specs for creates
2 parents f70856a + 9d83820 commit 2f5f7ab

5 files changed

Lines changed: 30 additions & 5 deletions

File tree

bin/clover/src/pipelines/gcp/funcs/actions/create.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ async function main(component: Input): Promise<Output> {
108108
url += (url.includes("?") ? "&" : "?") + queryParams.join("&");
109109
}
110110

111+
const httpMethod = insertApiPath.httpMethod || "POST";
112+
111113
// Make the API request with retry logic
112114
const response = await siExec.withRetry(async () => {
113115
const resp = await fetch(url, {
114-
method: "POST", // insert is always POST
116+
method: httpMethod,
115117
headers: {
116118
"Authorization": `Bearer ${token}`,
117119
"Content-Type": "application/json",
@@ -121,7 +123,11 @@ async function main(component: Input): Promise<Output> {
121123

122124
if (!resp.ok) {
123125
const errorText = await resp.text();
124-
const error = new Error(`Unable to create resource; API returned ${resp.status} ${resp.statusText}: ${errorText}`) as any;
126+
const error = new Error(`Unable to create resource;
127+
Called "${url}"
128+
API returned ${resp.status} ${resp.statusText}:
129+
${errorText}`
130+
) as any;
125131
error.status = resp.status;
126132
error.body = errorText;
127133
throw error;

bin/clover/src/pipelines/gcp/funcs/actions/delete.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,13 @@ async function main(component: Input): Promise<Output> {
112112
}
113113

114114
const errorText = await resp.text();
115-
const error = new Error(`Unable to delete resource; API returned ${resp.status} ${resp.statusText}: ${errorText}`) as any;
115+
116+
const error = new Error(`Unable to delete resource;
117+
Called "${url}"
118+
API returned ${resp.status} ${resp.statusText}:
119+
${errorText}`
120+
) as any;
121+
116122
error.status = resp.status;
117123
error.body = errorText;
118124
throw error;

bin/clover/src/pipelines/gcp/funcs/actions/refresh.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ async function main(component: Input): Promise<Output> {
109109
}
110110

111111
const errorText = await resp.text();
112-
const error = new Error(`Unable to refresh resource; API returned ${resp.status} ${resp.statusText}: ${errorText}`) as any;
112+
113+
const error = new Error(`Unable to refresh resource;
114+
Called "${url}"
115+
API returned ${resp.status} ${resp.statusText}:
116+
${errorText}`
117+
) as any;
118+
113119
error.status = resp.status;
114120
error.body = errorText;
115121
throw error;

bin/clover/src/pipelines/gcp/funcs/actions/update.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,13 @@ async function main(component: Input): Promise<Output> {
159159

160160
if (!resp.ok) {
161161
const errorText = await resp.text();
162-
const error = new Error(`Unable to update resource; API returned ${resp.status} ${resp.statusText}: ${errorText}`) as any;
162+
163+
const error = new Error(`Unable to update resource;
164+
Called "${url}"
165+
API returned ${resp.status} ${resp.statusText}:
166+
${errorText}`
167+
) as any;
168+
163169
error.status = resp.status;
164170
error.body = errorText;
165171
throw error;

bin/clover/src/pipelines/gcp/pipeline-steps/addDefaultProps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export function addDefaultProps(specs: ExpandedPkgSpec[]): ExpandedPkgSpec[] {
7878
insertProp.data.hidden = true;
7979
insertProp.data.defaultValue = JSON.stringify({
8080
path: gcpSchema.methods.insert.path,
81+
httpMethod: gcpSchema.methods.insert.httpMethod,
8182
parameterOrder: gcpSchema.methods.insert.parameterOrder,
8283
});
8384
extraProp.entries.push(insertProp);

0 commit comments

Comments
 (0)