Repository navigation
Move src environment variable access to deno_ral - #15429
Merged
Merged
Conversation
Step 0 of the env codemod plan, measured at 83432c0 on Windows with Deno 2.9.8. The tinytex rate-limit fix (#15388) moved one Deno.env site in src/tools/github.ts into a default parameter, so the dry run now reports 148 replacements instead of 149 and the src ratchet count falls by 165 (384 to 219). Cited lines moved by up to 11 lines; none changed or disappeared, and the tables carry the new numbers. The plan also gains what PRs 10-13 learned: deno check needs --allow-import while src/core/yaml.ts imports from skypack; seven of the PR's files are already unformatted on main, so deno fmt skips them to keep unrelated hunks out; staging uses explicit paths; the dry-run report lives in .claude/docs/ where a later session can read it; conflicts rebase on upstream/main, since origin is a fork. Task 4 now registers env.get/set/delete/toObject as ratchet replacement keys for src and package/src, matching the fs keys. The ratchet only reports a covered API where a file's count rises, so the 48 package/src sites PR 24 converts stay plain counts. The env contract test gains a Windows-only check that names are case-insensitive: Deno 2.9.8 and Node 24.21 both behave that way, and the Node port of the layer must keep it.
The codemod commit landed with the plan's message and exactly the dry run's 50 rewritten files, but its checkbox stayed unticked.
Task 4 was ticked without an execution-log entry, so the wrap-up writes it from the saved run logs and records the coordinator reruns. The env.ts row of the deno_ral module table was two characters wider than the rest of the table.
The Task 4 entry was rebuilt from logs that hold test output only; say so, and give the exact Windows invocation of the wrap-up reruns.
command-passthrough.test.ts spawns bare quarto.cmd, so the reruns exercised whichever launcher PATH found first. Record the rerun with the worktree's package/dist/bin first on PATH.
run-script.test.ts also spawns bare quarto.cmd, so the PATH rerun covers the three smoke/run tests that call quartoDevCmd(), not only command-passthrough.
Mark the PR 14 audit counts as historical next to the step 0 measurement, state when the ratchet actually reports a covered API, add PR 33's workflow residue scan to the babel-hyphen row, and list the files the filesystem codemod deliberately leaves as Deno.*.
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. |
cderv
added a commit
that referenced
this pull request
Nov 27, 2026
…r own file
Record the merged env layer and codemod over src (56 files; src/core/performance/metrics.ts keeps its Deno.env read, which PR 25 Task 6 converts once PR 20b removes that file's Deno patch) and the new ratchet baseline (src 219), and point the handoff to PR 08, whose dependencies are now all merged. In the open decisions, retire the three PR 14 rows and the 10-13-then-14 landing-order decision, narrow the shared replacement-keys row to PR 08 (PR 14 added the env keys with the same scopes), and update the PR 05 and PR 20b split rows, whose PR 14 condition is now met.
The "Open decisions with an owner" table was about half of the README, and every plan's step 0 read the whole README to find the few rows that name its PR. The table moves unchanged to OPEN-DECISIONS.md, which opens with rg commands that print the rows for one plan; they match only PR context ("PR NN", "PRs 25, 33 and 37"), so dates and line numbers do not match. The README heading stays as a pointer, so the frozen plans and execution logs that cite README "Open decisions" still resolve. The live instructions in README, AGENTS.md, HANDOFF.md and _TEMPLATE.md that say where to read or record rows now name the new file, and the PR 04 decider "external contact above" now names README "Roles".
10 of 15 tasks
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.
Part of the runtime migration (#15133). Follows #15418, #15423, #15426 and #15427, which moved
srcfile operations todeno_ral/fs.ts. This does the same for environment variables:src/deno_ral/env.tsadds anenvobject (get,set,delete,toObject), and the codemod rewrites everyDeno.envcall insrcto use it. A call likeDeno.env.get("HOME")becomesenv.get("HOME"). The layer still calls Deno underneath.Most of the diff is the codemod output (148 calls in 50 files), in its own commit (eb7d469). The rest is done by hand:
env(a parameter, aconst), so the codemod leaves them alone. They import the layer asenv as runtimeEnvand their 17 calls use that name (a1474dc). Inaxe/cmd.ts, rewriting the default value(key) => Deno.env.get(key)toenv.getwould have made the default read its own parameter.envmethods use nothis, becausedotenv.tspassesenv.deleteas a callback toforEachwhen it removes the variables it loaded on a previous render.env.get,setanddeletereject an empty name or one containing=or NUL with aTypeError. Deno already throws on these names, so nothing changes today. Node'sprocess.envdoes not, and the check keeps both runtimes rejecting the same names.Deno.env.*call insrcorpackage/srcas covered by the layer, like thefscalls since Move src/core, src/quarto-core and src/config file operations to deno_ral #15418 (f00958c).The runtime boundary baseline for
srcdrops from 384 to 219Deno.*calls (-165: 148 from the codemod, 17 by hand). Left onDeno.env:src/core/performance/metrics.ts, which the codemod skips while it patchesDeno, the julia-engine subtree undersrc/resources, and two comments.package/srcandtestsfollow in later PRs.No changelog entry: nothing changes for users.
The branch also carries the PR 14 plan, refreshed against current main before the codemod ran, and a follow-up to the PR 13 hand-off notes under
dev-docs/runtime-migration/.Pending checks
test-smokes-parallel.ymlon Ubuntu and Windowstest-quarto-latexmk.ymlon all three OSes (the codemod rewrites the whole ofsrc,tinytex.tsandgithub.tsamong the filesquarto-latexmkimports)Test plan
srcafter the commits: 0 calls would be rewrittendeno check quarto.tspassessrcat 219, every other scope unchangedenvtest included (262 passed, 0 failed), and smoke tests for profiles, dotenv, pre/post render scripts, drafts,checkandrun(41 passed, 0 failed), on Windows_environmentsetting a variable: the R chunk reads itquarto checkshows the same Python and R rows as the main buildQUARTO_CAPTURE_RENDER_COMMANDwrites the environment snapshot (--to html; the capture fails on docx with the main build too)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.