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 — Add support for running ML-powered queries for JS `security-extended` behind `ml_powered_queries` feature flag by henrymercer · Pull Request #857 · github/codeql-action

Conversation

@henrymercer

@henrymercer henrymercer commented Dec 15, 2021

Copy link
Copy Markdown
Contributor

This PR builds on #856 to add support for running ML-powered queries. Currently these queries would only be run for customers (a) performing JavaScript analysis, (b) running the security-extended (or security-and-quality) query suite, and (c) whose repos are opted into the ml_powered_queries feature flag.

The action happens in src/config-utils.ts: when all of these conditions hold, we add the codeql/javascript-experimental-atm-queries pack to the analysis.

Since the security review for this feature is not yet complete, these queries will currently return no results. We will not roll out the feature flag until this security review is complete to avoid needlessly increasing the runtime of customers' analyses by downloading the ML-powered query pack.

Points for review

We want to enable ML-powered queries based in part on which query suite the customer is running. We resolve query suites into query paths in the init action, and the analysis action to my knowledge doesn't know what query suites the user requested. Therefore the init action is the natural point to test whether we should run ML-powered queries.

However this does necessitate an API call to test feature flag enablement in the init action as well as the existing one in the analysis action that's used for database upload.

Another option is saving some kind of information (e.g. feature flags or the query suites requested) to the config file in the init action and loading them in the analysis action. I didn't go with this since it seems like overengineering for the benefit of one fewer API call, and the API call in consideration doesn't count towards rate limits, but what do reviewers think?

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
@henrymercer
henrymercer requested a review from a team as a code owner December 15, 2021 20:04
@henrymercer
henrymercer force-pushed the henrymercer/ml-powered-queries branch from fa3d4da to 8b80bf3 Compare December 15, 2021 20:07
Base automatically changed from henrymercer/feature-flagging to main December 16, 2021 16:18
@henrymercer
henrymercer force-pushed the henrymercer/ml-powered-queries branch 3 times, most recently from 14a0324 to 02bfe3b Compare December 16, 2021 17:20
aeisenberg
aeisenberg reviewed Dec 17, 2021
View reviewed changes

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

Couple of questions inline.

Also, to answer yours, I think it's fine to make the feature flags request in init AND analyze.

What do you think about adding a comment of storing the feature flags in the config file as a potential future improvement?

Sorry, something went wrong.

Uh oh!

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

henrymercer reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread src/config-utils.ts Resolved

Uh oh!

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

Comment thread src/init-action.ts Resolved

Uh oh!

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

aeisenberg
aeisenberg approved these changes Jan 5, 2022
View reviewed changes

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

This is good to go in after updating the version range.

Sorry, something went wrong.

Uh oh!

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

All reactions
henrymercer added 6 commits January 6, 2022 11:57
@henrymercer
Run ML-powered queries for JS security-extended behind feature flag
2f4be8e
@henrymercer
Test loading of ML-powered queries
5602bd5
@henrymercer
Bump the version of the ATM query pack to 0.0.2
efded22
@henrymercer
Document use of redundant feature flag API call
9de1702
@henrymercer
Only run ML-powered queries with v2.7.5 or newer of the CLI
2159631
@henrymercer
Allow patch version of ML-powered queries pack to be bumped
e7fe6da
@henrymercer
henrymercer force-pushed the henrymercer/ml-powered-queries branch from c2a20cd to e7fe6da Compare January 6, 2022 11:58
@henrymercer
henrymercer merged commit 848e514 into main Jan 6, 2022
@henrymercer
henrymercer deleted the henrymercer/ml-powered-queries branch January 6, 2022 17:55
@github-actions github-actions Bot mentioned this pull request Jan 11, 2022
Merge main into v1 #870
Merged
5 tasks
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

@henrymercer @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.