Skip to content

Report which analysis kinds are enabled in status reports #3055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mbg
Copy link
Member

@mbg mbg commented Aug 21, 2025

This adds a new field to StatusReportBase for a comma-separated list of analysis names that are active.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

This will make it easier to replace in the future
@Copilot Copilot AI review requested due to automatic review settings August 21, 2025 14:30
@mbg mbg requested a review from a team as a code owner August 21, 2025 14:30
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds reporting of enabled analysis types (code-scanning, code-quality) to status reports by introducing a new analyses field that contains a comma-separated list of active analysis kinds.

  • Introduces an AnalysisKind enum to standardize analysis type names
  • Adds logic to detect when code quality analysis is enabled through a new helper function
  • Updates status reports to include the comma-separated list of enabled analyses

Reviewed Changes

Copilot reviewed 10 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/analyses.ts New enum defining analysis kind constants (code-scanning, code-quality)
src/config-utils.ts Adds isCodeQualityEnabled helper function to check if quality queries are configured
src/status-report.ts Adds analyses field to status reports and logic to populate it based on config
src/analyze.ts Refactors to use the new isCodeQualityEnabled helper instead of direct property checks
src/analyze-action.ts Updates to use the new isCodeQualityEnabled helper function
lib/* Generated JavaScript files corresponding to the TypeScript changes

@mbg mbg force-pushed the mbg/cq/telemetry branch from 46f84c3 to c208f33 Compare August 21, 2025 14:31
Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. My only question is would we rather wait for the analysis_kinds input so we can be more sure about when code scanning is enabled or not?

/**
* Returns `true` if Code Quality analysis is enabled, or `false` if not.
*/
export function isCodeQualityEnabled(config: Config): config is Config & {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could in future reference an analysis-kinds input.

@mbg
Copy link
Member Author

mbg commented Aug 22, 2025

My only question is would we rather wait for the analysis_kinds input so we can be more sure about when code scanning is enabled or not?

I think I am happy to merge this as-is (once I have made the other necessary backend changes), since it should be accurate for the current setup. I can then iterate on the details as we move forward and update this accordingly. That's also why I added the isCodeQualityEnabled helper so that this is easy to update with subsequent changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants