backport 9.6.3 → 9.6.5
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/backportRun.d.ts +1 -1
- package/dist/backportRun.js +3 -1
- package/dist/backportRun.js.map +1 -1
- package/dist/entrypoint.api.d.ts +4 -3
- package/dist/entrypoint.module.private.test.js +5 -5
- package/dist/entrypoint.module.private.test.js.map +1 -1
- package/dist/lib/apm.js +0 -1
- package/dist/lib/apm.js.map +1 -1
- package/dist/lib/cherrypickAndCreateTargetPullRequest/cherrypickAndCreateTargetPullRequest.js +5 -3
- package/dist/lib/cherrypickAndCreateTargetPullRequest/cherrypickAndCreateTargetPullRequest.js.map +1 -1
- package/dist/lib/cherrypickAndCreateTargetPullRequest/getBackportBranchName.js +4 -2
- package/dist/lib/cherrypickAndCreateTargetPullRequest/getBackportBranchName.js.map +1 -1
- package/dist/lib/cherrypickAndCreateTargetPullRequest/getBackportBranchName.test.js +64 -17
- package/dist/lib/cherrypickAndCreateTargetPullRequest/getBackportBranchName.test.js.map +1 -1
- package/dist/lib/github/v3/createStatusComment.js +2 -2
- package/dist/lib/github/v3/createStatusComment.js.map +1 -1
- package/dist/lib/github/v3/getPullRequest/createPullRequest.d.ts +19 -0
- package/dist/lib/github/v3/getPullRequest/createPullRequest.js +68 -0
- package/dist/lib/github/v3/getPullRequest/createPullRequest.js.map +1 -0
- package/dist/lib/github/v3/getPullRequest/getPullRequestBody.d.ts +7 -0
- package/dist/lib/github/v3/getPullRequest/getPullRequestBody.js +61 -0
- package/dist/lib/github/v3/getPullRequest/getPullRequestBody.js.map +1 -0
- package/dist/lib/github/v3/getPullRequest/getPullRequestBody.test.js +421 -0
- package/dist/lib/github/v3/getPullRequest/getPullRequestBody.test.js.map +1 -0
- package/dist/lib/github/v3/getPullRequest/getTitle.d.ts +7 -0
- package/dist/lib/github/v3/getPullRequest/getTitle.js +34 -0
- package/dist/lib/github/v3/getPullRequest/getTitle.js.map +1 -0
- package/dist/lib/github/v3/getPullRequest/getTitle.test.d.ts +1 -0
- package/dist/lib/github/v3/getPullRequest/getTitle.test.js +111 -0
- package/dist/lib/github/v3/getPullRequest/getTitle.test.js.map +1 -0
- package/dist/lib/github/v4/enablePullRequestAutoMerge.mutation.test.js +1 -1
- package/dist/lib/github/v4/enablePullRequestAutoMerge.mutation.test.js.map +1 -1
- package/dist/lib/github/v4/fetchCommits/allFetchers.private.test.js +1 -1
- package/dist/lib/github/v4/fetchCommits/allFetchers.private.test.js.map +1 -1
- package/dist/lib/github/v4/fetchCommits/fetchCommitBySha.private.test.js +1 -1
- package/dist/lib/github/v4/fetchCommits/fetchCommitBySha.private.test.js.map +1 -1
- package/dist/lib/github/v4/fetchExistingPullRequest.d.ts +1 -1
- package/dist/lib/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +3 -2
- package/dist/lib/registerHandlebarsHelpers.d.ts +1 -0
- package/dist/lib/registerHandlebarsHelpers.js +14 -0
- package/dist/lib/registerHandlebarsHelpers.js.map +1 -0
- package/dist/{runSequentially.d.ts → lib/runSequentially.d.ts} +3 -3
- package/dist/{runSequentially.js → lib/runSequentially.js} +5 -5
- package/dist/lib/runSequentially.js.map +1 -0
- package/dist/options/ConfigOptions.d.ts +3 -2
- package/dist/options/cliArgs.d.ts +3 -2
- package/dist/options/cliArgs.js +4 -0
- package/dist/options/cliArgs.js.map +1 -1
- package/dist/options/config/config.d.ts +3 -2
- package/dist/options/options.d.ts +4 -2
- package/dist/options/options.js +8 -4
- package/dist/options/options.js.map +1 -1
- package/dist/options/options.test.js +1 -0
- package/dist/options/options.test.js.map +1 -1
- package/dist/test/e2e/cli/date-filters.private.test.js +3 -3
- package/dist/test/e2e/cli/different-merge-strategies.private.test.js +6 -16
- package/dist/test/e2e/cli/different-merge-strategies.private.test.js.map +1 -1
- package/dist/test/e2e/cli/entrypoint.cli.private.test.js +5 -3
- package/dist/test/e2e/cli/entrypoint.cli.private.test.js.map +1 -1
- package/dist/test/e2e/cli/error-handling-interactive-mode.private.test.js +3 -10
- package/dist/test/e2e/cli/error-handling-interactive-mode.private.test.js.map +1 -1
- package/dist/test/e2e/cli/gracefully-handles-corrupt-repo.private.test.js +2 -2
- package/dist/test/e2e/cli/repo-with-backportrc-removed.private.test.js +1 -1
- package/dist/test/e2e/cli/repo-with-changing-branchLabelMapping.private.test.js +1 -1
- package/dist/test/e2e/cli/test-that-repo-can-be-cloned.private.test.js +3 -8
- package/dist/test/e2e/cli/test-that-repo-can-be-cloned.private.test.js.map +1 -1
- package/dist/test/e2e/module/entrypoint.module.mutation.test.js +1 -1
- package/dist/test/replaceStringAndLinebreaks.d.ts +1 -0
- package/dist/test/replaceStringAndLinebreaks.js +7 -1
- package/dist/test/replaceStringAndLinebreaks.js.map +1 -1
- package/dist/test/setupFiles/automatic-mocks.js +2 -0
- package/dist/test/setupFiles/automatic-mocks.js.map +1 -1
- package/dist/utils/packageVersion.d.ts +1 -1
- package/dist/utils/packageVersion.js +1 -1
- package/package.json +3 -3
- package/yarn.lock +149 -109
- package/dist/lib/github/v3/createPullRequest.d.ts +0 -30
- package/dist/lib/github/v3/createPullRequest.js +0 -123
- package/dist/lib/github/v3/createPullRequest.js.map +0 -1
- package/dist/lib/github/v3/createPullRequest.test.js +0 -527
- package/dist/lib/github/v3/createPullRequest.test.js.map +0 -1
- package/dist/runSequentially.js.map +0 -1
- /package/dist/lib/github/v3/{createPullRequest.test.d.ts → getPullRequest/getPullRequestBody.test.d.ts} +0 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const handlebars_1 = __importDefault(require("handlebars"));
|
|
7
|
+
const getPullRequestBody_1 = require("./getPullRequestBody");
|
|
8
|
+
const commits = [
|
|
9
|
+
{
|
|
10
|
+
sourcePullRequest: {
|
|
11
|
+
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
12
|
+
},
|
|
13
|
+
sourceCommit: {
|
|
14
|
+
sha: 'acbcdef',
|
|
15
|
+
message: 'My commit message (#55)',
|
|
16
|
+
},
|
|
17
|
+
sourceBranch: 'main',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
sourcePullRequest: {
|
|
21
|
+
url: 'https://github.com/backport-org/different-merge-strategies/pull/56',
|
|
22
|
+
},
|
|
23
|
+
sourceCommit: {
|
|
24
|
+
sha: 'hijklmn',
|
|
25
|
+
message: 'Another commit message (#56)',
|
|
26
|
+
},
|
|
27
|
+
sourceBranch: 'main',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
describe('getPullRequestBody', () => {
|
|
31
|
+
describe('template variables should be replaced', () => {
|
|
32
|
+
describe('{{defaultPrDescription}}', () => {
|
|
33
|
+
it('replaces {{defaultPrDescription}}', () => {
|
|
34
|
+
const options = {
|
|
35
|
+
prDescription: '{{defaultPrDescription}}\n\ntext to append',
|
|
36
|
+
};
|
|
37
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '7.x' }))
|
|
38
|
+
.toMatchInlineSnapshot(`
|
|
39
|
+
"# Backport
|
|
40
|
+
|
|
41
|
+
This will backport the following commits from \`main\` to \`7.x\`:
|
|
42
|
+
- [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
43
|
+
- [Another commit message (#56)](https://github.com/backport-org/different-merge-strategies/pull/56)
|
|
44
|
+
|
|
45
|
+
<!--- Backport version: 1.2.3-mocked -->
|
|
46
|
+
|
|
47
|
+
### Questions ?
|
|
48
|
+
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
49
|
+
|
|
50
|
+
text to append"
|
|
51
|
+
`);
|
|
52
|
+
});
|
|
53
|
+
it('replaces {defaultPrDescription} for legacy reasons', () => {
|
|
54
|
+
const options = {
|
|
55
|
+
prDescription: '{defaultPrDescription}\n\ntext to append',
|
|
56
|
+
};
|
|
57
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '7.x' }))
|
|
58
|
+
.toMatchInlineSnapshot(`
|
|
59
|
+
"# Backport
|
|
60
|
+
|
|
61
|
+
This will backport the following commits from \`main\` to \`7.x\`:
|
|
62
|
+
- [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
63
|
+
- [Another commit message (#56)](https://github.com/backport-org/different-merge-strategies/pull/56)
|
|
64
|
+
|
|
65
|
+
<!--- Backport version: 1.2.3-mocked -->
|
|
66
|
+
|
|
67
|
+
### Questions ?
|
|
68
|
+
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
69
|
+
|
|
70
|
+
text to append"
|
|
71
|
+
`);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe('{{commitsStringified}}', () => {
|
|
75
|
+
it('replaces {{commitsStringified}} with a stringifid JSON', () => {
|
|
76
|
+
const options = {
|
|
77
|
+
prDescription: 'Just output the commits: {{commitsStringified}}',
|
|
78
|
+
};
|
|
79
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '7.x' })).toMatchInlineSnapshot(`"Just output the commits: [{"sourcePullRequest":{"url":"https://github.com/backport-org/different-merge-strategies/pull/55"},"sourceCommit":{"sha":"acbcdef","message":"My commit message (#55)"},"sourceBranch":"main"},{"sourcePullRequest":{"url":"https://github.com/backport-org/different-merge-strategies/pull/56"},"sourceCommit":{"sha":"hijklmn","message":"Another commit message (#56)"},"sourceBranch":"main"}]"`);
|
|
80
|
+
});
|
|
81
|
+
it('replaces {commits} for legacy reasons', () => {
|
|
82
|
+
const options = {
|
|
83
|
+
prDescription: 'Just output the commits: {commits}',
|
|
84
|
+
};
|
|
85
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '7.x' })).toMatchInlineSnapshot(`"Just output the commits: [{"sourcePullRequest":{"url":"https://github.com/backport-org/different-merge-strategies/pull/55"},"sourceCommit":{"sha":"acbcdef","message":"My commit message (#55)"},"sourceBranch":"main"},{"sourcePullRequest":{"url":"https://github.com/backport-org/different-merge-strategies/pull/56"},"sourceCommit":{"sha":"hijklmn","message":"Another commit message (#56)"},"sourceBranch":"main"}]"`);
|
|
86
|
+
});
|
|
87
|
+
it('handles curly brackets in commit messages without error', () => {
|
|
88
|
+
const commits = [
|
|
89
|
+
{
|
|
90
|
+
sourceCommit: {
|
|
91
|
+
message: "This is a commit message\nThis is a description with illegal brackets ```\r\nmetadata={{\r\n extraActionsColor: 'text',\r\n }}\r\n```",
|
|
92
|
+
sha: 'mySha',
|
|
93
|
+
},
|
|
94
|
+
sourceBranch: 'main',
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
const options = {
|
|
98
|
+
prDescription: '{defaultPrDescription}\n\n<!--BACKPORT {commits} BACKPORT-->',
|
|
99
|
+
};
|
|
100
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '9.0' }))
|
|
101
|
+
.toMatchInlineSnapshot(`
|
|
102
|
+
"# Backport
|
|
103
|
+
|
|
104
|
+
This will backport the following commits from \`main\` to \`9.0\`:
|
|
105
|
+
- This is a commit message (mySha)
|
|
106
|
+
|
|
107
|
+
<!--- Backport version: 1.2.3-mocked -->
|
|
108
|
+
|
|
109
|
+
### Questions ?
|
|
110
|
+
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
111
|
+
|
|
112
|
+
<!--BACKPORT [{"sourceCommit":{"message":"This is a commit message\\nThis is a description with illegal brackets \`\`\`\\r\\nmetadata={{\\r\\n extraActionsColor: 'text',\\r\\n }}\\r\\n\`\`\`","sha":"mySha"},"sourceBranch":"main"}] BACKPORT-->"
|
|
113
|
+
`);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
describe('{{commitMessages}}', () => {
|
|
117
|
+
it('replaces {{commitMessages}}', () => {
|
|
118
|
+
const options = {
|
|
119
|
+
prDescription: '{{commitMessages}}',
|
|
120
|
+
};
|
|
121
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '7.x' }))
|
|
122
|
+
.toMatchInlineSnapshot(`
|
|
123
|
+
" - [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
124
|
+
- [Another commit message (#56)](https://github.com/backport-org/different-merge-strategies/pull/56)"
|
|
125
|
+
`);
|
|
126
|
+
});
|
|
127
|
+
it('replaces {{commitMessages}} in default PR description', () => {
|
|
128
|
+
const options = {};
|
|
129
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '7.x' }))
|
|
130
|
+
.toMatchInlineSnapshot(`
|
|
131
|
+
"# Backport
|
|
132
|
+
|
|
133
|
+
This will backport the following commits from \`main\` to \`7.x\`:
|
|
134
|
+
- [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
135
|
+
- [Another commit message (#56)](https://github.com/backport-org/different-merge-strategies/pull/56)
|
|
136
|
+
|
|
137
|
+
<!--- Backport version: 1.2.3-mocked -->
|
|
138
|
+
|
|
139
|
+
### Questions ?
|
|
140
|
+
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)"
|
|
141
|
+
`);
|
|
142
|
+
});
|
|
143
|
+
it('handles curly brackets in commit message without error', () => {
|
|
144
|
+
const commits = [
|
|
145
|
+
{
|
|
146
|
+
sourceCommit: {
|
|
147
|
+
message: "```metadata={{ extraActionsColor: 'text',\r\n }}\r\n```",
|
|
148
|
+
sha: 'mySha',
|
|
149
|
+
},
|
|
150
|
+
sourceBranch: 'main',
|
|
151
|
+
},
|
|
152
|
+
];
|
|
153
|
+
const options = {
|
|
154
|
+
prDescription: '{defaultPrDescription}\n\n<!--BACKPORT {commits} BACKPORT-->',
|
|
155
|
+
};
|
|
156
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '9.0' }))
|
|
157
|
+
.toMatchInlineSnapshot(`
|
|
158
|
+
"# Backport
|
|
159
|
+
|
|
160
|
+
This will backport the following commits from \`main\` to \`9.0\`:
|
|
161
|
+
- \`\`\`metadata={{ extraActionsColor: 'text',
|
|
162
|
+
(mySha)
|
|
163
|
+
|
|
164
|
+
<!--- Backport version: 1.2.3-mocked -->
|
|
165
|
+
|
|
166
|
+
### Questions ?
|
|
167
|
+
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
|
|
168
|
+
|
|
169
|
+
<!--BACKPORT [{"sourceCommit":{"message":"\`\`\`metadata={{ extraActionsColor: 'text',\\r\\n }}\\r\\n\`\`\`","sha":"mySha"},"sourceBranch":"main"}] BACKPORT-->"
|
|
170
|
+
`);
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
describe('{{packageVersion}}', () => {
|
|
174
|
+
it('replaces {{PACKAGE_VERSION}}', () => {
|
|
175
|
+
const body = (0, getPullRequestBody_1.getPullRequestBody)({
|
|
176
|
+
options: {},
|
|
177
|
+
commits,
|
|
178
|
+
targetBranch: 'release',
|
|
179
|
+
});
|
|
180
|
+
expect(body).toContain('Backport version: 1.2.3-mocked');
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
describe('{{commits}}', () => {
|
|
184
|
+
it('should render commits using Handlebars #each helper', () => {
|
|
185
|
+
const options = {
|
|
186
|
+
prDescription: '{{#each commits}} - {{shortSha this.sourceCommit.sha}} {{this.sourceCommit.message}}\n{{/each}}',
|
|
187
|
+
};
|
|
188
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '7.x' }))
|
|
189
|
+
.toMatchInlineSnapshot(`
|
|
190
|
+
" - acbcdef My commit message (#55)
|
|
191
|
+
- hijklmn Another commit message (#56)
|
|
192
|
+
"
|
|
193
|
+
`);
|
|
194
|
+
});
|
|
195
|
+
it('should handle curly brackets in commits message', () => {
|
|
196
|
+
const commits = [
|
|
197
|
+
{
|
|
198
|
+
sourceCommit: {
|
|
199
|
+
message: "This is a commit message\nThis is a description with illegal brackets ```\r\nmetadata={{\r\n extraActionsColor: 'text',\r\n }}\r\n```",
|
|
200
|
+
sha: 'mySha',
|
|
201
|
+
},
|
|
202
|
+
sourceBranch: 'main',
|
|
203
|
+
},
|
|
204
|
+
];
|
|
205
|
+
const options = {
|
|
206
|
+
prDescription: '{{#each commits}} - {{shortSha this.sourceCommit.sha}} {{this.sourceCommit.message}}\n{{/each}}',
|
|
207
|
+
};
|
|
208
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '7.x' }))
|
|
209
|
+
.toMatchInlineSnapshot(`
|
|
210
|
+
" - mySha This is a commit message
|
|
211
|
+
This is a description with illegal brackets \`\`\`
|
|
212
|
+
metadata={{
|
|
213
|
+
extraActionsColor: 'text',
|
|
214
|
+
}}
|
|
215
|
+
\`\`\`
|
|
216
|
+
"
|
|
217
|
+
`);
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
describe('custom templates', () => {
|
|
222
|
+
it('should support prodfiler team format', () => {
|
|
223
|
+
const commits = [
|
|
224
|
+
{
|
|
225
|
+
sourceCommit: {
|
|
226
|
+
sha: '9e42503a7d0e06e60c575ed2c3b7dc3e5df0dd5c',
|
|
227
|
+
message: 'My commit message (#55)',
|
|
228
|
+
},
|
|
229
|
+
sourcePullRequest: {
|
|
230
|
+
number: 123,
|
|
231
|
+
title: 'Original PR title',
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
sourceCommit: {
|
|
236
|
+
sha: '5ce6c3fb9525426d66a85eba057e1214f5f52995',
|
|
237
|
+
message: 'Another commit message',
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
];
|
|
241
|
+
const options = {
|
|
242
|
+
prDescription: `Backport #{{commits.0.sourcePullRequest.number}}: {{commits.0.sourcePullRequest.title}}
|
|
243
|
+
|
|
244
|
+
{{#each commits}}{{shortSha this.sourceCommit.sha}} {{this.sourceCommit.message}}\n{{/each}}`,
|
|
245
|
+
};
|
|
246
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '7.x' }))
|
|
247
|
+
.toMatchInlineSnapshot(`
|
|
248
|
+
"Backport #123: Original PR title
|
|
249
|
+
|
|
250
|
+
9e42503a My commit message (#55)
|
|
251
|
+
5ce6c3fb Another commit message
|
|
252
|
+
"
|
|
253
|
+
`);
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
describe('commit message formatting', () => {
|
|
257
|
+
it('when single pull request is backported', () => {
|
|
258
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({
|
|
259
|
+
options: {},
|
|
260
|
+
commits: [
|
|
261
|
+
{
|
|
262
|
+
sourcePullRequest: {
|
|
263
|
+
title: 'My PR Title',
|
|
264
|
+
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
265
|
+
},
|
|
266
|
+
sourceCommit: {
|
|
267
|
+
sha: 'abcdefghi',
|
|
268
|
+
message: 'My commit message (#55)',
|
|
269
|
+
},
|
|
270
|
+
sourceBranch: 'master',
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
targetBranch: '7.x',
|
|
274
|
+
})).toMatchInlineSnapshot(`
|
|
275
|
+
"# Backport
|
|
276
|
+
|
|
277
|
+
This will backport the following commits from \`master\` to \`7.x\`:
|
|
278
|
+
- [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
279
|
+
|
|
280
|
+
<!--- Backport version: 1.2.3-mocked -->
|
|
281
|
+
|
|
282
|
+
### Questions ?
|
|
283
|
+
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)"
|
|
284
|
+
`);
|
|
285
|
+
});
|
|
286
|
+
it('when a single commit (non pull request) is backported', () => {
|
|
287
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({
|
|
288
|
+
options: {},
|
|
289
|
+
commits: [
|
|
290
|
+
{
|
|
291
|
+
sourceCommit: {
|
|
292
|
+
sha: 'abcdefghijklmw',
|
|
293
|
+
message: 'My commit message',
|
|
294
|
+
},
|
|
295
|
+
sourceBranch: 'main',
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
targetBranch: '7.x',
|
|
299
|
+
})).toMatchInlineSnapshot(`
|
|
300
|
+
"# Backport
|
|
301
|
+
|
|
302
|
+
This will backport the following commits from \`main\` to \`7.x\`:
|
|
303
|
+
- My commit message (abcdefgh)
|
|
304
|
+
|
|
305
|
+
<!--- Backport version: 1.2.3-mocked -->
|
|
306
|
+
|
|
307
|
+
### Questions ?
|
|
308
|
+
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)"
|
|
309
|
+
`);
|
|
310
|
+
});
|
|
311
|
+
it('when multiple commits are backported', () => {
|
|
312
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({
|
|
313
|
+
options: {},
|
|
314
|
+
commits: [
|
|
315
|
+
{
|
|
316
|
+
sourcePullRequest: {
|
|
317
|
+
number: 55,
|
|
318
|
+
title: 'My PR Title',
|
|
319
|
+
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
320
|
+
},
|
|
321
|
+
sourceCommit: {
|
|
322
|
+
sha: 'abcdefghijklm',
|
|
323
|
+
message: 'My commit message (#55)',
|
|
324
|
+
},
|
|
325
|
+
sourceBranch: 'main',
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
sourceCommit: {
|
|
329
|
+
sha: 'qwertyuiop',
|
|
330
|
+
message: 'Another commit message',
|
|
331
|
+
},
|
|
332
|
+
sourceBranch: 'main',
|
|
333
|
+
},
|
|
334
|
+
],
|
|
335
|
+
targetBranch: '7.x',
|
|
336
|
+
})).toMatchInlineSnapshot(`
|
|
337
|
+
"# Backport
|
|
338
|
+
|
|
339
|
+
This will backport the following commits from \`main\` to \`7.x\`:
|
|
340
|
+
- [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
341
|
+
- Another commit message (qwertyui)
|
|
342
|
+
|
|
343
|
+
<!--- Backport version: 1.2.3-mocked -->
|
|
344
|
+
|
|
345
|
+
### Questions ?
|
|
346
|
+
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)"
|
|
347
|
+
`);
|
|
348
|
+
});
|
|
349
|
+
it('when a PR is merged (instead of squashed) and the individual commits are selected', () => {
|
|
350
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({
|
|
351
|
+
options: {},
|
|
352
|
+
commits: [
|
|
353
|
+
{
|
|
354
|
+
sourceCommit: {
|
|
355
|
+
message: 'Merge strategy: Second commit',
|
|
356
|
+
sha: 'e8df5eaa4db7b94474b48e2320b02d33a830d9fb',
|
|
357
|
+
},
|
|
358
|
+
sourcePullRequest: {
|
|
359
|
+
number: 1,
|
|
360
|
+
title: 'My PR Title',
|
|
361
|
+
url: 'https://github.com/backport-org/different-merge-strategies/pull/1',
|
|
362
|
+
},
|
|
363
|
+
sourceBranch: 'main',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
sourceCommit: {
|
|
367
|
+
message: 'Merge strategy: First commit',
|
|
368
|
+
sha: '5411b1c1144093e422220008f23f2c2b909ed113',
|
|
369
|
+
},
|
|
370
|
+
sourcePullRequest: {
|
|
371
|
+
number: 1,
|
|
372
|
+
title: 'My PR Title',
|
|
373
|
+
url: 'https://github.com/backport-org/different-merge-strategies/pull/1',
|
|
374
|
+
},
|
|
375
|
+
sourceBranch: 'main',
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
targetBranch: '7.x',
|
|
379
|
+
})).toMatchInlineSnapshot(`
|
|
380
|
+
"# Backport
|
|
381
|
+
|
|
382
|
+
This will backport the following commits from \`main\` to \`7.x\`:
|
|
383
|
+
- [Merge strategy: Second commit](https://github.com/backport-org/different-merge-strategies/pull/1)
|
|
384
|
+
- [Merge strategy: First commit](https://github.com/backport-org/different-merge-strategies/pull/1)
|
|
385
|
+
|
|
386
|
+
<!--- Backport version: 1.2.3-mocked -->
|
|
387
|
+
|
|
388
|
+
### Questions ?
|
|
389
|
+
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)"
|
|
390
|
+
`);
|
|
391
|
+
});
|
|
392
|
+
});
|
|
393
|
+
describe('handlebars', () => {
|
|
394
|
+
it('should return default description if handlebars compilation fails', () => {
|
|
395
|
+
const compileError = new Error('Simulated compile error');
|
|
396
|
+
// Stub Handlebars.compile to throw an error.
|
|
397
|
+
const compileSpy = jest
|
|
398
|
+
.spyOn(handlebars_1.default, 'compile')
|
|
399
|
+
.mockImplementation(() => {
|
|
400
|
+
throw compileError;
|
|
401
|
+
});
|
|
402
|
+
const options = {};
|
|
403
|
+
expect((0, getPullRequestBody_1.getPullRequestBody)({ options, commits, targetBranch: '7.x' }))
|
|
404
|
+
.toMatchInlineSnapshot(`
|
|
405
|
+
"# Backport
|
|
406
|
+
|
|
407
|
+
This will backport the following commits from \`main\` to \`7.x\`:
|
|
408
|
+
- [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
409
|
+
- [Another commit message (#56)](https://github.com/backport-org/different-merge-strategies/pull/56)
|
|
410
|
+
|
|
411
|
+
<!--- Backport version: 1.2.3-mocked -->
|
|
412
|
+
|
|
413
|
+
### Questions ?
|
|
414
|
+
Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)"
|
|
415
|
+
`);
|
|
416
|
+
// Restore the stubs.
|
|
417
|
+
compileSpy.mockRestore();
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
});
|
|
421
|
+
//# sourceMappingURL=getPullRequestBody.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPullRequestBody.test.js","sourceRoot":"","sources":["../../../../../src/lib/github/v3/getPullRequest/getPullRequestBody.test.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AAGpC,6DAA0D;AAE1D,MAAM,OAAO,GAAG;IACd;QACE,iBAAiB,EAAE;YACjB,GAAG,EAAE,oEAAoE;SAC1E;QACD,YAAY,EAAE;YACZ,GAAG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E;gBACvB,MAAM,YAAY,CAAC;YACrB,CAAC,CAAC,CAAC;YAEL,MAAM,OAAO,GAAG,EAAwB,CAAC;YAEzC,MAAM,CAAC,IAAA,uCAAkB,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;iBAClE,qBAAqB,CAAC;;;;;;;;;;;CAW9B,CAAC,CAAC;YAEG,qBAAqB;YACrB,UAAU,CAAC,WAAW,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ValidConfigOptions } from '../../../../options/options';
|
|
2
|
+
import { Commit } from '../../../sourceCommit/parseSourceCommit';
|
|
3
|
+
export declare function getTitle({ options, commits, targetBranch, }: {
|
|
4
|
+
options: ValidConfigOptions;
|
|
5
|
+
commits: Commit[];
|
|
6
|
+
targetBranch: string;
|
|
7
|
+
}): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getTitle = void 0;
|
|
7
|
+
const handlebars_1 = __importDefault(require("handlebars"));
|
|
8
|
+
const getSourceBranchFromCommits_1 = require("../../../getSourceBranchFromCommits");
|
|
9
|
+
const logger_1 = require("../../../logger");
|
|
10
|
+
const commitFormatters_1 = require("../../commitFormatters");
|
|
11
|
+
function getTitle({ options, commits, targetBranch, }) {
|
|
12
|
+
const sourceBranch = (0, getSourceBranchFromCommits_1.getSourceBranchFromCommits)(commits);
|
|
13
|
+
const commitMessages = commits
|
|
14
|
+
.map((c) => (0, commitFormatters_1.getFirstLine)(c.sourceCommit.message))
|
|
15
|
+
.join(' | ');
|
|
16
|
+
const defaultPrTitle = '[{{targetBranch}}] {{commitMessages}}';
|
|
17
|
+
const prTitle = (options.prTitle ?? defaultPrTitle)
|
|
18
|
+
.replaceAll('{{commitMessages}}', `{{{{raw}}}}${commitMessages}{{{{/raw}}}}`)
|
|
19
|
+
.replaceAll('{{targetBranch}}', targetBranch)
|
|
20
|
+
.replaceAll('{{sourceBranch}}', sourceBranch);
|
|
21
|
+
try {
|
|
22
|
+
const template = handlebars_1.default.compile(prTitle, { noEscape: true });
|
|
23
|
+
return template({
|
|
24
|
+
sourcePullRequest: commits[0].sourcePullRequest, // assume that all commits are from the same PR
|
|
25
|
+
commits,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
logger_1.logger.error('Error while compiling PR title template', error);
|
|
30
|
+
return prTitle.replaceAll('{{{{raw}}}}', '').replaceAll('{{{{/raw}}}}', '');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.getTitle = getTitle;
|
|
34
|
+
//# sourceMappingURL=getTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTitle.js","sourceRoot":"","sources":["../../../../../src/lib/github/v3/getPullRequest/getTitle.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAoC;AAEpC,oFAAiF;AACjF,4CAAyC;AAEzC,6DAAsD;AAEtD,SAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,OAAO,EACP,YAAY,GAKb;IACC,MAAM,YAAY,GAAG,IAAA,uDAA0B,EAAC,OAAO,CAAC,CAAC;IACzD,MAAM,cAAc,GAAG,OAAO;SAC3B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,+BAAY,EAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SAChD,IAAI,CAAC,KAAK,CAAC,CAAC;IAEf,MAAM,cAAc,GAAG,uCAAuC,CAAC;IAE/D,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC;SAChD,UAAU,CACT,oBAAoB,EACpB,cAAc,cAAc,cAAc,CAC3C;SACA,UAAU,CAAC,kBAAkB,EAAE,YAAY,CAAC;SAC5C,UAAU,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;IAEhD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,oBAAU,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACjE,OAAO,QAAQ,CAAC;YACd,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAiB,EAAE,+CAA+C;YAChG,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAM,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;QAC/D,OAAO,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC;AAlCD,4BAkCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const handlebars_1 = __importDefault(require("handlebars"));
|
|
7
|
+
const getTitle_1 = require("./getTitle");
|
|
8
|
+
describe('getTitle', () => {
|
|
9
|
+
const commits = [
|
|
10
|
+
{
|
|
11
|
+
sourceBranch: 'main',
|
|
12
|
+
sourcePullRequest: {
|
|
13
|
+
title: 'My PR Title',
|
|
14
|
+
number: 55,
|
|
15
|
+
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
16
|
+
},
|
|
17
|
+
sourceCommit: {
|
|
18
|
+
sha: 'abcdefghi',
|
|
19
|
+
message: 'My commit message (#55)',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
sourcePullRequest: {
|
|
24
|
+
number: 56,
|
|
25
|
+
title: 'My PR Title',
|
|
26
|
+
url: 'https://github.com/backport-org/different-merge-strategies/pull/56',
|
|
27
|
+
},
|
|
28
|
+
sourceCommit: {
|
|
29
|
+
sha: 'jklmnopqr',
|
|
30
|
+
message: 'Another commit message (#56)',
|
|
31
|
+
},
|
|
32
|
+
sourceBranch: 'main',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
it('has the default title', () => {
|
|
36
|
+
const options = {};
|
|
37
|
+
expect((0, getTitle_1.getTitle)({ options, commits, targetBranch: '7.x' })).toEqual('[7.x] My commit message (#55) | Another commit message (#56)');
|
|
38
|
+
});
|
|
39
|
+
it('renders title with the original PR title', () => {
|
|
40
|
+
const options = {
|
|
41
|
+
prTitle: '[{{targetBranch}}] {{sourcePullRequest.title}}',
|
|
42
|
+
};
|
|
43
|
+
expect((0, getTitle_1.getTitle)({ options, commits, targetBranch: '7.x' })).toEqual('[7.x] My PR Title');
|
|
44
|
+
});
|
|
45
|
+
it('renders title using a specific commit', () => {
|
|
46
|
+
const options = {
|
|
47
|
+
prTitle: '[{{targetBranch}}] {{commits.0.sourcePullRequest.title}}',
|
|
48
|
+
};
|
|
49
|
+
expect((0, getTitle_1.getTitle)({ options, commits, targetBranch: '7.x' })).toEqual('[7.x] My PR Title');
|
|
50
|
+
});
|
|
51
|
+
it('renders title using {{commitMessages}}', () => {
|
|
52
|
+
const options = {
|
|
53
|
+
prTitle: 'Branch: "{{targetBranch}}". Messages: {{commitMessages}}',
|
|
54
|
+
};
|
|
55
|
+
expect((0, getTitle_1.getTitle)({ options, commits, targetBranch: '7.x' })).toEqual('Branch: "7.x". Messages: My commit message (#55) | Another commit message (#56)');
|
|
56
|
+
});
|
|
57
|
+
it('support backticks', () => {
|
|
58
|
+
const options = {
|
|
59
|
+
prTitle: '[{{targetBranch}}] {{commitMessages}}',
|
|
60
|
+
};
|
|
61
|
+
const commits = [
|
|
62
|
+
{
|
|
63
|
+
sourceBranch: 'main',
|
|
64
|
+
sourcePullRequest: {
|
|
65
|
+
title: 'My PR Title',
|
|
66
|
+
number: 55,
|
|
67
|
+
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
68
|
+
},
|
|
69
|
+
sourceCommit: {
|
|
70
|
+
sha: 'abcdefghi',
|
|
71
|
+
message: 'My commit message with `backticks` (#55)',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
expect((0, getTitle_1.getTitle)({ options, commits, targetBranch: '7.x' })).toEqual('[7.x] My commit message with `backticks` (#55)');
|
|
76
|
+
});
|
|
77
|
+
it('does not break on curly brackets', () => {
|
|
78
|
+
const options = {
|
|
79
|
+
prTitle: '[{{targetBranch}}] {{commitMessages}}',
|
|
80
|
+
};
|
|
81
|
+
const commits = [
|
|
82
|
+
{
|
|
83
|
+
sourceBranch: 'main',
|
|
84
|
+
sourcePullRequest: {
|
|
85
|
+
title: 'My PR Title',
|
|
86
|
+
number: 55,
|
|
87
|
+
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
88
|
+
},
|
|
89
|
+
sourceCommit: {
|
|
90
|
+
sha: 'abcdefghi',
|
|
91
|
+
message: "```metadata={{ extraActionsColor: 'text',\r\n }}\r\n```",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
expect(() => (0, getTitle_1.getTitle)({ options, commits, targetBranch: '7.x' })).not.toThrow();
|
|
96
|
+
});
|
|
97
|
+
it('should return default description if handlebars compilation fails', () => {
|
|
98
|
+
const compileError = new Error('Simulated compile error');
|
|
99
|
+
// Stub Handlebars.compile to throw an error.
|
|
100
|
+
const compileSpy = jest
|
|
101
|
+
.spyOn(handlebars_1.default, 'compile')
|
|
102
|
+
.mockImplementation(() => {
|
|
103
|
+
throw compileError;
|
|
104
|
+
});
|
|
105
|
+
const options = {};
|
|
106
|
+
expect((0, getTitle_1.getTitle)({ options, commits, targetBranch: '7.x' })).toMatchInlineSnapshot(`"[7.x] My commit message (#55) | Another commit message (#56)"`);
|
|
107
|
+
// Restore the stubs.
|
|
108
|
+
compileSpy.mockRestore();
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=getTitle.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTitle.test.js","sourceRoot":"","sources":["../../../../../src/lib/github/v3/getPullRequest/getTitle.test.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AAGpC,yCAAsC;AAEtC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,MAAM,OAAO,GAAG;QACd;YACE,YAAY,EAAE,MAAM;YACpB,iBAAiB,EAAE;gBACjB,KAAK,EAAE,aAAa;gBACpB,MAAM,EAAE,EAAE;gBACV,GAAG,EAAE,oEAAoE;aAC1E;YACD,YAAY,EAAE;gBACZ,GAAG,EAAE,WAAW;gBAChB,OAAO,EAAE,yBAAyB;aACnC;SACF;QACD;YACE,iBAAiB,EAAE;gBACjB,MAAM,EAAE,EAAE;gBACV,KAAK,EAAE,aAAa;gBACpB,GAAG,EAAE,oEAAoE;aAC1E;YACD,YAAY,EAAE;gBACZ,GAAG,EAAE,WAAW;gBAChB,OAAO,EAAE,8BAA8B;aACxC;YACD,YAAY,EAAE,MAAM;SACrB;KACU,CAAC;IAEd,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,OAAO,GAAG,EAAwB,CAAC;QACzC,MAAM,CAAC,IAAA,mBAAQ,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CACjE,8DAA8D,CAC/D,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,OAAO,GAAG;YACd,OAA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Default(require("crypto"));
|
|
7
7
|
const rest_1 = require("@octokit/rest");
|
|
8
8
|
const getDevAccessToken_1 = require("../../../test/private/getDevAccessToken");
|
|
9
|
-
const createPullRequest_1 = require("../v3/createPullRequest");
|
|
9
|
+
const createPullRequest_1 = require("../v3/getPullRequest/createPullRequest");
|
|
10
10
|
const disablePullRequestAutoMerge_1 = require("./disablePullRequestAutoMerge");
|
|
11
11
|
const enablePullRequestAutoMerge_1 = require("./enablePullRequestAutoMerge");
|
|
12
12
|
const fetchPullRequestAutoMergeMethod_1 = require("./fetchPullRequestAutoMergeMethod");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enablePullRequestAutoMerge.mutation.test.js","sourceRoot":"","sources":["../../../../src/lib/github/v4/enablePullRequestAutoMerge.mutation.test.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,wCAAwC;AAExC,+EAA4E;AAC5E
|
|
1
|
+
{"version":3,"file":"enablePullRequestAutoMerge.mutation.test.js","sourceRoot":"","sources":["../../../../src/lib/github/v4/enablePullRequestAutoMerge.mutation.test.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,wCAAwC;AAExC,+EAA4E;AAC5E,8EAGgD;AAEhD,+EAA4E;AAC5E,6EAGsC;AACtC,uFAAoF;AAEpF,yHAAyH;AACzH,qHAAqH;AACrH,2DAA2D;AAC3D,MAAM,eAAe,GAAG,cAAc,CAAC;AACvC,MAAM,cAAc,GAAG,8BAA8B,CAAC;AACtD,MAAM,WAAW,GAAG,0CAA0C,CAAC;AAC/D,MAAM,WAAW,GAAG,IAAA,qCAAiB,GAAE,CAAC;AAExC,IAAI,CAAC,UAAU,CAAC,KAAM,CAAC,CAAC;AAExB,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAEhF,SAAS,cAA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