| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Warning
This PR introduces a new ActionState type (a type-level “state feature” system) and begins adopting it across several action entry points to reduce reliance on global state and improve testability. It also refactors getConfigFileInput to take ActionState and updates unit tests to use a new TestEnv harness.
Changes:
| File | Description |
|---|---|
| src/action-common.ts | Adds ActionState feature typing and runInActions wrapper used by multiple actions. |
| src/actions-util.ts | Introduces ActionsEnvVars enum and updates some env var reads to use it. |
| src/util.ts | Adds getEnv plus env var helpers that support dependency injection in tests. |
| src/environment.ts | Adds Env interface to abstract over process.env. |
| src/autobuild-action.ts | Converts wrapper to runInActions and injects logger via ActionState. |
| src/analyze-action.ts | Converts wrapper to runInActions and injects logger via ActionState. |
| src/init-action.ts | Converts wrapper to runInActions and passes ActionState into config file resolution. |
| src/setup-codeql-action.ts | Converts wrapper to runInActions and injects logger via ActionState. |
| src/upload-sarif-action.ts | Converts wrapper to runInActions and injects logger via ActionState. |
| src/config/file.ts | Refactors getConfigFileInput to accept ActionState and fetch the FF internally (async). |
| src/config/file.test.ts | Updates tests to use the new TestEnv/callee test harness. |
| src/testing-utils.ts | Adds TestEnv/callee, getTestEnv, and tightens default Actions env var typing. |
| src/api-client.ts | Uses ActionsEnvVars for some required env vars in API details creation. |
| lib/entry-points.js | Excluded (generated output); not reviewed per policy/instructions. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR extracts some changes from #3973 that add the new ActionState type. The ActionState type is indexed (at the type-level) over the types of state a corresponding value provides (essentially providing a primitive state effect system). Concretely, this allows:
This PR adds the new type and surrounding infrastructure. It also updates some parts of the codebase to make use of it, but the goal of this PR is by no means to refactor the entire codebase to make use of ActionState values. The main example uses in this PR are:
Notes for reviewers
Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
Products:
Environments:
How did/will you validate this change?
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