From 118840763287984a7f270553bc56793764f9c8be Mon Sep 17 00:00:00 2001 From: Ciprianna Engel Date: Thu, 12 Jan 2023 10:26:46 -0600 Subject: [PATCH] fix: sets the method to POST in reRunWorkflow fetch request. This was not set and defaulted to a GET, causing the request to fail. Signed-off-by: Ciprianna Engel --- .changeset/poor-poems-allow.md | 5 +++++ plugins/cloudbuild/src/api/CloudbuildClient.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/poor-poems-allow.md diff --git a/.changeset/poor-poems-allow.md b/.changeset/poor-poems-allow.md new file mode 100644 index 0000000000..b82a762b83 --- /dev/null +++ b/.changeset/poor-poems-allow.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-cloudbuild': patch +--- + +Fixed bug in the CloudbuildClient reRunWorkflow fetch call. The method in the fetch request was not specified and defaulted to a GET. Method is now explicitly set to POST with this change. diff --git a/plugins/cloudbuild/src/api/CloudbuildClient.ts b/plugins/cloudbuild/src/api/CloudbuildClient.ts index 035b20f63d..cb6747e803 100644 --- a/plugins/cloudbuild/src/api/CloudbuildClient.ts +++ b/plugins/cloudbuild/src/api/CloudbuildClient.ts @@ -34,6 +34,7 @@ export class CloudbuildClient implements CloudbuildApi { options.projectId, )}/builds/${encodeURIComponent(options.runId)}:retry`, { + method: 'POST', headers: new Headers({ Accept: '*/*', Authorization: `Bearer ${await this.getToken()}`,