Skip to content

Add after_script to ensure the documents are regenerated #3596

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

Conversation

yutannihilation
Copy link
Member

@yutannihilation yutannihilation commented Oct 28, 2019

It's a common mistake to forget to run devtools::documents(), but it's hard to detect them by reviewing on GitHub. It would be nice if it can be detected on Travis CI. This PR adds an after_script for this; the error might be false positive so it can be ignored by manually checking the CI results.

@clauswilke
Copy link
Member

Presumably the automatic check on this is going to fail until #3595 is merged? This will be a good test case.

@yutannihilation
Copy link
Member Author

Presumably the automatic check on this is going to fail until #3595 is merged?

Ah, yes! Let's see if this works as expected...

@yutannihilation
Copy link
Member Author

Ouch...

Error: 'documents' is not an exported object from 'namespace:devtools'

@clauswilke
Copy link
Member

It's devtools::document().

@yutannihilation
Copy link
Member Author

Sorry, I misunderstood about the build stages. after_script cannot make the build fail. Let me think if I can insert the check into script.

The exit code of after_success, after_failure, after_script, after_deploy and subsequent stages do not affect the build result. However, if one of these stages times out, the build is marked as failed. (https://docs.travis-ci.com/user/job-lifecycle/#breaking-the-build)

@yutannihilation
Copy link
Member Author

Hmm, it's actually failed. I'm confused...

https://travis-ci.org/tidyverse/ggplot2/jobs/604197809#L1227-L1232

@yutannihilation
Copy link
Member Author

@clauswilke It might take some time to figure out the proper settings here, so you don't need to wait for this to merge #3595.

@yutannihilation
Copy link
Member Author

My guess is that explicit exit <non-zero status> works while execution of some script that exits non-zero status (e.g. Rscript -e 'devtools::documents()') is ignored. But, I'm not sure if we can rely on this behaviour.

@yutannihilation
Copy link
Member Author

They say I should not use exit. Probably I need to think about a better approach to do this in R, so I'm closing this for now.

https://docs.travis-ci.com/user/job-lifecycle/#how-does-this-work-or-why-you-should-not-use-exit-in-build-steps

@yutannihilation yutannihilation deleted the ci/check-documents-regenerated branch October 29, 2019 03:13
@lock
Copy link

lock bot commented Apr 26, 2020

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants