Skip to content
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

Merged
merged 2 commits into from Mar 14, 2023

Conversation

henrymercer
Copy link
Contributor

A circular dependency between codeql.ts and feature-flags.ts meant that featureConfig[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

  • 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 henrymercer requested a review from a team as a code owner March 14, 2023 21:09
Copy link
Contributor

@angelapwen angelapwen left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

@henrymercer henrymercer merged commit b8ea587 into main Mar 14, 2023
281 checks passed
@henrymercer henrymercer deleted the henrymercer/fix-circular-dependency branch March 14, 2023 21:31
@github-actions github-actions bot mentioned this pull request Mar 15, 2023
6 tasks
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.

None yet

3 participants