-
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
add space parameter for Posit Cloud #983
Conversation
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.
The Connect client needs to be updated.
Error in client$deployApplication(application, bundle$id, space) :
unused argument (space)
The #961 issue also suggests creating a function to list the available spaces; is that arriving, as well?
R/client-cloud.R
Outdated
# in case the source cloud project is a temporary copy, there is no | ||
# content id. The output will be published without a space id. | ||
if (!is.null(currentProjectId)) { | ||
json$project <- currentProjectId |
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 change does not add the json$project
when provided an incoming spaceId
. Is it needed in this case?
Compare this change to the change in deployApplication()
-- there, the space associated with the current project is never used, while the current project id is used unconditionally (even when there is spaceId
argument).
What is the expectation for the project
and space
fields provided to the different API calls? I'm not familiar with the APIs that are being called -- more details would be really helpful.
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 change does not add the
json$project
when provided an incomingspaceId
. Is it needed in this case?
Thanks, it is needed here – pushed a commit to change this logic. If we're executing inside a Posit Cloud project, we always want to link the output to that output through project
. For the space, we want to update it if there's a specific space passed in through deployApp
. If there's no space when we create the application, it should be set to the space of the project.
…t setting logic in createApplication
R/client-cloud.R
Outdated
currentProjectId <- getCurrentProjectId(service, authInfo) | ||
if (!is.null(currentProjectId)) { | ||
outputPatchData$project <- currentProjectId |
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 different logic than is used when creating; intentional? In this case, we could end up using currentProjectId
from the environment and the spaceId
argument. When creating, the spaceId
argument is only used when there is no currentProjectId
.
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 think the logic as-written makes sense (at least to me). When you deploy, it should definitely set the space based on the space of the environment project. But on redeploys, it would probably be more confusing for projects to move between spaces without providing the argument.
@m-- Any other thoughts?
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.
also cc @kippandrew ^
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 think that makes sense to me.
# Conflicts: # R/client-cloud.R # R/client-connect.R # R/client-shinyapps.R # R/deployApp.R
Probably, likely in another PR. |
Resolves #961.
cc @scubastevew