FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Feature flagging via the GitHub API by henrymercer · Pull Request #856 · github/codeql-action · GitHub

Feature flagging via the GitHub API - #856

Merged
henrymercer merged 6 commits into
mainfrom
henrymercer/feature-flagging
Dec 16, 2021
Merged

henrymercer merged 6 commits into
mainfrom
henrymercer/feature-flagging

Conversation

henrymercer commented Dec 14, 2021
edited
Loading

Copy link
Copy Markdown
Contributor

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

  • 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.

henrymercer marked this pull request as ready for review December 14, 2021 21:18
henrymercer requested a review from a team as a code owner December 14, 2021 21:18
henrymercer force-pushed the henrymercer/feature-flagging branch from 4a0c236 to d6499fa Compare December 15, 2021 13:17

robertbrignull left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread src/feature-flags.ts Outdated
Comment thread src/feature-flags.ts Outdated
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.

aeisenberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good. A few minor comments.

Comment thread src/analyze-action-env.test.ts Outdated
Comment thread src/feature-flags.ts Outdated
Comment thread src/feature-flags.ts

robertbrignull left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM too once @aeisenberg is happy

Comment thread src/database-upload.test.ts Outdated
henrymercer force-pushed the henrymercer/feature-flagging branch from 6250a27 to 254816c Compare December 16, 2021 13:39

aeisenberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nice.

henrymercer merged commit 249c7ff into main Dec 16, 2021
henrymercer deleted the henrymercer/feature-flagging branch December 16, 2021 16:18
github-actions Bot mentioned this pull request Jan 11, 2022
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL