Skip to content

Commit 919e4ca

Browse files
committed
Merge remote-tracking branch 'upstream/main' into aeisenberg/ff-refactoring
2 parents 1a17c59 + c6c7d29 commit 919e4ca

12 files changed

+86
-47
lines changed

.github/update-release-branch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def open_pr(
104104
body.append(' - [ ] Wait for the "Update dependencies" workflow to push a commit updating the dependencies.')
105105
body.append(' - [ ] Mark the PR as ready for review to trigger the full set of PR checks.')
106106

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

109109
if is_v2_release:
110110
body.append(' - [ ] Merge the mergeback PR that will automatically be created once this PR is merged.')

.github/workflows/post-release-mergeback.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
- [ ] Remove and re-add the "Update dependencies" label to the PR to trigger just this workflow.
123123
- [ ] Wait for the "Update dependencies" workflow to push a commit updating the dependencies.
124124
- [ ] Mark the PR as ready for review to trigger the full set of PR checks.
125-
- [ ] Approve and merge the PR.
125+
- [ ] Approve and merge the PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.
126126
EOF
127127
)
128128

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
No user facing changes.
66

7+
## 2.1.27 - 06 Oct 2022
8+
9+
- 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.
10+
711
## 2.1.26 - 29 Sep 2022
812

913
- Update default CodeQL bundle version to 2.11.0. [#1267](https://github.com/github/codeql-action/pull/1267)

lib/feature-flags.test.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/feature-flags.test.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init.js

+31-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeql",
3-
"version": "2.1.27",
3+
"version": "2.1.28",
44
"private": true,
55
"description": "CodeQL action",
66
"scripts": {

src/feature-flags.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ for (const variant of ALL_FEATURE_FLAGS_DISABLED_VARIANTS) {
6666
(v: LoggedMessage) =>
6767
v.type === "debug" &&
6868
v.message ===
69-
"Not running against github.com. Disabling all feature flags."
69+
"Not running against github.com. Disabling all toggleable features."
7070
) !== undefined
7171
);
7272
});
@@ -122,7 +122,7 @@ test("Feature flags exception is propagated if the API request errors", async (t
122122
),
123123
{
124124
message:
125-
"Encountered an error while trying to load feature flags: Error: some error message",
125+
"Encountered an error while trying to determine feature enablement: Error: some error message",
126126
}
127127
);
128128
});
@@ -217,7 +217,7 @@ for (const featureFlag of Object.keys(featureConfig)) {
217217
await t.throwsAsync(
218218
async () => featureFlags.getValue(featureFlag as Feature),
219219
{
220-
message: `Internal error: A minimum version is specified for feature flag ${featureFlag}, but no instance of CodeQL was provided.`,
220+
message: `Internal error: A minimum version is specified for feature ${featureFlag}, but no instance of CodeQL was provided.`,
221221
}
222222
);
223223
});

src/init.ts

+37-18
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,7 @@ export async function runInit(
117117
}
118118
}
119119
} catch (e) {
120-
// Handle the situation where init is called twice
121-
// for the same database in the same job.
122-
if (
123-
e instanceof Error &&
124-
e.message?.includes("Refusing to create databases") &&
125-
e.message.includes("exists and is not an empty directory.")
126-
) {
127-
throw new util.UserError(
128-
`Is the "init" action called twice in the same job? ${e.message}`
129-
);
130-
} else if (
131-
e instanceof Error &&
132-
e.message?.includes("is not compatible with this CodeQL CLI")
133-
) {
134-
throw new util.UserError(e.message);
135-
} else {
136-
throw e;
137-
}
120+
throw processError(e);
138121
}
139122
return await getCombinedTracerConfig(
140123
config,
@@ -144,6 +127,42 @@ export async function runInit(
144127
);
145128
}
146129

130+
/**
131+
* Possibly convert this error into a UserError in order to avoid
132+
* counting this error towards our internal error budget.
133+
*
134+
* @param e The error to possibly convert to a UserError.
135+
*
136+
* @returns A UserError if the error is a known error that can be
137+
* attributed to the user, otherwise the original error.
138+
*/
139+
function processError(e: any): Error {
140+
if (!(e instanceof Error)) {
141+
return e;
142+
}
143+
144+
if (
145+
// Init action called twice
146+
e.message?.includes("Refusing to create databases") &&
147+
e.message?.includes("exists and is not an empty directory.")
148+
) {
149+
return new util.UserError(
150+
`Is the "init" action called twice in the same job? ${e.message}`
151+
);
152+
}
153+
154+
if (
155+
// Version of CodeQL CLI is incompatible with this version of the CodeQL Action
156+
e.message?.includes("is not compatible with this CodeQL CLI") ||
157+
// Expected source location for database creation does not exist
158+
e.message?.includes("Invalid source root")
159+
) {
160+
return new util.UserError(e.message);
161+
}
162+
163+
return e;
164+
}
165+
147166
// Runs a powershell script to inject the tracer into a parent process
148167
// so it can tracer future processes, hopefully including the build process.
149168
// If processName is given then injects into the nearest parent process with

0 commit comments

Comments
 (0)