-
Notifications
You must be signed in to change notification settings - Fork 83
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
Reduce the usage of appPath #696
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -237,7 +237,7 @@ deployApp <- function(appDir = getwd(), | |
} | ||
|
||
# invoke pre-deploy hook if we have one | ||
runDeploymentHook(appPath, "rsconnect.pre.deploy", verbose = verbose) | ||
runDeploymentHook(appDir, "rsconnect.pre.deploy", verbose = verbose) | ||
|
||
appFiles <- standardizeAppFiles(appDir, appFiles, appFileManifest) | ||
|
||
|
@@ -247,7 +247,7 @@ deployApp <- function(appDir = getwd(), | |
} | ||
|
||
# determine the deployment target and target account info | ||
target <- deploymentTarget(appPath, appName, appTitle, appId, account, server) | ||
target <- deploymentTarget(recordDir, appName, appTitle, appId, account, server) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Internally, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've renamed it to |
||
|
||
# test for compatibility between account type and publish intent | ||
if (!isCloudServer(target$server) && identical(upload, FALSE)) { | ||
|
@@ -353,7 +353,7 @@ deployApp <- function(appDir = getwd(), | |
|
||
# invoke post-deploy hook if we have one | ||
if (deploymentSucceeded) { | ||
runDeploymentHook(appPath, "rsconnect.post.deploy", verbose = verbose) | ||
runDeploymentHook(appDir, "rsconnect.post.deploy", verbose = verbose) | ||
} | ||
|
||
logger("Deployment log finished") | ||
|
@@ -378,7 +378,7 @@ needsVisibilityChange <- function(server, application, appVisibility = NULL) { | |
cur != appVisibility | ||
} | ||
|
||
runDeploymentHook <- function(appPath, option, verbose = FALSE) { | ||
runDeploymentHook <- function(appDir, option, verbose = FALSE) { | ||
hook <- getOption(option) | ||
if (!is.function(hook)) { | ||
return() | ||
|
@@ -387,7 +387,7 @@ runDeploymentHook <- function(appPath, option, verbose = FALSE) { | |
if (verbose) { | ||
cat("Invoking `", option, "` hook\n", sep = "") | ||
} | ||
hook(appPath) | ||
hook(appDir) | ||
} | ||
|
||
|
||
|
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.
This is a functional change to package contract, correct? Given a target Rmd in a directory containing lots of Rmd, how will the hook know what you're about to deploy?
This work initially landed with #283 and #295, but without a specific motivating example.
Additionally, I think the IDE deploy pane transfers many (most? all?) R options and environment variables from the R session to the deploy pane (without using these hooks).
I did find one issue referencing this hook:
and a reference from
thematic
!!:Unfortunately, I don't know of many in-the-wild uses of this feature that might care about the file-path vs. directory change. At the very least, we should NEWS this adjustment and mark it as a potentially breaking change.
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.
Yeah, this is a change, and the documentation for the hooks is murky:
What does "content about to be deployed" mean? (especially if you've used
appFiles
or friends).My guess is that this won't affect any code in the wild, but I'll add a news bullet.
FWIW I think the thematic usage would break when
appPath
is not a directory.