| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Warning
This PR adds feature-flagged support for merging Default Setup’s config input with a repository-provided config-file, enabling both sources to contribute supported configuration fields in Default Setup runs. It also refactors config loading logic to make this behavior testable and expands the environment abstraction used for parallelizable tests.
Changes:
| File | Description |
|---|---|
| src/util.ts | Extends getEnv to support listing and mutating env entries (entries, set). |
| src/testing-utils.ts | Allows setting base Actions env vars into a provided Env for tests. |
| src/feature-flags.ts | Adds the AllowMergeConfigFiles feature flag configuration. |
| src/environment.ts | Adds CODEQL_ACTION_TEMP and expands the Env interface. |
| src/config/db-config.ts | Adds config types for Default Setup and implements mergeUserConfigs. |
| src/config/db-config.test.ts | Adds unit tests for mergeUserConfigs. |
| src/config-utils.ts | Extracts determineUserConfig and implements merge logic under FF + Default Setup. |
| src/config-utils.test.ts | Adds targeted tests for determineUserConfig behavior (including merge cases). |
| src/actions-util.ts | Threads optional Env through several helpers and uses EnvVar.TEMP for temp dir selection. |
| lib/entry-points.js | Not reviewed (excluded by policy; also generated output). |
Sorry, something went wrong.
This makes the implementations more consistent for now, and less error-prone
There was a problem hiding this comment.
Warning
Sorry, something went wrong.
| result["threat-models"] = Array.from(threatModels); | ||
| } | ||
|
|
||
| return result; |
There was a problem hiding this comment.
It is probably worth logging a warning that is sent to telemetry if we find any other properties in fromConfigInput. If we format this as a telemetry diagnostic, we can set the internal-error tag on the reporting descriptor to send exceptions to Sentry.
Sorry, something went wrong.
Sorry, something went wrong.
| test("determineUserConfig - empty config when neither input is specified", async (t) => { | ||
| await withTmpDir(async (tmpDir) => { | ||
| const logger = new RecordingLogger(); | ||
| const env = util.getEnv(DEFAULT_ACTIONS_VARS); |
There was a problem hiding this comment.
Should this act on a copy of DEFAULT_ACTIONS_VARS, to avoid potential calls to Env.set mutating DEFAULT_ACTIONS_VARS? I know that determineUserConfig is read only, but this could be confusing if behaviour changes.
Sorry, something went wrong.
There was a problem hiding this comment.
I have pushed some improvements to the TestEnv implementation in #4005, which will help address this here once those changes are merged.
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Warning
Sorry, something went wrong.
There was a problem hiding this comment.
A couple of minor suggestions that can be ignored, and some food for thought. But otherwise, looks good 👍
Sorry, something went wrong.
There was a problem hiding this comment.
Warning
Sorry, something went wrong.
There was a problem hiding this comment.
I'm happy merging this as is, but consider making use of the internal-error tag on the telemetry diagnostics to report exceptions to Sentry.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR introduces support for merging the config inputs that are provided by Default Setup with custom configuration files. That can be the case if, for example, a configuration file is configured by the corresponding repository property. With the change in this PR, a supported scenario is that e.g.:
Notes for reviewers / deliberate implementation aspects
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