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

feat(generate) return non-zero code or page error (#4991) #5195

Merged
merged 5 commits into from
Mar 11, 2019

Conversation

loomchild
Copy link

@loomchild loomchild commented Mar 10, 2019

Introduce --fail-on-page-error option that will cause nuxt generate to return non-zero status code when it encounters a page generation error. This is useful to let CI know that something went wrong.

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Resolves: #4991
This PR is a result of the discussion under this ticket and the fact that nuxt-generate-cluster implements similar feature: see nuxt-community/nuxt-generate-cluster#17.

This feature allows nuxt generate to return non-zero status code in case of page generation error. This is useful to let CI know that something went wrong, otherwise such issues might get unnoticed for a long time.

In order to avoid changing existing behavior and introducing a breaking change I am proposing to add a parameter --fail-on-page-error. Only if this parameter is present the error status code will be returned.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

Note - I am not sure if it requires documentation update and where I should update it, but I am happy to do it if needed. For the moment I have added a option description which will be available when running nuxt generate --help.

@codecov-io
Copy link

codecov-io commented Mar 10, 2019

Codecov Report

Merging #5195 into dev will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #5195      +/-   ##
==========================================
+ Coverage   96.31%   96.32%   +<.01%     
==========================================
  Files          73       73              
  Lines        2472     2474       +2     
  Branches      626      627       +1     
==========================================
+ Hits         2381     2383       +2     
  Misses         76       76              
  Partials       15       15
Impacted Files Coverage Δ
packages/cli/src/commands/generate.js 95% <66.66%> (-5%) ⬇️
packages/vue-renderer/src/renderer.js 94.84% <0%> (+0.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13cb0f7...1c3f72c. Read the comment docs.

Introduce --fail-on-page-error option that will cause nuxt generate to
return non-zero status code when it encounters a page generation error.
This is useful to let CI know that something went wrong.
pi0
pi0 previously approved these changes Mar 11, 2019
@loomchild
Copy link
Author

Yay, my first PR to Nuxt. Thanks guys!

@pimlie
Copy link

pimlie commented Mar 11, 2019

@loomchild Great work, that many more may follow! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nuxt generate should exit with non-zero code on errors
5 participants