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

Deployment record improvements #827

Merged
merged 3 commits into from
May 2, 2023
Merged

Conversation

hadley
Copy link
Member

@hadley hadley commented May 1, 2023

* Improve `envVars` handling. Fixes #820.
* Add support for `version`. Fixes #821.
* Name arguments to `createDeploymentTarget()` calls
@hadley hadley requested review from aronatkins and mslynch May 1, 2023 13:42
R/deployments.R Outdated Show resolved Hide resolved
@hadley hadley mentioned this pull request May 1, 2023
Copy link
Contributor

@aronatkins aronatkins left a comment

Choose a reason for hiding this comment

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

The envVars and version fields are new and should not cause much difficulty if folks roll-back to an old release; old rsconnect will parse those fields, but may remove them on write.

Should we add something to NEWS about the consequences to stored envVars if folks upgrade then downgrade?

https://github.com/rstudio/rsconnect/blob/v0.8.29/R/deployments.R

@@ -69,6 +69,14 @@ test_that("can read/write metadata", {
expect_equal(out$meta2, "two")
})

test_that("can read/write version", {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where do we test reading a DCF file that lacks the envVars and version fields?

We should test reading single files with/without these fields as well as a collection of files where some of them lack these fields.

path <- addTestDeployment(app, "test1", envVars = NULL)
deps <- deployments(app, excludeOrphaned = FALSE)
expect_equal(deps$envVars, list(character()))
expect_false("envVars" %in% rownames(read.dcf(path)))
Copy link
Member Author

Choose a reason for hiding this comment

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

@aronatkins this is where we test what happens when we deliberately create a deployment without envVars — we test that envVars is not written to the DCF, but it's still successfully read. I'll add something similar for version.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. I missed that this test was confirming the processing of an "old" DCF. Would you mind adding a comment / renaming the test to remind us that this is testing DCF compatibility upon upgrade?

@hadley hadley merged commit 0918f7f into main May 2, 2023
@hadley hadley deleted the deployment-record-improvements branch May 2, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version the deployment dcf record Re-deploying old app fails because of envVars
3 participants