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

Fix devtools::check_built failure failure #5053

Merged
merged 2 commits into from
Nov 11, 2021

Conversation

harupy
Copy link
Member

@harupy harupy commented Nov 11, 2021

Signed-off-by: harupy hkawamura0130@gmail.com

What changes are proposed in this pull request?

Fix devtools::check_built failure failure caused by the latest MLflow R release:

https://github.com/mlflow/mlflow/runs/4175272472?check_suite_focus=true#step:14:138

── R CMD check results ────────────────────────────────────── mlflow 1.21.1 ────
Duration: 52.7s

❯ checking CRAN incoming feasibility ... NOTE
  Maintainer: ‘Matei Zaharia <matei@databricks.com>’
  
  Days since last update: 0

0 errors ✔ | 0 warnings ✔ | 1 note ✖

How is this patch tested?

Make sure the R check passes.

Does this PR change the documentation?

  • No. You can skip the rest of this section.
  • Yes. Make sure the changed pages / sections render correctly by following the steps below.
  1. Check the status of the ci/circleci: build_doc check. If it's successful, proceed to the
    next step, otherwise fix it.
  2. Click Details on the right to open the job page of CircleCI.
  3. Click the Artifacts tab.
  4. Click docs/build/html/index.html.
  5. Find the changed pages / sections and make sure they render correctly.

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/projects: MLproject format, project running backends
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/server-infra: MLflow Tracking server backend
  • area/tracking: Tracking Service, tracking client APIs, autologging

Interface

  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

Language

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

Integrations

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations

How should the PR be classified in the release notes? Choose one:

  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Signed-off-by: harupy <hkawamura0130@gmail.com>
@github-actions github-actions bot added the rn/none List under Small Changes in Changelogs. label Nov 11, 2021
Signed-off-by: harupy <hkawamura0130@gmail.com>
Comment on lines +7 to +21
# Disable CRAN incoming feasibility check within a week after the latest release because it fails.
#
# Relevant code:
# https://github.com/wch/r-source/blob/4561aea946a75425ddcc8869cdb129ed5e27af97/src/library/tools/R/QC.R#L8005-L8008
install.packages(c("xml2", "rvest"))
library(xml2)
library(rvest)

url <- "https://cran.r-project.org/web/packages/mlflow/index.html"
html <- read_html(url)
xpath <- '//td[text()="Published:"]/following-sibling::td[1]/text()'
published_date <- as.Date(html_text(html_nodes(html, xpath=xpath)))
today <- Sys.Date()
days_since_last_release <- difftime(today, published_date, units="days")
remote <- as.numeric(days_since_last_release) > 7
Copy link
Member Author

Choose a reason for hiding this comment

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

This is hacky but I could not find another way.

@@ -4,5 +4,21 @@ package <- parent_dir[grepl("mlflow_", parent_dir)]
library(reticulate)
use_condaenv(mlflow:::mlflow_conda_env_name())

devtools::check_built(path = package, remote = TRUE, error_on = "note", args = "--no-tests")
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about we just do error_on="warning".
According to https://devtools.r-lib.org/reference/check.html

Passing R CMD check is essential if you want to submit your package to CRAN: you must not have any ERRORs or WARNINGs, and you want to ensure that there are as few NOTEs as possible.

So it's acceptable to have one or more notes. According to https://stackoverflow.com/a/23831508/12165968, the maintainer note is safe to ignore.

The downside of my proposal is that we might be less alerted if other notes show up.

Copy link
Member Author

@harupy harupy Nov 11, 2021

Choose a reason for hiding this comment

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

Thanks for the comment! In the mlflow 1.21.0 release, one note (about an invalid URL on README) blocked the package publication (not submission).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it. It's frustrating that CRAN also categorizes blocking issues as a note besides non-blocking ones...
Do we know whether disabling the CRAN incoming feasibility check will miss blocking issues? I didn't understand what exactly CRAN incoming feasibility check does and why setting the 7 days threshold resolves the issue...

Copy link
Member Author

@harupy harupy Nov 11, 2021

Choose a reason for hiding this comment

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

Do we know whether disabling the CRAN incoming feasibility check will miss blocking issues?

I think disabling the CRAN incoming feasibility check will miss blocking issues.

I didn't understand what exactly CRAN incoming feasibility check does.

It performs a bunch of checks. You can take a look at this file:
https://github.com/wch/r-source/blob/4561aea946a75425ddcc8869cdb129ed5e27af97/src/library/tools/R/QC.R#L8005-L8008

why setting the 7 days threshold resolves the issue.

── R CMD check results ────────────────────────────────────── mlflow 1.21.1 ────
Duration: 52.7s

❯ checking CRAN incoming feasibility ... NOTE
  Maintainer: ‘Matei Zaharia <matei@databricks.com>’
  
  Days since last update: 0

0 errors ✔ | 0 warnings ✔ | 1 note ✖

This note basically means it's been 0 days since the last release. It's too early. The code I attached indicates that the threshold is 7 days. It looks like there is no option to disable this recency check so we just disable the entire feasibility check by setting remote to FALSE within a week.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. I previously thought checking CRAN incoming feasibility ... NOTE Maintainer: ‘Matei Zaharia <matei@databricks.com>’ just means a complaint about the maintainer.

So, as long as we don't release two versions within 7 days, it would run through the same checks as it was before this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep :)

Copy link
Collaborator

@liangz1 liangz1 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this issue! (I'm not very confident about this PR so you can decide whether you want another reviewer to take a look.)

@harupy
Copy link
Member Author

harupy commented Nov 11, 2021

Thanks for the review and comments! To be honest, I'm not 100% confident about the 7 days threshold but I'll merge this PR and see what happens in 7 days :)

@harupy harupy merged commit 9a1c8d4 into mlflow:master Nov 11, 2021
@harupy harupy deleted the set-remote-to-false branch November 12, 2021 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn/none List under Small Changes in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants