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 — Honor the Lua tracer FF for `database trace-command` invocations for scanned languages. by criemen · Pull Request #1120 · github/codeql-action

Conversation

@criemen

@criemen criemen commented Jun 24, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

In theory, a scanned language will not setup the build tracer, and so
shouldn't care about lua versus legacy tracing. However, go is a
special case where the autobuilder runs under the build tracer, that
then gets disabled immediately again, unless a special environment
variable is used.
Therefore, we need to thread through the feature flag to this
database trace-command invocation. For other scanned languages,
this should be a no-op, as no tracing is ever set up.

I couldn't find any tests for the existing functionality, so I couldn't extend them either. If anybody has some great ideas for how to test this change, I'm happy to write some tests for this, too.

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.

Sorry, something went wrong.

Uh oh!

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

All reactions
@criemen
criemen requested a review from a team as a code owner June 24, 2022 10:32
aeisenberg
aeisenberg reviewed Jun 24, 2022
View reviewed changes

@aeisenberg aeisenberg left a comment

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.

Looks sensible. Though I think it shouldn't be too hard to create a unit test.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/analyze.ts Resolved

Uh oh!

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

@aeisenberg

aeisenberg commented Jun 24, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Another thing that I'm seeing is that these Test Python Package Installation tests are flaky. We should probably automatically retry them if they fail. (Unrelated to this PR.)

#1122

All reactions

Sorry, something went wrong.

Uh oh!

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

@aeisenberg

aeisenberg commented Jun 24, 2022

Copy link
Copy Markdown
Contributor

Oh...looks like this test is no longer flaky...it's just failing.

All reactions

Sorry, something went wrong.

Uh oh!

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

ghost
ghost reviewed Jun 25, 2022
View reviewed changes

@ghost ghost left a comment

Copy link
Copy Markdown

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.

Looks good. All tests passed.

Sorry, something went wrong.

Uh oh!

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

All reactions
criemen added 2 commits June 27, 2022 16:04
@criemen
Honor the Lua tracer FF for database trace-command invocations for …
f422a50
…scanned languages.

In theory, a scanned language will not setup the build tracer, and so
shouldn't care about lua versus legacy tracing. However, `go` is a
special case where the autobuilder runs under the build tracer, that
then gets disabled immediately again, unless a special environment
variable is used.
Therefore, we need to thread through the feature flag to this
`database trace-command` invocation. For other scanned languages,
this should be a no-op, as no tracing is ever set up.
@criemen
Implement unit tests for reading the Lua tracer FF in analyze-action.
ab7316e
@criemen
criemen force-pushed the criemen/lua-tracer-ff-2 branch from 11b7154 to ab7316e Compare June 27, 2022 16:04
github-advanced-security[bot]
github-advanced-security AI found potential problems Jun 27, 2022
View reviewed changes
Comment thread src/codeql.ts
export async function getCodeQLForTesting(): Promise<CodeQL> {
return getCodeQLForCmd("codeql-for-testing", false);
export async function getCodeQLForTesting(
cmd = "codeql-for-testing"

Check failure

Code scanning / CodeQL

Exec call vulnerable to binary planting

This exec call might be vulnerable to Windows binary planting vulnerabilities. This exec call might be vulnerable to Windows binary planting vulnerabilities. This exec call might be vulnerable to Windows binary planting vulnerabilities.
aeisenberg
aeisenberg reviewed Jun 27, 2022
View reviewed changes
Comment thread src/analyze.test.ts
injectedMlQueries: false,
};

test("createdDBForScannedLanguages() Lua feature flag enabled, but old CLI", async (t) => {

@aeisenberg aeisenberg Jun 27, 2022

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.

There are 4 tests here that are almost the same, but with different parameters. Can you merge them? The easiest thing to do is something like this:

[{ name: "Lua feature flag enabled, but old CLI", version: "2.9.0", ... }, ...].forEach(options => {
  test(`createdDBForScannedLanguages() ${options.name}`, async (t) => {
    ...
    sinon.stub(codeqlObject, "getVersion").resolves(options.version);
    ...
  });
});

This will help emphasize the actual differences between the tests.

Sorry, something went wrong.

Uh oh!

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

All reactions
aeisenberg
aeisenberg approved these changes Jun 27, 2022
View reviewed changes

@aeisenberg aeisenberg left a comment

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.

My suggestion is quite minor. Feel free to merge this now to get it into the 2.10.0 release and then tweak it later.

Sorry, something went wrong.

Uh oh!

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

All reactions
@criemen
Merge branch 'main' into criemen/lua-tracer-ff-2
821fe9b
@criemen
criemen merged commit b40cd03 into main Jun 28, 2022
@criemen
criemen deleted the criemen/lua-tracer-ff-2 branch June 28, 2022 09:19
@criemen

criemen commented Jun 28, 2022

Copy link
Copy Markdown
Contributor Author

I'll do so, thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

This was referenced Jun 28, 2022
Merge main into releases/v2 #1129
Merged
Merge releases/v2 into releases/v1 #1131
Merged
@aliscco aliscco mentioned this pull request Jun 22, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/codeql-action#613
Open
@aliscco aliscco mentioned this pull request Nov 30, 2023
[Snyk] Fix for 4 vulnerabilities aliscco/codeql-action#1004
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aeisenberg aeisenberg aeisenberg approved these changes
+1 more reviewer
Reviewers whose approvals may not affect merge requirements

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.

3 participants

@criemen @aeisenberg @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.