Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b7c408a
Update changelog and version after v3.24.3
github-actions[bot] Feb 15, 2024
29e98fd
Update checked-in dependencies
github-actions[bot] Feb 15, 2024
65b0987
Merge pull request #2149 from github/mergeback/v3.24.3-to-main-37961461
angelapwen Feb 15, 2024
ef0a773
Account for existing but empty `cpus` file
angelapwen Feb 15, 2024
2ddf87a
Update release documentation with `v3` instructions
angelapwen Feb 15, 2024
0ce9708
Merge pull request #2152 from github/angelapwen/update-release-docs
angelapwen Feb 16, 2024
8cb81db
Add unit tests for `getCgroupCpuCountFromCpus`
angelapwen Feb 16, 2024
c709994
Add permissions info to README
aeisenberg Feb 16, 2024
b9d85b4
Bump the npm group with 4 updates
dependabot[bot] Feb 19, 2024
4a610e2
Update checked-in dependencies
github-actions[bot] Feb 19, 2024
1737b12
Merge pull request #2154 from github/dependabot/npm_and_yarn/npm-8576…
angelapwen Feb 20, 2024
592977e
Merge pull request #2151 from angelapwen/fix-cpu-group-bug
angelapwen Feb 20, 2024
a7dc229
add first_party_analysis boolean to all status reports
nickfyson Feb 1, 2024
36c51ac
Capitalize Code Scanning
aeisenberg Feb 20, 2024
bf8c75e
Merge pull request #2153 from github/aeisenberg/add-permissions-doc
aeisenberg Feb 21, 2024
f32f0bf
ensure only the upload-sarif action can submit a status report with f…
nickfyson Feb 21, 2024
cca1dde
Merge branch 'main' into nickfyson/first-or-third-party
nickfyson Feb 21, 2024
ebda17e
respond to review comments
nickfyson Feb 21, 2024
982d934
Merge pull request #2111 from github/nickfyson/first-or-third-party
nickfyson Feb 21, 2024
5b1ae29
Update changelog for v3.24.4
github-actions[bot] Feb 21, 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
Prev Previous commit
Next Next commit
respond to review comments
  • Loading branch information
nickfyson committed Feb 21, 2024
commit ebda17e8597cc970bf2442f27c6f2a429d14826f
2 changes: 1 addition & 1 deletion lib/environment.js

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

43 changes: 18 additions & 25 deletions lib/status-report.test.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/status-report.test.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 src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export enum EnvVar {
HAS_WARNED_ABOUT_DISK_SPACE = "CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE",

/** Whether the init action has been run. */
INIT_ACTION_HAS_RUN = "CODEQL_INIT_ACTION_HAS_RUN",
INIT_ACTION_HAS_RUN = "CODEQL_ACTION_INIT_HAS_RUN",

/** UUID representing the current job run. */
JOB_RUN_UUID = "JOB_RUN_UUID",
Expand Down
56 changes: 24 additions & 32 deletions src/status-report.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,26 @@ import { withTmpDir } from "./util";

setupTests(test);

function setupEnvironmentAndStub(tmpDir: string) {
setupActionsVars(tmpDir, tmpDir);

process.env["CODEQL_ACTION_ANALYSIS_KEY"] = "analysis-key";
process.env["GITHUB_REF"] = "refs/heads/main";
process.env["GITHUB_REPOSITORY"] = "octocat/HelloWorld";
process.env["GITHUB_RUN_ATTEMPT"] = "2";
process.env["GITHUB_RUN_ID"] = "100";
process.env["GITHUB_SHA"] = "a".repeat(40);
process.env["ImageVersion"] = "2023.05.19.1";
process.env["RUNNER_OS"] = "macOS";
process.env["RUNNER_TEMP"] = tmpDir;

const getRequiredInput = sinon.stub(actionsUtil, "getRequiredInput");
getRequiredInput.withArgs("matrix").resolves("input/matrix");
}

test("createStatusReportBase", async (t) => {
await withTmpDir(async (tmpDir: string) => {
setupActionsVars(tmpDir, tmpDir);

process.env["CODEQL_ACTION_ANALYSIS_KEY"] = "analysis-key";
process.env["GITHUB_REF"] = "refs/heads/main";
process.env["GITHUB_REPOSITORY"] = "octocat/HelloWorld";
process.env["GITHUB_RUN_ATTEMPT"] = "2";
process.env["GITHUB_RUN_ID"] = "100";
process.env["GITHUB_SHA"] = "a".repeat(40);
process.env["ImageVersion"] = "2023.05.19.1";
process.env["RUNNER_OS"] = "macOS";

const getRequiredInput = sinon.stub(actionsUtil, "getRequiredInput");
getRequiredInput.withArgs("matrix").resolves("input/matrix");
setupEnvironmentAndStub(tmpDir);

const statusReport = await createStatusReportBase(
"init",
Expand All @@ -43,14 +48,14 @@ test("createStatusReportBase", async (t) => {
);
t.is(statusReport.analysis_key, "analysis-key");
t.is(statusReport.cause, "failure cause");
t.is(statusReport.commit_oid, process.env["GITHUB_SHA"]);
t.is(statusReport.commit_oid, process.env["GITHUB_SHA"]!);
t.is(statusReport.exception, "exception stack trace");
t.is(statusReport.job_name, process.env["GITHUB_JOB"] || "");
t.is(typeof statusReport.job_run_uuid, "string");
t.is(statusReport.ref, process.env["GITHUB_REF"]);
t.is(statusReport.ref, process.env["GITHUB_REF"]!);
t.is(statusReport.runner_available_disk_space_bytes, 100);
t.is(statusReport.runner_image_version, process.env["ImageVersion"]);
t.is(statusReport.runner_os, process.env["RUNNER_OS"]);
t.is(statusReport.runner_os, process.env["RUNNER_OS"]!);
t.is(statusReport.started_at, process.env[EnvVar.WORKFLOW_STARTED_AT]!);
t.is(statusReport.status, "failure");
t.is(statusReport.workflow_name, process.env["GITHUB_WORKFLOW"] || "");
Expand All @@ -61,20 +66,7 @@ test("createStatusReportBase", async (t) => {

test("createStatusReportBase_firstParty", async (t) => {
await withTmpDir(async (tmpDir: string) => {
setupActionsVars(tmpDir, tmpDir);

process.env["CODEQL_ACTION_ANALYSIS_KEY"] = "analysis-key";
process.env["GITHUB_REF"] = "refs/heads/main";
process.env["GITHUB_REPOSITORY"] = "octocat/HelloWorld";
process.env["GITHUB_RUN_ATTEMPT"] = "2";
process.env["GITHUB_RUN_ID"] = "100";
process.env["GITHUB_SHA"] = "a".repeat(40);
process.env["ImageVersion"] = "2023.05.19.1";
process.env["RUNNER_OS"] = "macOS";
process.env["RUNNER_TEMP"] = tmpDir;

const getRequiredInput = sinon.stub(actionsUtil, "getRequiredInput");
getRequiredInput.withArgs("matrix").resolves("input/matrix");
setupEnvironmentAndStub(tmpDir);

t.is(
(
Expand Down Expand Up @@ -104,7 +96,7 @@ test("createStatusReportBase_firstParty", async (t) => {
true,
);

process.env["CODEQL_INIT_ACTION_HAS_RUN"] = "foobar";
process.env["CODEQL_ACTION_INIT_HAS_RUN"] = "foobar";
t.is(
(
await createStatusReportBase(
Expand Down Expand Up @@ -133,7 +125,7 @@ test("createStatusReportBase_firstParty", async (t) => {
true,
);

process.env["CODEQL_INIT_ACTION_HAS_RUN"] = "true";
process.env["CODEQL_ACTION_INIT_HAS_RUN"] = "true";
t.is(
(
await createStatusReportBase(
Expand Down