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 — Start running ATM queries again by edoardopirovano · Pull Request #999 · github/codeql-action

Conversation

@edoardopirovano

@edoardopirovano edoardopirovano commented Mar 25, 2022

Copy link
Copy Markdown
Contributor

Between the time when I ported the Action's code for parsing config files to the CLI and when we actually switched the Action to using the new code, the Action's code gained an interesting new effect that was not in the ported code: If the feature flag for ATM was set the Action would, while it was parsing the file, also add the ATM packs to it if they weren't already present. When we switched over to using the parsing in the CLI, this effect was lost and we stopped running ATM queries (!!).

This PR is a rather hacky fix that addresses this by recording (when the Action parses the config file - which it still does even if it later doesn't need it) whether it injected the ML queries. Then, when we pass the full config to the CLI we also augment it with the ML queries if we injected them before. It's not how I would like to do it, but there's a couple of reasons we can't do something more elegant:

  1. We don't want to wait for a CLI release to get things working again, so moving this injection into the CLI isn't an option. Additionally, the CLI would need to know whether the feature flag is set, and also the version of the ML pack to inject (which during the beta we want to record in the Action due to its shorter release cycle), so we'd have to pass a couple more flags in.
  2. We can't stop injecting into the Action's parsed version of the config file as well because old CLIs still use this. Plus, the telemetry looks here to know whether the ML queries are enabled.

This code is also missing tests, we have an internal issue tracking this. I'll manually test this for now, and before we touch this code again we should have an integration test that actually runs ATM queries, so we don't accidentally disable them again.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Sorry, something went wrong.

Uh oh!

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

All reactions
@edoardopirovano
edoardopirovano requested a review from a team as a code owner March 25, 2022 17:36
aeisenberg
aeisenberg reviewed Mar 25, 2022
View reviewed changes
Comment thread src/config-utils.ts
logger: Logger,
configFile?: string
) {
): Promise<boolean> {

@aeisenberg aeisenberg Mar 25, 2022

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.

Just looking at this function, it's not clear what the return value is for. Can you add @return to the jsdoc above to document it?

Sorry, something went wrong.

Uh oh!

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

All reactions

@edoardopirovano edoardopirovano Mar 28, 2022

Copy link
Copy Markdown
Contributor 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, this is a good point. I've expanded the documentation.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/config-utils.ts Outdated
Comment on lines +841 to +842
injectedMlQueries ||
(await parseQueryUses(

@aeisenberg aeisenberg Mar 25, 2022

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.

Is this right? It looks like if a previous query input injected ML queries, then we won't parse any further ones. Do we want to call parseQueryUses no matter what?

Sorry, something went wrong.

Uh oh!

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

All reactions

@edoardopirovano edoardopirovano Mar 28, 2022

Copy link
Copy Markdown
Contributor 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.

Eek, yes you're right. We definitely don't want to short-circuiting of the || to happen here and need to call parseQueryUses regardless. I've fixed that.

Sorry, something went wrong.

Uh oh!

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

All reactions
@edoardopirovano
Start running ATM queries again
d625a00
@edoardopirovano
edoardopirovano force-pushed the edoardo/reenable-atm branch from e2eaa10 to d625a00 Compare March 28, 2022 08:07
aeisenberg
aeisenberg approved these changes Mar 28, 2022
View reviewed changes
@edoardopirovano
edoardopirovano merged commit 0ed0799 into main Mar 28, 2022
@edoardopirovano
edoardopirovano deleted the edoardo/reenable-atm branch March 28, 2022 21:06
This was referenced Mar 30, 2022
Merge main into v2 #1004
Merged
Merge v2 into v1 #1006
Merged
@edoardopirovano edoardopirovano mentioned this pull request Apr 5, 2022
Revert usage of --codescanning-config flag #1018
Merged
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aeisenberg aeisenberg aeisenberg approved these changes

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.

2 participants

@edoardopirovano @aeisenberg
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.