GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — C++: Handle codeql_action_cpp_build_mode_none feature flag by calumgrant · Pull Request #2568 · github/codeql-action

Conversation

@calumgrant

@calumgrant calumgrant commented Oct 24, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

Continues #2565, tidying up the feature flag options and setting the environment variables.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
github-advanced-security[bot]
github-advanced-security AI found potential problems Oct 24, 2024
View reviewed changes
Comment thread src/init-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/init-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

@calumgrant
C++: Handle codeql_action_cpp_build_mode_none feature flag
0d2a78f
@calumgrant
calumgrant force-pushed the calumgrant/bmn-ff2 branch from efbdf00 to 0d2a78f Compare October 24, 2024 15:53
@calumgrant
calumgrant marked this pull request as ready for review October 24, 2024 16:41
@calumgrant
calumgrant requested a review from a team as a code owner October 24, 2024 16:41
aeisenberg
aeisenberg reviewed Oct 24, 2024
View reviewed changes
Comment thread src/init-action.ts Outdated
Comment on lines +555 to +559
logger.info("Enabling C++ build-mode: none");
core.exportVariable(bmn_var, "true");
} else {
logger.info("Disabling C++ build-mode: none");
core.exportVariable(bmn_var, "false");

@aeisenberg aeisenberg Oct 24, 2024

Copy link
Copy Markdown
Contributor

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 assume the reason why you are doing this is because the extractor requires this same env var to be set?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@calumgrant calumgrant Oct 25, 2024

Copy link
Copy Markdown
Contributor Author

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 not required, just setting it for completeness.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/init-action.ts Outdated

// Set CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE
if (config.languages.includes(Language.cpp)) {
const bmn_var = "CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE";

@aeisenberg aeisenberg Oct 24, 2024

Copy link
Copy Markdown
Contributor

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 probably a linter error. Here's a more canonical name.

Suggested change
const bmn_var = "CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE";
const bmnVar = "CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE";

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

calumgrant reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@aeisenberg aeisenberg Oct 24, 2024

Copy link
Copy Markdown
Contributor

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.

Is this simpler? features.getValue is guaranteed to return a boolean and if the env var is already set, it will use that as an override.

const bmnVar = await features.getValue(Feature.CppBuildModeNone, codeql);
core.exportVariable(bmnVar);
logger.info(`Setting C++ build-mode: none to ${bmnVar}`);

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

calumgrant reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@calumgrant calumgrant Oct 25, 2024

Copy link
Copy Markdown
Contributor Author

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.

That didn't quite compile, but I managed to simplify things. The code in init-action.ts is not written in this idiomatic way, and the docs to exportVariable() don't mention the behaviour when the variable is already set. Most of the code in init-action.ts defensively checks the environment.

I would suggest refactoring this file as most people will just adapt code that's already there.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
github-advanced-security[bot]
github-advanced-security AI found potential problems Oct 25, 2024
View reviewed changes
Comment thread src/init-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/init-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

@calumgrant
C++: Refactor CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE
802a7ed
github-advanced-security[bot]
github-advanced-security AI found potential problems Oct 25, 2024
View reviewed changes
Comment thread src/init-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

@calumgrant
Fix linter errors
f88a648
@calumgrant
calumgrant force-pushed the calumgrant/bmn-ff2 branch from 26d552d to f88a648 Compare October 25, 2024 09:11
henrymercer
henrymercer approved these changes Oct 25, 2024
View reviewed changes
Comment thread src/init-action.ts
Comment on lines +549 to +551
// Set CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE
if (config.languages.includes(Language.cpp)) {
const bmnVar = "CODEQL_EXTRACTOR_CPP_BUILD_MODE_NONE";

@henrymercer henrymercer Oct 25, 2024

Copy link
Copy Markdown
Contributor

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.

If you think we might want users to interact with this option, we should make this an extractor option by changing the name to CODEQL_EXTRACTOR_CPP_OPTION_BUILD_MODE_NONE and including an entry in codeql-extractor.yml. That gives customers more options for configuring it. If this is only going to be used by the Action, then we can leave it as is.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@calumgrant calumgrant Oct 25, 2024

Copy link
Copy Markdown
Contributor Author

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 internal and short-lived, so I don't think we should give customers the option of configuring it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@calumgrant
calumgrant merged commit b91f43b into main Oct 25, 2024
@calumgrant
calumgrant deleted the calumgrant/bmn-ff2 branch October 25, 2024 11:01
This was referenced Nov 8, 2024
Merge main into releases/v3 #2585
Merged
Merge releases/v3 into releases/v2 #2587
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aeisenberg aeisenberg aeisenberg left review comments
@henrymercer henrymercer henrymercer approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@calumgrant @aeisenberg @henrymercer @github-advanced-security
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.