Commit Graph

65 Commits

Author SHA1 Message Date
Henry Mercer feb711fe0b Merge branch 'main' into henrymercer/add-ml-powered-query-enablement-to-analyze-status-report 2022-02-15 17:31:07 +00:00
Henry Mercer bcdaad245b Add ML-powered query enablement info to analyze finish status report 2022-02-15 15:04:23 +00:00
Robert 8aa32bd9c9 Remove check of database uploads feature flag 2022-02-15 14:10:33 +00:00
Alex Croteau 1bfa9ace60 Adds integration test and fixes linting 2022-01-31 20:06:18 -05:00
Alex Croteau 980fd4ed38 Adds ref and SHA as inputs, and sarif-id as output 2022-01-31 20:06:17 -05:00
Andrew Eisenberg f18151cc59 Update error message and remove feature flag preloading
Discussion here https://github.com/github/codeql-action/pull/882#discussion_r789924177
shows that properly handling preloading feature flag errors is complex
and the benefit we get from it does not offset the complexity.
2022-01-21 11:20:48 -08:00
Edoardo Pirovano e677af3fd0 Make name of debugging artifact and DB within it configurable 2022-01-07 15:10:26 +00:00
Henry Mercer 9de1702400 Document use of redundant feature flag API call 2022-01-06 11:58:02 +00:00
Edoardo Pirovano 00d4d60204 Always upload DB when in debug mode 2022-01-04 16:49:31 +00:00
Henry Mercer 5e87034b3b Explicitly pass repository to feature flags constructor
As suggested in review: The `GITHUB_REPOSITORY` environment variable is
only available on Actions. Passing it in explicitly avoids potentially
crashing if this code is called from the runner.
2021-12-15 17:03:43 +00:00
Henry Mercer d6499fad61 Use new feature flag architecture when uploading databases 2021-12-15 13:17:05 +00:00
Chris Gavin 4eef7ef32c Split out waiting for processing. 2021-11-17 13:20:36 +00:00
Edoardo Pirovano f360da772a Sanitize artifact name before using 2021-11-05 08:40:16 +00:00
Edoardo Pirovano 375c14729e Include matrix information in debug artifact name 2021-11-04 19:20:24 +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 1f4460b9fb Make use of multi-language and indirect tracing 2021-09-22 16:12:23 +01:00
Andrew Eisenberg 40568daca8 Fix compile errors introduced by typescript 4.4.2
4.4.2 introduces a breaking change that the variable in a catch clause
is now `unknown` type. So, we need to cast the `e`, `err`, or `error`
variables to type `Error`.
2021-09-10 14:06:27 -07:00
Edoardo Pirovano 0c4306b672 Pass --ram flag to database finalize 2021-08-12 18:12:28 +01:00
Edoardo Pirovano ef852c006a Support splitting of DB creation and query execution 2021-06-28 17:14:22 +01:00
Robert 146c897909 Upload CodeQL databases 2021-06-22 13:05:12 +01:00
Robert d893508e3a Revert "Upload CodeQL databases" 2021-06-21 10:26:02 +01:00
Robert f3cd5fa001 Add workflow input to disable uploads 2021-06-18 09:56:15 +01:00
Robert b985a67b97 Only attempt to upload on dotcom 2021-06-16 17:24:26 +01:00
Robert d693b3cb0d Check if on default branch before uploading database 2021-06-16 14:43:42 +01:00
Robert 2a9a602a5e Upload databases from analyze action 2021-06-10 16:09:58 +01:00
Edoardo Pirovano ddb83a462d Cleanup CodeQL DBs and output their location for later steps 2021-06-04 18:54:15 +01:00
Andrew Eisenberg f60ef170b0 Cleaning up comments around env vars
Also, move `getTemporaryDirectory` back to `actions-util`.
2021-06-03 11:33:20 -07:00
Andrew Eisenberg 3708898bf2 Add environment variables to signal feature and version to the CLI
This PR ensures environment variables are set before any invocation of
the CLI.  Here is a list of vars that are set:

https://github.com/github/codeql-coreql-team/issues/1124#issuecomment-852463521

This ensures the CLI knows the features and versions of the containing
actions/runner.

Additionally:

- Fix the user agent so that it more closely aligns with user agent
  spec
- Refactor environment variable initialization so that it all happens in
  one place and call.
- Move Mode, getRequiredEnvParam, setMode, getMode out of actions-util
  and into util. actions-util is meant for utils only called by the
  action, not the runner.

The `prepareLocalRunEnvironment()` method is most likely deprecated and
should be removed. I originally added it because I had a way of working
where I would run the action from my local machine to test out changes,
but this was always a little flaky. So, I no longer use this way of
working. I will probably remove it soon.
2021-06-02 11:06:02 -07:00
Andrew Eisenberg 47588796b4 Send the version and mode with the user agent
This commit changes the way the action determines if running in action
or runner mode. There is now an environment variable that is set at the
beginning of the process and elsewhere in the process, we can check to
see if the variable is set.
2021-05-31 09:03:29 -07:00
Edoardo Pirovano 79c79f1be5 Add configuration option to set CodeQL DB location 2021-05-18 00:13:36 +01:00
David Verdeguer c93cbc943a Forward category input to codeql cli 2021-05-03 19:41:53 +02:00
Andrew Eisenberg 998f472183 Add baseline metrics for lines of code
This commit uses a third party library to estimate the lines of code in
a database that is to be analyzed by codeql.

The estimate uses the same includes and excludes globs for determining
which files should be counted.

The lines of code count is returned by language and injected into the
SARIF as `baseline` property in the `${language}/summary/lines-of-code`
metric.
2021-04-26 14:09:38 -07:00
Chris Gavin 7b72f1c330 Merge main into allow-override-temp. 2021-02-15 11:45:08 +00:00
Chris Gavin ed751ece83 Allow overriding path of temporary files. 2021-02-01 15:34:13 +00:00
Sam Partington c2377b2e49 Remove parameters from uploadFromActions
Retrieve the relevant values in the method itself instead.
2021-01-28 15:37:09 +00:00
Chris Gavin 94b32884f9 Dump logs to stdout instead of stderr to avoid synchronization problems. 2021-01-26 09:47:31 +00:00
Chris Gavin 8705aaff32 Walk log filex manually rather than using the Actions globber. 2021-01-26 09:21:38 +00:00
Chris Gavin 219142571c Upload debug logs automatically when ACTIONS_STEP_DEBUG is enabled. 2021-01-25 15:44:31 +00:00
Sam Partington c7275a75ce Don't re-retrieve GitHub version when already have it
https://github.com/github/codeql-action/commit/54e0c67332afd925b1a71c346726efc5c788b260#r45693026
https://github.com/github/codeql-action/commit/54e0c67332afd925b1a71c346726efc5c788b260#r45693030
2021-01-06 11:40:16 +00:00
Sam Partington 023add5df0 Fix linter violations 2021-01-06 11:19:50 +00:00
Sam Partington 54e0c67332 Revert "Retrieve GitHubVersion when used rather than passing around"
This reverts commit 6de1b753c2.

https://github.com/github/codeql-action/pull/323#discussion_r551960301
2021-01-06 11:06:01 +00:00
Sam Partington 4bc186cf34 Move type definition to where it's used
https://github.com/github/codeql-action/pull/323#discussion_r551951925
2021-01-06 10:58:32 +00:00
Sam Partington 1da4ce5a03 Ensure stats get sent when not uploading results
https://github.com/github/codeql-action/pull/323#discussion_r551948732
2021-01-06 10:52:16 +00:00
Sam Partington 6de1b753c2 Retrieve GitHubVersion when used rather than passing around 2020-12-22 11:49:42 +00:00
Sam Partington 45dd5ee97d Fix linter violations 2020-12-22 11:28:08 +00:00
Sam Partington 82a8fa443e Merge branch 'main' into split-upload-method 2020-12-22 11:23:49 +00:00
Sam Partington ff28c8d403 Move uploading side-effect out of runAnalyze
https://github.com/github/codeql-action/pull/323#discussion_r530978010
2020-11-27 12:27:10 +00:00
Eric Cornelissen cd727934bf Update source so github/no-then passes 2020-11-25 22:45:53 +01:00
Sam Partington 3ee4739b13 Make anonymous objects into variables for readability 2020-11-24 11:23:53 +00:00