All files / packages/sds-release-manager/src/utils templates.ts

100% Statements 5/5
100% Branches 0/0
100% Functions 4/4
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49                      7x 7x             14x           7x         3x                                    
export type BumpBazelPinContext = {
  workItemId: string;
  oldVersion: string;
  newVersion: string;
  targetBranch: string;
  sldsScsPrUrl: string;
  nexusArtifactUrl: string;
};
 
// Branch: t/design-systems-engineering/w-<wi-lower>/slds-scs-<version>
export function generateBranchName(workItemId: string, newVersion: string): string {
  const wi = workItemId.replace(/^W-/i, '').toLowerCase();
  return `t/design-systems-engineering/w-${wi}/slds-scs-${newVersion}`;
}
 
// Commit / PR title: @W-…: bump slds-scs Bazel pin <old> → <new> into p4/<rel>-patch
export function generateCommitMessage(
  ctx: Pick<BumpBazelPinContext, 'workItemId' | 'oldVersion' | 'newVersion' | 'targetBranch'>,
): string {
  return `@${ctx.workItemId}: bump slds-scs Bazel pin ${ctx.oldVersion} → ${ctx.newVersion} into ${ctx.targetBranch}`;
}
 
export function generatePRTitle(
  ctx: Pick<BumpBazelPinContext, 'workItemId' | 'oldVersion' | 'newVersion' | 'targetBranch'>,
): string {
  return generateCommitMessage(ctx);
}
 
// PR body from bump-slds-scs-bazel-pin playbook Step 7
export function generatePRBody(ctx: BumpBazelPinContext): string {
  return `## ChangeLog
 
- bump _SLDS_SCS_VERSION to ${ctx.newVersion}
 
Manual fallback because SFCI's core-deploy didn't auto-bump after slds-scs PR merged. See ${ctx.sldsScsPrUrl}.
 
Nexus: ${ctx.nexusArtifactUrl}
 
---
 
TEXT BELOW THIS LINE WILL BE IGNORED
 
---
 
- Remember to at-mention the GUS work item ID in the PR title.
- If you need to merge your change to a codeline (company-wide) branch, you won't be able to merge this PR from this page, you have to send it through precheckin.
`;
}