mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-04-21 19:18:43 +00:00
Compare commits
No commits in common. "main" and "v4.8.4" have entirely different histories.
7 changed files with 5550 additions and 4117 deletions
|
@ -1,11 +1,5 @@
|
|||
# Changelog
|
||||
|
||||
## <small>4.8.5 (2025-04-15)</small>
|
||||
|
||||
* build(deps): audit fix (#150) ([3a9d367](https://github.com/kiegroup/git-backporting/commit/3a9d367)), closes [#150](https://github.com/kiegroup/git-backporting/issues/150)
|
||||
* build(deps): upgrade release-it to v18 (#153) ([c9a7375](https://github.com/kiegroup/git-backporting/commit/c9a7375)), closes [#153](https://github.com/kiegroup/git-backporting/issues/153)
|
||||
* fix(#151): fix gitlab post comments url (#152) ([d74a787](https://github.com/kiegroup/git-backporting/commit/d74a787)), closes [#152](https://github.com/kiegroup/git-backporting/issues/152)
|
||||
|
||||
## [4.8.4](https://github.com/kiegroup/git-backporting/compare/v4.8.3...v4.8.4) (2024-11-02)
|
||||
|
||||
|
||||
|
|
372
dist/cli/index.js
vendored
372
dist/cli/index.js
vendored
|
@ -1151,9 +1151,7 @@ class GitLabClient {
|
|||
// example: <host>/api/v4/projects/<namespace>%2Fbackporting-example/merge_requests/1
|
||||
async getPullRequest(namespace, repo, mrNumber, squash) {
|
||||
const projectId = this.getProjectId(namespace, repo);
|
||||
const url = `/projects/${projectId}/merge_requests/${mrNumber}`;
|
||||
this.logger.debug(`Fetching pull request ${url}`);
|
||||
const { data } = await this.client.get(`${url}`);
|
||||
const { data } = await this.client.get(`/projects/${projectId}/merge_requests/${mrNumber}`);
|
||||
if (squash === undefined) {
|
||||
squash = (0, git_util_1.inferSquash)(data.state === "opened", data.squash_commit_sha);
|
||||
}
|
||||
|
@ -1243,7 +1241,7 @@ class GitLabClient {
|
|||
try {
|
||||
const { namespace, project, id } = this.extractMergeRequestData(mrUrl);
|
||||
const projectId = this.getProjectId(namespace, project);
|
||||
const { data } = await this.client.post(`/projects/${projectId}/merge_requests/${id}/notes`, {
|
||||
const { data } = await this.client.post(`/projects/${projectId}/issues/${id}/notes`, {
|
||||
body: comment,
|
||||
});
|
||||
if (!data) {
|
||||
|
@ -16268,14 +16266,6 @@ module.exports = require("child_process");
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6113:
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("crypto");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2361:
|
||||
/***/ ((module) => {
|
||||
|
||||
|
@ -19644,11 +19634,10 @@ exports.suggestSimilar = suggestSimilar;
|
|||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||
// Axios v1.7.4 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
|
||||
|
||||
const FormData$1 = __nccwpck_require__(4334);
|
||||
const crypto = __nccwpck_require__(6113);
|
||||
const url = __nccwpck_require__(7310);
|
||||
const proxyFromEnv = __nccwpck_require__(3329);
|
||||
const http = __nccwpck_require__(3685);
|
||||
|
@ -19662,9 +19651,7 @@ const events = __nccwpck_require__(2361);
|
|||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
|
||||
const crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
|
||||
const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
|
||||
const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv);
|
||||
const http__default = /*#__PURE__*/_interopDefaultLegacy(http);
|
||||
const https__default = /*#__PURE__*/_interopDefaultLegacy(https);
|
||||
const util__default = /*#__PURE__*/_interopDefaultLegacy(util);
|
||||
|
@ -20278,6 +20265,26 @@ const toFiniteNumber = (value, defaultValue) => {
|
|||
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
||||
};
|
||||
|
||||
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
const DIGIT = '0123456789';
|
||||
|
||||
const ALPHABET = {
|
||||
DIGIT,
|
||||
ALPHA,
|
||||
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
||||
};
|
||||
|
||||
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
||||
let str = '';
|
||||
const {length} = alphabet;
|
||||
while (size--) {
|
||||
str += alphabet[Math.random() * length|0];
|
||||
}
|
||||
|
||||
return str;
|
||||
};
|
||||
|
||||
/**
|
||||
* If the thing is a FormData object, return true, otherwise return false.
|
||||
*
|
||||
|
@ -20405,6 +20412,8 @@ const utils$1 = {
|
|||
findKey,
|
||||
global: _global,
|
||||
isContextDefined,
|
||||
ALPHABET,
|
||||
generateString,
|
||||
isSpecCompliantForm,
|
||||
toJSONObject,
|
||||
isAsyncFn,
|
||||
|
@ -20438,10 +20447,7 @@ function AxiosError(message, code, config, request, response) {
|
|||
code && (this.code = code);
|
||||
config && (this.config = config);
|
||||
request && (this.request = request);
|
||||
if (response) {
|
||||
this.response = response;
|
||||
this.status = response.status ? response.status : null;
|
||||
}
|
||||
response && (this.response = response);
|
||||
}
|
||||
|
||||
utils$1.inherits(AxiosError, Error, {
|
||||
|
@ -20461,7 +20467,7 @@ utils$1.inherits(AxiosError, Error, {
|
|||
// Axios
|
||||
config: utils$1.toJSONObject(this.config),
|
||||
code: this.code,
|
||||
status: this.status
|
||||
status: this.response && this.response.status ? this.response.status : null
|
||||
};
|
||||
}
|
||||
});
|
||||
|
@ -20798,7 +20804,7 @@ function encode(val) {
|
|||
*
|
||||
* @param {string} url The base of the url (e.g., http://www.google.com)
|
||||
* @param {object} [params] The params to be appended
|
||||
* @param {?(object|Function)} options
|
||||
* @param {?object} options
|
||||
*
|
||||
* @returns {string} The formatted url
|
||||
*/
|
||||
|
@ -20810,12 +20816,6 @@ function buildURL(url, params, options) {
|
|||
|
||||
const _encode = options && options.encode || encode;
|
||||
|
||||
if (utils$1.isFunction(options)) {
|
||||
options = {
|
||||
serialize: options
|
||||
};
|
||||
}
|
||||
|
||||
const serializeFn = options && options.serialize;
|
||||
|
||||
let serializedParams;
|
||||
|
@ -20916,29 +20916,6 @@ const transitionalDefaults = {
|
|||
|
||||
const URLSearchParams = url__default["default"].URLSearchParams;
|
||||
|
||||
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
const DIGIT = '0123456789';
|
||||
|
||||
const ALPHABET = {
|
||||
DIGIT,
|
||||
ALPHA,
|
||||
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
||||
};
|
||||
|
||||
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
||||
let str = '';
|
||||
const {length} = alphabet;
|
||||
const randomValues = new Uint32Array(size);
|
||||
crypto__default["default"].randomFillSync(randomValues);
|
||||
for (let i = 0; i < size; i++) {
|
||||
str += alphabet[randomValues[i] % length];
|
||||
}
|
||||
|
||||
return str;
|
||||
};
|
||||
|
||||
|
||||
const platform$1 = {
|
||||
isNode: true,
|
||||
classes: {
|
||||
|
@ -20946,15 +20923,11 @@ const platform$1 = {
|
|||
FormData: FormData__default["default"],
|
||||
Blob: typeof Blob !== 'undefined' && Blob || null
|
||||
},
|
||||
ALPHABET,
|
||||
generateString,
|
||||
protocols: [ 'http', 'https', 'file', 'data' ]
|
||||
};
|
||||
|
||||
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
||||
|
||||
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
||||
|
||||
/**
|
||||
* Determine if we're running in a standard browser environment
|
||||
*
|
||||
|
@ -20972,8 +20945,10 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
const hasStandardBrowserEnv = hasBrowserEnv &&
|
||||
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
||||
const hasStandardBrowserEnv = (
|
||||
(product) => {
|
||||
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
||||
})(typeof navigator !== 'undefined' && navigator.product);
|
||||
|
||||
/**
|
||||
* Determine if we're running in a standard browser webWorker environment
|
||||
|
@ -21000,7 +20975,6 @@ const utils = /*#__PURE__*/Object.freeze({
|
|||
hasBrowserEnv: hasBrowserEnv,
|
||||
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
||||
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
||||
navigator: _navigator,
|
||||
origin: origin
|
||||
});
|
||||
|
||||
|
@ -21722,15 +21696,14 @@ function combineURLs(baseURL, relativeURL) {
|
|||
*
|
||||
* @returns {string} The combined full path
|
||||
*/
|
||||
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
||||
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
||||
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
||||
function buildFullPath(baseURL, requestedURL) {
|
||||
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
||||
return combineURLs(baseURL, requestedURL);
|
||||
}
|
||||
return requestedURL;
|
||||
}
|
||||
|
||||
const VERSION = "1.8.4";
|
||||
const VERSION = "1.7.4";
|
||||
|
||||
function parseProtocol(url) {
|
||||
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
||||
|
@ -21940,9 +21913,9 @@ const readBlob = async function* (blob) {
|
|||
|
||||
const readBlob$1 = readBlob;
|
||||
|
||||
const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
|
||||
const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
|
||||
|
||||
const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__default["default"].TextEncoder();
|
||||
const textEncoder = new util.TextEncoder();
|
||||
|
||||
const CRLF = '\r\n';
|
||||
const CRLF_BYTES = textEncoder.encode(CRLF);
|
||||
|
@ -22000,7 +21973,7 @@ const formDataToStream = (form, headersHandler, options) => {
|
|||
const {
|
||||
tag = 'form-data-boundary',
|
||||
size = 25,
|
||||
boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
|
||||
boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)
|
||||
} = options || {};
|
||||
|
||||
if(!utils$1.isFormData(form)) {
|
||||
|
@ -22280,7 +22253,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
|
|||
function setProxy(options, configProxy, location) {
|
||||
let proxy = configProxy;
|
||||
if (!proxy && proxy !== false) {
|
||||
const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location);
|
||||
const proxyUrl = proxyFromEnv.getProxyForUrl(location);
|
||||
if (proxyUrl) {
|
||||
proxy = new URL(proxyUrl);
|
||||
}
|
||||
|
@ -22425,8 +22398,8 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||
}
|
||||
|
||||
// Parse url
|
||||
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
||||
const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
|
||||
const fullPath = buildFullPath(config.baseURL, config.url);
|
||||
const parsed = new URL(fullPath, utils$1.hasBrowserEnv ? platform.origin : undefined);
|
||||
const protocol = parsed.protocol || supportedProtocols[0];
|
||||
|
||||
if (protocol === 'data:') {
|
||||
|
@ -22511,7 +22484,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||
} catch (e) {
|
||||
}
|
||||
}
|
||||
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
||||
} else if (utils$1.isBlob(data)) {
|
||||
data.size && headers.setContentType(data.type || 'application/octet-stream');
|
||||
headers.setContentLength(data.size || 0);
|
||||
data = stream__default["default"].Readable.from(readBlob$1(data));
|
||||
|
@ -22622,7 +22595,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||
if (config.socketPath) {
|
||||
options.socketPath = config.socketPath;
|
||||
} else {
|
||||
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
||||
options.hostname = parsed.hostname;
|
||||
options.port = parsed.port;
|
||||
setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
|
||||
}
|
||||
|
@ -22764,7 +22737,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||
}
|
||||
|
||||
const err = new AxiosError(
|
||||
'stream has been aborted',
|
||||
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
||||
AxiosError.ERR_BAD_RESPONSE,
|
||||
config,
|
||||
lastRequest
|
||||
|
@ -22887,18 +22860,68 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||
});
|
||||
};
|
||||
|
||||
const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
|
||||
url = new URL(url, platform.origin);
|
||||
const isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
||||
|
||||
return (
|
||||
origin.protocol === url.protocol &&
|
||||
origin.host === url.host &&
|
||||
(isMSIE || origin.port === url.port)
|
||||
);
|
||||
})(
|
||||
new URL(platform.origin),
|
||||
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
||||
) : () => true;
|
||||
// Standard browser envs have full support of the APIs needed to test
|
||||
// whether the request URL is of the same origin as current location.
|
||||
(function standardBrowserEnv() {
|
||||
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
||||
const urlParsingNode = document.createElement('a');
|
||||
let originURL;
|
||||
|
||||
/**
|
||||
* Parse a URL to discover its components
|
||||
*
|
||||
* @param {String} url The URL to be parsed
|
||||
* @returns {Object}
|
||||
*/
|
||||
function resolveURL(url) {
|
||||
let href = url;
|
||||
|
||||
if (msie) {
|
||||
// IE needs attribute set twice to normalize properties
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
href = urlParsingNode.href;
|
||||
}
|
||||
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
|
||||
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
||||
return {
|
||||
href: urlParsingNode.href,
|
||||
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
||||
host: urlParsingNode.host,
|
||||
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
||||
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
||||
hostname: urlParsingNode.hostname,
|
||||
port: urlParsingNode.port,
|
||||
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
||||
urlParsingNode.pathname :
|
||||
'/' + urlParsingNode.pathname
|
||||
};
|
||||
}
|
||||
|
||||
originURL = resolveURL(window.location.href);
|
||||
|
||||
/**
|
||||
* Determine if a URL shares the same origin as the current location
|
||||
*
|
||||
* @param {String} requestURL The URL to test
|
||||
* @returns {boolean} True if URL shares the same origin, otherwise false
|
||||
*/
|
||||
return function isURLSameOrigin(requestURL) {
|
||||
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
||||
return (parsed.protocol === originURL.protocol &&
|
||||
parsed.host === originURL.host);
|
||||
};
|
||||
})() :
|
||||
|
||||
// Non standard browser envs (web workers, react-native) lack needed support.
|
||||
(function nonStandardBrowserEnv() {
|
||||
return function isURLSameOrigin() {
|
||||
return true;
|
||||
};
|
||||
})();
|
||||
|
||||
const cookies = platform.hasStandardBrowserEnv ?
|
||||
|
||||
|
@ -22955,7 +22978,7 @@ function mergeConfig(config1, config2) {
|
|||
config2 = config2 || {};
|
||||
const config = {};
|
||||
|
||||
function getMergedValue(target, source, prop, caseless) {
|
||||
function getMergedValue(target, source, caseless) {
|
||||
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
||||
return utils$1.merge.call({caseless}, target, source);
|
||||
} else if (utils$1.isPlainObject(source)) {
|
||||
|
@ -22967,11 +22990,11 @@ function mergeConfig(config1, config2) {
|
|||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
function mergeDeepProperties(a, b, prop , caseless) {
|
||||
function mergeDeepProperties(a, b, caseless) {
|
||||
if (!utils$1.isUndefined(b)) {
|
||||
return getMergedValue(a, b, prop , caseless);
|
||||
return getMergedValue(a, b, caseless);
|
||||
} else if (!utils$1.isUndefined(a)) {
|
||||
return getMergedValue(undefined, a, prop , caseless);
|
||||
return getMergedValue(undefined, a, caseless);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23029,7 +23052,7 @@ function mergeConfig(config1, config2) {
|
|||
socketPath: defaultToConfig2,
|
||||
responseEncoding: defaultToConfig2,
|
||||
validateStatus: mergeDirectKeys,
|
||||
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
||||
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
||||
};
|
||||
|
||||
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
||||
|
@ -23048,7 +23071,7 @@ const resolveConfig = (config) => {
|
|||
|
||||
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
||||
|
||||
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
||||
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
||||
|
||||
// HTTP basic authentication
|
||||
if (auth) {
|
||||
|
@ -23277,46 +23300,45 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|||
};
|
||||
|
||||
const composeSignals = (signals, timeout) => {
|
||||
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
||||
let controller = new AbortController();
|
||||
|
||||
if (timeout || length) {
|
||||
let controller = new AbortController();
|
||||
let aborted;
|
||||
|
||||
let aborted;
|
||||
const onabort = function (cancel) {
|
||||
if (!aborted) {
|
||||
aborted = true;
|
||||
unsubscribe();
|
||||
const err = cancel instanceof Error ? cancel : this.reason;
|
||||
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
||||
}
|
||||
};
|
||||
|
||||
const onabort = function (reason) {
|
||||
if (!aborted) {
|
||||
aborted = true;
|
||||
unsubscribe();
|
||||
const err = reason instanceof Error ? reason : this.reason;
|
||||
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
||||
}
|
||||
};
|
||||
let timer = timeout && setTimeout(() => {
|
||||
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
||||
}, timeout);
|
||||
|
||||
let timer = timeout && setTimeout(() => {
|
||||
const unsubscribe = () => {
|
||||
if (signals) {
|
||||
timer && clearTimeout(timer);
|
||||
timer = null;
|
||||
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
||||
}, timeout);
|
||||
signals.forEach(signal => {
|
||||
signal &&
|
||||
(signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
|
||||
});
|
||||
signals = null;
|
||||
}
|
||||
};
|
||||
|
||||
const unsubscribe = () => {
|
||||
if (signals) {
|
||||
timer && clearTimeout(timer);
|
||||
timer = null;
|
||||
signals.forEach(signal => {
|
||||
signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
|
||||
});
|
||||
signals = null;
|
||||
}
|
||||
};
|
||||
signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
|
||||
|
||||
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
||||
const {signal} = controller;
|
||||
|
||||
const {signal} = controller;
|
||||
signal.unsubscribe = unsubscribe;
|
||||
|
||||
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
||||
|
||||
return signal;
|
||||
}
|
||||
return [signal, () => {
|
||||
timer && clearTimeout(timer);
|
||||
timer = null;
|
||||
}];
|
||||
};
|
||||
|
||||
const composeSignals$1 = composeSignals;
|
||||
|
@ -23339,34 +23361,14 @@ const streamChunk = function* (chunk, chunkSize) {
|
|||
}
|
||||
};
|
||||
|
||||
const readBytes = async function* (iterable, chunkSize) {
|
||||
for await (const chunk of readStream(iterable)) {
|
||||
yield* streamChunk(chunk, chunkSize);
|
||||
const readBytes = async function* (iterable, chunkSize, encode) {
|
||||
for await (const chunk of iterable) {
|
||||
yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
|
||||
}
|
||||
};
|
||||
|
||||
const readStream = async function* (stream) {
|
||||
if (stream[Symbol.asyncIterator]) {
|
||||
yield* stream;
|
||||
return;
|
||||
}
|
||||
|
||||
const reader = stream.getReader();
|
||||
try {
|
||||
for (;;) {
|
||||
const {done, value} = await reader.read();
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
yield value;
|
||||
}
|
||||
} finally {
|
||||
await reader.cancel();
|
||||
}
|
||||
};
|
||||
|
||||
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
||||
const iterator = readBytes(stream, chunkSize);
|
||||
const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
|
||||
const iterator = readBytes(stream, chunkSize, encode);
|
||||
|
||||
let bytes = 0;
|
||||
let done;
|
||||
|
@ -23469,11 +23471,7 @@ const getBodyLength = async (body) => {
|
|||
}
|
||||
|
||||
if(utils$1.isSpecCompliantForm(body)) {
|
||||
const _request = new Request(platform.origin, {
|
||||
method: 'POST',
|
||||
body,
|
||||
});
|
||||
return (await _request.arrayBuffer()).byteLength;
|
||||
return (await new Request(body).arrayBuffer()).byteLength;
|
||||
}
|
||||
|
||||
if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
||||
|
@ -23513,13 +23511,18 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
|
||||
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
||||
|
||||
let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
||||
let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
|
||||
composeSignals$1([signal, cancelToken], timeout) : [];
|
||||
|
||||
let request;
|
||||
let finished, request;
|
||||
|
||||
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
||||
composedSignal.unsubscribe();
|
||||
});
|
||||
const onFinish = () => {
|
||||
!finished && setTimeout(() => {
|
||||
composedSignal && composedSignal.unsubscribe();
|
||||
});
|
||||
|
||||
finished = true;
|
||||
};
|
||||
|
||||
let requestContentLength;
|
||||
|
||||
|
@ -23546,7 +23549,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
progressEventReducer(asyncDecorator(onUploadProgress))
|
||||
);
|
||||
|
||||
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
||||
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23554,9 +23557,6 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
withCredentials = withCredentials ? 'include' : 'omit';
|
||||
}
|
||||
|
||||
// Cloudflare Workers throws when credentials are defined
|
||||
// see https://github.com/cloudflare/workerd/issues/902
|
||||
const isCredentialsSupported = "credentials" in Request.prototype;
|
||||
request = new Request(url, {
|
||||
...fetchOptions,
|
||||
signal: composedSignal,
|
||||
|
@ -23564,14 +23564,14 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
headers: headers.normalize().toJSON(),
|
||||
body: data,
|
||||
duplex: "half",
|
||||
credentials: isCredentialsSupported ? withCredentials : undefined
|
||||
credentials: withCredentials
|
||||
});
|
||||
|
||||
let response = await fetch(request);
|
||||
|
||||
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
||||
|
||||
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
||||
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
|
||||
const options = {};
|
||||
|
||||
['status', 'statusText', 'headers'].forEach(prop => {
|
||||
|
@ -23588,8 +23588,8 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
response = new Response(
|
||||
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
||||
flush && flush();
|
||||
unsubscribe && unsubscribe();
|
||||
}),
|
||||
isStreamResponse && onFinish();
|
||||
}, encodeText),
|
||||
options
|
||||
);
|
||||
}
|
||||
|
@ -23598,7 +23598,9 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
|
||||
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
||||
|
||||
!isStreamResponse && unsubscribe && unsubscribe();
|
||||
!isStreamResponse && onFinish();
|
||||
|
||||
stopTimeout && stopTimeout();
|
||||
|
||||
return await new Promise((resolve, reject) => {
|
||||
settle(resolve, reject, {
|
||||
|
@ -23611,7 +23613,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
});
|
||||
})
|
||||
} catch (err) {
|
||||
unsubscribe && unsubscribe();
|
||||
onFinish();
|
||||
|
||||
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
||||
throw Object.assign(
|
||||
|
@ -23822,14 +23824,6 @@ validators$1.transitional = function transitional(validator, version, message) {
|
|||
};
|
||||
};
|
||||
|
||||
validators$1.spelling = function spelling(correctSpelling) {
|
||||
return (value, opt) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Assert object's properties type
|
||||
*
|
||||
|
@ -23899,9 +23893,9 @@ class Axios {
|
|||
return await this._request(configOrUrl, config);
|
||||
} catch (err) {
|
||||
if (err instanceof Error) {
|
||||
let dummy = {};
|
||||
let dummy;
|
||||
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
|
||||
|
||||
// slice off the Error: ... line
|
||||
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
||||
|
@ -23956,18 +23950,6 @@ class Axios {
|
|||
}
|
||||
}
|
||||
|
||||
// Set config.allowAbsoluteUrls
|
||||
if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
|
||||
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
||||
} else {
|
||||
config.allowAbsoluteUrls = true;
|
||||
}
|
||||
|
||||
validator.assertOptions(config, {
|
||||
baseUrl: validators.spelling('baseURL'),
|
||||
withXsrfToken: validators.spelling('withXSRFToken')
|
||||
}, true);
|
||||
|
||||
// Set config.method
|
||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||
|
||||
|
@ -24058,7 +24040,7 @@ class Axios {
|
|||
|
||||
getUri(config) {
|
||||
config = mergeConfig(this.defaults, config);
|
||||
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
||||
const fullPath = buildFullPath(config.baseURL, config.url);
|
||||
return buildURL(fullPath, config.params, config.paramsSerializer);
|
||||
}
|
||||
}
|
||||
|
@ -24198,20 +24180,6 @@ class CancelToken {
|
|||
}
|
||||
}
|
||||
|
||||
toAbortSignal() {
|
||||
const controller = new AbortController();
|
||||
|
||||
const abort = (err) => {
|
||||
controller.abort(err);
|
||||
};
|
||||
|
||||
this.subscribe(abort);
|
||||
|
||||
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
||||
|
||||
return controller.signal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
||||
* cancels the `CancelToken`.
|
||||
|
@ -24417,7 +24385,7 @@ module.exports = axios;
|
|||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = JSON.parse('{"name":"@kie/git-backporting","version":"4.8.5","description":"Git backporting is a tool to execute automatic pull request git backporting.","author":"","license":"MIT","private":false,"main":"./dist/gha/index.js","bin":{"git-backporting":"./dist/cli/index.js"},"files":["dist/cli/index.js"],"publishConfig":{"access":"public"},"scripts":{"prepare":"husky install","clean":"rm -rf ./build ./dist","compile":"tsc -p tsconfig.json && tsc-alias -p tsconfig.json","package":"npm run package:cli && npm run package:gha","package:cli":"ncc build ./build/src/bin/cli.js -o dist/cli","package:gha":"ncc build ./build/src/bin/gha.js -o dist/gha","build":"npm run clean && npm run compile && npm run package","test":"jest --silent","test:report":"npm test -- --coverage --testResultsProcessor=jest-sonar-reporter","lint":"eslint . --ext .ts","lint:fix":"npm run lint -- --fix","ts-node":"ts-node","postversion":"npm run build && git add dist && rm -rf build","release":"release-it","release:branch":"git checkout -b release/$(release-it --release-version) main","release:prepare":"release-it --no-npm.publish --no-github.release --no-git.push --no-git.tag --no-git.requireUpstream","release:prepare:all":"npm run release:branch && npm run release:prepare"},"repository":{"type":"git","url":"git+https://github.com/kiegroup/git-backporting.git"},"keywords":["backporting","pull-requests","merge-requests","github-action","cherry-pick"],"bugs":{"url":"https://github.com/kiegroup/git-backporting/issues"},"homepage":"https://github.com/kiegroup/git-backporting#readme","devDependencies":{"@commitlint/cli":"^17.4.0","@commitlint/config-conventional":"^17.4.0","@gitbeaker/rest":"^39.1.0","@kie/mock-github":"^1.1.0","@octokit/webhooks-types":"^6.8.0","@release-it/conventional-changelog":"^10.0.0","@types/fs-extra":"^9.0.13","@types/jest":"^29.2.4","@types/node":"^18.11.17","@typescript-eslint/eslint-plugin":"^5.47.0","@typescript-eslint/parser":"^5.47.0","@vercel/ncc":"^0.36.0","eslint":"^8.30.0","husky":"^8.0.2","jest":"^29.0.0","jest-sonar-reporter":"^2.0.0","release-it":"^18.1.2","semver":"^7.3.8","ts-jest":"^29.0.0","ts-node":"^10.8.1","tsc-alias":"^1.8.2","tsconfig-paths":"^4.1.0","typescript":"^4.9.3"},"dependencies":{"@actions/core":"^1.10.0","@octokit/rest":"^18.12.0","axios":"^1.4.0","commander":"^9.3.0","fs-extra":"^11.1.0","https":"^1.0.0","simple-git":"^3.15.1"}}');
|
||||
module.exports = JSON.parse('{"name":"@kie/git-backporting","version":"4.8.4","description":"Git backporting is a tool to execute automatic pull request git backporting.","author":"","license":"MIT","private":false,"main":"./dist/gha/index.js","bin":{"git-backporting":"./dist/cli/index.js"},"files":["dist/cli/index.js"],"publishConfig":{"access":"public"},"scripts":{"prepare":"husky install","clean":"rm -rf ./build ./dist","compile":"tsc -p tsconfig.json && tsc-alias -p tsconfig.json","package":"npm run package:cli && npm run package:gha","package:cli":"ncc build ./build/src/bin/cli.js -o dist/cli","package:gha":"ncc build ./build/src/bin/gha.js -o dist/gha","build":"npm run clean && npm run compile && npm run package","test":"jest --silent","test:report":"npm test -- --coverage --testResultsProcessor=jest-sonar-reporter","lint":"eslint . --ext .ts","lint:fix":"npm run lint -- --fix","ts-node":"ts-node","postversion":"npm run build && git add dist && rm -rf build","release":"release-it","release:branch":"git checkout -b release/$(release-it --release-version) main","release:prepare":"release-it --no-npm.publish --no-github.release --no-git.push --no-git.tag --no-git.requireUpstream","release:prepare:all":"npm run release:branch && npm run release:prepare"},"repository":{"type":"git","url":"git+https://github.com/kiegroup/git-backporting.git"},"keywords":["backporting","pull-requests","merge-requests","github-action","cherry-pick"],"bugs":{"url":"https://github.com/kiegroup/git-backporting/issues"},"homepage":"https://github.com/kiegroup/git-backporting#readme","devDependencies":{"@commitlint/cli":"^17.4.0","@commitlint/config-conventional":"^17.4.0","@gitbeaker/rest":"^39.1.0","@kie/mock-github":"^1.1.0","@octokit/webhooks-types":"^6.8.0","@release-it/conventional-changelog":"^7.0.0","@types/fs-extra":"^9.0.13","@types/jest":"^29.2.4","@types/node":"^18.11.17","@typescript-eslint/eslint-plugin":"^5.47.0","@typescript-eslint/parser":"^5.47.0","@vercel/ncc":"^0.36.0","eslint":"^8.30.0","husky":"^8.0.2","jest":"^29.0.0","jest-sonar-reporter":"^2.0.0","release-it":"^16.1.3","semver":"^7.3.8","ts-jest":"^29.0.0","ts-node":"^10.8.1","tsc-alias":"^1.8.2","tsconfig-paths":"^4.1.0","typescript":"^4.9.3"},"dependencies":{"@actions/core":"^1.10.0","@octokit/rest":"^18.12.0","axios":"^1.4.0","commander":"^9.3.0","fs-extra":"^11.1.0","https":"^1.0.0","simple-git":"^3.15.1"}}');
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
|
362
dist/gha/index.js
vendored
362
dist/gha/index.js
vendored
|
@ -1116,9 +1116,7 @@ class GitLabClient {
|
|||
// example: <host>/api/v4/projects/<namespace>%2Fbackporting-example/merge_requests/1
|
||||
async getPullRequest(namespace, repo, mrNumber, squash) {
|
||||
const projectId = this.getProjectId(namespace, repo);
|
||||
const url = `/projects/${projectId}/merge_requests/${mrNumber}`;
|
||||
this.logger.debug(`Fetching pull request ${url}`);
|
||||
const { data } = await this.client.get(`${url}`);
|
||||
const { data } = await this.client.get(`/projects/${projectId}/merge_requests/${mrNumber}`);
|
||||
if (squash === undefined) {
|
||||
squash = (0, git_util_1.inferSquash)(data.state === "opened", data.squash_commit_sha);
|
||||
}
|
||||
|
@ -1208,7 +1206,7 @@ class GitLabClient {
|
|||
try {
|
||||
const { namespace, project, id } = this.extractMergeRequestData(mrUrl);
|
||||
const projectId = this.getProjectId(namespace, project);
|
||||
const { data } = await this.client.post(`/projects/${projectId}/merge_requests/${id}/notes`, {
|
||||
const { data } = await this.client.post(`/projects/${projectId}/issues/${id}/notes`, {
|
||||
body: comment,
|
||||
});
|
||||
if (!data) {
|
||||
|
@ -19044,11 +19042,10 @@ module.exports = require("zlib");
|
|||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||
// Axios v1.7.4 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
|
||||
|
||||
const FormData$1 = __nccwpck_require__(4334);
|
||||
const crypto = __nccwpck_require__(6113);
|
||||
const url = __nccwpck_require__(7310);
|
||||
const proxyFromEnv = __nccwpck_require__(3329);
|
||||
const http = __nccwpck_require__(3685);
|
||||
|
@ -19062,9 +19059,7 @@ const events = __nccwpck_require__(2361);
|
|||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
|
||||
const crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
|
||||
const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
|
||||
const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv);
|
||||
const http__default = /*#__PURE__*/_interopDefaultLegacy(http);
|
||||
const https__default = /*#__PURE__*/_interopDefaultLegacy(https);
|
||||
const util__default = /*#__PURE__*/_interopDefaultLegacy(util);
|
||||
|
@ -19678,6 +19673,26 @@ const toFiniteNumber = (value, defaultValue) => {
|
|||
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
||||
};
|
||||
|
||||
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
const DIGIT = '0123456789';
|
||||
|
||||
const ALPHABET = {
|
||||
DIGIT,
|
||||
ALPHA,
|
||||
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
||||
};
|
||||
|
||||
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
||||
let str = '';
|
||||
const {length} = alphabet;
|
||||
while (size--) {
|
||||
str += alphabet[Math.random() * length|0];
|
||||
}
|
||||
|
||||
return str;
|
||||
};
|
||||
|
||||
/**
|
||||
* If the thing is a FormData object, return true, otherwise return false.
|
||||
*
|
||||
|
@ -19805,6 +19820,8 @@ const utils$1 = {
|
|||
findKey,
|
||||
global: _global,
|
||||
isContextDefined,
|
||||
ALPHABET,
|
||||
generateString,
|
||||
isSpecCompliantForm,
|
||||
toJSONObject,
|
||||
isAsyncFn,
|
||||
|
@ -19838,10 +19855,7 @@ function AxiosError(message, code, config, request, response) {
|
|||
code && (this.code = code);
|
||||
config && (this.config = config);
|
||||
request && (this.request = request);
|
||||
if (response) {
|
||||
this.response = response;
|
||||
this.status = response.status ? response.status : null;
|
||||
}
|
||||
response && (this.response = response);
|
||||
}
|
||||
|
||||
utils$1.inherits(AxiosError, Error, {
|
||||
|
@ -19861,7 +19875,7 @@ utils$1.inherits(AxiosError, Error, {
|
|||
// Axios
|
||||
config: utils$1.toJSONObject(this.config),
|
||||
code: this.code,
|
||||
status: this.status
|
||||
status: this.response && this.response.status ? this.response.status : null
|
||||
};
|
||||
}
|
||||
});
|
||||
|
@ -20198,7 +20212,7 @@ function encode(val) {
|
|||
*
|
||||
* @param {string} url The base of the url (e.g., http://www.google.com)
|
||||
* @param {object} [params] The params to be appended
|
||||
* @param {?(object|Function)} options
|
||||
* @param {?object} options
|
||||
*
|
||||
* @returns {string} The formatted url
|
||||
*/
|
||||
|
@ -20210,12 +20224,6 @@ function buildURL(url, params, options) {
|
|||
|
||||
const _encode = options && options.encode || encode;
|
||||
|
||||
if (utils$1.isFunction(options)) {
|
||||
options = {
|
||||
serialize: options
|
||||
};
|
||||
}
|
||||
|
||||
const serializeFn = options && options.serialize;
|
||||
|
||||
let serializedParams;
|
||||
|
@ -20316,29 +20324,6 @@ const transitionalDefaults = {
|
|||
|
||||
const URLSearchParams = url__default["default"].URLSearchParams;
|
||||
|
||||
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
const DIGIT = '0123456789';
|
||||
|
||||
const ALPHABET = {
|
||||
DIGIT,
|
||||
ALPHA,
|
||||
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
||||
};
|
||||
|
||||
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
||||
let str = '';
|
||||
const {length} = alphabet;
|
||||
const randomValues = new Uint32Array(size);
|
||||
crypto__default["default"].randomFillSync(randomValues);
|
||||
for (let i = 0; i < size; i++) {
|
||||
str += alphabet[randomValues[i] % length];
|
||||
}
|
||||
|
||||
return str;
|
||||
};
|
||||
|
||||
|
||||
const platform$1 = {
|
||||
isNode: true,
|
||||
classes: {
|
||||
|
@ -20346,15 +20331,11 @@ const platform$1 = {
|
|||
FormData: FormData__default["default"],
|
||||
Blob: typeof Blob !== 'undefined' && Blob || null
|
||||
},
|
||||
ALPHABET,
|
||||
generateString,
|
||||
protocols: [ 'http', 'https', 'file', 'data' ]
|
||||
};
|
||||
|
||||
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
||||
|
||||
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
||||
|
||||
/**
|
||||
* Determine if we're running in a standard browser environment
|
||||
*
|
||||
|
@ -20372,8 +20353,10 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
const hasStandardBrowserEnv = hasBrowserEnv &&
|
||||
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
||||
const hasStandardBrowserEnv = (
|
||||
(product) => {
|
||||
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
||||
})(typeof navigator !== 'undefined' && navigator.product);
|
||||
|
||||
/**
|
||||
* Determine if we're running in a standard browser webWorker environment
|
||||
|
@ -20400,7 +20383,6 @@ const utils = /*#__PURE__*/Object.freeze({
|
|||
hasBrowserEnv: hasBrowserEnv,
|
||||
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
||||
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
||||
navigator: _navigator,
|
||||
origin: origin
|
||||
});
|
||||
|
||||
|
@ -21122,15 +21104,14 @@ function combineURLs(baseURL, relativeURL) {
|
|||
*
|
||||
* @returns {string} The combined full path
|
||||
*/
|
||||
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
||||
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
||||
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
||||
function buildFullPath(baseURL, requestedURL) {
|
||||
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
||||
return combineURLs(baseURL, requestedURL);
|
||||
}
|
||||
return requestedURL;
|
||||
}
|
||||
|
||||
const VERSION = "1.8.4";
|
||||
const VERSION = "1.7.4";
|
||||
|
||||
function parseProtocol(url) {
|
||||
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
||||
|
@ -21340,9 +21321,9 @@ const readBlob = async function* (blob) {
|
|||
|
||||
const readBlob$1 = readBlob;
|
||||
|
||||
const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
|
||||
const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
|
||||
|
||||
const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__default["default"].TextEncoder();
|
||||
const textEncoder = new util.TextEncoder();
|
||||
|
||||
const CRLF = '\r\n';
|
||||
const CRLF_BYTES = textEncoder.encode(CRLF);
|
||||
|
@ -21400,7 +21381,7 @@ const formDataToStream = (form, headersHandler, options) => {
|
|||
const {
|
||||
tag = 'form-data-boundary',
|
||||
size = 25,
|
||||
boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
|
||||
boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)
|
||||
} = options || {};
|
||||
|
||||
if(!utils$1.isFormData(form)) {
|
||||
|
@ -21680,7 +21661,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
|
|||
function setProxy(options, configProxy, location) {
|
||||
let proxy = configProxy;
|
||||
if (!proxy && proxy !== false) {
|
||||
const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location);
|
||||
const proxyUrl = proxyFromEnv.getProxyForUrl(location);
|
||||
if (proxyUrl) {
|
||||
proxy = new URL(proxyUrl);
|
||||
}
|
||||
|
@ -21825,8 +21806,8 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||
}
|
||||
|
||||
// Parse url
|
||||
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
||||
const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
|
||||
const fullPath = buildFullPath(config.baseURL, config.url);
|
||||
const parsed = new URL(fullPath, utils$1.hasBrowserEnv ? platform.origin : undefined);
|
||||
const protocol = parsed.protocol || supportedProtocols[0];
|
||||
|
||||
if (protocol === 'data:') {
|
||||
|
@ -21911,7 +21892,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||
} catch (e) {
|
||||
}
|
||||
}
|
||||
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
||||
} else if (utils$1.isBlob(data)) {
|
||||
data.size && headers.setContentType(data.type || 'application/octet-stream');
|
||||
headers.setContentLength(data.size || 0);
|
||||
data = stream__default["default"].Readable.from(readBlob$1(data));
|
||||
|
@ -22022,7 +22003,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||
if (config.socketPath) {
|
||||
options.socketPath = config.socketPath;
|
||||
} else {
|
||||
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
||||
options.hostname = parsed.hostname;
|
||||
options.port = parsed.port;
|
||||
setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
|
||||
}
|
||||
|
@ -22164,7 +22145,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||
}
|
||||
|
||||
const err = new AxiosError(
|
||||
'stream has been aborted',
|
||||
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
||||
AxiosError.ERR_BAD_RESPONSE,
|
||||
config,
|
||||
lastRequest
|
||||
|
@ -22287,18 +22268,68 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||
});
|
||||
};
|
||||
|
||||
const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
|
||||
url = new URL(url, platform.origin);
|
||||
const isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
||||
|
||||
return (
|
||||
origin.protocol === url.protocol &&
|
||||
origin.host === url.host &&
|
||||
(isMSIE || origin.port === url.port)
|
||||
);
|
||||
})(
|
||||
new URL(platform.origin),
|
||||
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
||||
) : () => true;
|
||||
// Standard browser envs have full support of the APIs needed to test
|
||||
// whether the request URL is of the same origin as current location.
|
||||
(function standardBrowserEnv() {
|
||||
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
||||
const urlParsingNode = document.createElement('a');
|
||||
let originURL;
|
||||
|
||||
/**
|
||||
* Parse a URL to discover its components
|
||||
*
|
||||
* @param {String} url The URL to be parsed
|
||||
* @returns {Object}
|
||||
*/
|
||||
function resolveURL(url) {
|
||||
let href = url;
|
||||
|
||||
if (msie) {
|
||||
// IE needs attribute set twice to normalize properties
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
href = urlParsingNode.href;
|
||||
}
|
||||
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
|
||||
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
||||
return {
|
||||
href: urlParsingNode.href,
|
||||
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
||||
host: urlParsingNode.host,
|
||||
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
||||
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
||||
hostname: urlParsingNode.hostname,
|
||||
port: urlParsingNode.port,
|
||||
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
||||
urlParsingNode.pathname :
|
||||
'/' + urlParsingNode.pathname
|
||||
};
|
||||
}
|
||||
|
||||
originURL = resolveURL(window.location.href);
|
||||
|
||||
/**
|
||||
* Determine if a URL shares the same origin as the current location
|
||||
*
|
||||
* @param {String} requestURL The URL to test
|
||||
* @returns {boolean} True if URL shares the same origin, otherwise false
|
||||
*/
|
||||
return function isURLSameOrigin(requestURL) {
|
||||
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
||||
return (parsed.protocol === originURL.protocol &&
|
||||
parsed.host === originURL.host);
|
||||
};
|
||||
})() :
|
||||
|
||||
// Non standard browser envs (web workers, react-native) lack needed support.
|
||||
(function nonStandardBrowserEnv() {
|
||||
return function isURLSameOrigin() {
|
||||
return true;
|
||||
};
|
||||
})();
|
||||
|
||||
const cookies = platform.hasStandardBrowserEnv ?
|
||||
|
||||
|
@ -22355,7 +22386,7 @@ function mergeConfig(config1, config2) {
|
|||
config2 = config2 || {};
|
||||
const config = {};
|
||||
|
||||
function getMergedValue(target, source, prop, caseless) {
|
||||
function getMergedValue(target, source, caseless) {
|
||||
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
||||
return utils$1.merge.call({caseless}, target, source);
|
||||
} else if (utils$1.isPlainObject(source)) {
|
||||
|
@ -22367,11 +22398,11 @@ function mergeConfig(config1, config2) {
|
|||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
function mergeDeepProperties(a, b, prop , caseless) {
|
||||
function mergeDeepProperties(a, b, caseless) {
|
||||
if (!utils$1.isUndefined(b)) {
|
||||
return getMergedValue(a, b, prop , caseless);
|
||||
return getMergedValue(a, b, caseless);
|
||||
} else if (!utils$1.isUndefined(a)) {
|
||||
return getMergedValue(undefined, a, prop , caseless);
|
||||
return getMergedValue(undefined, a, caseless);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22429,7 +22460,7 @@ function mergeConfig(config1, config2) {
|
|||
socketPath: defaultToConfig2,
|
||||
responseEncoding: defaultToConfig2,
|
||||
validateStatus: mergeDirectKeys,
|
||||
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
||||
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
||||
};
|
||||
|
||||
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
||||
|
@ -22448,7 +22479,7 @@ const resolveConfig = (config) => {
|
|||
|
||||
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
||||
|
||||
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
||||
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
||||
|
||||
// HTTP basic authentication
|
||||
if (auth) {
|
||||
|
@ -22677,46 +22708,45 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|||
};
|
||||
|
||||
const composeSignals = (signals, timeout) => {
|
||||
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
||||
let controller = new AbortController();
|
||||
|
||||
if (timeout || length) {
|
||||
let controller = new AbortController();
|
||||
let aborted;
|
||||
|
||||
let aborted;
|
||||
const onabort = function (cancel) {
|
||||
if (!aborted) {
|
||||
aborted = true;
|
||||
unsubscribe();
|
||||
const err = cancel instanceof Error ? cancel : this.reason;
|
||||
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
||||
}
|
||||
};
|
||||
|
||||
const onabort = function (reason) {
|
||||
if (!aborted) {
|
||||
aborted = true;
|
||||
unsubscribe();
|
||||
const err = reason instanceof Error ? reason : this.reason;
|
||||
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
||||
}
|
||||
};
|
||||
let timer = timeout && setTimeout(() => {
|
||||
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
||||
}, timeout);
|
||||
|
||||
let timer = timeout && setTimeout(() => {
|
||||
const unsubscribe = () => {
|
||||
if (signals) {
|
||||
timer && clearTimeout(timer);
|
||||
timer = null;
|
||||
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
||||
}, timeout);
|
||||
signals.forEach(signal => {
|
||||
signal &&
|
||||
(signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
|
||||
});
|
||||
signals = null;
|
||||
}
|
||||
};
|
||||
|
||||
const unsubscribe = () => {
|
||||
if (signals) {
|
||||
timer && clearTimeout(timer);
|
||||
timer = null;
|
||||
signals.forEach(signal => {
|
||||
signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
|
||||
});
|
||||
signals = null;
|
||||
}
|
||||
};
|
||||
signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
|
||||
|
||||
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
||||
const {signal} = controller;
|
||||
|
||||
const {signal} = controller;
|
||||
signal.unsubscribe = unsubscribe;
|
||||
|
||||
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
||||
|
||||
return signal;
|
||||
}
|
||||
return [signal, () => {
|
||||
timer && clearTimeout(timer);
|
||||
timer = null;
|
||||
}];
|
||||
};
|
||||
|
||||
const composeSignals$1 = composeSignals;
|
||||
|
@ -22739,34 +22769,14 @@ const streamChunk = function* (chunk, chunkSize) {
|
|||
}
|
||||
};
|
||||
|
||||
const readBytes = async function* (iterable, chunkSize) {
|
||||
for await (const chunk of readStream(iterable)) {
|
||||
yield* streamChunk(chunk, chunkSize);
|
||||
const readBytes = async function* (iterable, chunkSize, encode) {
|
||||
for await (const chunk of iterable) {
|
||||
yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
|
||||
}
|
||||
};
|
||||
|
||||
const readStream = async function* (stream) {
|
||||
if (stream[Symbol.asyncIterator]) {
|
||||
yield* stream;
|
||||
return;
|
||||
}
|
||||
|
||||
const reader = stream.getReader();
|
||||
try {
|
||||
for (;;) {
|
||||
const {done, value} = await reader.read();
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
yield value;
|
||||
}
|
||||
} finally {
|
||||
await reader.cancel();
|
||||
}
|
||||
};
|
||||
|
||||
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
||||
const iterator = readBytes(stream, chunkSize);
|
||||
const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
|
||||
const iterator = readBytes(stream, chunkSize, encode);
|
||||
|
||||
let bytes = 0;
|
||||
let done;
|
||||
|
@ -22869,11 +22879,7 @@ const getBodyLength = async (body) => {
|
|||
}
|
||||
|
||||
if(utils$1.isSpecCompliantForm(body)) {
|
||||
const _request = new Request(platform.origin, {
|
||||
method: 'POST',
|
||||
body,
|
||||
});
|
||||
return (await _request.arrayBuffer()).byteLength;
|
||||
return (await new Request(body).arrayBuffer()).byteLength;
|
||||
}
|
||||
|
||||
if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
||||
|
@ -22913,13 +22919,18 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
|
||||
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
||||
|
||||
let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
||||
let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
|
||||
composeSignals$1([signal, cancelToken], timeout) : [];
|
||||
|
||||
let request;
|
||||
let finished, request;
|
||||
|
||||
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
||||
composedSignal.unsubscribe();
|
||||
});
|
||||
const onFinish = () => {
|
||||
!finished && setTimeout(() => {
|
||||
composedSignal && composedSignal.unsubscribe();
|
||||
});
|
||||
|
||||
finished = true;
|
||||
};
|
||||
|
||||
let requestContentLength;
|
||||
|
||||
|
@ -22946,7 +22957,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
progressEventReducer(asyncDecorator(onUploadProgress))
|
||||
);
|
||||
|
||||
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
||||
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22954,9 +22965,6 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
withCredentials = withCredentials ? 'include' : 'omit';
|
||||
}
|
||||
|
||||
// Cloudflare Workers throws when credentials are defined
|
||||
// see https://github.com/cloudflare/workerd/issues/902
|
||||
const isCredentialsSupported = "credentials" in Request.prototype;
|
||||
request = new Request(url, {
|
||||
...fetchOptions,
|
||||
signal: composedSignal,
|
||||
|
@ -22964,14 +22972,14 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
headers: headers.normalize().toJSON(),
|
||||
body: data,
|
||||
duplex: "half",
|
||||
credentials: isCredentialsSupported ? withCredentials : undefined
|
||||
credentials: withCredentials
|
||||
});
|
||||
|
||||
let response = await fetch(request);
|
||||
|
||||
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
||||
|
||||
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
||||
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
|
||||
const options = {};
|
||||
|
||||
['status', 'statusText', 'headers'].forEach(prop => {
|
||||
|
@ -22988,8 +22996,8 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
response = new Response(
|
||||
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
||||
flush && flush();
|
||||
unsubscribe && unsubscribe();
|
||||
}),
|
||||
isStreamResponse && onFinish();
|
||||
}, encodeText),
|
||||
options
|
||||
);
|
||||
}
|
||||
|
@ -22998,7 +23006,9 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
|
||||
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
||||
|
||||
!isStreamResponse && unsubscribe && unsubscribe();
|
||||
!isStreamResponse && onFinish();
|
||||
|
||||
stopTimeout && stopTimeout();
|
||||
|
||||
return await new Promise((resolve, reject) => {
|
||||
settle(resolve, reject, {
|
||||
|
@ -23011,7 +23021,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|||
});
|
||||
})
|
||||
} catch (err) {
|
||||
unsubscribe && unsubscribe();
|
||||
onFinish();
|
||||
|
||||
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
||||
throw Object.assign(
|
||||
|
@ -23222,14 +23232,6 @@ validators$1.transitional = function transitional(validator, version, message) {
|
|||
};
|
||||
};
|
||||
|
||||
validators$1.spelling = function spelling(correctSpelling) {
|
||||
return (value, opt) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Assert object's properties type
|
||||
*
|
||||
|
@ -23299,9 +23301,9 @@ class Axios {
|
|||
return await this._request(configOrUrl, config);
|
||||
} catch (err) {
|
||||
if (err instanceof Error) {
|
||||
let dummy = {};
|
||||
let dummy;
|
||||
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
|
||||
|
||||
// slice off the Error: ... line
|
||||
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
||||
|
@ -23356,18 +23358,6 @@ class Axios {
|
|||
}
|
||||
}
|
||||
|
||||
// Set config.allowAbsoluteUrls
|
||||
if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
|
||||
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
||||
} else {
|
||||
config.allowAbsoluteUrls = true;
|
||||
}
|
||||
|
||||
validator.assertOptions(config, {
|
||||
baseUrl: validators.spelling('baseURL'),
|
||||
withXsrfToken: validators.spelling('withXSRFToken')
|
||||
}, true);
|
||||
|
||||
// Set config.method
|
||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||
|
||||
|
@ -23458,7 +23448,7 @@ class Axios {
|
|||
|
||||
getUri(config) {
|
||||
config = mergeConfig(this.defaults, config);
|
||||
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
||||
const fullPath = buildFullPath(config.baseURL, config.url);
|
||||
return buildURL(fullPath, config.params, config.paramsSerializer);
|
||||
}
|
||||
}
|
||||
|
@ -23598,20 +23588,6 @@ class CancelToken {
|
|||
}
|
||||
}
|
||||
|
||||
toAbortSignal() {
|
||||
const controller = new AbortController();
|
||||
|
||||
const abort = (err) => {
|
||||
controller.abort(err);
|
||||
};
|
||||
|
||||
this.subscribe(abort);
|
||||
|
||||
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
||||
|
||||
return controller.signal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
||||
* cancels the `CancelToken`.
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
[tools]
|
||||
node = "20"
|
8911
package-lock.json
generated
8911
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@kie/git-backporting",
|
||||
"version": "4.8.5",
|
||||
"version": "4.8.4",
|
||||
"description": "Git backporting is a tool to execute automatic pull request git backporting.",
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
|
@ -55,7 +55,7 @@
|
|||
"@gitbeaker/rest": "^39.1.0",
|
||||
"@kie/mock-github": "^1.1.0",
|
||||
"@octokit/webhooks-types": "^6.8.0",
|
||||
"@release-it/conventional-changelog": "^10.0.0",
|
||||
"@release-it/conventional-changelog": "^7.0.0",
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/jest": "^29.2.4",
|
||||
"@types/node": "^18.11.17",
|
||||
|
@ -66,7 +66,7 @@
|
|||
"husky": "^8.0.2",
|
||||
"jest": "^29.0.0",
|
||||
"jest-sonar-reporter": "^2.0.0",
|
||||
"release-it": "^18.1.2",
|
||||
"release-it": "^16.1.3",
|
||||
"semver": "^7.3.8",
|
||||
"ts-jest": "^29.0.0",
|
||||
"ts-node": "^10.8.1",
|
||||
|
|
|
@ -48,9 +48,7 @@ export default class GitLabClient implements GitClient {
|
|||
// example: <host>/api/v4/projects/<namespace>%2Fbackporting-example/merge_requests/1
|
||||
async getPullRequest(namespace: string, repo: string, mrNumber: number, squash: boolean | undefined): Promise<GitPullRequest> {
|
||||
const projectId = this.getProjectId(namespace, repo);
|
||||
const url = `/projects/${projectId}/merge_requests/${mrNumber}`;
|
||||
this.logger.debug(`Fetching pull request ${url}`);
|
||||
const { data } = await this.client.get(`${url}`);
|
||||
const { data } = await this.client.get(`/projects/${projectId}/merge_requests/${mrNumber}`);
|
||||
|
||||
if (squash === undefined) {
|
||||
squash = inferSquash(data.state === "opened", data.squash_commit_sha);
|
||||
|
@ -171,7 +169,7 @@ export default class GitLabClient implements GitClient {
|
|||
const { namespace, project, id } = this.extractMergeRequestData(mrUrl);
|
||||
const projectId = this.getProjectId(namespace, project);
|
||||
|
||||
const { data } = await this.client.post(`/projects/${projectId}/merge_requests/${id}/notes`, {
|
||||
const { data } = await this.client.post(`/projects/${projectId}/issues/${id}/notes`, {
|
||||
body: comment,
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue