Skip to content

Chain result upto compare method #90

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

Merged
merged 5 commits into from
Aug 10, 2017
Merged

Conversation

vishrutshah
Copy link
Contributor

@vishrutshah vishrutshah commented Aug 7, 2017

@msftclas
Copy link

msftclas commented Aug 7, 2017

@vishrutshah,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

lib/validate.js Outdated
return openApiDiff.compare(oldSwagger, newSwagger);
return openApiDiff.compare(oldSwagger, newSwagger).then((result, err) => {
console.log(result);
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.catch on error

lib/validate.js Outdated
@@ -29,5 +29,7 @@ exports.compare = function compare(oldSwagger, newSwagger, options) {
log.filepath = options.logFilepath || log.filepath;
let openApiDiff = new OpenApiDiff(options);

return openApiDiff.compare(oldSwagger, newSwagger);
return openApiDiff.compare(oldSwagger, newSwagger).then((result, err) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to err

lib/validate.js Outdated
@@ -30,6 +30,10 @@ exports.compare = function compare(oldSwagger, newSwagger, options) {
let openApiDiff = new OpenApiDiff(options);

return openApiDiff.compare(oldSwagger, newSwagger).then((result, err) => {
console.log(result);
if (err) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for if (err) if we do catch

@vishrutshah
Copy link
Contributor Author

@veronicagg & @amarzavery I've updated PR to incorporate yesterday's feedback. Please feel free to review again as you get chance. Thanks!

Here is the successfully failed CI Build: https://travis-ci.org/Azure/azure-rest-api-specs/builds/262944817?utm_source=github_status&utm_medium=notification

CHANGELOG.md Outdated
@@ -1,6 +1,10 @@
## 0.1.7
Released on 2017-08-10.
- Chaining the promises upto `compare` method and gracefully existing application [#88](https://github.com/Azure/openapi-diff/issues/88)
Copy link

@amarzavery amarzavery Aug 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exi s ting

@@ -61,11 +61,8 @@ class OpenApiDiff {

return Promise.all([promise1, promise2]).then(results => {
return self.processViaOpenApiDiff(results[0], results[1]).then((result, error) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return Promise.all([promise1, promise2]).then(results => { 
  return self.processViaOpenApiDiff(results[0], results[1]); //this is already returning a promise, so need to chain a redundant `.then()` to it
};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@amarzavery
Copy link

:shipit:

Copy link
Contributor

@veronicagg veronicagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@vishrutshah
Copy link
Contributor Author

 return Promise.resolve('Thanks everyone for the review!!'); 

:)

@vishrutshah vishrutshah merged commit 9df9120 into Azure:master Aug 10, 2017
@vishrutshah vishrutshah deleted the chain-result branch August 10, 2017 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants