rstudio / packrat

Packrat is a dependency management system for R
http://rstudio.github.io/packrat/
399 stars 89 forks source link

Update vendored `renv`; update script to allow taking tagged versions #683

Closed toph-allen closed 1 year ago

toph-allen commented 1 year ago

This PR updates the embedded version of renv used by Packrat. Since the current HEAD on the renv repo is not passing CI, I took the previous version. To do this, I modified the tools-sync-renv.R script to allow passing a single argument, like so:

R -f tools/tools-sync-renv.R --args 0.15.5-48

If there are zero arguments, the script will proceed as before. If there is one argument, it uses that in a modified git checkout command. If there is more than one argument, it stops and emits a warning.

QA notes

These are taken from the last "bump renv" PR.

We want to ensure that this change doesn't break dependency detection, which is currently the only place we use renv. One way to exercise this is to deploy a simple Shiny app to an RStudio Connect instance.

After installing the version of Packrat in this PR, deploy the following Shiny app to a Connect instance and ensure that it runs.

library(shiny)

ui <- fluidPage(
    titlePanel("Old Faithful Geyser Data"),
    sidebarLayout(
        sidebarPanel(
            sliderInput("bins",
                        "Number of bins:",
                        min = 1,
                        max = 50,
                        value = 30),
            div("username", verbatimTextOutput("user")),
            div("groups", verbatimTextOutput("groups"))
        ),

        mainPanel(
            plotOutput("plot")
        )
    )
)

server <- function(input, output, session) {
  output$plot <- renderPlot({
    x    <- faithful[, 2]
    bins <- seq(min(x), max(x), length.out = input$bins + 1)

    hist(x, breaks = bins, col = 'darkgray', border = 'white')
  })

  output$user <- renderText(session$user)
  output$groups <- renderText(session$groups)
}

shinyApp(ui = ui, server = server)
toph-allen commented 1 year ago

@aronatkins I updated logic to remove one of the conditional statements by just capturing the command to use. Now the message at the top of renv.R includes the git clone command used and the timestamp at which it was called. The message also includes the renv version and the hash.

ChaitaC commented 1 year ago

verified on packrat branch toph-update-renv

RemoteRef: toph-update-renv
RemoteSha: 7d423359b75a1fd0214ccbfb2078d7a16dee812e
GithubRepo: packrat
GithubUsername: rstudio
GithubRef: toph-update-renv
GithubSHA1: 7d423359b75a1fd0214ccbfb2078d7a16dee812e
NeedsCompilation: no
Packaged: 2022-08-10 14:37:32 UTC; chaitamacpro
Built: R 4.1.1; ; 2022-08-10 14:37:33 UTC; unix

Screen Shot 2022-08-10 at 9 38 27 AM