rstudio / rstudio/packrat

snapshot.sources env var or options is not picked by snapshot() function

Open
#555 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
409
Forks
89
PR merge metrics
No merged PRs in 30d

Description

Hi,

I noticed that setting

Sys.setenv(R_PACKRAT_SNAPSHOT_SOURCES = FALSE)

did not deactivate the snapshot.source in snapshot()

Strangely when trying to debug, I noticed that
https://github.com/rstudio/packrat/blob/965cca1b04f326dc39a95b175ac8383fed3c068e/R/snapshot.R#L300
was always FALSE. Maybe because snapshot.sources arg is passed to snapshotImpl by snapshot()

I will try to work on a reprex and a test to reproduce this and PR a fix

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with Sys.setenv(R_PACKRAT_SNAPSHOT_SOURCES = FALSE) and inspect R/snapshot.R around line 300, including how snapshot() passes snapshot.sources to snapshotImpl. Add a regression test for the environment variable or option, and confirm that snapshot.sources is disabled when it is set to FALSE.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.