From 26e815a94ddc79bcac6a3d0715d230cfcf57d5c3 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 7 Oct 2022 14:00:24 +0100 Subject: [PATCH 1/4] --native => --publish-native --- bin/cml/comment/create.js | 21 +++++++++++---------- bin/cml/comment/create.test.js | 24 ++++++++++++------------ 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/bin/cml/comment/create.js b/bin/cml/comment/create.js index 59ea2a60d..9708410ee 100644 --- a/bin/cml/comment/create.js +++ b/bin/cml/comment/create.js @@ -16,6 +16,15 @@ exports.options = kebabcaseKeys({ description: 'Post to an existing PR/MR associated with the specified commit' }, + watch: { + type: 'boolean', + description: 'Watch for changes and automatically update the comment' + }, + triggerFile: { + type: 'string', + description: 'File used to trigger the watcher', + hidden: true + }, commitSha: { type: 'string', alias: 'head-sha', @@ -31,17 +40,9 @@ exports.options = kebabcaseKeys({ default: 'https://asset.cml.dev', description: 'Self-hosted image server URL' }, - watch: { - type: 'boolean', - description: 'Watch for changes and automatically update the comment' - }, - triggerFile: { - type: 'string', - description: 'File used to trigger the watcher', - hidden: true - }, - native: { + publishNative: { type: 'boolean', + alias: 'native', description: "Uses driver's native capabilities to upload assets instead of CML's storage; not available on GitHub" }, diff --git a/bin/cml/comment/create.test.js b/bin/cml/comment/create.test.js index a7a8a28ec..a271a5af8 100644 --- a/bin/cml/comment/create.test.js +++ b/bin/cml/comment/create.test.js @@ -18,21 +18,21 @@ describe('Comment integration tests', () => { --help Show help [boolean] Options: - --pr Post to an existing PR/MR associated with the - specified commit [boolean] - --commit-sha, --head-sha Commit SHA linked to this comment + --pr Post to an existing PR/MR associated with the + specified commit [boolean] + --watch Watch for changes and automatically update the + comment [boolean] + --commit-sha, --head-sha Commit SHA linked to this comment [string] [default: \\"HEAD\\"] - --publish Upload any local images found in the Markdown report - [boolean] - --publish-url Self-hosted image server URL + --publish Upload any local images found in the Markdown + report [boolean] + --publish-url Self-hosted image server URL [string] [default: \\"https://asset.cml.dev\\"] - --watch Watch for changes and automatically update the - comment [boolean] - --native Uses driver's native capabilities to upload assets - instead of CML's storage; not available on GitHub + --publish-native, --native Uses driver's native capabilities to upload assets + instead of CML's storage; not available on GitHub [boolean] - --rm-watermark Avoid watermark; CML needs a watermark to be able to - distinguish CML comments from others [boolean]" + --rm-watermark Avoid watermark; CML needs a watermark to be able + to distinguish CML comments from others [boolean]" `); }); }); From ec4204e34d734e3db17c336350f28b6b482111cb Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 7 Oct 2022 14:14:22 +0100 Subject: [PATCH 2/4] cleanup pr --- bin/cml.test.js | 14 +++++++------- bin/cml/pr.js | 2 +- bin/cml/pr/create.e2e.test.js | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/cml.test.js b/bin/cml.test.js index 612fed3ab..04ac3fd39 100644 --- a/bin/cml.test.js +++ b/bin/cml.test.js @@ -8,13 +8,13 @@ describe('command-line interface tests', () => { "cml.js Commands: - cml.js check Manage CI checks - cml.js comment Manage comments - cml.js pr Manage pull requests - cml.js runner Manage self-hosted (cloud & on-premise) CI runners - cml.js tensorboard Manage tensorboard.dev connections - cml.js workflow Manage CI workflows - cml.js ci Prepare Git repository for CML operations + cml.js check Manage CI checks + cml.js comment Manage comments + cml.js pr Manage pull requests + cml.js runner Manage self-hosted (cloud & on-premise) CI runners + cml.js tensorboard Manage tensorboard.dev connections + cml.js workflow Manage CI workflows + cml.js ci Prepare Git repository for CML operations Global Options: --log Logging verbosity diff --git a/bin/cml/pr.js b/bin/cml/pr.js index 65930cbfb..530518d21 100644 --- a/bin/cml/pr.js +++ b/bin/cml/pr.js @@ -1,6 +1,6 @@ const { options, handler } = require('./pr/create'); -exports.command = 'pr '; +exports.command = 'pr'; exports.description = 'Manage pull requests'; exports.handler = handler; exports.builder = (yargs) => diff --git a/bin/cml/pr/create.e2e.test.js b/bin/cml/pr/create.e2e.test.js index 86a7fd446..9b9105f1e 100644 --- a/bin/cml/pr/create.e2e.test.js +++ b/bin/cml/pr/create.e2e.test.js @@ -5,7 +5,7 @@ describe('CML e2e', () => { const output = await exec(`echo none | node ./bin/cml.js pr --help`); expect(output).toMatchInlineSnapshot(` - "cml.js pr + "cml.js pr Manage pull requests From ffc132dbdd440aceb5565caf646fd441a39779f0 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 14 Oct 2022 15:02:08 +0100 Subject: [PATCH 3/4] Revert "cleanup pr " This reverts commit ec4204e34d734e3db17c336350f28b6b482111cb. --- bin/cml.test.js | 14 +++++++------- bin/cml/pr.js | 2 +- bin/cml/pr/create.e2e.test.js | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/cml.test.js b/bin/cml.test.js index 04ac3fd39..612fed3ab 100644 --- a/bin/cml.test.js +++ b/bin/cml.test.js @@ -8,13 +8,13 @@ describe('command-line interface tests', () => { "cml.js Commands: - cml.js check Manage CI checks - cml.js comment Manage comments - cml.js pr Manage pull requests - cml.js runner Manage self-hosted (cloud & on-premise) CI runners - cml.js tensorboard Manage tensorboard.dev connections - cml.js workflow Manage CI workflows - cml.js ci Prepare Git repository for CML operations + cml.js check Manage CI checks + cml.js comment Manage comments + cml.js pr Manage pull requests + cml.js runner Manage self-hosted (cloud & on-premise) CI runners + cml.js tensorboard Manage tensorboard.dev connections + cml.js workflow Manage CI workflows + cml.js ci Prepare Git repository for CML operations Global Options: --log Logging verbosity diff --git a/bin/cml/pr.js b/bin/cml/pr.js index 5d7976e25..4e9f6b3a3 100644 --- a/bin/cml/pr.js +++ b/bin/cml/pr.js @@ -1,6 +1,6 @@ const { options, handler } = require('./pr/create'); -exports.command = 'pr'; +exports.command = 'pr '; exports.description = 'Manage pull requests'; exports.handler = handler; exports.builder = (yargs) => diff --git a/bin/cml/pr/create.e2e.test.js b/bin/cml/pr/create.e2e.test.js index 9b9105f1e..86a7fd446 100644 --- a/bin/cml/pr/create.e2e.test.js +++ b/bin/cml/pr/create.e2e.test.js @@ -5,7 +5,7 @@ describe('CML e2e', () => { const output = await exec(`echo none | node ./bin/cml.js pr --help`); expect(output).toMatchInlineSnapshot(` - "cml.js pr + "cml.js pr Manage pull requests From 90238b7fb1cdf26fea981b3f5bacab04f412793a Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 14 Oct 2022 15:09:12 +0100 Subject: [PATCH 4/4] reorder again --- bin/cml/comment/create.js | 12 ++++++------ bin/cml/comment/create.test.js | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/cml/comment/create.js b/bin/cml/comment/create.js index 1b98036b4..c0dea33c8 100644 --- a/bin/cml/comment/create.js +++ b/bin/cml/comment/create.js @@ -20,6 +20,12 @@ exports.options = kebabcaseKeys({ description: 'Post to an existing PR/MR associated with the specified commit' }, + commitSha: { + type: 'string', + alias: 'head-sha', + default: 'HEAD', + description: 'Commit SHA linked to this comment' + }, watch: { type: 'boolean', description: 'Watch for changes and automatically update the comment' @@ -29,12 +35,6 @@ exports.options = kebabcaseKeys({ description: 'File used to trigger the watcher', hidden: true }, - commitSha: { - type: 'string', - alias: 'head-sha', - default: 'HEAD', - description: 'Commit SHA linked to this comment' - }, publish: { type: 'boolean', default: true, diff --git a/bin/cml/comment/create.test.js b/bin/cml/comment/create.test.js index d9a61be6a..681ae8b05 100644 --- a/bin/cml/comment/create.test.js +++ b/bin/cml/comment/create.test.js @@ -20,10 +20,10 @@ describe('Comment integration tests', () => { Options: --pr Post to an existing PR/MR associated with the specified commit [boolean] - --watch Watch for changes and automatically update the - comment [boolean] --commit-sha, --head-sha Commit SHA linked to this comment [string] [default: \\"HEAD\\"] + --watch Watch for changes and automatically update the + comment [boolean] --publish Upload any local images found in the Markdown report [boolean] [default: true] --publish-url Self-hosted image server URL