From 042288e72c11ae6994208f81e3df0fa64d0dfbc5 Mon Sep 17 00:00:00 2001 From: shishu314 Date: Mon, 29 Sep 2025 13:14:53 -0400 Subject: [PATCH] fix(infra)- Add pr number to release branches (#9506) Co-authored-by: Shi Shu --- .github/workflows/release-patch-1-create-pr.yml | 2 +- .github/workflows/release-patch-2-trigger.yml | 8 +++++++- packages/cli/src/ui/AppContainer.tsx | 4 +++- scripts/releasing/create-patch-pr.js | 10 ++++++++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-patch-1-create-pr.yml b/.github/workflows/release-patch-1-create-pr.yml index 6af5dac05e..9f67e11f33 100644 --- a/.github/workflows/release-patch-1-create-pr.yml +++ b/.github/workflows/release-patch-1-create-pr.yml @@ -68,7 +68,7 @@ jobs: run: | # Capture output and display it in logs using tee { - node scripts/releasing/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }} + node scripts/releasing/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --pullRequestNumber=${{ github.event.inputs.original_pr }} --dry-run=${{ github.event.inputs.dry_run }} echo "EXIT_CODE=$?" >> "$GITHUB_OUTPUT" } 2>&1 | tee >( echo "LOG_CONTENT<> "$GITHUB_ENV" diff --git a/.github/workflows/release-patch-2-trigger.yml b/.github/workflows/release-patch-2-trigger.yml index 842a662c4f..4b23c2dc2b 100644 --- a/.github/workflows/release-patch-2-trigger.yml +++ b/.github/workflows/release-patch-2-trigger.yml @@ -32,6 +32,11 @@ on: required: false type: 'boolean' default: false + test_mode: + description: 'Whether or not to run in test mode' + required: false + type: 'boolean' + default: false jobs: trigger-patch-release: @@ -68,5 +73,6 @@ jobs: GITHUB_EVENT_NAME: '${{ github.event_name }}' GITHUB_EVENT_PAYLOAD: '${{ toJSON(github.event) }}' FORCE_SKIP_TESTS: '${{ github.event.inputs.force_skip_tests }}' + TEST_MODE: '${{ github.event.inputs.test_mode }}' run: | - node scripts/releasing/patch-trigger.js + node scripts/releasing/patch-trigger.js --dry-run=${{ github.event.inputs.dry_run }} diff --git a/packages/cli/src/ui/AppContainer.tsx b/packages/cli/src/ui/AppContainer.tsx index 3c40fbad28..55bc26e68a 100644 --- a/packages/cli/src/ui/AppContainer.tsx +++ b/packages/cli/src/ui/AppContainer.tsx @@ -995,7 +995,9 @@ Logging in with Google... Please restart Gemini CLI to continue. if (streamingState === StreamingState.Idle) { title = originalTitleRef.current; } else { - const statusText = thought?.subject?.replace(/[\r\n]+/g, ' ').substring(0, 80); + const statusText = thought?.subject + ?.replace(/[\r\n]+/g, ' ') + .substring(0, 80); title = statusText || originalTitleRef.current; } diff --git a/scripts/releasing/create-patch-pr.js b/scripts/releasing/create-patch-pr.js index 1a32a50b21..8e61c77593 100644 --- a/scripts/releasing/create-patch-pr.js +++ b/scripts/releasing/create-patch-pr.js @@ -18,6 +18,12 @@ async function main() { type: 'string', demandOption: true, }) + .option('pullRequestNumber', { + alias: 'pr', + description: "The pr number that we're cherry picking", + type: 'number', + demandOption: true, + }) .option('channel', { alias: 'ch', description: 'The release channel to patch.', @@ -32,7 +38,7 @@ async function main() { .help() .alias('help', 'h').argv; - const { commit, channel, dryRun } = argv; + const { commit, channel, dryRun, pullRequestNumber } = argv; console.log(`Starting patch process for commit: ${commit}`); console.log(`Targeting channel: ${channel}`); @@ -45,7 +51,7 @@ async function main() { const releaseInfo = getLatestReleaseInfo(channel); const latestTag = releaseInfo.currentTag; - const releaseBranch = `release/${latestTag}`; + const releaseBranch = `release/${latestTag}-pr-${pullRequestNumber}`; const hotfixBranch = `hotfix/${latestTag}/${channel}/cherry-pick-${commit.substring(0, 7)}`; // Create the release branch from the tag if it doesn't exist.