Skip to content
Snippets Groups Projects
Unverified Commit 9a55d753 authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

feat(onboarding): Semantic onboarding PR (#25666)

parent e9a2da0d
No related branches found
No related tags found
No related merge requests found
...@@ -77,6 +77,23 @@ describe('workers/repository/onboarding/pr/index', () => { ...@@ -77,6 +77,23 @@ describe('workers/repository/onboarding/pr/index', () => {
expect(platform.createPr).toHaveBeenCalledTimes(1); expect(platform.createPr).toHaveBeenCalledTimes(1);
}); });
it('creates semantic PR', async () => {
await ensureOnboardingPr(
{
...config,
semanticCommitType: undefined, // should default to "chore"
semanticCommits: 'enabled',
},
packageFiles,
branches,
);
expect(platform.createPr).toHaveBeenCalledWith(
expect.objectContaining({
prTitle: 'chore: Configure Renovate',
}),
);
});
it('creates PR with labels', async () => { it('creates PR with labels', async () => {
await ensureOnboardingPr( await ensureOnboardingPr(
{ {
......
...@@ -173,10 +173,16 @@ If you need any further assistance then you can also [request help here](${ ...@@ -173,10 +173,16 @@ If you need any further assistance then you can also [request help here](${
logger.info('DRY-RUN: Would create onboarding PR'); logger.info('DRY-RUN: Would create onboarding PR');
} else { } else {
// TODO #22198 // TODO #22198
const prTitle =
config.semanticCommits === 'enabled'
? `${config.semanticCommitType ?? 'chore'}: ${
config.onboardingPrTitle
}`
: config.onboardingPrTitle!;
const pr = await platform.createPr({ const pr = await platform.createPr({
sourceBranch: config.onboardingBranch!, sourceBranch: config.onboardingBranch!,
targetBranch: config.defaultBranch!, targetBranch: config.defaultBranch!,
prTitle: config.onboardingPrTitle!, prTitle,
prBody, prBody,
labels, labels,
platformOptions: getPlatformPrOptions({ platformOptions: getPlatformPrOptions({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment