Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0dc76a9
feat: use http agent that respects environment proxy settings when st…
NlightNFotis Dec 4, 2024
8f2cb3a
build: add undici to node_modules folder - CI fails without it
NlightNFotis Dec 4, 2024
78be2f1
ci: add configuration tto run proxy with zstd package to test streami…
NlightNFotis Dec 3, 2024
9c48c8b
ci: add capability to handle container initialisation steps to sync.py
NlightNFotis Dec 5, 2024
b4bc093
ci: remove patch file and cleanup justfile
NlightNFotis Dec 5, 2024
b706e37
chore: add changelog entry
NlightNFotis Dec 5, 2024
182c5e7
chore: reword description in CHANGELOG.md
NlightNFotis Dec 6, 2024
a89fbc8
docs: add readme for justfile/pr-checks update
NlightNFotis Dec 9, 2024
c901aee
ci: remove dns for container running proxy steps (experimental)
NlightNFotis Dec 9, 2024
70aac4e
Introduce withGroupAsync()
cklin Dec 9, 2024
dd4aa40
deepenGitHistory: specify HEAD
cklin Dec 9, 2024
3e10d34
deepenGitHistory: do not fetch submodules
cklin Dec 9, 2024
57a2859
getPullRequestEditedDiffRanges: work around fatal error
cklin Dec 9, 2024
f9b0c1f
build: refresh js files
cklin Dec 9, 2024
3951a82
Merge branch 'main' into NlightNFotis/detect_use_proxy_when_streaming
NlightNFotis Dec 9, 2024
51e71f8
docs: add documentation for the reason why we need to have a setup st…
NlightNFotis Dec 9, 2024
4c20d4f
feat: cleanup destination directory if we fail during streaming of th…
NlightNFotis Dec 9, 2024
9fd5c24
Update changelog and version after v3.27.7
github-actions[bot] Dec 10, 2024
18cf30d
Update checked-in dependencies
github-actions[bot] Dec 10, 2024
417bb84
Merge pull request #2641 from github/mergeback/v3.27.7-to-main-babb554e
henrymercer Dec 10, 2024
dfed55c
Merge pull request #2638 from github/cklin/diff-informed-graph-fetchi…
cklin Dec 10, 2024
b0cd76b
Move Git functions to git-utils.ts
cklin Dec 9, 2024
b2c41ec
Create git-utils.test.ts for git-utils.ts
cklin Dec 9, 2024
300d251
build: refresh js files
cklin Dec 9, 2024
c6454d5
Merge branch 'main' into NlightNFotis/detect_use_proxy_when_streaming
henrymercer Dec 10, 2024
4d64ab6
Merge pull request #2639 from github/cklin/extract-git-utils
cklin Dec 10, 2024
9323695
Update PR checks readme instructions
aeisenberg Dec 9, 2024
88bcf64
feat: change wording of error reporting when a failure occurs during …
NlightNFotis Dec 11, 2024
9e8cd42
fix: move changelog entry to appropriate place
NlightNFotis Dec 11, 2024
1e5b591
Merge branch 'main' into NlightNFotis/detect_use_proxy_when_streaming
NlightNFotis Dec 11, 2024
f327a84
Avoid failing the workflow on a proxy post step
marcogario Dec 11, 2024
849b60e
Add token information
marcogario Dec 11, 2024
47dd68e
formatting
marcogario Dec 11, 2024
c4bbe15
Merge pull request #2624 from github/NlightNFotis/detect_use_proxy_wh…
NlightNFotis Dec 11, 2024
78d0136
Merge pull request #2643 from github/marcogario/robustify_start_proxy…
marcogario Dec 11, 2024
9a8645d
Use an app token for triggering a release
aeisenberg Dec 11, 2024
9cfbef4
Merge pull request #2644 from github/aeisenberg/use-app-token-for-rel…
aeisenberg Dec 12, 2024
90a2700
Update changelog for v3.27.8
github-actions[bot] Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th

Note that the only difference between `v2` and `v3` of the CodeQL Action is the node version they support, with `v3` running on node 20 while we continue to release `v2` to support running on node 16. For example `3.22.11` was the first `v3` release and is functionally identical to `2.22.11`. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.

## [UNRELEASED]

No user facing changes.

## 3.27.7 - 10 Dec 2024

- We are rolling out a change in December 2024 that will extract the CodeQL bundle directly to the toolcache to improve performance. [#2631](https://github.com/github/codeql-action/pull/2631)
Expand Down
28 changes: 25 additions & 3 deletions lib/actions-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/actions-util.js.map

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions lib/analyze.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze.js.map

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions lib/logging.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/logging.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "3.27.7",
"version": "3.27.8",
"private": true,
"description": "CodeQL action",
"scripts": {
Expand Down
29 changes: 27 additions & 2 deletions src/actions-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const determineBaseBranchHeadCommitOid = async function (
};

/**
* Deepen the git history of the given ref by one level. Errors are logged.
* Deepen the git history of HEAD by one level. Errors are logged.
*
* This function uses the `checkout_path` to determine the repository path and
* works only when called from `analyze` or `upload-sarif`.
Expand All @@ -172,7 +172,14 @@ export const deepenGitHistory = async function () {
try {
await runGitCommand(
getOptionalInput("checkout_path"),
["fetch", "--no-tags", "--deepen=1"],
[
"fetch",
"origin",
"HEAD",
"--no-tags",
"--no-recurse-submodules",
"--deepen=1",
],
"Cannot deepen the shallow repository.",
);
} catch {
Expand All @@ -198,6 +205,24 @@ export const gitFetch = async function (branch: string, extraFlags: string[]) {
}
};

/**
* Repack the git repository, using with the given flags. Errors are logged.
*
* This function uses the `checkout_path` to determine the repository path and
* works only when called from `analyze` or `upload-sarif`.
*/
export const gitRepack = async function (flags: string[]) {
try {
await runGitCommand(
getOptionalInput("checkout_path"),
["repack", ...flags],
"Cannot repack the repository.",
);
} catch {
// Errors are already logged by runGitCommand()
}
};

/**
* Compute the all merge bases between the given refs. Returns an empty array
* if no merge base is found, or if there is an error.
Expand Down
30 changes: 19 additions & 11 deletions src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { addDiagnostic, makeDiagnostic } from "./diagnostics";
import { EnvVar } from "./environment";
import { FeatureEnablement, Feature } from "./feature-flags";
import { isScannedLanguage, Language } from "./languages";
import { Logger, withGroup } from "./logging";
import { Logger, withGroupAsync } from "./logging";
import { DatabaseCreationTimings, EventReport } from "./status-report";
import { ToolsFeature } from "./tools-features";
import { endTracingForCluster } from "./tracer-config";
Expand Down Expand Up @@ -256,14 +256,17 @@ export async function setupDiffInformedQueryRun(
if (!(await features.getValue(Feature.DiffInformedQueries, codeql))) {
return undefined;
}
return await withGroup("Generating diff range extension pack", async () => {
const diffRanges = await getPullRequestEditedDiffRanges(
baseRef,
headRef,
logger,
);
return writeDiffRangeDataExtensionPack(logger, diffRanges);
});
return await withGroupAsync(
"Generating diff range extension pack",
async () => {
const diffRanges = await getPullRequestEditedDiffRanges(
baseRef,
headRef,
logger,
);
return writeDiffRangeDataExtensionPack(logger, diffRanges);
},
);
}

interface DiffThunkRange {
Expand Down Expand Up @@ -295,7 +298,7 @@ async function getPullRequestEditedDiffRanges(

// To compute the merge bases between the base branch and the PR topic branch,
// we need to fetch the commit graph from the branch heads to those merge
// babes. The following 4-step procedure does so while limiting the amount of
// babes. The following 6-step procedure does so while limiting the amount of
// history fetched.

// Step 1: Deepen from the PR merge commit to the base branch head and the PR
Expand All @@ -314,7 +317,12 @@ async function getPullRequestEditedDiffRanges(
// Step 4: Fetch the base branch history, stopping when we reach commits that
// are reachable from the PR topic branch head.
await actionsUtil.gitFetch(baseRef, [`--shallow-exclude=${headRef}`]);
// Step 5: Deepen the history so that we have the merge bases between the base
// Step 5: Repack the history to remove the shallow grafts that were added by
// the previous fetches. This step works around a bug that causes subsequent
// deepening fetches to fail with "fatal: error in object: unshallow <SHA>".
// See https://stackoverflow.com/q/63878612
await actionsUtil.gitRepack(["-d"]);
// Step 6: Deepen the history so that we have the merge bases between the base
// branch and the PR topic branch.
await actionsUtil.deepenGitHistory();

Expand Down
12 changes: 12 additions & 0 deletions src/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ export function withGroup<T>(groupName: string, f: () => T): T {
}
}

export async function withGroupAsync<T>(
groupName: string,
f: () => Promise<T>,
): Promise<T> {
core.startGroup(groupName);
try {
return await f();
} finally {
core.endGroup();
}
}

/** Format a duration for use in logs. */
export function formatDuration(durationMs: number) {
if (durationMs < 1000) {
Expand Down