From 57de2dc9e70552fa20f94ef931839030fa8c4ff3 Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Thu, 24 Oct 2024 00:50:10 +0000 Subject: [PATCH] Fix non-native uploads --- cml_qa_tests_dummy | 1 + src/cml.js | 6 ++++-- src/drivers/gitlab.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 160000 cml_qa_tests_dummy diff --git a/cml_qa_tests_dummy b/cml_qa_tests_dummy new file mode 160000 index 000000000..f8b8b49a2 --- /dev/null +++ b/cml_qa_tests_dummy @@ -0,0 +1 @@ +Subproject commit f8b8b49a253243830ef59a7f090eb887157b2b67 diff --git a/src/cml.js b/src/cml.js index b6146d82d..ecabc8edf 100644 --- a/src/cml.js +++ b/src/cml.js @@ -346,12 +346,14 @@ class CML { ({ mime, uri } = await upload(opts)); } - if (!rmWatermark) { + if (!rmWatermark && !native) { const [, type] = mime.split('/'); uri = watermarkUri({ uri, type }); } - uri = preventcacheUri({ uri }); + if (!native) { + uri = preventcacheUri({ uri }); + } if (md && mime.match('(image|video)/.*')) return `![](${uri}${title ? ` "${title}"` : ''})`; diff --git a/src/drivers/gitlab.js b/src/drivers/gitlab.js index aea364d08..202e8708b 100644 --- a/src/drivers/gitlab.js +++ b/src/drivers/gitlab.js @@ -139,7 +139,7 @@ class Gitlab { const { url } = await this.request({ endpoint, method: 'POST', body }); - return { uri: `${await this.repoBase()}${url}`, mime, size }; + return { uri: url, mime, size }; } async runnerToken(body) {