Commit Graph

123 Commits

Author SHA1 Message Date
Henry Mercer 96a8424f0c Don't bypass the toolcache in test mode 2022-08-16 16:18:12 +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 072cd929a3 Merge remote-tracking branch 'upstream/main' into aeisenberg/unrevert-query-filters 2022-08-11 10:00:12 -07:00
Andrew Eisenberg d74f663ed4 Merge remote-tracking branch 'upstream/main' into aeisenberg/fix-config-files 2022-08-11 09:57:45 -07:00
Andrew Eisenberg a09a029937 Fix failing test and address PR comments 2022-08-11 09:56:08 -07:00
Angela P Wen 4e121c0ef5 Address additional review comments 2022-08-11 13:58:01 +02:00
Andrew Eisenberg 44f42da9ca Merge branch 'main' into aeisenberg/unrevert-query-filters 2022-08-10 15:22:40 -07:00
Angela P Wen 484a72c924 Add utilities unit tests 2022-08-10 14:57:57 +02:00
Angela P Wen 5da7870265 Refactoring per PR comments 2022-08-01 12:52:16 +02:00
Angela P Wen 52de49c899 Refactor helper function to util 2022-08-01 11:42:55 +02:00
Andrew Eisenberg 01d16b1e01 Merge branch 'main' into aeisenberg/fix-config-files 2022-07-13 14:05:48 -07:00
Henry Mercer c2fd5d10f6 Don't make temporary directories symlinks
`toolcache.extractTar` currently falls over when `ACTIONS_TEMP` contains
a symlink, and the runner no longer exists, so it's unlikely our
customers would be running with temporary directories that contain
symlinks.
2022-06-29 18:59:33 +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
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 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 80ecdcdf69 Merge pull request #1098 from github/aeisenberg/remove-queries
Add capability to filter queries
2022-06-15 17:52:46 -07:00
Andrew Eisenberg 6db77eec0d Merge remote-tracking branch 'upstream/main' into aeisenberg/remove-queries 2022-06-15 17:21:05 -07:00
tombolton f8f4c0b33e compile the modified TypeScript to Javascript 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
Andrew Eisenberg b11fe85402 Merge branch 'main' into aeisenberg/packs-with-paths 2022-04-29 11:10:16 -07: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 7c2be06006 Factor out test mode determination code 2022-04-28 19:13:22 +01:00
Henry Mercer 02083c307e Add a comment to explain why we show the upgrade message on GHES 3.4 2022-04-28 14:16:32 +01:00
Henry Mercer 35ef6a2db3 Move formatGitHubVersion into util.test.ts 2022-04-28 14:16:32 +01:00
Henry Mercer 5227afabbe Tweak wording of message 2022-04-28 14:16:32 +01:00
Henry Mercer 0256599547 Prompt customers to upgrade from v1 to v2 2022-04-27 16:11:24 +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 2c03704a6c Allow the version of the ML-powered pack to depend on the CLI version 2022-03-31 14:58:29 +01:00
Henry Mercer dd6b592e3e Simplify ML-powered query status report definition
We now limit the cardinality of the ML-powered JS queries status report
field server-side. With no need for a limit on the cardinality of the
status report client-side, we can simplify how we produce it.
2022-03-31 14:55:32 +01:00
Chuan-kai Lin f60bb5cc38 Include CodeQL CLI and action versions in status reports 2022-03-17 10:07:29 -07:00
Chuan-kai Lin aeefdce612 Restore compatibility with GHES 3.1 2022-03-14 08:20:27 -07:00
Henry Mercer 0b3acf68ab Bump ML-powered queries to v0.1.0 2022-03-11 15:04:07 +00:00
Edoardo Pirovano 42af7232c3 Revert "Merge pull request #869 from github/edoardo/windows-11-error"
This reverts commit faa9ba7363, reversing
changes made to 71112ab35d.
2022-02-24 11:29:26 +00:00
Andrew Eisenberg 3d93bb2ac9 Add UserError
This commit adds a `UserError` class that should be thrown when the
cause of an error is fundamentally from user configuration.

When sending status reports, avoid sending a `failure` for `UserError`s.
This will prevent our diagnostics from pinging us for errors outside of
our control.
2022-02-17 11:47:31 -08:00
Henry Mercer 03c64ef07d Add more documentation for ML-powered JS queries status report
Also be more explicit about which version strings are reportable in
the code.
2022-02-07 16:46:53 +00:00
Henry Mercer c95a3d854c Limit cardinality of ML-powered JS queries status report
Some platforms that ingest this status report charge based on the
cardinality of the fields, so here we restrict the version strings we
support to a fixed set.
2022-02-07 14:36:40 +00:00
Henry Mercer 501fe7ff12 Update getMlPoweredJsQueriesStatus doc 2022-02-04 17:16:25 +00:00
Henry Mercer 537b2f873a Add "multiple" report for ML-powered JS query enablement
When multiple ML-powered JS packs are in scope (an unsupported
scenario), the status report is "multiple".
2022-02-04 16:37:26 +00:00
Henry Mercer 1cddec9558 Add ML-powered queries enablement to init status report
We report this information in the `init` status report rather than the
`analyze` status report so we can gather data about timeouts.
2022-02-03 16:29:28 +00:00
Andrew Eisenberg 8454e21c9c Change category uniqueness test
Turboscan only allows a single combination of tool name and automation
details id for testing category uniqueness.

Previously, the check in the action was not entirely correct since it
only looked at the _category_ and not the combination of the category
and the tool name.

It's even more precise now since it is looking at the actual, computed
value of the automation details id, rather than an inputted value of
the category.

This change also includes a refactoring where the action is now avoiding
multiple parsing/stringifying of the sarif files. Instead, sarif is
parsed once at the start of the process and stringified once, after
sarif processing is completely finished.
2022-01-12 15:26:34 -08:00
Edoardo Pirovano d2a0fc83dc Refuse to run on Windows 11 2022-01-11 18:34:33 +00:00
Edoardo Pirovano e677af3fd0 Make name of debugging artifact and DB within it configurable 2022-01-07 15:10:26 +00:00
Edoardo Pirovano 705f634a1d Refuse to use broken versions in the toolcache 2021-12-09 13:43:57 +00:00
Andrew Eisenberg 67d11b5928 Always use force: true for del 2021-12-08 15:37:43 -08:00
Andrew Eisenberg 45dc27d3c1 Remove rmDir references
`rmDir` is not available on the node version used by the actions runner.

Instead, use the `del` package. It is safe, well-tested, and
cross-platform.
2021-12-08 12:11:31 -08:00
Robert c82e09aa41 Delete bundled db before recreating 2021-12-01 12:25:57 +00:00
Chris Gavin 316ad9d919 Add an option to allow waiting until an analysis has been processed before finishing the Action. 2021-11-17 12:14:13 +00:00
Edoardo Pirovano bc31f604d3 Add an option to upload some debugging artifacts 2021-11-01 16:12:50 +00:00
Chuan-kai Lin 70b730eb7d Add RAM and threads options to init action 2021-10-28 15:09:59 -07:00
Edoardo Pirovano 292203e8b6 Remove calls to fs.rmdirSync 2021-09-23 09:38:52 +01:00