Commit Graph

140 Commits

Author SHA1 Message Date
Henry Mercer 43c3ed9c28 More feature flag renaming 2022-10-11 11:52:55 -07:00
Andrew Eisenberg 701cea34ba More renaming 2022-10-11 10:39:40 -07:00
Andrew Eisenberg 1a17c59fb0 More renaming
Avoid usage of "Feature Flag" unless we are talking specifically about
the response from github features api. Otherwise, use terms like
"Toggleable features".

Note both "toggleable" and "togglable" appear to be valid spellings of
the word. I chose the first for no good reason.
2022-10-07 11:33:32 -07:00
Andrew Eisenberg 6de05e4b24 Rename FeatureFlag -> Feature 2022-10-06 13:06:10 -07:00
Andrew Eisenberg b16314e16c Address comments from review
- Change env var name for `MlPoweredQueriesEnabled`
- Throw error if minimumVersion is specified, but CodeQL argument is not
  supplied.
- Fix failing tests. Note that I removed a config-utils test because it
  is no longer relevant since we handle codeql minimum versions in the
  `getValue` function.
2022-10-06 12:29:58 -07:00
Andrew Eisenberg 6085805a3a Append / to end of registries url
Avoids a bug in 2.10.4. Also, add some better handling for invalid
registries blocks.
2022-09-08 08:00:24 -07:00
Andrew Eisenberg 59744464eb Fix unit tests 2022-09-07 16:10:34 -07:00
Andrew Eisenberg 376fea671d Clarify description of registries input 2022-09-06 14:06:30 -07:00
Andrew Eisenberg bf97a6da5b Apply suggestions from code review 2022-09-06 10:41:32 -07:00
Andrew Eisenberg e9b47b1898 Change to using a single input 2022-09-01 16:07:26 -07:00
Andrew Eisenberg 0e98efa2bb Add support for downloading packs from GHES
This change adds:

- new `registries` block allowed in code scanning config file
- new `registries-auth-tokens` input in init action
- Change the downloadPacks function so that it accepts new parameters:
    - registries block
    - api auth
- Generate a qlconfig.yml file with the registries block if one is
  supplied. Use this file when downloading packs.
- temporarily set the `GITHUB_TOKEN` and `CODEQL_REGISTRIES_AUTH` based
  on api auth

TODO:

1. integration test
2. handle pack downloads when the config is generated by the CLI
2022-08-30 10:04:30 -07:00
Andrew Eisenberg 0a2b0d236c Moves calls to pack download to the init action
This ensures all steps to gather queries happens in the init action.
This is where checking out queries in other repos happens as well.
2022-08-26 16:04:57 -07:00
Andrew Eisenberg ac92a02de7 Merge remote-tracking branch 'upstream/main' into aeisenberg/better-error-message 2022-08-23 09:29:19 -07:00
Andrew Eisenberg 5861352d57 Better error messages for invalid queries and query filters blocks
Handle other cases where the config is invalid.
2022-08-23 09:25:59 -07:00
Edoardo Pirovano 4139682b64 Add telemetry for TRAP caching 2022-08-16 11:54:31 +01:00
Andrew Eisenberg fa2bc211fd Merge branch 'aeisenberg/unrevert-query-filters' into aeisenberg/fix-config-files 2022-08-11 14:57:16 -07:00
Andrew Eisenberg bcf47202b5 Merge remote-tracking branch 'upstream/main' into aeisenberg/unrevert-query-filters 2022-08-11 11:37:55 -07:00
Andrew Eisenberg a09a029937 Fix failing test and address PR comments 2022-08-11 09:56:08 -07:00
Chris Gavin bbdc9efa94 Use the API URL from the environment if it is present. 2022-08-11 08:38:11 +01:00
Andrew Eisenberg 2314063848 Add the defaultAugmentationProperties constant
This makes some syntax in tests somewhat simpler.
2022-08-10 15:42:45 -07:00
Andrew Eisenberg 0403fb7d8c Merge branch 'main' into aeisenberg/fix-config-files 2022-08-10 15:39:35 -07:00
Andrew Eisenberg 44f42da9ca Merge branch 'main' into aeisenberg/unrevert-query-filters 2022-08-10 15:22:40 -07:00
Edoardo Pirovano 8f867dcb21 Introduce TRAP caching 2022-08-05 17:48:05 +01:00
Andrew Eisenberg 01d16b1e01 Merge branch 'main' into aeisenberg/fix-config-files 2022-07-13 14:05:48 -07:00
Henry Mercer 4792297702 Fix test failures on Windows related to path separators 2022-06-29 18:59:32 +01:00
Andrew Eisenberg 6fabde2be8 Add packs and queries from input
This commit adds the packs and queries from the actions input to the
config file used by the CodeQL CLI.

When the `+` is used, the actions input value is combined with the
config value and when it is not used, the input value overrides the
config value.

This commit also adds a bunch of integration tests for this feature.
In order to avoid adding too many new jobs, all of the tests are
run sequentially in a single job (matrixed across relevant operating
systems and OSes).
2022-06-28 14:07:51 -07:00
Henry Mercer 41d6ac4d2a Remove toolcache decorator
This decorator enabled us to use the functionality of the Actions
toolcache within the runner too.
Now that we've deleted the runner we no longer need it.
2022-06-28 18:22:09 +01:00
Andrew Eisenberg 2a70419420 Revert "Revert "Add capability to filter queries #1098""
This reverts commit 99d4397d88.
2022-06-27 13:13:55 -07:00
Andrew Eisenberg 1653a84fbc Allow scans with packs for languages not being scanned
Previously, we were being too strict about checking that a pack's
language was being scanned. It was a failure if a pack language
was specified for a language not being scanned.
2022-06-22 14:37:31 -07:00
Andrew Eisenberg 99d4397d88 Revert "Add capability to filter queries #1098"
https://github.com/github/codeql-action/pull/1098
This reverts commit 777b778409.
This reverts commit 59ca9b59cb.
This reverts commit eec34d5f05.
This reverts commit 40b280032c.
2022-06-21 13:49:33 -07:00
Andrew Eisenberg 6db77eec0d Merge remote-tracking branch 'upstream/main' into aeisenberg/remove-queries 2022-06-15 17:21:05 -07:00
tombolton a27dc4fee4 update security extended test for all platforms 2022-06-15 11:42:22 +01:00
tombolton a568674c69 add tests for ML powered queries 0.3.0 and CLI 2.9.3 2022-06-15 11:42:22 +01:00
Andrew Eisenberg 40b280032c Add capability to filter queries
This change adds a `query-filters` property to the codeql-config file.

This property is an array of `exclude`/`include` entries for a query
suite. These filters are appended to the generated query suite files
and used to filter queries after they are selected.

A related change is that now, all pack references are run in a single
query suite, which has the query filters appended to them.
2022-06-14 12:07:49 -07:00
Henry Mercer 533ce91971 Merge remote-tracking branch 'origin/main' into henrymercer/run-atm-on-windows 2022-05-11 19:32:14 +01:00
Henry Mercer 395afb1dd9 Fix unit test assertion on Windows 2022-04-29 18:18:19 +01:00
Andrew Eisenberg 06b15c22b1 Allow pack specifiers to include paths
Also, this cleans up our pack-related integration tests.
We are now testing with the most recent CLIs.
2022-04-28 17:14:30 -07:00
Henry Mercer d9e30cb001 Run ML-powered queries on Windows with CodeQL CLI 2.9.0+ 2022-04-28 19:18:15 +01:00
Henry Mercer e26813cf98 Run version ~0.2.0 of the ML-powered query pack for v2.8.4+ of the CLI 2022-03-31 14:58:41 +01:00
Henry Mercer e6f3e049b4 Add descriptions to each test 2022-03-30 18:17:06 +01:00
Henry Mercer e83a1d469e Stop running ML-powered queries on Windows 2022-03-30 18:05:12 +01:00
Edoardo Pirovano d625a00cee Start running ATM queries again 2022-03-28 09:06:45 +01:00
Henry Mercer 0b3acf68ab Bump ML-powered queries to v0.1.0 2022-03-11 15:04:07 +00:00
Henry Mercer 9f32fc9b9d Only add ML-powered queries pack if the user didn't manually request it 2022-02-04 16:34:17 +00:00
Henry Mercer ce89f1b611 Upgrade Ava to v4 2022-02-01 18:56:42 +00:00
Edoardo Pirovano e677af3fd0 Make name of debugging artifact and DB within it configurable 2022-01-07 15:10:26 +00:00
Henry Mercer e7fe6da378 Allow patch version of ML-powered queries pack to be bumped 2022-01-06 11:58:03 +00:00
Henry Mercer 2159631658 Only run ML-powered queries with v2.7.5 or newer of the CLI 2022-01-06 11:58:03 +00:00
Henry Mercer efded22908 Bump the version of the ATM query pack to 0.0.2 2022-01-06 11:57:33 +00:00
Henry Mercer 5602bd50bf Test loading of ML-powered queries 2022-01-06 11:57:33 +00:00