GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Overlay databases: Use `Config` instead of `AugmentationProperties` by mbg · Pull Request #3072 · github/codeql-action

Conversation

@mbg

@mbg mbg commented Sep 2, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Extracted from #3064. Moves extraQueryExclusions and overlay database configuration out of AugmentationProperties and into Config.

The reasoning for this change is that AugmentationProperties is intended for user inputs to the init Action that cannot be represented in the same format that is used by UserConfig (which is understood by the CodeQL CLI). Options stored in the AugmentationProperties are then intended to be combined with an existing UserConfig into a new UserConfig.

We will remove AugmentationProperties from Config (used to represent the CodeQL Action configuration / state that is shared across different steps in a CodeQL workflow) in #3075. This makes sense, because the purpose of AugmentationProperties (as explained above) is just to represent user inputs to the Action until they can be converted into a UserConfig.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
mbg force-pushed the mbg/refactor/augmentation-properties branch 2 times, most recently from d0ba608 to 029e76e Compare September 2, 2025 12:59
@mbg
mbg marked this pull request as ready for review September 2, 2025 13:06
@mbg
mbg requested a review from a team as a code owner September 2, 2025 13:06
@mbg
mbg requested review from Copilot and henrymercer September 2, 2025 13:07
Copilot AI reviewed Sep 2, 2025
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this 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 refactors the overlay database configuration by moving related properties from the AugmentationProperties interface to the main Config interface for better organization and clarity.

Key Changes:

  • Moves overlay database mode and caching properties from AugmentationProperties to Config
  • Adds computedConfig field to store the final computed configuration
  • Updates all references to use the new property locations

Reviewed Changes

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

Show a summary per file
File Description
src/config-utils.ts Moves overlay database properties from AugmentationProperties to Config, adds computedConfig field
src/testing-utils.ts Updates test configuration to use new property locations
src/overlay-database-utils.ts Updates overlay database utility functions to access properties from config instead of config.augmentationProperties
src/init-action.ts Updates initialization code to use new property structure
src/analyze.ts Updates analysis functions to use new property locations
src/codeql.ts Updates CodeQL functions to use new property structure and removes dependency on generateCodeScanningConfig
src/test.ts Updates test files to use new property structure
lib/*.js Generated JavaScript files with corresponding changes

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
mbg requested a review from cklin September 2, 2025 13:24
cklin
cklin reviewed Sep 2, 2025
View reviewed changes
Comment thread src/config-utils.ts Outdated
if (config.computedConfig["query-filters"] === undefined) {
config.computedConfig["query-filters"] = [];
}
config.computedConfig["query-filters"].push({

@cklin cklin Sep 2, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We need to be a careful here. Ordering matters in query-filters, and there was a recent bug where we accidentally overrode the user-specified query-filters setting by putting our own exclusion at the top of the list. See comments at

codeql-action/src/config-utils.ts

Lines 1478 to 1485 in 68d7fe3

augmentedConfig["query-filters"] = [
// Ordering matters. If the first filter is an inclusion, it implicitly
// excludes all queries that are not included. If it is an exclusion,
// it implicitly includes all queries that are not excluded. So user
// filters (if any) should always be first to preserve intent.
...(augmentedConfig["query-filters"] || []),
...augmentationProperties.extraQueryExclusions,
];

Saving the programmatic exclusions in extraQueryExclusions allows us to easily ensure that those exclusions always come after user-specified filters. If we are mixing them all together in the same ``query-filters` field, we would need some other way to ensure proper ordering.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mbg mbg Sep 2, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yep, I am aware that the ordering here is critical and that you previously fixed an issue related to that.

For context, the main motivation for this PR is that the overlay database settings don't really belong in AugmentationProperties and we are working on removing the AugmentationProperties in Config.

In other words, the line you commented on does not produce a UserConfig that's later combined with other AugmentationProperties using generateCodeScanningConfig. The UserConfig that is mutated on the line you've commented on is the UserConfig that is given to the CLI. Since we are appending exclude-from-incremental here, it should have the same effect as what you previously accomplished by modifying AugmentationProperties.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@cklin cklin Sep 2, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

First, thank you for the explanation!

There are two parts to my concern.

  1. That this PR preserves the existing behavior of putting the exclude-from-incremental exclusion after user-specified query filters
  2. That we help future developers (which could well be our future selves) avoid introducing this regression by accident

You made a strong case that you addressed the first part, and I agree with you on that. What about the second part?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mbg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@mbg mbg Sep 2, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for separating those points. I think what 2. has made me realise here is that you had introduced extraQueryExclusions to AugmentationProperties as part of your work on the Action in the last few months, but that it also doesn't really belong into AugmentationProperties.

What I could propose then to address 2. is to move extraQueryExclusions to Config as well, add exclude-from-incremental to it here, and then apply extraQueryExclusions to the query-filters of the UserConfig that we pass on to the CLI as late as possible (i.e. just before invoking the CLI). That would then behave similarly to what we had previously, except we don't have the baggage of the entire AugmentationProperties.

There might be more we could do to protect against shooting ourselves in the foot, but I think that's largely outside the scope of this change.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mbg mbg Sep 3, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I have pushed a commit which moves extraQueryExclusions out of AugmentationProperties into Config. The part of the code from generateCodeScanningConfig that appends the extraQueryExclusions to a UserConfig is now in its own function as well. I have added a bit more documentation at the point where we append the extra query exclusions that links to your previous PR as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@cklin cklin Sep 3, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thank you! These changes addressed all my concerns.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mbg reacted with heart emoji
All reactions
  • ❤️ 1 reaction
mbg added 2 commits September 2, 2025 18:01
@mbg
Add computedConfig property to Config type
c4d2772
@mbg
Move overlay db settings from AugmentationProperties to Config
ac9b91e
@mbg
mbg force-pushed the mbg/refactor/augmentation-properties branch from 029e76e to ac9b91e Compare September 2, 2025 17:02
@mbg mbg mentioned this pull request Sep 2, 2025
Remove augmentationProperties from Config type #3075
Merged
@mbg
mbg requested a review from cklin September 3, 2025 11:08
@mbg
mbg force-pushed the mbg/refactor/augmentation-properties branch from e4b1ce5 to fe428a8 Compare September 3, 2025 11:10
@mbg
Move extraQueryExclusions out of AugmentationProperties
e9fb72d
@mbg
mbg force-pushed the mbg/refactor/augmentation-properties branch from fe428a8 to e9fb72d Compare September 3, 2025 11:14
@mbg
Mark result of appendExtraQueryExclusions as Readonly to prevent …
7f81363
…further modification
@mbg
mbg force-pushed the mbg/refactor/augmentation-properties branch from 61c593a to 7f81363 Compare September 3, 2025 11:21
henrymercer
henrymercer approved these changes Sep 3, 2025
View reviewed changes
cklin
cklin approved these changes Sep 3, 2025
View reviewed changes
@mbg
mbg merged commit 1fd8a71 into main Sep 3, 2025
@mbg
mbg deleted the mbg/refactor/augmentation-properties branch September 3, 2025 15:40
@github-actions github-actions Bot mentioned this pull request Sep 5, 2025
Merge main into releases/v3 #3081
Merged
8 tasks done
krsjenswbp
krsjenswbp reviewed Sep 11, 2025
View reviewed changes

@krsjenswbp krsjenswbp left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

ok

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cklin cklin cklin approved these changes
Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@henrymercer henrymercer henrymercer approved these changes
+1 more reviewer
@krsjenswbp krsjenswbp krsjenswbp left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@mbg @cklin @henrymercer @krsjenswbp
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.