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 — Improve reliability and performance when using the `autobuild` build mode by henrymercer · Pull Request #2235 · github/codeql-action

Conversation

@henrymercer

@henrymercer henrymercer commented Apr 12, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

This PR directly traces autobuild scripts when a build mode is specified to the init Action.

Before, the init Action did not know whether the workflow would call the autobuilder or run manual build scripts, so we always had to start indirect tracing in case we needed to trace manual build steps.

However in new-style workflows where the build mode is specified, this is no longer necessary, and we only need to use indirect tracing when the build mode is manual. For the autobuild build mode, we can avoid starting indirect tracing and directly trace the autobuild script using database trace-command. We expect this to provide reliability and performance benefits, which we will validate.

This is behind the autobuild_direct_tracing_enabled feature flag.

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
henrymercer added 6 commits April 12, 2024 16:37
@henrymercer
Move BuildMode to util.ts
5b74166
@henrymercer
Use direct tracing when autobuild build mode specified
e37d0f3
Behind a flag, for now
@henrymercer
Use extraction via build mode in autobuild Action when available
3d49faa
@henrymercer
Apply network timeout fix to extraction with direct tracing
8f057a3
@henrymercer
Run autobuild script via direct tracing when feature enabled
cbe29f5
@henrymercer
Add changelog note
2eaad47
@henrymercer
henrymercer force-pushed the henrymercer/autobuild-with-direct-tracing branch from 8859bb4 to 2eaad47 Compare April 12, 2024 16:07
@henrymercer
henrymercer changed the base branch from main to henrymercer/feature-flags-with-tool-feature-dependencies April 12, 2024 16:07
@henrymercer
Add PR check for direct tracing
aa4a08d
@henrymercer
henrymercer marked this pull request as ready for review April 12, 2024 17:00
@henrymercer
henrymercer requested a review from a team as a code owner April 12, 2024 17:00
Base automatically changed from henrymercer/feature-flags-with-tool-feature-dependencies to main April 12, 2024 17:00
@henrymercer
Merge branch 'main' into henrymercer/autobuild-with-direct-tracing
f21d2d2
@henrymercer henrymercer changed the title Improve the reliability and performance of analyzing code when using the autobuild build mode Improve reliability and performance when using the autobuild build mode Apr 12, 2024
aeisenberg
aeisenberg reviewed Apr 12, 2024
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 great.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread CHANGELOG.md Outdated
We recommend removing any references to these from your workflows. For more information, see the release notes for CodeQL Action v3.23.0 and v2.23.0.
- Automatically overwrite an existing database if found on the filesystem. [#2229](https://github.com/github/codeql-action/pull/2229)
- Bump the minimum CodeQL bundle version to 2.12.6. [#2232](https://github.com/github/codeql-action/pull/2232)
- We are rolling out a feature in April 2024 that improves the reliability and performance of analyzing code when using the `autobuild` build mode. This feature uses direct tracing to trace the build when the `autobuild` build mode is specified using the `build-mode` input to the `init` Action. [#2335](https://github.com/github/codeql-action/pull/2335)

@aeisenberg aeisenberg Apr 12, 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.

There's a lot going on in this changelog. Can you add some links to external docs around direct tracing. Also, is there a github changelog post for the build-mode changes you can link to?

Sorry, something went wrong.

Uh oh!

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

All reactions

@henrymercer henrymercer Apr 15, 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.

Fair point — I'll leave the details out of the changelog note, and link some docs about build modes.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pr-checks/checks/autobuild-direct-tracing.yml Outdated
@@ -0,0 +1,30 @@
name: "Autobuild direct tracing"
description: "An end-to-end integration test of a Java repository built using 'build-mode: autobuild', with direct tracing enabled"
operatingSystems: ["ubuntu"]

@aeisenberg aeisenberg Apr 12, 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.

Should we be testing on windows, too?

Sorry, something went wrong.

Uh oh!

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

All reactions

@henrymercer henrymercer Apr 15, 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.

Yes, I think this makes sense. It doesn't really give us any additional confidence that the code changes are correct, but it does give us better confidence that direct tracing is working as expected.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pr-checks/checks/autobuild-direct-tracing.yml
name: "Autobuild direct tracing"
description: "An end-to-end integration test of a Java repository built using 'build-mode: autobuild', with direct tracing enabled"
operatingSystems: ["ubuntu"]
versions: ["latest", "nightly-latest"]

@aeisenberg aeisenberg Apr 12, 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.

Not something to fix in this PR, but how can we ensure that as we release new versions of the CLI, we add them to the matrix? There are other integration tests that only run on "latest", "nightly-latest" because when we wrote them, those were the only versions that supported the feature being tested.

Could we add a minimum-version property so that tests that specify it run on all CLI versions >= the minimum version?

Sorry, something went wrong.

Uh oh!

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

All reactions

@henrymercer henrymercer Apr 15, 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.

I like this idea, but I think it's beyond the scope of this PR. I'll file an issue.

Sorry, something went wrong.

Uh oh!

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

aeisenberg and angelapwen reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
angelapwen
angelapwen reviewed Apr 12, 2024
View reviewed changes
Comment thread src/codeql.ts
Comment on lines +674 to +676
if (config.buildMode === BuildMode.Autobuild) {
applyAutobuildAzurePipelinesTimeoutFix();
}

@angelapwen angelapwen Apr 12, 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'm not sure I understand why're now applying this fix only if we're using autobuild/direct tracing 🤔 it looks like we set those options unconditionally in the past.

Sorry, something went wrong.

Uh oh!

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

All reactions

@henrymercer henrymercer Apr 15, 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.

I think this PR should be additive when it comes to applying this fix — previously we applied it to the autobuild Action only, now we also apply it to database trace-command calls.

Sorry, something went wrong.

Uh oh!

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

angelapwen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@henrymercer henrymercer self-assigned this Apr 15, 2024
henrymercer added 3 commits April 15, 2024 18:26
@henrymercer
Run PR check on Windows too
59771dd
@henrymercer
Improve changelog note
14eab91
@henrymercer
Merge branch 'main' into henrymercer/autobuild-with-direct-tracing
ea78e51
@henrymercer
henrymercer requested review from aeisenberg and angelapwen April 15, 2024 17:51
angelapwen
angelapwen previously approved these changes Apr 15, 2024
View reviewed changes
Comment thread CHANGELOG.md Outdated
- Automatically overwrite an existing database if found on the filesystem. [#2229](https://github.com/github/codeql-action/pull/2229)
- Bump the minimum CodeQL bundle version to 2.12.6. [#2232](https://github.com/github/codeql-action/pull/2232)
- We are rolling out a feature in April 2024 that improves the reliability and performance of analyzing code when using the `autobuild` build mode. This feature uses direct tracing to trace the build when the `autobuild` build mode is specified using the `build-mode` input to the `init` Action. [#2335](https://github.com/github/codeql-action/pull/2335)
- We are rolling out a feature in April/May 2024 that improves the reliability and performance of analyzing code when analyzing a compiled language with the `autobuild` [build mode](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes). [#2335](https://github.com/github/codeql-action/pull/2335)

@angelapwen angelapwen Apr 15, 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.

Just noticed PR number should be 2235 instead of 2335 😸

Sorry, something went wrong.

Uh oh!

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

henrymercer reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@henrymercer
Fix PR link in changelog
db2b739
@henrymercer
henrymercer dismissed angelapwen’s stale review via db2b739 April 16, 2024 11:34
@henrymercer
henrymercer requested a review from angelapwen April 16, 2024 11:34
angelapwen
angelapwen approved these changes Apr 16, 2024
View reviewed changes
@henrymercer
henrymercer merged commit 18111b6 into main Apr 16, 2024
@henrymercer
henrymercer deleted the henrymercer/autobuild-with-direct-tracing branch April 16, 2024 17:59
@github-actions github-actions Bot mentioned this pull request Apr 17, 2024
Merge main into releases/v3 #2248
Merged
8 tasks
@github-actions github-actions Bot mentioned this pull request Apr 17, 2024
Merge releases/v3 into releases/v2 #2250
Merged
8 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Sep 16, 2026
ci(actions): bump github/codeql-action/init from 4.37.8 to 4.38.0 VBCreators/AI-RAG#32
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aeisenberg aeisenberg Awaiting requested review from aeisenberg
1 more reviewer
@angelapwen angelapwen angelapwen approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

@henrymercer henrymercer

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

@henrymercer @aeisenberg @angelapwen
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.