-
Notifications
You must be signed in to change notification settings - Fork 452
Add a repository property for disabling overlay #3507
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
Changes from 1 commit
7ea93ee
ed39a1e
2808ca7
9c61a2d
70db156
1824278
445a2a9
056b091
4068616
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,28 +7,50 @@ import { GitHubVariant, GitHubVersion } from "../util"; | |||||||||||||||||||||
| * Enumerates repository property names that have some meaning to us. | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| export enum RepositoryPropertyName { | ||||||||||||||||||||||
| DISABLE_OVERLAY = "github-codeql-disable-overlay", | ||||||||||||||||||||||
| EXTRA_QUERIES = "github-codeql-extra-queries", | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| function isKnownPropertyName(value: string): value is RepositoryPropertyName { | ||||||||||||||||||||||
| return Object.values(RepositoryPropertyName).includes( | ||||||||||||||||||||||
| value as RepositoryPropertyName, | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
|
||||||||||||||||||||||
| function isKnownPropertyName(value: string): value is RepositoryPropertyName { | |
| return Object.values(RepositoryPropertyName).includes( | |
| value as RepositoryPropertyName, | |
| ); | |
| const KNOWN_REPOSITORY_PROPERTY_NAMES = new Set<string>( | |
| Object.values(RepositoryPropertyName), | |
| ); | |
| function isKnownPropertyName(value: string): value is RepositoryPropertyName { | |
| return KNOWN_REPOSITORY_PROPERTY_NAMES.has(value); |
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 didn't comment on this in my initial review, but I quite like this mapping of properties to expected types and the associated machinery below.
mbg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
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.
Minor: Since this is new, consider making this check case-insensitive?
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 consistent with other boolean checks, e.g. in environment variables. Also the repository properties UI has support for boolean properties, which will be set to either "true" or "false".
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.
Agreed that it is consistent, but is it intuitive? Do we gain anything from being this strict here?
For the repo properties UI, doesn't that require each org to individually configure the property as a boolean? If so, it's easy to imagine someone accidentally configuring it as a string and then using True etc.
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.
It's a valid point, but on the flip side if we allow True (or 1, etc) here, it's surprising when that isn't accepted elsewhere. We can make it clear in our instructions that this should be configured as a boolean property.
Outdated
Copilot
AI
Feb 24, 2026
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.
New behavior maps DISABLE_OVERLAY from the API string value to a boolean (value === "true"), but there is no unit test exercising this parsing/mapping in loadPropertiesFromApi. Add a test case that returns github-codeql-disable-overlay from the mocked API and asserts the resulting RepositoryProperties contains the correct boolean.
mbg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
mbg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
Copilot
AI
Feb 24, 2026
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.
The JSDoc still says the API returns a list of RepositoryProperty objects, but that type no longer exists and the response type is now GitHubRepositoryProperty[]/GitHubPropertiesResponse. Update the comment to match the actual types to avoid confusion for future maintainers.
| * The API returns a list of `RepositoryProperty` objects. | |
| * The API returns `GitHubPropertiesResponse`, a list of `GitHubRepositoryProperty` objects. |
Uh oh!
There was an error while loading. Please reload this page.