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

Prompt users during make() in interactive mode #762

Merged
merged 3 commits into from
Mar 1, 2019
Merged

Prompt users during make() in interactive mode #762

merged 3 commits into from
Mar 1, 2019

Conversation

wlandau
Copy link
Member

@wlandau wlandau commented Mar 1, 2019

Summary

drake gets initial dependencies from the user's environment rather than script files. However, environments are brittle, so targets can falsely invalidate if you run make() in a stale R session. This PR implements safeguards and reminders for make() in interactive mode. If the R session is interactive and some targets are out of date, make() prompts you with a menu to keep you from accidentally mangling your project. It also reminds you to read #761 regardless of how your targets are doing.

> interactive()
[1] TRUE
> library(drake)
> plan <- drake_plan(x = 1, y = 2)
> make(plan)
2 outdated targets:
  x
  y

Really run make() in interactive mode?
Considerations: https://github.com/ropensci/drake/issues/761 

1: yes
2: no

Selection: 1
target x
target y
make() in interactive mode requires extra care:
https://github.com/ropensci/drake/issues/761
> make(plan)
All targets are already up to date.
make() in interactive mode requires extra care:
https://github.com/ropensci/drake/issues/761

You can disable the menu with make(force = TRUE) or options(drake_force_interactive = TRUE).

cc @MilesMcBain, @ha0ye

Related GitHub issues and pull requests

Checklist

  • I have read drake's code of conduct, and I agree to follow its rules.
  • I have listed any substantial changes in the development news.
  • I have added testthat unit tests to tests/testthat to confirm that any new features or functionality work correctly.
  • I have tested this pull request locally with devtools::check()
  • This pull request is ready for review.
  • I think this pull request is ready to merge.

@codecov-io
Copy link

codecov-io commented Mar 1, 2019

Codecov Report

Merging #762 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #762   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          72     72           
  Lines        6106   6122   +16     
=====================================
+ Hits         6106   6122   +16
Impacted Files Coverage Δ
R/exec-backend.R 100% <ø> (ø) ⬆️
R/vis-color.R 100% <ø> (ø) ⬆️
R/api-make.R 100% <100%> (ø) ⬆️
R/exec-session.R 100% <100%> (ø) ⬆️
R/vis-console.R 100% <100%> (ø) ⬆️
R/preprocess-config.R 100% <100%> (ø) ⬆️

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 ba70906...66a1fdc. Read the comment docs.

@wlandau wlandau merged commit 4aecf22 into master Mar 1, 2019
@wlandau wlandau deleted the 761-menu branch March 1, 2019 19:49
wlandau-lilly added a commit to wlandau/roweb2 that referenced this pull request Mar 1, 2019
stefaniebutland pushed a commit to ropensci-archive/roweb2 that referenced this pull request Mar 18, 2019
* Change the video player in the drake tech note

The default PowToon player is having problems,
so I propose a switch to Wistia.

* Add technote: drake version 7.0.0

* Try to fix authors field

* Rm mtcars beforehand

Needed to consistently reproduce `lock_envir = FALSE` behavior.
Also add a link.

* Reknit drake tech note

ropensci/drake#756

* Reknit to remove superfluous message

* Add a tag

* Update drake 7.0.0 tech note...

...re ropensci/drake#762

* Add more thanks

* Update a header

* Clean up error messages in drake itself

* Minor edit

* Minor elaboration

* Minor update: reduced verbosity in drake

* Mention some future work

* Update drake tech note

re ropensci/drake#765

* Clean up the section on interactive sessions

* Fix a typo

* Fix a link

* Edit recap section in drake tech note

* Sync recap

* Mention @tjmahr

Ref: ropensci/drake#775

* Last-minute edits to the drake v7 tech note

* Update word choice

* Knit in batch mode

* Mention literate programming

* Address https://github.com/ropensci/roweb2/pull/423/files#r264418051

* Address https://github.com/ropensci/roweb2/pull/423/files#r264418238

* Add a mention

Reduced trigger verbosity suggested by @aedobbyn:
ropensci/drake@ec050a4

* Alphabetize mentions by first name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants