Repository navigation
[backport] Restore RIG_MODE when configure-test-env.ps1 is interrupted - #15334
Merged
Merged
Conversation
configure-test-env.ps1 sets RIG_MODE=user when it is unset and removed it only at the end of the R block. Interrupting `rig add` or `rig proj sync` (Ctrl+C during a long R download) or any terminating error skipped that line, so RIG_MODE=user stayed in the calling shell. run-tests.ps1 dot-sources the script, and environment variables are process-wide in PowerShell anyway. The removal now runs in a finally block, which PowerShell also runs on Ctrl+C. An explicitly set RIG_MODE is still left untouched. Most of the diff is re-indentation of the R block. Checked on Windows by shadowing rig with a function that throws on `rig add`: before, RIG_MODE was left as "user"; after, it is unset, and a preset RIG_MODE=admin is kept. The R section run with the real rig still installs R 4.6.2 in user mode, syncs the lock and installs dev knitr and rmarkdown, and leaves RIG_MODE unset. (cherry picked from commit c1c8a4f)
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Backport from #15333
Same fix on
v1.11, whereconfigure-test-env.ps1is identical tomain. The cherry-pick applied without conflicts.Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.