Commit Graph

244 Commits

Author SHA1 Message Date
Chuan-kai Lin 4cd7a721f7 Remove loadConfig()
The loadConfig() function is mostly the same as getDefaultConfig(),
except that it calls loadUserConfig() and stores the results in
originalUserInput.

This refactoring commit replaces the loadConfig() call with
getDefaultConfig() and loadUserConfig(), which allows deleting a large
amount of duplicated code.
2025-07-09 14:32:05 -07:00
Chuan-kai Lin f4358b38d1 Extract loadUserConfig() 2025-07-09 14:32:05 -07:00
Chuan-kai Lin 95a1b7e2bf Add getOverlayDatabaseMode() tests 2025-07-07 08:14:41 -07:00
Chuan-kai Lin d42ce71087 Add AugmentationProperties.useOverlayDatabaseCaching
This commit adds useOverlayDatabaseCaching to AugmentationProperties to
indicate whether the action should upload overlay-base databases to the
actions cache and to download a cached overlay-base database when
creating an overlay database.
2025-07-03 12:35:24 -07:00
Chuan-kai Lin b4425372ef Limit OverlayAnalysis to internal repos 2025-07-03 12:35:24 -07:00
Chuan-kai Lin 93e8729640 getOverlayDatabaseMode: use Feature.OverlayAnalysis
This commit changes getOverlayDatabaseMode so that, when
Feature.OverlayAnalysis is enabled, it calculates the overlay database
mode automatically based on analysis metadata. If we are analyzing the
default branch, use OverlayBase, and if we are analyzing a PR, use
Overlay.

If CODEQL_OVERLAY_DATABASE_MODE is set to a valid overlay database mode,
that environment variable still takes precedence.
2025-07-03 12:35:24 -07:00
Chuan-kai Lin a336faa497 databaseInitCluster: use overlayDatabaseMode from config
This commit changes databaseInitCluster() to use overlayDatabaseMode
from AugmentationProperties instead of the overlayDatabaseMode
parameter. There is no behavior change because both overlayDatabaseMode
values are computed the same way.

The commit then cleans up the overlayDatabaseMode parameter and the code
paths that feed into it.
2025-07-03 12:35:24 -07:00
Chuan-kai Lin ee8a8c4e0b config-utils: populate getOverlayDatabaseMode()
This commit populates getOverlayDatabaseMode() in config-utils with the
same code from getOverlayDatabaseMode() in init.
2025-07-03 12:35:24 -07:00
Chuan-kai Lin 9022c7382c Add AugmentationProperties.overlayDatabaseMode
This commit adds overlayDatabaseMode to AugmentationProperties and
creates a placeholder getOverlayDatabaseMode() function, with the
necessary inputs, to populate it.
2025-07-03 12:35:24 -07:00
Chuan-kai Lin f5304e7bf5 Rename defaultQueryFilters
This commit renames AugmentationProperties.defaultQueryFilters to
extraQueryExclusions, and changes its type to ExcludeQueryFilter[]. It
matters whether we are adding query inclusions or exclusions, and this
renaming makes that distinction clearer.
2025-06-19 12:19:28 -07:00
Michael B. Gale 87c547189e Read and parse quality-queries input 2025-06-16 13:17:55 +01:00
Chuan-kai Lin 71ab101d38 Set default query filter for diff-informed analysis 2025-03-27 14:06:40 -07:00
Chuan-kai Lin da967b1ade AugmentationProperties: add defaultQueryFilters
This commit adds a defaultQueryFilters field to AugmentationProperties
and incorporates its value into the augmented Code Scanning config.
However, in this commit defaultQueryFilters is always empty, so there is
not yet any actual behavior change.
2025-03-27 13:44:47 -07:00
github-actions[bot] 44e03577b2 Rebuild 2024-12-03 18:39:38 +00:00
Dave Bartolomeo ca91b63a7d Add comment about registry kinds 2024-11-01 14:00:48 -04:00
Dave Bartolomeo 2a3ca27b96 Merge remote-tracking branch 'origin/main' into dbartol/actions-analysis 2024-10-31 16:18:51 -04:00
Michael B. Gale 79faaf1396 Add CachingKind enum to control whether to restore or store caches 2024-10-29 12:10:17 +00:00
Michael B. Gale 1922a489a8 Add dependencyCachingEnabled to Config 2024-10-29 12:06:46 +00:00
Dave Bartolomeo 6682b14bf4 Handle kind property in registries 2024-10-18 17:22:11 -04:00
Henry Mercer fc983c82c2 Remove unneeded version guards 2024-10-15 19:38:49 +01:00
Remco Vermeulen 7c2bec0cc3 Merge remote-tracking branch 'upstream/main' into rvermeulen/extend-init-complete-status-report 2024-08-06 09:11:17 -07:00
Henry Mercer ecb9ccfcb1 Fix new linter errors 2024-08-05 19:22:26 +01:00
Remco Vermeulen b7b85bb26f Change removal of credentials to adhere to no-vars-unused 2024-07-31 11:24:51 -07:00
Remco Vermeulen 7ff117d65d Address formatting issues 2024-07-31 11:24:33 -07:00
Remco Vermeulen 9f7e0af9f6 Add registries to the init status complete report
Registries might require authentication, before we add it to the
report we remove any credentials.
2024-07-26 16:35:29 -07:00
Henry Mercer 1ea11ca775 Enable no-unsafe-return rule 2024-06-13 19:52:39 +01:00
Henry Mercer d8f549d6d8 Improve type safety by using more specific function types 2024-06-13 19:26:45 +01:00
Henry Mercer 0c392c4570 Add rollback mechanism for C# buildless 2024-06-11 18:45:16 +01:00
Angela P Wen ac2f82a1ff Log warning if SIP is disabled and CLI version is < 2.15.1 (#2261)
* PR Checks: use `macos-12` runners for CLI v. < 2.15.1

Prior to CLI v2.15.1, MacOS ARM runners were not supported by the build tracer. "macos-latest" is now an ARM runner, so we run these tests on the old CLIs on Intel runners instead.

* Log a warning if SIP is disabled and CLI is < 2.15.1

* Add changenote for SIP-disabled support on old CLI versions

* Set up Python 3.11 for all MacOS checks
2024-04-25 22:20:13 +00:00
Henry Mercer 5b74166227 Move BuildMode to util.ts 2024-04-12 16:37:13 +01:00
Henry Mercer 381e65f460 Allow generated user config file to be outside the workspace 2024-02-15 12:07:48 +00:00
Henry Mercer eb60ca25f8 Merge branch 'main' into henrymercer/java-buildless-rollback 2024-02-14 15:18:48 +00:00
Henry Mercer 191f59f435 Store generated config file in temporary directory
This prevents it from becoming part of the analysis.
2024-02-13 15:59:45 +00:00
Henry Mercer 4e5f9c0873 Introduce a rollback mechanism for Java buildless 2024-02-12 23:11:48 +00:00
Angela P Wen 1515e2bb20 Refactor configuration errors (#2105)
Refactor the existing classes of configuration errors into their own file; consolidate the place we check for configuration errors into `codeql.ts`, where the actual command invocations happen.

Also, rename the `UserError` type to `ConfigurationError` to standardize on a single term.
2024-02-08 17:20:03 +00:00
Henry Mercer 0fe34bd39a Extract language appropriately in analyze step when build mode specified 2024-02-07 13:19:29 +00:00
Henry Mercer 0166a8a567 Add build mode to configuration 2024-01-30 19:10:37 +00:00
Henry Mercer ec42edcaab Refactoring: Create interface for config initialization
This eliminates argument order mistakes, and also lets us add new inputs
without having to update every test.
2024-01-30 18:59:59 +00:00
Henry Mercer 415881f4cf Remove code specific to GitHub AE 2024-01-08 13:28:39 +00:00
Henry Mercer 4feb32a7ef Remove code to download packs 2024-01-04 16:29:49 +00:00
Henry Mercer f65fc6a926 Remove parsing of queries, packs, paths, and pathsIgnore 2024-01-04 16:27:05 +00:00
Henry Mercer b683173003 Remove unused arguments 2024-01-04 15:05:15 +00:00
Henry Mercer fa98ec0c7a Remove CliConfigFileEnabled feature flag 2024-01-04 14:39:36 +00:00
Henry Mercer 7b16c0dad0 Improve method name for addQueriesFromWorkflow. 2023-10-02 17:35:03 +01:00
Henry Mercer ebbadee09e Remove ML-powered queries 2023-10-02 17:20:50 +01:00
Henry Mercer 1d5eed8d40 Remove deprecated functionality 2023-09-27 16:16:13 +01:00
Henry Mercer 74714a34ca Implement support for language aliasing 2023-09-14 16:11:20 +01:00
Angela P Wen b16296be30 Auto-fix linting errors 2023-07-25 10:34:21 +02:00
Henry Mercer bac7c32ff7 Resolve the final dependency cycle! 2023-07-19 17:37:43 +01:00
Henry Mercer 004f976bef Fix dependency cycle between util and config-utils 2023-07-19 16:48:21 +01:00