MCPcopy Create free account
hub / github.com/angular/dev-infra / cherryPickChangelogIntoNextBranch

Function cherryPickChangelogIntoNextBranch

ng-dev/release/publish/actions.ts:599–636  ·  view source on GitHub ↗

* Cherry-picks the release notes of a version that have been pushed to a given branch * into the `next` primary development branch. A pull request is created for this. * @returns a boolean indicating successful creation of the cherry-pick pull request.

(
    releaseNotes: ReleaseNotes,
    stagingBranch: string,
  )

Source from the content-addressed store, hash-verified

597 );
598
599 return {
600 ...stagingInfo,
601 beforeStagingSha,
602 };
603 }
604
605 /**
606 * Cherry-picks the release notes of a version that have been pushed to a given branch
607 * into the `next` primary development branch. A pull request is created for this.
608 * @returns a boolean indicating successful creation of the cherry-pick pull request.
609 */
610 protected async cherryPickChangelogIntoNextBranch(
611 releaseNotes: ReleaseNotes,
612 stagingBranch: string,
613 ): Promise<boolean> {
614 const nextBranch = this.active.next.branchName;
615 const {version} = releaseNotes;
616 const commitMessage = getReleaseNoteCherryPickCommitMessage(version);
617
618 // Checkout the next branch.
619 await this.checkoutUpstreamBranch(nextBranch);
620
621 await this.prependReleaseNotesToChangelog(releaseNotes);
622
623 const filesToCommit: string[] = [workspaceRelativeChangelogPath];
624
625 await this.createCommit(commitMessage, filesToCommit);
626 Log.info(green(` ✓ Created changelog cherry-pick commit for: "${version}".`));
627
628 // Create a cherry-pick pull request that should be merged by the caretaker.
629 const pullRequest = await this.pushChangesToForkAndCreatePullRequest(
630 nextBranch,
631 `changelog-cherry-pick-${version}`,
632 commitMessage,
633 `Cherry-picks the changelog from the "${stagingBranch}" branch to the next ` +
634 `branch (${nextBranch}).`,
635 );
636
637 Log.info(
638 green(
639 ` ✓ Pull request for cherry-picking the changelog into "${nextBranch}" ` +

Callers

nothing calls this directly

Tested by

no test coverage detected