-
Notifications
You must be signed in to change notification settings - Fork 18
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
Added informative error format #143
Added informative error format #143
Conversation
bin/tag-release-prerelease.js
Outdated
@@ -12,6 +12,9 @@ commander.parse(process.argv); | |||
let options = {}; | |||
const { verbose, maxbuffer, args } = commander; | |||
const prerelease = args.length ? args[0] : true; | |||
options = extend({}, { prerelease, verbose, maxbuffer, workflow }); | |||
options = extend( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the extend
is needed here. You should just be able to do something like...
options = { prerelease, verbose, maxbuffer, workflow, command: "prerelease" };
bin/tag-release-promote.js
Outdated
@@ -12,6 +12,9 @@ commander.parse(process.argv); | |||
let options = {}; | |||
const { verbose, maxbuffer, args } = commander; | |||
const promote = args.length ? args[0] : true; | |||
options = extend({}, { promote, verbose, maxbuffer, workflow }); | |||
options = extend( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
bin/tag-release-qa.js
Outdated
}; | ||
|
||
let options = {}; | ||
const { verbose, maxbuffer, args } = commander; | ||
const qa = args.length ? args[0] : true; | ||
options = extend({}, { qa, verbose, maxbuffer, callback, workflow }); | ||
options = extend( | ||
{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
bin/tag-release-reset.js
Outdated
@@ -6,6 +6,6 @@ const workflow = require("../src/workflows/reset"); | |||
|
|||
commander.parse(process.argv); | |||
|
|||
const options = extend({}, { reset: true, workflow }); | |||
const options = extend({}, { reset: true, workflow, command: "reset" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here...
bin/tag-release-start.js
Outdated
@@ -10,6 +10,6 @@ utils.applyCommanderOptions(commander); | |||
commander.parse(process.argv); | |||
|
|||
const { verbose, maxbuffer } = commander; | |||
const options = extend({}, { verbose, maxbuffer, workflow }); | |||
const options = extend({}, { verbose, maxbuffer, workflow, command: "start" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here...
specs/helpers/setup.spec.js
Outdated
state = {}; | ||
}); | ||
|
||
afterEach(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove the afterEach here since the beforeEach will run before each test. You should have a fresh start each time
specs/workflows/steps/index.spec.js
Outdated
@@ -73,7 +73,9 @@ describe("shared workflow steps", () => { | |||
}); | |||
|
|||
afterEach(() => { | |||
state = {}; | |||
state = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this code into the beforeEach and remove this afterEach?
src/helpers/runWorkflow.js
Outdated
command: ${options.command} | ||
step: ${options.step} | ||
error: ${error.message}`; | ||
utils.writeFile(logPath, content); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could just be...
const fs = require("fs");
fs.appendFileSync(logPath, content);
Then you could remove lines 9-12. At some point in the future maybe you could pull that out to a utils.appendFile method, but for now I'm find if you just use fs directly since the API is the same. It could be refactored in a following PR and update the other places you mentioned that could benefit for appendFile instead of writing the whole thing again
src/workflows/steps/index.js
Outdated
@@ -88,6 +88,7 @@ const api = { | |||
}, | |||
fetchUpstream(state) { | |||
state.step = "fetchUpstream"; | |||
// return Promise.reject(new Error("something bad")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete please
ce585f6
to
f5759be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve this
Short description of the work completed
Steps to test (if not obvious)
For Reviewer Use Only
src/help.js
andREADME.md
patch)