Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into aeisenberg/ff-refac…
Browse files Browse the repository at this point in the history
…toring
  • Loading branch information
aeisenberg committed Oct 7, 2022
2 parents 1a17c59 + c6c7d29 commit 919e4ca
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/update-release-branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def open_pr(
body.append(' - [ ] Wait for the "Update dependencies" workflow to push a commit updating the dependencies.')
body.append(' - [ ] Mark the PR as ready for review to trigger the full set of PR checks.')

body.append(' - [ ] Approve and merge this PR.')
body.append(' - [ ] Approve and merge this PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.')

if is_v2_release:
body.append(' - [ ] Merge the mergeback PR that will automatically be created once this PR is merged.')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-release-mergeback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
- [ ] Remove and re-add the "Update dependencies" label to the PR to trigger just this workflow.
- [ ] Wait for the "Update dependencies" workflow to push a commit updating the dependencies.
- [ ] Mark the PR as ready for review to trigger the full set of PR checks.
- [ ] Approve and merge the PR.
- [ ] Approve and merge the PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.
EOF
)
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

No user facing changes.

## 2.1.27 - 06 Oct 2022

- We are rolling out a feature of the CodeQL Action in October 2022 that changes the way that Go code is analyzed to be more consistent with other compiled languages like C/C++, C#, and Java. You do not need to alter your code scanning workflows. If you encounter any problems, please [file an issue](https://github.com/github/codeql-action/issues) or open a private ticket with GitHub Support and request an escalation to engineering.

## 2.1.26 - 29 Sep 2022

- Update default CodeQL bundle version to 2.11.0. [#1267](https://github.com/github/codeql-action/pull/1267)
Expand Down
6 changes: 3 additions & 3 deletions lib/feature-flags.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/feature-flags.test.js.map

Large diffs are not rendered by default.

46 changes: 31 additions & 15 deletions lib/init.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/init.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": "2.1.27",
"version": "2.1.28",
"private": true,
"description": "CodeQL action",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/feature-flags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ for (const variant of ALL_FEATURE_FLAGS_DISABLED_VARIANTS) {
(v: LoggedMessage) =>
v.type === "debug" &&
v.message ===
"Not running against github.com. Disabling all feature flags."
"Not running against github.com. Disabling all toggleable features."
) !== undefined
);
});
Expand Down Expand Up @@ -122,7 +122,7 @@ test("Feature flags exception is propagated if the API request errors", async (t
),
{
message:
"Encountered an error while trying to load feature flags: Error: some error message",
"Encountered an error while trying to determine feature enablement: Error: some error message",
}
);
});
Expand Down Expand Up @@ -217,7 +217,7 @@ for (const featureFlag of Object.keys(featureConfig)) {
await t.throwsAsync(
async () => featureFlags.getValue(featureFlag as Feature),
{
message: `Internal error: A minimum version is specified for feature flag ${featureFlag}, but no instance of CodeQL was provided.`,
message: `Internal error: A minimum version is specified for feature ${featureFlag}, but no instance of CodeQL was provided.`,
}
);
});
Expand Down
55 changes: 37 additions & 18 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,24 +117,7 @@ export async function runInit(
}
}
} catch (e) {
// Handle the situation where init is called twice
// for the same database in the same job.
if (
e instanceof Error &&
e.message?.includes("Refusing to create databases") &&
e.message.includes("exists and is not an empty directory.")
) {
throw new util.UserError(
`Is the "init" action called twice in the same job? ${e.message}`
);
} else if (
e instanceof Error &&
e.message?.includes("is not compatible with this CodeQL CLI")
) {
throw new util.UserError(e.message);
} else {
throw e;
}
throw processError(e);
}
return await getCombinedTracerConfig(
config,
Expand All @@ -144,6 +127,42 @@ export async function runInit(
);
}

/**
* Possibly convert this error into a UserError in order to avoid
* counting this error towards our internal error budget.
*
* @param e The error to possibly convert to a UserError.
*
* @returns A UserError if the error is a known error that can be
* attributed to the user, otherwise the original error.
*/
function processError(e: any): Error {
if (!(e instanceof Error)) {
return e;
}

if (
// Init action called twice
e.message?.includes("Refusing to create databases") &&
e.message?.includes("exists and is not an empty directory.")
) {
return new util.UserError(
`Is the "init" action called twice in the same job? ${e.message}`
);
}

if (
// Version of CodeQL CLI is incompatible with this version of the CodeQL Action
e.message?.includes("is not compatible with this CodeQL CLI") ||
// Expected source location for database creation does not exist
e.message?.includes("Invalid source root")
) {
return new util.UserError(e.message);
}

return e;
}

// Runs a powershell script to inject the tracer into a parent process
// so it can tracer future processes, hopefully including the build process.
// If processName is given then injects into the nearest parent process with
Expand Down

0 comments on commit 919e4ca

Please sign in to comment.