Compare commits

...

12 Commits

Author SHA1 Message Date
Henry Mercer c35d1b1644 Merge pull request #3947 from github/dependabot/github_actions/dot-github/workflows/actions-minor-3d0b6ad432
Bump ruby/setup-ruby from 1.307.0 to 1.310.0 in /.github/workflows in the actions-minor group across 1 directory
2026-06-04 10:10:18 +00:00
Robert cb1a588b02 Merge pull request #3937 from github/robertbrignull/waitForProcessing_backoff
Change waitForProcessing to use exponential backoff
2026-06-04 10:06:49 +00:00
Henry Mercer ba47406412 Merge pull request #3943 from github/henrymercer/cache-cli-version-info
Cache CLI version information across Actions steps
2026-06-04 09:58:34 +00:00
Henry Mercer 5be8119767 Merge pull request #3938 from github/henrymercer/git-client-feature-flag
Add FF to force JGit-based Git backend
2026-06-04 09:58:15 +00:00
Robert 6047ac775f Merge branch 'main' into robertbrignull/waitForProcessing_backoff 2026-06-04 10:35:04 +01:00
github-actions[bot] af7b8f37ea Rebuild 2026-06-04 02:43:57 +00:00
dependabot[bot] 3569f75599 Bump ruby/setup-ruby
Bumps the actions-minor group with 1 update in the /.github/workflows directory: [ruby/setup-ruby](https://github.com/ruby/setup-ruby).


Updates `ruby/setup-ruby` from 1.307.0 to 1.310.0
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](https://github.com/ruby/setup-ruby/compare/6aaa311d81eba98ae12eaffbcb63296ace0efcde...afeafc3d1ab54a631816aba4c914a0081c12ff2f)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-version: 1.310.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-04 02:42:04 +00:00
Henry Mercer 5ccef82244 Address review comments 2026-06-03 18:31:11 +01:00
Henry Mercer bab673d0e0 Cache CLI version information across Actions steps 2026-06-02 19:27:05 +01:00
Robert d40e417f3c Only do initial wait when not running tests 2026-06-01 16:43:42 +01:00
Henry Mercer 948a63aed1 Add FF to force JGit-based Git backend 2026-06-01 15:20:13 +01:00
Robert dfc14113e3 Change waitForProcessing to use exponential backoff 2026-05-28 11:15:07 +01:00
11 changed files with 359 additions and 157 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ jobs:
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Set up Ruby
uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # v1.307.0
uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
with:
ruby-version: 2.6
- name: Install Code Scanning integration
+172 -131
View File
@@ -19179,12 +19179,12 @@ var require_lib = __commonJS({
throw new Error("Client has already been disposed.");
}
const parsedUrl = new URL(requestUrl);
let info7 = this._prepareRequest(verb, parsedUrl, headers);
let info8 = this._prepareRequest(verb, parsedUrl, headers);
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
let numTries = 0;
let response;
do {
response = yield this.requestRaw(info7, data);
response = yield this.requestRaw(info8, data);
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
let authenticationHandler;
for (const handler2 of this.handlers) {
@@ -19194,7 +19194,7 @@ var require_lib = __commonJS({
}
}
if (authenticationHandler) {
return authenticationHandler.handleAuthentication(this, info7, data);
return authenticationHandler.handleAuthentication(this, info8, data);
} else {
return response;
}
@@ -19217,8 +19217,8 @@ var require_lib = __commonJS({
}
}
}
info7 = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = yield this.requestRaw(info7, data);
info8 = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = yield this.requestRaw(info8, data);
redirectsRemaining--;
}
if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
@@ -19247,7 +19247,7 @@ var require_lib = __commonJS({
* @param info
* @param data
*/
requestRaw(info7, data) {
requestRaw(info8, data) {
return __awaiter2(this, void 0, void 0, function* () {
return new Promise((resolve13, reject) => {
function callbackForResult(err, res) {
@@ -19259,7 +19259,7 @@ var require_lib = __commonJS({
resolve13(res);
}
}
this.requestRawWithCallback(info7, data, callbackForResult);
this.requestRawWithCallback(info8, data, callbackForResult);
});
});
}
@@ -19269,12 +19269,12 @@ var require_lib = __commonJS({
* @param data
* @param onResult
*/
requestRawWithCallback(info7, data, onResult) {
requestRawWithCallback(info8, data, onResult) {
if (typeof data === "string") {
if (!info7.options.headers) {
info7.options.headers = {};
if (!info8.options.headers) {
info8.options.headers = {};
}
info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
info8.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
}
let callbackCalled = false;
function handleResult(err, res) {
@@ -19283,7 +19283,7 @@ var require_lib = __commonJS({
onResult(err, res);
}
}
const req = info7.httpModule.request(info7.options, (msg) => {
const req = info8.httpModule.request(info8.options, (msg) => {
const res = new HttpClientResponse(msg);
handleResult(void 0, res);
});
@@ -19295,7 +19295,7 @@ var require_lib = __commonJS({
if (socket) {
socket.end();
}
handleResult(new Error(`Request timeout: ${info7.options.path}`));
handleResult(new Error(`Request timeout: ${info8.options.path}`));
});
req.on("error", function(err) {
handleResult(err);
@@ -19331,27 +19331,27 @@ var require_lib = __commonJS({
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
}
_prepareRequest(method, requestUrl, headers) {
const info7 = {};
info7.parsedUrl = requestUrl;
const usingSsl = info7.parsedUrl.protocol === "https:";
info7.httpModule = usingSsl ? https3 : http;
const info8 = {};
info8.parsedUrl = requestUrl;
const usingSsl = info8.parsedUrl.protocol === "https:";
info8.httpModule = usingSsl ? https3 : http;
const defaultPort = usingSsl ? 443 : 80;
info7.options = {};
info7.options.host = info7.parsedUrl.hostname;
info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort;
info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || "");
info7.options.method = method;
info7.options.headers = this._mergeHeaders(headers);
info8.options = {};
info8.options.host = info8.parsedUrl.hostname;
info8.options.port = info8.parsedUrl.port ? parseInt(info8.parsedUrl.port) : defaultPort;
info8.options.path = (info8.parsedUrl.pathname || "") + (info8.parsedUrl.search || "");
info8.options.method = method;
info8.options.headers = this._mergeHeaders(headers);
if (this.userAgent != null) {
info7.options.headers["user-agent"] = this.userAgent;
info8.options.headers["user-agent"] = this.userAgent;
}
info7.options.agent = this._getAgent(info7.parsedUrl);
info8.options.agent = this._getAgent(info8.parsedUrl);
if (this.handlers) {
for (const handler2 of this.handlers) {
handler2.prepareRequest(info7.options);
handler2.prepareRequest(info8.options);
}
}
return info7;
return info8;
}
_mergeHeaders(headers) {
if (this.requestOptions && this.requestOptions.headers) {
@@ -21406,7 +21406,7 @@ var require_core = __commonJS({
exports2.error = error3;
exports2.warning = warning14;
exports2.notice = notice;
exports2.info = info7;
exports2.info = info8;
exports2.startGroup = startGroup4;
exports2.endGroup = endGroup4;
exports2.group = group;
@@ -21503,7 +21503,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
function notice(message, properties = {}) {
(0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
}
function info7(message) {
function info8(message) {
process.stdout.write(message + os7.EOL);
}
function startGroup4(name) {
@@ -42402,12 +42402,12 @@ var require_operationHelpers = __commonJS({
if (hasOriginalRequest(request3)) {
return getOperationRequestInfo(request3[originalRequestSymbol]);
}
let info7 = state_js_1.state.operationRequestMap.get(request3);
if (!info7) {
info7 = {};
state_js_1.state.operationRequestMap.set(request3, info7);
let info8 = state_js_1.state.operationRequestMap.get(request3);
if (!info8) {
info8 = {};
state_js_1.state.operationRequestMap.set(request3, info8);
}
return info7;
return info8;
}
}
});
@@ -76954,9 +76954,9 @@ var require_reflection_type_check = __commonJS({
var reflection_info_1 = require_reflection_info();
var oneof_1 = require_oneof();
var ReflectionTypeCheck = class {
constructor(info7) {
constructor(info8) {
var _a;
this.fields = (_a = info7.fields) !== null && _a !== void 0 ? _a : [];
this.fields = (_a = info8.fields) !== null && _a !== void 0 ? _a : [];
}
prepare() {
if (this.data)
@@ -77202,8 +77202,8 @@ var require_reflection_json_reader = __commonJS({
var assert_1 = require_assert();
var reflection_long_convert_1 = require_reflection_long_convert();
var ReflectionJsonReader = class {
constructor(info7) {
this.info = info7;
constructor(info8) {
this.info = info8;
}
prepare() {
var _a;
@@ -77499,9 +77499,9 @@ var require_reflection_json_writer = __commonJS({
var reflection_info_1 = require_reflection_info();
var assert_1 = require_assert();
var ReflectionJsonWriter = class {
constructor(info7) {
constructor(info8) {
var _a;
this.fields = (_a = info7.fields) !== null && _a !== void 0 ? _a : [];
this.fields = (_a = info8.fields) !== null && _a !== void 0 ? _a : [];
}
/**
* Converts the message to a JSON object, based on the field descriptors.
@@ -77754,8 +77754,8 @@ var require_reflection_binary_reader = __commonJS({
var reflection_long_convert_1 = require_reflection_long_convert();
var reflection_scalar_default_1 = require_reflection_scalar_default();
var ReflectionBinaryReader = class {
constructor(info7) {
this.info = info7;
constructor(info8) {
this.info = info8;
}
prepare() {
var _a;
@@ -77928,8 +77928,8 @@ var require_reflection_binary_writer = __commonJS({
var assert_1 = require_assert();
var pb_long_1 = require_pb_long();
var ReflectionBinaryWriter = class {
constructor(info7) {
this.info = info7;
constructor(info8) {
this.info = info8;
}
prepare() {
if (!this.fields) {
@@ -78179,9 +78179,9 @@ var require_reflection_merge_partial = __commonJS({
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.reflectionMergePartial = void 0;
function reflectionMergePartial(info7, target, source) {
function reflectionMergePartial(info8, target, source) {
let fieldValue, input = source, output;
for (let field of info7.fields) {
for (let field of info8.fields) {
let name = field.localName;
if (field.oneof) {
const group = input[field.oneof];
@@ -78250,12 +78250,12 @@ var require_reflection_equals = __commonJS({
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.reflectionEquals = void 0;
var reflection_info_1 = require_reflection_info();
function reflectionEquals(info7, a, b) {
function reflectionEquals(info8, a, b) {
if (a === b)
return true;
if (!a || !b)
return false;
for (let field of info7.fields) {
for (let field of info8.fields) {
let localName = field.localName;
let val_a = field.oneof ? a[field.oneof][localName] : a[localName];
let val_b = field.oneof ? b[field.oneof][localName] : b[localName];
@@ -91275,7 +91275,7 @@ var require_async = __commonJS({
}
}
var sortBy$1 = awaitify(sortBy, 3);
function timeout(asyncFn, milliseconds, info7) {
function timeout(asyncFn, milliseconds, info8) {
var fn = wrapAsync(asyncFn);
return initialParams((args, callback) => {
var timedOut = false;
@@ -91284,8 +91284,8 @@ var require_async = __commonJS({
var name = asyncFn.name || "anonymous";
var error3 = new Error('Callback function "' + name + '" timed out.');
error3.code = "ETIMEDOUT";
if (info7) {
error3.info = info7;
if (info8) {
error3.info = info8;
}
timedOut = true;
callback(error3);
@@ -114681,12 +114681,12 @@ var require_lib4 = __commonJS({
throw new Error("Client has already been disposed.");
}
const parsedUrl = new URL(requestUrl);
let info7 = this._prepareRequest(verb, parsedUrl, headers);
let info8 = this._prepareRequest(verb, parsedUrl, headers);
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
let numTries = 0;
let response;
do {
response = yield this.requestRaw(info7, data);
response = yield this.requestRaw(info8, data);
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
let authenticationHandler;
for (const handler2 of this.handlers) {
@@ -114696,7 +114696,7 @@ var require_lib4 = __commonJS({
}
}
if (authenticationHandler) {
return authenticationHandler.handleAuthentication(this, info7, data);
return authenticationHandler.handleAuthentication(this, info8, data);
} else {
return response;
}
@@ -114719,8 +114719,8 @@ var require_lib4 = __commonJS({
}
}
}
info7 = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = yield this.requestRaw(info7, data);
info8 = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = yield this.requestRaw(info8, data);
redirectsRemaining--;
}
if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
@@ -114749,7 +114749,7 @@ var require_lib4 = __commonJS({
* @param info
* @param data
*/
requestRaw(info7, data) {
requestRaw(info8, data) {
return __awaiter2(this, void 0, void 0, function* () {
return new Promise((resolve13, reject) => {
function callbackForResult(err, res) {
@@ -114761,7 +114761,7 @@ var require_lib4 = __commonJS({
resolve13(res);
}
}
this.requestRawWithCallback(info7, data, callbackForResult);
this.requestRawWithCallback(info8, data, callbackForResult);
});
});
}
@@ -114771,12 +114771,12 @@ var require_lib4 = __commonJS({
* @param data
* @param onResult
*/
requestRawWithCallback(info7, data, onResult) {
requestRawWithCallback(info8, data, onResult) {
if (typeof data === "string") {
if (!info7.options.headers) {
info7.options.headers = {};
if (!info8.options.headers) {
info8.options.headers = {};
}
info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
info8.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
}
let callbackCalled = false;
function handleResult(err, res) {
@@ -114785,7 +114785,7 @@ var require_lib4 = __commonJS({
onResult(err, res);
}
}
const req = info7.httpModule.request(info7.options, (msg) => {
const req = info8.httpModule.request(info8.options, (msg) => {
const res = new HttpClientResponse(msg);
handleResult(void 0, res);
});
@@ -114797,7 +114797,7 @@ var require_lib4 = __commonJS({
if (socket) {
socket.end();
}
handleResult(new Error(`Request timeout: ${info7.options.path}`));
handleResult(new Error(`Request timeout: ${info8.options.path}`));
});
req.on("error", function(err) {
handleResult(err);
@@ -114833,27 +114833,27 @@ var require_lib4 = __commonJS({
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
}
_prepareRequest(method, requestUrl, headers) {
const info7 = {};
info7.parsedUrl = requestUrl;
const usingSsl = info7.parsedUrl.protocol === "https:";
info7.httpModule = usingSsl ? https3 : http;
const info8 = {};
info8.parsedUrl = requestUrl;
const usingSsl = info8.parsedUrl.protocol === "https:";
info8.httpModule = usingSsl ? https3 : http;
const defaultPort = usingSsl ? 443 : 80;
info7.options = {};
info7.options.host = info7.parsedUrl.hostname;
info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort;
info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || "");
info7.options.method = method;
info7.options.headers = this._mergeHeaders(headers);
info8.options = {};
info8.options.host = info8.parsedUrl.hostname;
info8.options.port = info8.parsedUrl.port ? parseInt(info8.parsedUrl.port) : defaultPort;
info8.options.path = (info8.parsedUrl.pathname || "") + (info8.parsedUrl.search || "");
info8.options.method = method;
info8.options.headers = this._mergeHeaders(headers);
if (this.userAgent != null) {
info7.options.headers["user-agent"] = this.userAgent;
info8.options.headers["user-agent"] = this.userAgent;
}
info7.options.agent = this._getAgent(info7.parsedUrl);
info8.options.agent = this._getAgent(info8.parsedUrl);
if (this.handlers) {
for (const handler2 of this.handlers) {
handler2.prepareRequest(info7.options);
handler2.prepareRequest(info8.options);
}
}
return info7;
return info8;
}
_mergeHeaders(headers) {
if (this.requestOptions && this.requestOptions.headers) {
@@ -121241,11 +121241,11 @@ var require_dist_node12 = __commonJS({
}
async function wrapRequest2(state, request3, options) {
const limiter = new Bottleneck2();
limiter.on("failed", function(error3, info7) {
limiter.on("failed", function(error3, info8) {
const maxRetries = ~~error3.request.request.retries;
const after = ~~error3.request.request.retryAfter;
options.request.retryCount = info7.retryCount + 1;
if (maxRetries > info7.retryCount) {
options.request.retryCount = info8.retryCount + 1;
if (maxRetries > info8.retryCount) {
return after * state.retryAfterBaseValue;
}
});
@@ -122453,12 +122453,12 @@ var require_lib5 = __commonJS({
throw new Error("Client has already been disposed.");
}
const parsedUrl = new URL(requestUrl);
let info7 = this._prepareRequest(verb, parsedUrl, headers);
let info8 = this._prepareRequest(verb, parsedUrl, headers);
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
let numTries = 0;
let response;
do {
response = yield this.requestRaw(info7, data);
response = yield this.requestRaw(info8, data);
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
let authenticationHandler;
for (const handler2 of this.handlers) {
@@ -122468,7 +122468,7 @@ var require_lib5 = __commonJS({
}
}
if (authenticationHandler) {
return authenticationHandler.handleAuthentication(this, info7, data);
return authenticationHandler.handleAuthentication(this, info8, data);
} else {
return response;
}
@@ -122491,8 +122491,8 @@ var require_lib5 = __commonJS({
}
}
}
info7 = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = yield this.requestRaw(info7, data);
info8 = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = yield this.requestRaw(info8, data);
redirectsRemaining--;
}
if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
@@ -122521,7 +122521,7 @@ var require_lib5 = __commonJS({
* @param info
* @param data
*/
requestRaw(info7, data) {
requestRaw(info8, data) {
return __awaiter2(this, void 0, void 0, function* () {
return new Promise((resolve13, reject) => {
function callbackForResult(err, res) {
@@ -122533,7 +122533,7 @@ var require_lib5 = __commonJS({
resolve13(res);
}
}
this.requestRawWithCallback(info7, data, callbackForResult);
this.requestRawWithCallback(info8, data, callbackForResult);
});
});
}
@@ -122543,12 +122543,12 @@ var require_lib5 = __commonJS({
* @param data
* @param onResult
*/
requestRawWithCallback(info7, data, onResult) {
requestRawWithCallback(info8, data, onResult) {
if (typeof data === "string") {
if (!info7.options.headers) {
info7.options.headers = {};
if (!info8.options.headers) {
info8.options.headers = {};
}
info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
info8.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
}
let callbackCalled = false;
function handleResult(err, res) {
@@ -122557,7 +122557,7 @@ var require_lib5 = __commonJS({
onResult(err, res);
}
}
const req = info7.httpModule.request(info7.options, (msg) => {
const req = info8.httpModule.request(info8.options, (msg) => {
const res = new HttpClientResponse(msg);
handleResult(void 0, res);
});
@@ -122569,7 +122569,7 @@ var require_lib5 = __commonJS({
if (socket) {
socket.end();
}
handleResult(new Error(`Request timeout: ${info7.options.path}`));
handleResult(new Error(`Request timeout: ${info8.options.path}`));
});
req.on("error", function(err) {
handleResult(err);
@@ -122605,27 +122605,27 @@ var require_lib5 = __commonJS({
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
}
_prepareRequest(method, requestUrl, headers) {
const info7 = {};
info7.parsedUrl = requestUrl;
const usingSsl = info7.parsedUrl.protocol === "https:";
info7.httpModule = usingSsl ? https3 : http;
const info8 = {};
info8.parsedUrl = requestUrl;
const usingSsl = info8.parsedUrl.protocol === "https:";
info8.httpModule = usingSsl ? https3 : http;
const defaultPort = usingSsl ? 443 : 80;
info7.options = {};
info7.options.host = info7.parsedUrl.hostname;
info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort;
info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || "");
info7.options.method = method;
info7.options.headers = this._mergeHeaders(headers);
info8.options = {};
info8.options.host = info8.parsedUrl.hostname;
info8.options.port = info8.parsedUrl.port ? parseInt(info8.parsedUrl.port) : defaultPort;
info8.options.path = (info8.parsedUrl.pathname || "") + (info8.parsedUrl.search || "");
info8.options.method = method;
info8.options.headers = this._mergeHeaders(headers);
if (this.userAgent != null) {
info7.options.headers["user-agent"] = this.userAgent;
info8.options.headers["user-agent"] = this.userAgent;
}
info7.options.agent = this._getAgent(info7.parsedUrl);
info8.options.agent = this._getAgent(info8.parsedUrl);
if (this.handlers) {
for (const handler2 of this.handlers) {
handler2.prepareRequest(info7.options);
handler2.prepareRequest(info8.options);
}
}
return info7;
return info8;
}
_mergeHeaders(headers) {
if (this.requestOptions && this.requestOptions.headers) {
@@ -124615,10 +124615,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
(0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
}
exports2.notice = notice;
function info7(message) {
function info8(message) {
process.stdout.write(message + os7.EOL);
}
exports2.info = info7;
exports2.info = info8;
function startGroup4(name) {
(0, command_1.issue)("group", name);
}
@@ -148062,13 +148062,42 @@ function asHTTPError(arg) {
return void 0;
}
var cachedCodeQlVersion = void 0;
function cacheCodeQlVersion(version) {
function isVersionInfo(x) {
const candidate = x;
return typeof candidate === "object" && candidate !== null && typeof candidate.version === "string" && (candidate.features === void 0 || typeof candidate.features === "object" && candidate.features !== null) && (candidate.overlayVersion === void 0 || typeof candidate.overlayVersion === "number");
}
function isPersistedVersionInfo(x) {
const candidate = x;
return typeof candidate === "object" && candidate !== null && typeof candidate.cmd === "string" && isVersionInfo(candidate.version);
}
function cacheCodeQlVersion(cmd, version) {
if (cachedCodeQlVersion !== void 0) {
throw new Error("cacheCodeQlVersion() should be called only once");
}
cachedCodeQlVersion = version;
core3.exportVariable(
"CODEQL_ACTION_CLI_VERSION_INFO" /* CODEQL_VERSION_INFO */,
JSON.stringify({ cmd, version })
);
}
function getCachedCodeQlVersion() {
function getCachedCodeQlVersion(cmd) {
if (cachedCodeQlVersion !== void 0) {
return cachedCodeQlVersion;
}
const serialized = process.env["CODEQL_ACTION_CLI_VERSION_INFO" /* CODEQL_VERSION_INFO */];
if (!serialized) {
return void 0;
}
let persisted;
try {
persisted = JSON.parse(serialized);
} catch {
return void 0;
}
if (!isPersistedVersionInfo(persisted) || cmd !== void 0 && persisted.cmd !== cmd) {
return void 0;
}
cachedCodeQlVersion = persisted.version;
return cachedCodeQlVersion;
}
async function codeQlVersionAtLeast(codeql, requiredVersion) {
@@ -148669,11 +148698,11 @@ async function errorRequest(state, octokit, error3, options) {
}
async function wrapRequest(state, octokit, request3, options) {
const limiter = new import_light.default();
limiter.on("failed", function(error3, info7) {
limiter.on("failed", function(error3, info8) {
const maxRetries = ~~error3.request.request?.retries;
const after = ~~error3.request.request?.retryAfter;
options.request.retryCount = info7.retryCount + 1;
if (maxRetries > info7.retryCount) {
options.request.retryCount = info8.retryCount + 1;
if (maxRetries > info8.retryCount) {
return after * state.retryAfterBaseValue;
}
});
@@ -149396,6 +149425,11 @@ var featureConfig = {
legacyApi: true,
minimumVersion: void 0
},
["force_jgit" /* ForceJGit */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_FORCE_JGIT",
minimumVersion: void 0
},
["force_nightly" /* ForceNightly */]: {
defaultValue: false,
envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
@@ -153873,7 +153907,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
return cmd;
},
async getVersion() {
let result = getCachedCodeQlVersion();
let result = getCachedCodeQlVersion(cmd);
if (result === void 0) {
const output = await runCli(cmd, ["version", "--format=json"], {
noStreamStdout: true
@@ -153885,12 +153919,12 @@ async function getCodeQLForCmd(cmd, checkVersion) {
`Invalid JSON output from \`version --format=json\`: ${output}`
);
}
cacheCodeQlVersion(result);
cacheCodeQlVersion(cmd, result);
}
return result;
},
async printVersion() {
await runCli(cmd, ["version", "--format=json"]);
core11.info(JSON.stringify(await this.getVersion(), null, 2));
},
async supportsFeature(feature) {
return isSupportedToolsFeature(await this.getVersion(), feature);
@@ -157498,22 +157532,20 @@ function dumpSarifFile(sarifPayload, outputDir, logger, uploadTarget) {
logger.info(`Writing processed SARIF file to ${outputFile}`);
fs21.writeFileSync(outputFile, sarifPayload);
}
var STATUS_CHECK_FREQUENCY_MILLISECONDS = 5 * 1e3;
var STATUS_CHECK_TIMEOUT_MILLISECONDS = 2 * 60 * 1e3;
var STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS = 5 * 1e3;
var STATUS_CHECK_BACKOFF_MULTIPLIER = 2;
var STATUS_CHECK_MAX_TRIES = 5;
async function waitForProcessing(repositoryNwo, sarifID, logger, options = {
isUnsuccessfulExecution: false
}) {
logger.startGroup("Waiting for processing to finish");
try {
const client = getApiClient();
const statusCheckingStarted = Date.now();
while (true) {
if (Date.now() > statusCheckingStarted + STATUS_CHECK_TIMEOUT_MILLISECONDS) {
logger.warning(
"Timed out waiting for analysis to finish processing. Continuing."
);
break;
}
let statusCheckBackoff = STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS;
if (process.env["NODE_ENV"] !== "test") {
await delay(statusCheckBackoff, { allowProcessExit: false });
}
for (let statusCheckCount = 1; statusCheckCount <= STATUS_CHECK_MAX_TRIES; statusCheckCount++) {
let response = void 0;
try {
response = await client.request(
@@ -157551,9 +157583,15 @@ ${response.data.errors}`;
} else {
assertNever(status);
}
await delay(STATUS_CHECK_FREQUENCY_MILLISECONDS, {
allowProcessExit: false
});
if (statusCheckCount === STATUS_CHECK_MAX_TRIES) {
logger.warning(
"Timed out waiting for analysis to finish processing. Continuing."
);
break;
} else {
statusCheckBackoff *= STATUS_CHECK_BACKOFF_MULTIPLIER;
await delay(statusCheckBackoff, { allowProcessExit: false });
}
}
} finally {
logger.endGroup();
@@ -159357,6 +159395,9 @@ exec ${goBinaryPath} "$@"`
if (await features.getValue("disable_kotlin_analysis_enabled" /* DisableKotlinAnalysisEnabled */)) {
core21.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true");
}
if (await features.getValue("force_jgit" /* ForceJGit */)) {
core21.exportVariable("CODEQL_GIT_BACKEND", "jgit");
}
const kotlinLimitVar = "CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT";
if (await codeQlVersionAtLeast(codeql, "2.20.3") && !await codeQlVersionAtLeast(codeql, "2.20.4")) {
core21.exportVariable(kotlinLimitVar, "2.1.20");
+1 -1
View File
@@ -5,7 +5,7 @@ versions:
- default
steps:
- name: Set up Ruby
uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # v1.307.0
uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
with:
ruby-version: 2.6
- name: Install Code Scanning integration
+4 -3
View File
@@ -523,7 +523,7 @@ async function getCodeQLForCmd(
return cmd;
},
async getVersion() {
let result = util.getCachedCodeQlVersion();
let result = util.getCachedCodeQlVersion(cmd);
if (result === undefined) {
const output = await runCli(cmd, ["version", "--format=json"], {
noStreamStdout: true,
@@ -535,12 +535,13 @@ async function getCodeQLForCmd(
`Invalid JSON output from \`version --format=json\`: ${output}`,
);
}
util.cacheCodeQlVersion(result);
util.cacheCodeQlVersion(cmd, result);
}
return result;
},
async printVersion() {
await runCli(cmd, ["version", "--format=json"]);
// Reuse the cached version information rather than invoking the CLI again.
core.info(JSON.stringify(await this.getVersion(), null, 2));
},
async supportsFeature(feature: ToolsFeature) {
return isSupportedToolsFeature(await this.getVersion(), feature);
+6
View File
@@ -17,6 +17,12 @@ export enum EnvVar {
*/
CLI_VERBOSITY = "CODEQL_VERBOSITY",
/**
* `PersistedVersionInfo` for the CodeQL CLI, so later Actions steps can reuse it instead of
* invoking `codeql version` again.
*/
CODEQL_VERSION_INFO = "CODEQL_ACTION_CLI_VERSION_INFO",
/** Whether the CodeQL Action has invoked the Go autobuilder. */
DID_AUTOBUILD_GOLANG = "CODEQL_ACTION_DID_AUTOBUILD_GOLANG",
+10
View File
@@ -82,6 +82,11 @@ export enum Feature {
DisableJavaBuildlessEnabled = "disable_java_buildless_enabled",
DisableKotlinAnalysisEnabled = "disable_kotlin_analysis_enabled",
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
/**
* Emergency override that forces the CodeQL CLI to use the JGit-based Git backend instead of its
* default backend selection.
*/
ForceJGit = "force_jgit",
ForceNightly = "force_nightly",
IgnoreGeneratedFiles = "ignore_generated_files",
JavaNetworkDebugging = "java_network_debugging",
@@ -224,6 +229,11 @@ export const featureConfig = {
legacyApi: true,
minimumVersion: undefined,
},
[Feature.ForceJGit]: {
defaultValue: false,
envVar: "CODEQL_ACTION_FORCE_JGIT",
minimumVersion: undefined,
},
[Feature.ForceNightly]: {
defaultValue: false,
envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
+5
View File
@@ -614,6 +614,11 @@ async function run(startedAt: Date) {
core.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true");
}
// Emergency override to force the CodeQL CLI back to the JGit-based Git backend.
if (await features.getValue(Feature.ForceJGit)) {
core.exportVariable("CODEQL_GIT_BACKEND", "jgit");
}
const kotlinLimitVar =
"CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT";
if (
+5
View File
@@ -32,6 +32,7 @@ import {
GitHubVariant,
GitHubVersion,
HTTPError,
resetCachedCodeQlVersion,
} from "./util";
export const SAMPLE_DOTCOM_API_DETAILS = {
@@ -101,6 +102,10 @@ export function setupTests(testFn: TestFn<any>) {
// unless the test explicitly sets one up.
codeql.setCodeQL({});
// Reset the in-process CodeQL version cache so that it doesn't leak between
// tests, which each represent a separate Actions step in production.
resetCachedCodeQlVersion();
// Replace stdout and stderr so we can record output during tests
t.context.testOutput = "";
const processStdoutWrite = process.stdout.write.bind(process.stdout);
+27 -19
View File
@@ -829,8 +829,10 @@ function dumpSarifFile(
fs.writeFileSync(outputFile, sarifPayload);
}
const STATUS_CHECK_FREQUENCY_MILLISECONDS = 5 * 1000;
const STATUS_CHECK_TIMEOUT_MILLISECONDS = 2 * 60 * 1000;
// Should lead to status checks after 5s, 15s, 35s, 75s, and 155s.
const STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS = 5 * 1000;
const STATUS_CHECK_BACKOFF_MULTIPLIER = 2;
const STATUS_CHECK_MAX_TRIES = 5;
type ProcessingStatus = "pending" | "complete" | "failed";
@@ -854,20 +856,17 @@ export async function waitForProcessing(
try {
const client = api.getApiClient();
const statusCheckingStarted = Date.now();
while (true) {
if (
Date.now() >
statusCheckingStarted + STATUS_CHECK_TIMEOUT_MILLISECONDS
) {
// If the analysis hasn't finished processing in the allotted time, we continue anyway rather than failing.
// It's possible the analysis will eventually finish processing, but it's not worth spending more
// Actions time waiting.
logger.warning(
"Timed out waiting for analysis to finish processing. Continuing.",
);
break;
}
// Do an initial wait because processing will always take a minimum of 2-3 seconds
let statusCheckBackoff = STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS;
if (process.env["NODE_ENV"] !== "test") {
await util.delay(statusCheckBackoff, { allowProcessExit: false });
}
for (
let statusCheckCount = 1;
statusCheckCount <= STATUS_CHECK_MAX_TRIES;
statusCheckCount++
) {
let response: OctokitResponse<any> | undefined = undefined;
try {
response = await client.request(
@@ -912,9 +911,18 @@ export async function waitForProcessing(
util.assertNever(status);
}
await util.delay(STATUS_CHECK_FREQUENCY_MILLISECONDS, {
allowProcessExit: false,
});
if (statusCheckCount === STATUS_CHECK_MAX_TRIES) {
// If the analysis hasn't finished processing in the allotted time, we continue anyway rather than failing.
// It's possible the analysis will eventually finish processing, but it's not worth spending more
// Actions time waiting.
logger.warning(
"Timed out waiting for analysis to finish processing. Continuing.",
);
break;
} else {
statusCheckBackoff *= STATUS_CHECK_BACKOFF_MULTIPLIER;
await util.delay(statusCheckBackoff, { allowProcessExit: false });
}
}
} finally {
logger.endGroup();
+55
View File
@@ -532,3 +532,58 @@ test("Failure.orElse returns the default value for a failure result", (t) => {
const result = new util.Failure(new Error("test error"));
t.is(result.orElse("default value"), "default value");
});
test.serial(
"getCachedCodeQlVersion reuses a version persisted by an earlier step",
(t) => {
process.env[EnvVar.CODEQL_VERSION_INFO] = JSON.stringify({
cmd: "/path/to/codeql",
version: { version: "2.20.0" },
});
t.deepEqual(util.getCachedCodeQlVersion("/path/to/codeql"), {
version: "2.20.0",
});
},
);
test.serial(
"getCachedCodeQlVersion ignores a persisted version from a different CLI",
(t) => {
process.env[EnvVar.CODEQL_VERSION_INFO] = JSON.stringify({
cmd: "/path/to/other-codeql",
version: { version: "2.20.0" },
});
t.is(util.getCachedCodeQlVersion("/path/to/codeql"), undefined);
},
);
test.serial(
"getCachedCodeQlVersion ignores a malformed persisted value",
(t) => {
process.env[EnvVar.CODEQL_VERSION_INFO] = "not valid json";
t.is(util.getCachedCodeQlVersion("/path/to/codeql"), undefined);
},
);
test.serial(
"getCachedCodeQlVersion ignores a persisted value with the wrong structure",
(t) => {
for (const value of [
JSON.stringify({ cmd: "/path/to/codeql" }),
JSON.stringify({ cmd: "/path/to/codeql", version: {} }),
JSON.stringify({ cmd: "/path/to/codeql", version: { version: 2 } }),
JSON.stringify({ version: { version: "2.20.0" } }),
JSON.stringify({
cmd: "/path/to/codeql",
version: { version: "2.20.0", overlayVersion: "1" },
}),
JSON.stringify({
cmd: "/path/to/codeql",
version: { version: "2.20.0", features: "nope" },
}),
]) {
process.env[EnvVar.CODEQL_VERSION_INFO] = value;
t.is(util.getCachedCodeQlVersion("/path/to/codeql"), undefined, value);
}
},
);
+73 -2
View File
@@ -619,14 +619,85 @@ export function asHTTPError(arg: any): HTTPError | undefined {
let cachedCodeQlVersion: undefined | VersionInfo = undefined;
export function cacheCodeQlVersion(version: VersionInfo): void {
/**
* Resets the in-process cache of the CodeQL CLI version. Only for use in tests,
* which exercise multiple "steps" within a single process.
*/
export function resetCachedCodeQlVersion(): void {
cachedCodeQlVersion = undefined;
}
/** The persisted version together with the CLI path it was obtained from. */
interface PersistedVersionInfo {
cmd: string;
version: VersionInfo;
}
function isVersionInfo(x: unknown): x is VersionInfo {
const candidate = x as Partial<VersionInfo> | null;
return (
typeof candidate === "object" &&
candidate !== null &&
typeof candidate.version === "string" &&
(candidate.features === undefined ||
(typeof candidate.features === "object" &&
candidate.features !== null)) &&
(candidate.overlayVersion === undefined ||
typeof candidate.overlayVersion === "number")
);
}
function isPersistedVersionInfo(x: unknown): x is PersistedVersionInfo {
const candidate = x as Partial<PersistedVersionInfo> | null;
return (
typeof candidate === "object" &&
candidate !== null &&
typeof candidate.cmd === "string" &&
isVersionInfo(candidate.version)
);
}
export function cacheCodeQlVersion(cmd: string, version: VersionInfo): void {
if (cachedCodeQlVersion !== undefined) {
throw new Error("cacheCodeQlVersion() should be called only once");
}
cachedCodeQlVersion = version;
// Persist the version so that subsequent Actions steps, which run in separate
// processes, can reuse it rather than invoking `codeql version` again. We
// record the CLI path so that a different step using a different CodeQL bundle
// doesn't pick up a stale version.
core.exportVariable(
EnvVar.CODEQL_VERSION_INFO,
JSON.stringify({ cmd, version }),
);
}
export function getCachedCodeQlVersion(): undefined | VersionInfo {
export function getCachedCodeQlVersion(cmd?: string): undefined | VersionInfo {
if (cachedCodeQlVersion !== undefined) {
return cachedCodeQlVersion;
}
// Fall back to the value persisted by an earlier Actions step, if any. This is
// best-effort: any malformed or mismatched value is ignored so that the caller
// invokes `codeql version` instead.
const serialized = process.env[EnvVar.CODEQL_VERSION_INFO];
if (!serialized) {
return undefined;
}
let persisted: unknown;
try {
persisted = JSON.parse(serialized);
} catch {
return undefined;
}
if (
!isPersistedVersionInfo(persisted) ||
(cmd !== undefined && persisted.cmd !== cmd)
) {
return undefined;
}
// Memoize the parsed value so that subsequent calls in this process don't
// re-parse the environment variable.
cachedCodeQlVersion = persisted.version;
return cachedCodeQlVersion;
}