-
Notifications
You must be signed in to change notification settings - Fork 347
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
Fix a circular dependency that led a minimum version to be undefined
#1578
Conversation
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.
Thanks for investigation & extra debug statements 🕵️
@@ -94,7 +94,7 @@ export class Features implements FeatureEnablement { | |||
gitHubVersion: util.GitHubVersion, | |||
repositoryNwo: RepositoryNwo, | |||
tempDir: string, | |||
logger: Logger | |||
private readonly logger: Logger |
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.
Why do we make this private readonly
?
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 makes it a field on the Features
class so we can access it within getValue
.
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.
We could also add a logger
argument to getValue
, but that would cause a reasonable amount of churn, and sharing the logger makes sense.
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.
Ah, got it, thank you
A circular dependency between
codeql.ts
andfeature-flags.ts
meant thatfeatureConfig[Feature.ExportCodeScanningConfigEnabled].minimumVersion
was undefined. This in turn meant that we tried to pass some CLI options even if we were running with an early version of the CLI where these options didn't exist.The fact that we didn't catch this in PR checks highlights the need for more comprehensive testing across the full range of minor versions we support.
Merge / deployment checklist