-
Notifications
You must be signed in to change notification settings - Fork 18
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
Address ropensci review #213
Conversation
I resolved conflicts and tentatively undid the code changes. We can discuss. This is what a call to tic::do_bookdown()
#> Using TRAVIS_DEPLOY_KEY env var as the private key name for SSH deployment.
#> ✓ Creating a blank tic stage configuration
#> ℹ tic configuration
#> ── install ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── stage ──
#> ▶ step_install_deps(repos = repo_default())
#> ── deploy ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── stage ──
#> ▶ step_build_bookdown() Created on 2020-01-12 by the reprex package (v0.3.0) We can add a note that points to Testing for interactive code is brittle: users might want to run I also don't think that {tic} should unconditionally require a Perhaps we should link more prominently to the "troubleshooting" section, to assist first time users? Or move "troubleshooting: local runs" to the "Get started" document? |
Regarding |
Currently: tic::do_bookdown()
#> Using TRAVIS_DEPLOY_KEY env var as the private key name for SSH deployment.
#> ✓ Creating a clean tic stage configuration
#> ℹ See `?tic::dsl_get` for details
#>
#> ── tic configuration ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> ── install ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── stage ──
#> ▶ step_install_deps(repos = repo_default())
#> ── deploy ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── stage ──
#> ▶ step_build_bookdown() Created on 2020-01-12 by the reprex package (v0.3.0) The help page explains what's going on, pointing to the Checking |
@pat-s: I can't request your review. Could you please take a look? |
The motivation came from the ropensci review where Anna tried calling some tic functions on a new repo without a tic.R file - i.e. no run of
Should we expand the message something like: "We detected you are running XYZ interactively, which is not supported. See ?tic::dsl_get for details."? I think we have room to improve the documentation on how to use {tic} interactively even though we have https://docs.ropensci.org/tic/articles/advanced.html#emulating-a-ci-run-locally already:
This would have helped Anna in her review I assume. We should also prominently link such a resource in interactive calls to macros/steps like the one above. What do you think? |
@@ -4,17 +4,22 @@ LocalCI <- R6Class( | |||
|
|||
public = list( | |||
get_branch = function() { | |||
system2("git", "rev-parse --abbrev-ref HEAD", stdout = TRUE) | |||
suppressWarnings(system2("git", "rev-parse --abbrev-ref HEAD", stdout = TRUE)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment what we are suppressing here?
tryCatch( | ||
{ | ||
remote <- gh::gh_tree_remote() | ||
paste0(remote$username, "/", remote$repo) | ||
}, | ||
error = "" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What motivated this tryCatch?
@@ -23,7 +28,7 @@ LocalCI <- R6Class( | |||
NULL | |||
}, | |||
get_commit = function() { | |||
git2r::revparse_single(revision = "HEAD")$sha | |||
tryCatch(git2r::revparse_single(revision = "HEAD")$sha, error = "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What motivated this tryCatch?
R/steps-install.R
Outdated
@@ -9,6 +9,9 @@ InstallDeps <- R6Class( | |||
}, | |||
|
|||
prepare = function() { | |||
if (!file.exists("DESCRIPTION")) { | |||
stopc("No DESCRIPTION file found. The step_install_deps step and the do_package_checks macro are only available for packages.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recently like to format error messages as
cli_alert_danger("<extended descriptive message>")
stopc("No DESCRIPTION file found.")
The advantage is that you can wrap the extended description and also use cli formatting in it. The plain message in the stop call is then just to state the main reason of the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rlang conditions are better here, see ?rlang::cnd_body
. Here I'm using the pattern you're suggesting, for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks promising.
use_tic()
: Ensure that a DESCRIPTION file is present #200ropensci/software-review#305 (comment)
mention the difference between .com and .org -> new vignette "org-vs-com")
indeed, perhaps the default R_TRAVIS should be .com given the current changes to travis? -> changed in {travis}
During travis::travis_sync() the API token is pasted in the console and (although deleted form history) is still visible in the console. Could this be avoided in any way? -> done when refactoring {travis}
return early if
do_*
andstep_*
functions are called interactivelyerror and suggest to call
use_tic()
first when runningdsl_init()
in a repo without atic.R
Make it possible to pass the
endpoint
arg from {travis} funs touse_tic()
README updates
all examples are not
\dontrun
becausedsl_init()
only works within a projectBecause of
https://github.com/ropenscilabs/tic/blob/834b30f0c63b004015154bfb94fd8c30b18cb5c8/R/stage.R#L35-L45
I had to move {usethis} from suggests to imports. Otherwise {usethis} is missing as it is not yet installed in the "install" step as a dep when being called in
tic::prepare_stages()
.I would like to avoid this actually but we are using quite a bit of {usethis} internally all over the place and maybe we should just have it in imports.