Skip to content

[backport] Restore RIG_MODE when configure-test-env.ps1 is interrupted - #15334

Merged
cderv merged 1 commit into
v1.11from
backport/rig-mode-cleanup
Nov 12, 2026
Merged

cderv merged 1 commit into
v1.11from
backport/rig-mode-cleanup

Conversation

@cderv

@cderv cderv commented Nov 10, 2026

Copy link
Copy Markdown
Member

Important

Backport from #15333

Same fix on v1.11, where configure-test-env.ps1 is identical to main. The cherry-pick applied without conflicts.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

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)
@posit-snyk-bot

posit-snyk-bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv
cderv merged commit 4432cf7 into v1.11 Nov 12, 2026
44 checks passed
@cderv
cderv deleted the backport/rig-mode-cleanup branch November 12, 2026 09:33
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.

2 participants