Repository navigation
Conversation
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
🟢 Approval recommended
The reviewable changes consistently introduce the abstractions without identified correctness issues.
0 open findings
What changed in this PR
Adds injectable filesystem and environment abstractions to improve testability.
Changes:
- Adds
FileSystem,FSaction state, and OS release metadata. - Routes CodeQL environment access through
Env. - Narrows read-only environment parameters.
| File | Description |
|---|---|
src/fs.ts |
Defines the filesystem abstraction. |
src/action-common.ts |
Provides filesystem and OS metadata to actions. |
src/testing-utils.ts |
Adds filesystem and OS defaults to test state. |
src/init-action.ts |
Enables filesystem state for initialization. |
src/codeql.ts |
Injects environment access into CodeQL operations. |
src/actions-util.ts |
Accepts read-only environments for temporary paths. |
src/cli/output-cache.ts |
Accepts read-only environments for cache paths. |
lib/entry-points.js |
Generated bundle; excluded from review by policy. |
Files excluded by content exclusion policy (1)
- lib/entry-points.js
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
henrymercer
left a comment
There was a problem hiding this comment.
This change lets us run tests that stub fs in parallel, at the expense of requiring a wrapper object to be threaded through the program and used instead of direct APIs. However for most tests, it's convenient to use fs APIs directly with a temporary directory, and these tests can still be run in parallel with distinct temporary directories. Therefore I don't see the benefit of this outweighing the ongoing complexity of maintaining the wrapper.
Mostly a few cherry-picked commits from #4221 that are not directly related to that PR and more broadly useful. The main change is the addition of the
FileSystemtype and a corresponding"FS"feature forActionStatethat allows us to test functions which rely on thefsmodule more easily.Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
dynamicworkflows (Default Setup, Code Quality, ...).Products:
analysis-kinds: code-scanning.analysis-kinds: code-quality.upload-sarifaction.Environments:
github.comand/or GitHub Enterprise Cloud with Data Residency.How did/will you validate this change?
.test.tsfiles).pr-checks).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist