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

[ci] [R-package] catch builds that have not updated docs #3205

Merged
merged 5 commits into from
Jul 5, 2020

Conversation

jameslamb
Copy link
Collaborator

From @StrikerRUS 's suggestion in #3188 (comment), this pull request proposes adding a new R CI jobs called check-r-docs. This job regenerates the documentation for the R package and checks if there are any changes that have not been committed to the repo.

In R, the process for builds the docs in the R-package/man/ folder is like this:

  1. change files in R-package/R/
  2. install the liibrary
  3. run roxygen2::roxygenize(load = 'installed')

Because this process relies on installing the library, I think it makes sense to add into ./.ci/test_r_package.sh. It requires installing one additional somewhat-expensive dependency (roxygen2) and the documentation is not dependent on operating system so I think it makes sense to do this in a single new TASK instead of running it in all of the R CI jobs.

@jameslamb jameslamb requested a review from StrikerRUS July 4, 2020 02:08
@jameslamb jameslamb requested a review from Laurae2 as a code owner July 4, 2020 02:08
@@ -1,5 +1,5 @@
#' @name lgb.importance
#' @title Compute feature importance in a model
#' @title Compute feature importance in a model (testing)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added this as an example of the type of change that should trigger a failure. I'll remove it once we see if the new task works as expected.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -4,7 +4,7 @@
CRAN_MIRROR="https://cloud.r-project.org/"
R_LIB_PATH=~/Rlib
mkdir -p $R_LIB_PATH
echo "R_LIBS=$R_LIB_PATH" > ${HOME}/.Renviron
export R_LIBS=$R_LIB_PATH
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I made a mistake while developing...code with Rscript --vanilla -e failed to load a library because --vanilla ignores the .Renviron

I think we should remove this and use normal environment variables instead, to make the code a little more explicit and easier to reason about.

Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

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

Thank you, nice addition!

If one just want to fix a typo and do not have R environment, then it is possible to leave this docs updating process for maintainers by checking Allow edits from maintainers in a PR settings.

.ci/test.sh Outdated
@@ -69,7 +69,7 @@ if [[ $TASK == "if-else" ]]; then
exit 0
fi

if [[ $TASK == "r-package" ]]; then
if [[ $TASK == "r-package" ]] || [[ $TASK == "check-r-docs" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a suggestion to not overcomplicate this if statement in the future. Name task with something like r-package-check-docs and then just check that it starts with r-package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh good idea! Just pushed 0b17315 to implement this

.ci/test_r_package.sh Outdated Show resolved Hide resolved
@StrikerRUS StrikerRUS merged commit d8bc0fc into microsoft:master Jul 5, 2020
@StrikerRUS
Copy link
Collaborator

@guolinke Please make new job required. Thank you!

@jameslamb jameslamb deleted the ci/r-docs branch July 12, 2020 21:43
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants