-
Notifications
You must be signed in to change notification settings - Fork 356
Feature flagging via the GitHub API #856
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
Conversation
4a0c236
to
d6499fa
Compare
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 haven't reviewed in huge detail. I can do that tomorrow or leave it to the CodeQL team. I have a couple of initial comments though.
As suggested in review: The `GITHUB_REPOSITORY` environment variable is only available on Actions. Passing it in explicitly avoids potentially crashing if this code is called from the runner.
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.
Looks good. A few minor comments.
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.
LGTM too once @aeisenberg is happy
Replaces the previous string literal type
6250a27
to
254816c
Compare
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.
Nice.
This PR introduces feature flagging to the CodeQL Action via a GitHub API endpoint
/repositories/:repository_id/code-scanning/codeql-action/features
(see backlinked issue). This API endpoint only exists on Dotcom, so for GHES and GHAE feature flags will all be marked as disabled.This is a general purpose solution that'll allow us to add many feature flags to the CodeQL Action while only calling a single API endpoint. In this PR we use this mechanism to replace the database uploading feature flags; in the future we'll use it to decide whether to run ML-powered queries.
I've written some unit tests for the feature flagging class, and verified that database upload works as expected on a repo with the feature flag enabled. Ideas for further testing welcome.
Merge / deployment checklist