renovate 40.0.0-next.14 → 40.0.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/options/index.js +1 -1
- package/dist/config/options/index.js.map +1 -1
- package/dist/modules/manager/fingerprint.generated.js +25 -25
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/index.js +13 -11
- package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/schema.d.ts +75 -0
- package/dist/modules/platform/bitbucket-server/schema.js +14 -1
- package/dist/modules/platform/bitbucket-server/schema.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/types.d.ts +2 -1
- package/dist/modules/platform/bitbucket-server/types.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/utils.d.ts +0 -2
- package/dist/modules/platform/bitbucket-server/utils.js +1 -51
- package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
- package/package.json +3 -3
- package/renovate-schema.json +1 -1
@@ -9,3 +9,78 @@ export declare const UserSchema: z.ZodObject<{
|
|
9
9
|
displayName: string;
|
10
10
|
emailAddress: string;
|
11
11
|
}>;
|
12
|
+
export declare const Comment: z.ZodObject<{
|
13
|
+
text: z.ZodString;
|
14
|
+
id: z.ZodNumber;
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
16
|
+
id: number;
|
17
|
+
text: string;
|
18
|
+
}, {
|
19
|
+
id: number;
|
20
|
+
text: string;
|
21
|
+
}>;
|
22
|
+
export type Comment = z.infer<typeof Comment>;
|
23
|
+
export declare const PullRequestCommentActivity: z.ZodObject<{
|
24
|
+
action: z.ZodLiteral<"COMMENTED">;
|
25
|
+
commentAction: z.ZodString;
|
26
|
+
comment: z.ZodObject<{
|
27
|
+
text: z.ZodString;
|
28
|
+
id: z.ZodNumber;
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
30
|
+
id: number;
|
31
|
+
text: string;
|
32
|
+
}, {
|
33
|
+
id: number;
|
34
|
+
text: string;
|
35
|
+
}>;
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
37
|
+
action: "COMMENTED";
|
38
|
+
comment: {
|
39
|
+
id: number;
|
40
|
+
text: string;
|
41
|
+
};
|
42
|
+
commentAction: string;
|
43
|
+
}, {
|
44
|
+
action: "COMMENTED";
|
45
|
+
comment: {
|
46
|
+
id: number;
|
47
|
+
text: string;
|
48
|
+
};
|
49
|
+
commentAction: string;
|
50
|
+
}>;
|
51
|
+
export type PullRequestCommentActivity = z.infer<typeof PullRequestCommentActivity>;
|
52
|
+
export declare const PullRequestActivity: z.ZodUnion<[z.ZodObject<{
|
53
|
+
action: z.ZodString;
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
55
|
+
action: string;
|
56
|
+
}, {
|
57
|
+
action: string;
|
58
|
+
}>, z.ZodObject<{
|
59
|
+
action: z.ZodLiteral<"COMMENTED">;
|
60
|
+
commentAction: z.ZodString;
|
61
|
+
comment: z.ZodObject<{
|
62
|
+
text: z.ZodString;
|
63
|
+
id: z.ZodNumber;
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
65
|
+
id: number;
|
66
|
+
text: string;
|
67
|
+
}, {
|
68
|
+
id: number;
|
69
|
+
text: string;
|
70
|
+
}>;
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
72
|
+
action: "COMMENTED";
|
73
|
+
comment: {
|
74
|
+
id: number;
|
75
|
+
text: string;
|
76
|
+
};
|
77
|
+
commentAction: string;
|
78
|
+
}, {
|
79
|
+
action: "COMMENTED";
|
80
|
+
comment: {
|
81
|
+
id: number;
|
82
|
+
text: string;
|
83
|
+
};
|
84
|
+
commentAction: string;
|
85
|
+
}>]>;
|
86
|
+
export type PullRequestActivity = z.infer<typeof PullRequestActivity>;
|
@@ -1,9 +1,22 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.UserSchema = void 0;
|
3
|
+
exports.PullRequestActivity = exports.PullRequestCommentActivity = exports.Comment = exports.UserSchema = void 0;
|
4
4
|
const zod_1 = require("zod");
|
5
5
|
exports.UserSchema = zod_1.z.object({
|
6
6
|
displayName: zod_1.z.string(),
|
7
7
|
emailAddress: zod_1.z.string(),
|
8
8
|
});
|
9
|
+
exports.Comment = zod_1.z.object({
|
10
|
+
text: zod_1.z.string(),
|
11
|
+
id: zod_1.z.number(),
|
12
|
+
});
|
13
|
+
exports.PullRequestCommentActivity = zod_1.z.object({
|
14
|
+
action: zod_1.z.literal('COMMENTED'),
|
15
|
+
commentAction: zod_1.z.string(),
|
16
|
+
comment: exports.Comment,
|
17
|
+
});
|
18
|
+
exports.PullRequestActivity = zod_1.z.union([
|
19
|
+
zod_1.z.object({ action: zod_1.z.string() }),
|
20
|
+
exports.PullRequestCommentActivity,
|
21
|
+
]);
|
9
22
|
//# sourceMappingURL=schema.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/platform/bitbucket-server/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC;IACjC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;IACvB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\nexport const UserSchema = z.object({\n displayName: z.string(),\n emailAddress: z.string(),\n});\n"]}
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/platform/bitbucket-server/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC;IACjC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;IACvB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAEU,QAAA,OAAO,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC;AAIU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAC9B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,OAAO,EAAE,eAAO;CACjB,CAAC,CAAC;AAMU,QAAA,mBAAmB,GAAG,OAAC,CAAC,KAAK,CAAC;IACzC,OAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IAChC,kCAA0B;CAC3B,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\nexport const UserSchema = z.object({\n displayName: z.string(),\n emailAddress: z.string(),\n});\n\nexport const Comment = z.object({\n text: z.string(),\n id: z.number(),\n});\n\nexport type Comment = z.infer<typeof Comment>;\n\nexport const PullRequestCommentActivity = z.object({\n action: z.literal('COMMENTED'),\n commentAction: z.string(),\n comment: Comment,\n});\n\nexport type PullRequestCommentActivity = z.infer<\n typeof PullRequestCommentActivity\n>;\n\nexport const PullRequestActivity = z.union([\n z.object({ action: z.string() }),\n PullRequestCommentActivity,\n]);\n\nexport type PullRequestActivity = z.infer<typeof PullRequestActivity>;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../lib/modules/platform/bitbucket-server/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { HTTPError, Response } from 'got';\nimport type { Pr } from '../types';\n\nexport interface BbsConfig {\n bbUseDefaultReviewers: boolean;\n fileList: any[];\n mergeMethod: string;\n owner: string;\n prList: BbsPr[];\n projectKey: string;\n repository: string;\n repositorySlug: string;\n\n prVersions: Map<number, number>;\n ignorePrAuthor: boolean;\n username: string;\n}\n\nexport interface BbsPr extends Pr {\n version?: number;\n}\n\nexport type BbsRestPrState = 'DECLINED' | 'OPEN' | 'MERGED';\n\nexport interface BbsRestBranchRef {\n displayId: string;\n id: string;\n}\n\nexport interface BbsRestUser {\n name: string;\n}\n\nexport interface BbsRestUserRef {\n user: BbsRestUser;\n}\n\nexport interface BbsRestPr {\n createdDate: string;\n description: string;\n fromRef: BbsRestBranchRef;\n id: number;\n reviewers: BbsRestUserRef[];\n state: BbsRestPrState;\n title: string;\n toRef: BbsRestBranchRef;\n version?: number;\n}\n\nexport interface BbsRestRepo {\n id: number;\n project: { key: string };\n origin
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../lib/modules/platform/bitbucket-server/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { HTTPError, Response } from 'got';\nimport type { Pr } from '../types';\n\nexport interface BbsConfig {\n bbUseDefaultReviewers: boolean;\n fileList: any[];\n mergeMethod: string;\n owner: string;\n prList: BbsPr[];\n projectKey: string;\n repository: string;\n repositorySlug: string;\n\n prVersions: Map<number, number>;\n ignorePrAuthor: boolean;\n username: string;\n}\n\nexport interface BbsPr extends Pr {\n version?: number;\n}\n\nexport type BbsRestPrState = 'DECLINED' | 'OPEN' | 'MERGED';\n\nexport interface BbsRestBranchRef {\n displayId: string;\n id: string;\n}\n\nexport interface BbsRestUser {\n name: string;\n}\n\nexport interface BbsRestUserRef {\n user: BbsRestUser;\n}\n\nexport interface BbsRestPr {\n createdDate: string;\n description: string;\n fromRef: BbsRestBranchRef;\n id: number;\n reviewers: BbsRestUserRef[];\n state: BbsRestPrState;\n title: string;\n toRef: BbsRestBranchRef;\n version?: number;\n}\n\nexport interface BbsRestRepo {\n id: number;\n slug: string;\n project: { key: string };\n origin?: { name: string; slug: string }; // only present in forks\n links: {\n clone?: { href: string; name: string }[];\n };\n}\n\nexport interface BbsRestBranch {\n displayId: string;\n}\n\nexport interface BitbucketErrorResponse {\n errors?: {\n exceptionName?: string;\n reviewerErrors?: { context?: string }[];\n }[];\n}\n\nexport interface BitbucketError extends HTTPError {\n readonly response: Response<BitbucketErrorResponse>;\n}\n"]}
|
@@ -1,11 +1,9 @@
|
|
1
1
|
import type { HostRule } from '../../../types';
|
2
2
|
import type { GitOptions } from '../../../types/git';
|
3
|
-
import type { HttpOptions } from '../../../util/http/types';
|
4
3
|
import type { GitUrlOption } from '../types';
|
5
4
|
import type { BbsPr, BbsRestPr, BbsRestRepo, BitbucketError } from './types';
|
6
5
|
export declare const BITBUCKET_INVALID_REVIEWERS_EXCEPTION = "com.atlassian.bitbucket.pull.InvalidPullRequestReviewersException";
|
7
6
|
export declare function prInfo(pr: BbsRestPr): BbsPr;
|
8
|
-
export declare function accumulateValues<T = any>(reqUrl: string, method?: string, options?: HttpOptions, limit?: number): Promise<T[]>;
|
9
7
|
export interface BitbucketCommitStatus {
|
10
8
|
failed: number;
|
11
9
|
inProgress: number;
|
@@ -2,23 +2,20 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.BITBUCKET_INVALID_REVIEWERS_EXCEPTION = void 0;
|
4
4
|
exports.prInfo = prInfo;
|
5
|
-
exports.accumulateValues = accumulateValues;
|
6
5
|
exports.isInvalidReviewersResponse = isInvalidReviewersResponse;
|
7
6
|
exports.getInvalidReviewers = getInvalidReviewers;
|
8
7
|
exports.getRepoGitUrl = getRepoGitUrl;
|
9
8
|
exports.getExtraCloneOpts = getExtraCloneOpts;
|
10
9
|
const tslib_1 = require("tslib");
|
11
10
|
// SEE for the reference https://github.com/renovatebot/renovate/blob/c3e9e572b225085448d94aa121c7ec81c14d3955/lib/platform/bitbucket/utils.js
|
12
|
-
const node_url_1 =
|
11
|
+
const node_url_1 = require("node:url");
|
13
12
|
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
|
14
13
|
const error_messages_1 = require("../../../constants/error-messages");
|
15
14
|
const logger_1 = require("../../../logger");
|
16
15
|
const git = tslib_1.__importStar(require("../../../util/git"));
|
17
|
-
const bitbucket_server_1 = require("../../../util/http/bitbucket-server");
|
18
16
|
const url_1 = require("../../../util/url");
|
19
17
|
const pr_body_1 = require("../pr-body");
|
20
18
|
exports.BITBUCKET_INVALID_REVIEWERS_EXCEPTION = 'com.atlassian.bitbucket.pull.InvalidPullRequestReviewersException';
|
21
|
-
const bitbucketServerHttp = new bitbucket_server_1.BitbucketServerHttp();
|
22
19
|
// https://docs.atlassian.com/bitbucket-server/rest/6.0.0/bitbucket-rest.html#idp250
|
23
20
|
const prStateMapping = {
|
24
21
|
MERGED: 'merged',
|
@@ -37,53 +34,6 @@ function prInfo(pr) {
|
|
37
34
|
createdAt: pr.createdDate,
|
38
35
|
};
|
39
36
|
}
|
40
|
-
const addMaxLength = (inputUrl, limit = 100) => {
|
41
|
-
const { search, ...parsedUrl } = node_url_1.default.parse(inputUrl, true);
|
42
|
-
const maxedUrl = node_url_1.default.format({
|
43
|
-
...parsedUrl,
|
44
|
-
query: { ...parsedUrl.query, limit },
|
45
|
-
});
|
46
|
-
return maxedUrl;
|
47
|
-
};
|
48
|
-
function callApi(apiUrl, method, options) {
|
49
|
-
/* istanbul ignore next */
|
50
|
-
switch (method.toLowerCase()) {
|
51
|
-
case 'post':
|
52
|
-
return bitbucketServerHttp.postJson(apiUrl, options);
|
53
|
-
case 'put':
|
54
|
-
return bitbucketServerHttp.putJson(apiUrl, options);
|
55
|
-
case 'patch':
|
56
|
-
return bitbucketServerHttp.patchJson(apiUrl, options);
|
57
|
-
case 'head':
|
58
|
-
return bitbucketServerHttp.headJson(apiUrl, options);
|
59
|
-
case 'delete':
|
60
|
-
return bitbucketServerHttp.deleteJson(apiUrl, options);
|
61
|
-
case 'get':
|
62
|
-
default:
|
63
|
-
return bitbucketServerHttp.getJsonUnchecked(apiUrl, options);
|
64
|
-
}
|
65
|
-
}
|
66
|
-
async function accumulateValues(reqUrl, method = 'get', options, limit) {
|
67
|
-
let accumulator = [];
|
68
|
-
let nextUrl = addMaxLength(reqUrl, limit);
|
69
|
-
while (typeof nextUrl !== 'undefined') {
|
70
|
-
// TODO: fix typing (#9610)
|
71
|
-
const { body } = await callApi(nextUrl, method, options);
|
72
|
-
accumulator = [...accumulator, ...body.values];
|
73
|
-
if (body.isLastPage !== false) {
|
74
|
-
break;
|
75
|
-
}
|
76
|
-
const { search, ...parsedUrl } = node_url_1.default.parse(nextUrl, true);
|
77
|
-
nextUrl = node_url_1.default.format({
|
78
|
-
...parsedUrl,
|
79
|
-
query: {
|
80
|
-
...parsedUrl.query,
|
81
|
-
start: body.nextPageStart,
|
82
|
-
},
|
83
|
-
});
|
84
|
-
}
|
85
|
-
return accumulator;
|
86
|
-
}
|
87
37
|
function isInvalidReviewersResponse(err) {
|
88
38
|
const errors = err?.response?.body?.errors ?? [];
|
89
39
|
return (errors.length > 0 &&
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../lib/modules/platform/bitbucket-server/utils.ts"],"names":[],"mappings":";;;AA2BA,wBAWC;AAoCD,4CAgCC;AAmBD,gEAQC;AAED,kDAcC;AAkCD,sCA2BC;AAED,8CAOC;;AA3ND,8IAA8I;AAC9I,6DAAoC;AACpC,kEAAkC;AAClC,sEAA+E;AAC/E,4CAAyC;AAGzC,+DAAyC;AACzC,0EAA0E;AAE1E,2CAA6C;AAC7C,wCAA6C;AAIhC,QAAA,qCAAqC,GAChD,mEAAmE,CAAC;AAEtE,MAAM,mBAAmB,GAAG,IAAI,sCAAmB,EAAE,CAAC;AAEtD,oFAAoF;AACpF,MAAM,cAAc,GAAQ;IAC1B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,SAAgB,MAAM,CAAC,EAAa;IAClC,OAAO;QACL,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,MAAM,EAAE,EAAE,CAAC,EAAE;QACb,UAAU,EAAE,IAAA,yBAAe,EAAC,EAAE,CAAC,WAAW,CAAC;QAC3C,YAAY,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS;QAClC,YAAY,EAAE,EAAE,CA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AE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;IAChE,IAAI,MAAM,KAAK,UAAU,IAAI,CAAC,QAAQ,EAAE,CAAC;QACvC,OAAO,uBAAuB,CAAC,eAAe,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACpE,CAAC;IACD,gCAAgC;IAChC,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAAc;IAC9C,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,0CAA0C,IAAI,CAAC,KAAK,EAAE;SAC7D,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["// SEE for the reference https://github.com/renovatebot/renovate/blob/c3e9e572b225085448d94aa121c7ec81c14d3955/lib/platform/bitbucket/utils.js\nimport url, { URL } from 'node:url';\nimport is from '@sindresorhus/is';\nimport { CONFIG_GIT_URL_UNAVAILABLE } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport type { GitOptions, GitProtocol } from '../../../types/git';\nimport * as git from '../../../util/git';\nimport { BitbucketServerHttp } from '../../../util/http/bitbucket-server';\nimport type { HttpOptions, HttpResponse } from '../../../util/http/types';\nimport { parseUrl } from '../../../util/url';\nimport { getPrBodyStruct } from '../pr-body';\nimport type { GitUrlOption } from '../types';\nimport type { BbsPr, BbsRestPr, BbsRestRepo, BitbucketError } from './types';\n\nexport const BITBUCKET_INVALID_REVIEWERS_EXCEPTION =\n 'com.atlassian.bitbucket.pull.InvalidPullRequestReviewersException';\n\nconst bitbucketServerHttp = new BitbucketServerHttp();\n\n// https://docs.atlassian.com/bitbucket-server/rest/6.0.0/bitbucket-rest.html#idp250\nconst prStateMapping: any = {\n MERGED: 'merged',\n DECLINED: 'closed',\n OPEN: 'open',\n};\n\nexport function prInfo(pr: BbsRestPr): BbsPr {\n return {\n version: pr.version,\n number: pr.id,\n bodyStruct: getPrBodyStruct(pr.description),\n sourceBranch: pr.fromRef.displayId,\n targetBranch: pr.toRef.displayId,\n title: pr.title,\n state: prStateMapping[pr.state],\n createdAt: pr.createdDate,\n };\n}\n\nconst addMaxLength = (inputUrl: string, limit = 100): string => {\n const { search, ...parsedUrl } = url.parse(inputUrl, true);\n const maxedUrl = url.format({\n ...parsedUrl,\n query: { ...parsedUrl.query, limit },\n });\n return maxedUrl;\n};\n\nfunction callApi<T>(\n apiUrl: string,\n method: string,\n options?: HttpOptions,\n): Promise<HttpResponse<T>> {\n /* istanbul ignore next */\n switch (method.toLowerCase()) {\n case 'post':\n return bitbucketServerHttp.postJson<T>(apiUrl, options);\n case 'put':\n return bitbucketServerHttp.putJson<T>(apiUrl, options);\n case 'patch':\n return bitbucketServerHttp.patchJson<T>(apiUrl, options);\n case 'head':\n return bitbucketServerHttp.headJson(apiUrl, options) as Promise<\n HttpResponse<T>\n >;\n case 'delete':\n return bitbucketServerHttp.deleteJson<T>(apiUrl, options);\n case 'get':\n default:\n return bitbucketServerHttp.getJsonUnchecked<T>(apiUrl, options);\n }\n}\n\nexport async function accumulateValues<T = any>(\n reqUrl: string,\n method = 'get',\n options?: HttpOptions,\n limit?: number,\n): Promise<T[]> {\n let accumulator: T[] = [];\n let nextUrl = addMaxLength(reqUrl, limit);\n\n while (typeof nextUrl !== 'undefined') {\n // TODO: fix typing (#9610)\n const { body } = await callApi<{\n values: T[];\n isLastPage: boolean;\n nextPageStart: string;\n }>(nextUrl, method, options);\n accumulator = [...accumulator, ...body.values];\n if (body.isLastPage !== false) {\n break;\n }\n\n const { search, ...parsedUrl } = url.parse(nextUrl, true);\n nextUrl = url.format({\n ...parsedUrl,\n query: {\n ...parsedUrl.query,\n start: body.nextPageStart,\n },\n });\n }\n\n return accumulator;\n}\n\nexport interface BitbucketCommitStatus {\n failed: number;\n inProgress: number;\n successful: number;\n}\n\nexport type BitbucketBranchState =\n | 'SUCCESSFUL'\n | 'FAILED'\n | 'INPROGRESS'\n | 'STOPPED';\n\nexport interface BitbucketStatus {\n key: string;\n state: BitbucketBranchState;\n}\n\nexport function isInvalidReviewersResponse(err: BitbucketError): boolean {\n const errors = err?.response?.body?.errors ?? [];\n return (\n errors.length > 0 &&\n errors.every(\n (error) => error.exceptionName === BITBUCKET_INVALID_REVIEWERS_EXCEPTION,\n )\n );\n}\n\nexport function getInvalidReviewers(err: BitbucketError): string[] {\n const errors = err?.response?.body?.errors ?? [];\n let invalidReviewers: string[] = [];\n for (const error of errors) {\n if (error.exceptionName === BITBUCKET_INVALID_REVIEWERS_EXCEPTION) {\n invalidReviewers = invalidReviewers.concat(\n error.reviewerErrors\n ?.map(({ context }) => context)\n .filter(is.nonEmptyString) ?? [],\n );\n }\n }\n\n return invalidReviewers;\n}\n\nfunction generateUrlFromEndpoint(\n defaultEndpoint: string,\n opts: HostRule,\n repository: string,\n): string {\n const url = new URL(defaultEndpoint);\n const generatedUrl = git.getUrl({\n protocol: url.protocol as GitProtocol,\n // TODO: types (#22198)\n auth: `${opts.username}:${opts.password}`,\n host: `${url.host}${url.pathname}${\n url.pathname.endsWith('/') ? '' : /* istanbul ignore next */ '/'\n }scm`,\n repository,\n });\n logger.debug(`Using generated endpoint URL: ${generatedUrl}`);\n return generatedUrl;\n}\n\nfunction injectAuth(url: string, opts: HostRule): string {\n const repoUrl = parseUrl(url)!;\n if (!repoUrl) {\n logger.debug(`Invalid url: ${url}`);\n throw new Error(CONFIG_GIT_URL_UNAVAILABLE);\n }\n if (!opts.token && opts.username && opts.password) {\n repoUrl.username = opts.username;\n repoUrl.password = opts.password;\n }\n return repoUrl.toString();\n}\n\nexport function getRepoGitUrl(\n repository: string,\n defaultEndpoint: string,\n gitUrl: GitUrlOption | undefined,\n info: BbsRestRepo,\n opts: HostRule,\n): string {\n if (gitUrl === 'ssh') {\n const sshUrl = info.links.clone?.find(({ name }) => name === 'ssh');\n if (sshUrl === undefined) {\n throw new Error(CONFIG_GIT_URL_UNAVAILABLE);\n }\n logger.debug(`Using ssh URL: ${sshUrl.href}`);\n return sshUrl.href;\n }\n let cloneUrl = info.links.clone?.find(({ name }) => name === 'http');\n if (cloneUrl) {\n // Inject auth into the API provided URL\n return injectAuth(cloneUrl.href, opts);\n }\n // Http access might be disabled, try to find ssh url in this case\n cloneUrl = info.links.clone?.find(({ name }) => name === 'ssh');\n if (gitUrl === 'endpoint' || !cloneUrl) {\n return generateUrlFromEndpoint(defaultEndpoint, opts, repository);\n }\n // SSH urls can be used directly\n return cloneUrl.href;\n}\n\nexport function getExtraCloneOpts(opts: HostRule): GitOptions {\n if (opts.token) {\n return {\n '-c': `http.extraheader=Authorization: Bearer ${opts.token}`,\n };\n }\n return {};\n}\n"]}
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../lib/modules/platform/bitbucket-server/utils.ts"],"names":[],"mappings":";;;AAuBA,wBAWC;AAmBD,gEAQC;AAED,kDAcC;AAkCD,sCA2BC;AAED,8CAOC;;AAnJD,8IAA8I;AAC9I,uCAA+B;AAC/B,kEAAkC;AAClC,sEAA+E;AAC/E,4CAAyC;AAGzC,+DAAyC;AACzC,2CAA6C;AAC7C,wCAA6C;AAIhC,QAAA,qCAAqC,GAChD,mEAAmE,CAAC;AAEtE,oFAAoF;AACpF,MAAM,cAAc,GAAQ;IAC1B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,SAAgB,MAAM,CAAC,EAAa;IAClC,OAAO;QACL,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,MAAM,EAAE,EAAE,CAAC,EAAE;QACb,UAAU,EAAE,IAAA,yBAAe,EAAC,EAAE,CAAC,WAAW,CAAC;QAC3C,YAAY,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS;QAClC,YAAY,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS;QAChC,KAAK,EAAE,EAAE,CAAC,KAAK;QACf,KAAK,EAAE,cAAc,CAAC,EAA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KAAK,CAAC,kBAAkB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9C,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IACD,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;IACrE,IAAI,QAAQ,EAAE,CAAC;QACb,wCAAwC;QACxC,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IACD,kEAAkE;IAClE,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;IAChE,IAAI,MAAM,KAAK,UAAU,IAAI,CAAC,QAAQ,EAAE,CAAC;QACvC,OAAO,uBAAuB,CAAC,eAAe,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACpE,CAAC;IACD,gCAAgC;IAChC,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAAc;IAC9C,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,0CAA0C,IAAI,CAAC,KAAK,EAAE;SAC7D,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["// SEE for the reference https://github.com/renovatebot/renovate/blob/c3e9e572b225085448d94aa121c7ec81c14d3955/lib/platform/bitbucket/utils.js\nimport { URL } from 'node:url';\nimport is from '@sindresorhus/is';\nimport { CONFIG_GIT_URL_UNAVAILABLE } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport type { GitOptions, GitProtocol } from '../../../types/git';\nimport * as git from '../../../util/git';\nimport { parseUrl } from '../../../util/url';\nimport { getPrBodyStruct } from '../pr-body';\nimport type { GitUrlOption } from '../types';\nimport type { BbsPr, BbsRestPr, BbsRestRepo, BitbucketError } from './types';\n\nexport const BITBUCKET_INVALID_REVIEWERS_EXCEPTION =\n 'com.atlassian.bitbucket.pull.InvalidPullRequestReviewersException';\n\n// https://docs.atlassian.com/bitbucket-server/rest/6.0.0/bitbucket-rest.html#idp250\nconst prStateMapping: any = {\n MERGED: 'merged',\n DECLINED: 'closed',\n OPEN: 'open',\n};\n\nexport function prInfo(pr: BbsRestPr): BbsPr {\n return {\n version: pr.version,\n number: pr.id,\n bodyStruct: getPrBodyStruct(pr.description),\n sourceBranch: pr.fromRef.displayId,\n targetBranch: pr.toRef.displayId,\n title: pr.title,\n state: prStateMapping[pr.state],\n createdAt: pr.createdDate,\n };\n}\n\nexport interface BitbucketCommitStatus {\n failed: number;\n inProgress: number;\n successful: number;\n}\n\nexport type BitbucketBranchState =\n | 'SUCCESSFUL'\n | 'FAILED'\n | 'INPROGRESS'\n | 'STOPPED';\n\nexport interface BitbucketStatus {\n key: string;\n state: BitbucketBranchState;\n}\n\nexport function isInvalidReviewersResponse(err: BitbucketError): boolean {\n const errors = err?.response?.body?.errors ?? [];\n return (\n errors.length > 0 &&\n errors.every(\n (error) => error.exceptionName === BITBUCKET_INVALID_REVIEWERS_EXCEPTION,\n )\n );\n}\n\nexport function getInvalidReviewers(err: BitbucketError): string[] {\n const errors = err?.response?.body?.errors ?? [];\n let invalidReviewers: string[] = [];\n for (const error of errors) {\n if (error.exceptionName === BITBUCKET_INVALID_REVIEWERS_EXCEPTION) {\n invalidReviewers = invalidReviewers.concat(\n error.reviewerErrors\n ?.map(({ context }) => context)\n .filter(is.nonEmptyString) ?? [],\n );\n }\n }\n\n return invalidReviewers;\n}\n\nfunction generateUrlFromEndpoint(\n defaultEndpoint: string,\n opts: HostRule,\n repository: string,\n): string {\n const url = new URL(defaultEndpoint);\n const generatedUrl = git.getUrl({\n protocol: url.protocol as GitProtocol,\n // TODO: types (#22198)\n auth: `${opts.username}:${opts.password}`,\n host: `${url.host}${url.pathname}${\n url.pathname.endsWith('/') ? '' : /* istanbul ignore next */ '/'\n }scm`,\n repository,\n });\n logger.debug(`Using generated endpoint URL: ${generatedUrl}`);\n return generatedUrl;\n}\n\nfunction injectAuth(url: string, opts: HostRule): string {\n const repoUrl = parseUrl(url)!;\n if (!repoUrl) {\n logger.debug(`Invalid url: ${url}`);\n throw new Error(CONFIG_GIT_URL_UNAVAILABLE);\n }\n if (!opts.token && opts.username && opts.password) {\n repoUrl.username = opts.username;\n repoUrl.password = opts.password;\n }\n return repoUrl.toString();\n}\n\nexport function getRepoGitUrl(\n repository: string,\n defaultEndpoint: string,\n gitUrl: GitUrlOption | undefined,\n info: BbsRestRepo,\n opts: HostRule,\n): string {\n if (gitUrl === 'ssh') {\n const sshUrl = info.links.clone?.find(({ name }) => name === 'ssh');\n if (sshUrl === undefined) {\n throw new Error(CONFIG_GIT_URL_UNAVAILABLE);\n }\n logger.debug(`Using ssh URL: ${sshUrl.href}`);\n return sshUrl.href;\n }\n let cloneUrl = info.links.clone?.find(({ name }) => name === 'http');\n if (cloneUrl) {\n // Inject auth into the API provided URL\n return injectAuth(cloneUrl.href, opts);\n }\n // Http access might be disabled, try to find ssh url in this case\n cloneUrl = info.links.clone?.find(({ name }) => name === 'ssh');\n if (gitUrl === 'endpoint' || !cloneUrl) {\n return generateUrlFromEndpoint(defaultEndpoint, opts, repository);\n }\n // SSH urls can be used directly\n return cloneUrl.href;\n}\n\nexport function getExtraCloneOpts(opts: HostRule): GitOptions {\n if (opts.token) {\n return {\n '-c': `http.extraheader=Authorization: Bearer ${opts.token}`,\n };\n }\n return {};\n}\n"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "renovate",
|
3
3
|
"description": "Automated dependency updates. Flexible so you don't need to be.",
|
4
|
-
"version": "40.0.0-next.
|
4
|
+
"version": "40.0.0-next.16",
|
5
5
|
"type": "commonjs",
|
6
6
|
"bin": {
|
7
7
|
"renovate": "dist/renovate.js",
|
@@ -157,7 +157,7 @@
|
|
157
157
|
"@opentelemetry/context-async-hooks": "1.30.1",
|
158
158
|
"@opentelemetry/exporter-trace-otlp-http": "0.57.2",
|
159
159
|
"@opentelemetry/instrumentation": "0.57.2",
|
160
|
-
"@opentelemetry/instrumentation-bunyan": "0.45.
|
160
|
+
"@opentelemetry/instrumentation-bunyan": "0.45.1",
|
161
161
|
"@opentelemetry/instrumentation-http": "0.57.2",
|
162
162
|
"@opentelemetry/resources": "1.30.1",
|
163
163
|
"@opentelemetry/sdk-trace-base": "1.30.1",
|
@@ -192,7 +192,7 @@
|
|
192
192
|
"dequal": "2.0.3",
|
193
193
|
"detect-indent": "6.1.0",
|
194
194
|
"diff": "7.0.0",
|
195
|
-
"editorconfig": "2.0.
|
195
|
+
"editorconfig": "2.0.1",
|
196
196
|
"email-addresses": "5.0.0",
|
197
197
|
"emoji-regex": "10.4.0",
|
198
198
|
"emojibase": "16.0.0",
|
package/renovate-schema.json
CHANGED
@@ -1091,7 +1091,7 @@
|
|
1091
1091
|
"dockerSidecarImage": {
|
1092
1092
|
"description": "Change this value to override the default Renovate sidecar image.",
|
1093
1093
|
"type": "string",
|
1094
|
-
"default": "ghcr.io/containerbase/sidecar:13.8.
|
1094
|
+
"default": "ghcr.io/containerbase/sidecar:13.8.4"
|
1095
1095
|
},
|
1096
1096
|
"dockerUser": {
|
1097
1097
|
"description": "Set the `UID` and `GID` for Docker-based binaries if you use `binarySource=docker`.",
|