Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cml-pr command #510

Merged
merged 62 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
61f02ed
test-cml-pr
DavidGOrtega Apr 29, 2021
6ee65f4
packages
DavidGOrtega Apr 29, 2021
cadb16a
pre-release
DavidGOrtega May 10, 2021
3e8048e
log isci
DavidGOrtega May 10, 2021
72da839
log isci
DavidGOrtega May 10, 2021
ef9cdbc
user_name
DavidGOrtega May 10, 2021
4e14770
log gitlab url
DavidGOrtega May 10, 2021
c6382c3
log gitlab url
DavidGOrtega May 10, 2021
640b9ff
short 8
DavidGOrtega May 10, 2021
6ee5203
len paths
DavidGOrtega May 10, 2021
1c149bc
no undef
DavidGOrtega May 10, 2021
d703fbd
git
DavidGOrtega May 10, 2021
495f62f
files
DavidGOrtega May 10, 2021
f736474
files
DavidGOrtega May 10, 2021
4f8ea93
files
DavidGOrtega May 10, 2021
4b6ec74
files
DavidGOrtega May 10, 2021
b66a559
files
DavidGOrtega May 10, 2021
feeddd1
files
DavidGOrtega May 10, 2021
412fdc0
files
DavidGOrtega May 10, 2021
6ba7b0d
files
DavidGOrtega May 10, 2021
083621f
files
DavidGOrtega May 10, 2021
8b9229c
files
DavidGOrtega May 10, 2021
9a2ac54
files
DavidGOrtega May 10, 2021
4e360c4
files
DavidGOrtega May 10, 2021
c9f06b8
files
DavidGOrtega May 10, 2021
14274d0
files
DavidGOrtega May 10, 2021
9aad114
files
DavidGOrtega May 10, 2021
b803d89
files
DavidGOrtega May 10, 2021
bad6d1a
files
DavidGOrtega May 10, 2021
fa87e58
sha2
DavidGOrtega May 10, 2021
4e0c90e
sha2
DavidGOrtega May 10, 2021
3f52528
log filepath
DavidGOrtega May 11, 2021
3208ee3
log filepath
DavidGOrtega May 11, 2021
47d62a9
log filepath
DavidGOrtega May 11, 2021
868128b
exists and clean
DavidGOrtega May 11, 2021
2fcdca6
SHA vs SHA2
DavidGOrtega May 11, 2021
09aec12
pre-release
DavidGOrtega May 11, 2021
e50b21b
pre-release 2
DavidGOrtega May 11, 2021
d316ee7
pre-release 3
DavidGOrtega May 11, 2021
918ac5a
pre-release 3
DavidGOrtega May 11, 2021
ff0ed40
pre-release 3
DavidGOrtega May 11, 2021
78bb238
pre-release 3
DavidGOrtega May 11, 2021
a7e01a1
pre-release 3
DavidGOrtega May 11, 2021
18162f6
pre-release 3
DavidGOrtega May 11, 2021
a98b3ee
git back
DavidGOrtega May 11, 2021
5c0863d
git back
DavidGOrtega May 11, 2021
91fbfe5
git back
DavidGOrtega May 11, 2021
61518df
release
DavidGOrtega May 11, 2021
bdcbf26
merge master
DavidGOrtega May 11, 2021
c24e7c1
REPO_TOKEN
DavidGOrtega May 11, 2021
2768711
Merge branch 'master' of https://github.com/iterative/cml into cml-pr
DavidGOrtega May 11, 2021
57f506e
html_url
DavidGOrtega May 14, 2021
142949b
cml pr defaults
DavidGOrtega May 15, 2021
e886cf6
cml pr defaults
DavidGOrtega May 15, 2021
5a36b5b
test strict again
DavidGOrtega May 15, 2021
9f2b6a2
CI
DavidGOrtega May 16, 2021
bd83a1f
vars
DavidGOrtega May 16, 2021
c5f4dfa
shorter params
DavidGOrtega May 17, 2021
76ba817
snapshots and olivaw
DavidGOrtega May 17, 2021
2b3b2d3
test david
DavidGOrtega May 17, 2021
e9b2e9c
BB fix
DavidGOrtega May 17, 2021
1f073c4
snapshots
DavidGOrtega May 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions bin/cml-pr.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ console.log = console.error;
const yargs = require('yargs');
const decamelize = require('decamelize-keys');

const CML = require('../src/cml');
const CML = require('../src/cml').default;
const { GIT_REMOTE, GIT_USER_NAME, GIT_USER_EMAIL } = require('../src/cml');

const run = async (opts) => {
const globs = opts._.length ? opts._ : undefined;
const cml = new CML(opts);
print(await cml.pr_create({ ...opts, globs }));
print((await cml.pr_create({ ...opts, globs })) || '');
};

const opts = decamelize(
yargs
.strict()
DavidGOrtega marked this conversation as resolved.
Show resolved Hide resolved
.usage('Usage: $0 <path to markdown file>')
.usage('Usage: $0 <glob path> ... <glob path>')
.describe('md', 'Output in markdown format [](url).')
.boolean('md')
.default('git-remote', GIT_REMOTE)
.default('git-user-email', GIT_USER_EMAIL)
.default('git-user-name', GIT_USER_NAME)
DavidGOrtega marked this conversation as resolved.
Show resolved Hide resolved
.default('repo')
.describe(
'repo',
Expand Down
27 changes: 27 additions & 0 deletions bin/cml-pr.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
jest.setTimeout(200000);

const { exec } = require('../src/utils');

describe('CML e2e', () => {
test('cml-publish -h', async () => {
const output = await exec(`echo none | node ./bin/cml-pr.js -h`);

expect(output).toMatchInlineSnapshot(`
"Usage: cml-pr.js <glob path> ... <glob path>

Options:
--version Show version number [boolean]
--md Output in markdown format [](url). [boolean]
--repo Specifies the repo to be used. If not specified is extracted
from the CI ENV.
--token Personal access token to be used. If not specified in
extracted from ENV REPO_TOKEN.
--driver If not specify it infers it from the ENV.
[choices: \\"github\\", \\"gitlab\\"]
-h Show help [boolean]
--git-remote [default: \\"origin\\"]
--git-user-email [default: \\"olivaw@iterative.ai\\"]
--git-user-name [default: \\"iterative-olivaw\\"]"
DavidGOrtega marked this conversation as resolved.
Show resolved Hide resolved
`);
});
});
2 changes: 1 addition & 1 deletion bin/cml-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const fs = require('fs').promises;
const pipe_args = require('../src/pipe-args');
const yargs = require('yargs');

const CML = require('../src/cml');
const CML = require('../src/cml').default;

const run = async (opts) => {
const {
Expand Down
2 changes: 1 addition & 1 deletion bin/cml-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const decamelize = require('decamelize-keys');

const { exec, randid, sleep } = require('../src/utils');
const tf = require('../src/terraform');
const CML = require('../src/cml');
const CML = require('../src/cml').default;

const NAME = `cml-${randid()}`;
const WORKDIR_BASE = `${homedir()}/.cml`;
Expand Down
2 changes: 1 addition & 1 deletion bin/cml-send-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ console.log = console.error;
const fs = require('fs').promises;
const yargs = require('yargs');

const CML = require('../src/cml');
const CML = require('../src/cml').default;

const run = async (opts) => {
const {
Expand Down
2 changes: 1 addition & 1 deletion bin/cml-send-github-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ console.log = console.error;
const fs = require('fs').promises;
const yargs = require('yargs');

const CML = require('../src/cml');
const CML = require('../src/cml').default;
const CHECK_TITLE = 'CML Report';

const run = async (opts) => {
Expand Down
Loading