GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Allow Code Quality only analysis by mbg · Pull Request #3064 · github/codeql-action Conversation
|
| logger.warning( | ||
| "Query customizations will be ignored, because only `code-quality` analysis is enabled.", | ||
| ); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should we actually error in these cases? It's easy to miss Actions warnings, and users could think they're analysing something that doesn't actually work. That also avoids us the slight confusion of then having to override config.originalUserInput.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure about this, but decided to go with a warning because in Default Setup we provide inputs to queries and config. We can probably change that there for when Code Quality is enabled, but Code Scanning isn't, but I didn't want to make this an error just yet in case it causes us problems during the transition there.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I appreciate wanting to make the transition smooth, but I have some concerns about modifying config.originalUserInput, particularly since we use this to generate telemetry.
My understanding is today we have analyses with a quality-queries input and without an analysis-kinds input. This means we'll run code scanning, and therefore shouldn't hit this case. Then the transition can move to an explicit analysis-kinds input with the config and other customization inputs removed.
Is there anything I'm missing here?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think there are two separate points here:
quality-queries to analysis-kinds and remove the queries input in CQ-only mode in one go. (Probably "yes" and this being a warning is just overly defensive.)config.originalUserInput is an issue for telemetry.Regarding 2., I agree that this isn't a very nice approach. I'll have a look at refactoring this tomorrow so that originalUserInput can remain as-is and we set up the configuration for a CQ-only database differently.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| * | ||
| * @returns Returns `CodeScanning` if `AnalysisKind.CodeScanning` is enabled; otherwise `CodeQuality`. | ||
| */ | ||
| export function getDbAnalysisConfig(config: Config): AnalysisConfig { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This seems like a detail of how saving SARIF results currently works, in particular the fact that when both modes are on, we currently produce a code scanning file, then filter that to produce a code quality file. I don't really think it's a property of the database, since we'll ask the database to analyse both code scanning and code quality results in that situation.
I'd consider removing this in favour of some more explicit logic concerning the SARIF extension in analyze, unless there are more situations where this notion of "primary consumer" matters.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This seems like a detail of how saving SARIF results currently works, in particular the fact that when both modes are on, we currently produce a code scanning file, then filter that to produce a code quality file. I don't really think it's a property of the database, since we'll ask the database to analyse both code scanning and code quality results in that situation.
I don't think this is true, since in CQ-only mode the database is specifically initialised with code-quality queries. What getDbAnalysisConfig tells us is whether the database is initialised with a Code Scanning configuration (in CS only or CS+CQ mode) or a Code Quality configuration (in CQ only mode).
It's true though that this is currently only relevant when we are generating the "primary" SARIF file.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is true, since in CQ-only mode the database is specifically initialised with
code-qualityqueries. WhatgetDbAnalysisConfigtells us is whether the database is initialised with a Code Scanning configuration (in CS only or CS+CQ mode) or a Code Quality configuration (in CQ only mode).
I'm unsure how much meaning this has in practice. For instance, if I really wanted to, I could create a code scanning configuration that runs the code quality queries only by disabling the default queries and running a custom query pack. I'd expect the database to be identical to a database with analysis-kinds: code-quality. The only difference I can see is the name of the SARIF file and the upload API.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
f8915bb to
d2e5cc8
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This PR implements the ability to run Code Quality analysis independently from Code Scanning analysis, while maintaining backwards compatibility for combined analysis. The main purpose is to provide a "standalone" implementation where the database can be initialized specifically for Code Quality analysis by disabling default queries and configuring quality-specific queries.
Key changes include:
analyses.ts module with dedicated configurations for both Code Scanning and Code QualityCopilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/analyses.ts | New module defining analysis configurations and endpoints for Code Scanning and Code Quality |
| src/config-utils.ts | Enhanced with functions to determine database analysis kind and handle Code Quality-only configurations |
| src/util.ts | Added isDefined utility function for type narrowing |
| src/upload-lib.ts | Refactored to use new analysis configurations instead of hardcoded upload targets |
| src/analyze.ts | Updated SARIF file generation logic to handle different analysis configurations |
| Various test files | Updated test cases to use new analysis configuration objects |
| Workflow files | Updated to use analysis-kinds input instead of deprecated quality-queries |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
d2e5cc8 to
38f1a70
Compare
1ff29bf to
7916994
Compare
7916994 to
e75b5d3
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
ok
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.