Skip to content

Commit e153015

Browse files
committed
go
2 parents 0c6145f + cb8f93b commit e153015

File tree

160 files changed

+4701
-2391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+4701
-2391
lines changed

.github/workflows/deflake.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Deflake E2E'
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch_ref:
7+
description: 'Branch to run on'
8+
required: true
9+
default: 'main'
10+
type: 'string'
11+
test_name_pattern:
12+
description: 'The test name pattern to use'
13+
required: false
14+
type: 'string'
15+
runs:
16+
description: 'The number of runs'
17+
required: false
18+
default: 5
19+
type: 'number'
20+
21+
concurrency:
22+
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
23+
cancel-in-progress: |-
24+
${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release/') }}
25+
26+
jobs:
27+
deflake:
28+
name: 'Deflake'
29+
runs-on: 'gemini-cli-ubuntu-16-core'
30+
strategy:
31+
fail-fast: false
32+
steps:
33+
- name: 'Deflake'
34+
shell: 'bash'
35+
run: |
36+
ECHO 'DEFLAKE WORKFLOW'

.github/workflows/eval.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
steps:
3434
- name: 'Authenticate to Google Cloud'
3535
id: 'auth'
36-
uses: 'google-github-actions/auth@v2' # ratchet:exclude
36+
uses: 'google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed' # ratchet:exclude pin@v2.1.7
3737
with:
3838
project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}'
3939
workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'

.github/workflows/gemini-automated-issue-triage.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ jobs:
7070
- name: 'Check for triage label on manual trigger'
7171
if: |-
7272
github.event_name == 'workflow_dispatch' && !contains(steps.get_issue_data.outputs.labels, 'status/need-triage')
73+
env:
74+
ISSUE_NUMBER_INPUT: '${{ github.event.inputs.issue_number }}'
7375
run: |
74-
echo "Issue #${{ github.event.inputs.issue_number }} does not have the 'status/need-triage' label. Stopping workflow."
76+
echo "Issue #${ISSUE_NUMBER_INPUT} does not have the 'status/need-triage' label. Stopping workflow."
7577
exit 1
7678
7779
- name: 'Checkout'

.github/workflows/release-manual.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ jobs:
8585
- name: 'Prepare Release Info'
8686
id: 'release_info'
8787
working-directory: './release'
88+
env:
89+
INPUT_VERSION: '${{ github.event.inputs.version }}'
8890
run: |
89-
RELEASE_VERSION="${{ github.event.inputs.version }}"
91+
RELEASE_VERSION="${INPUT_VERSION}"
9092
echo "RELEASE_VERSION=${RELEASE_VERSION#v}" >> "${GITHUB_OUTPUT}"
9193
echo "PREVIOUS_TAG=$(git describe --tags --abbrev=0)" >> "${GITHUB_OUTPUT}"
9294

.github/workflows/release-nightly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Release: Nightly'
22

33
on:
44
schedule:
5-
- cron: '0 0 * * *'
5+
- cron: '0 19 * * *'
66
workflow_dispatch:
77
inputs:
88
dry_run:
@@ -137,7 +137,7 @@ jobs:
137137
a2a-package-name: '${{ vars.A2A_PACKAGE_NAME }}'
138138

139139
- name: 'Create and Merge Pull Request'
140-
if: "github.event.inputs.environment == 'prod'"
140+
if: "github.event.inputs.environment != 'dev'"
141141
uses: './.github/actions/create-pull-request'
142142
with:
143143
branch-name: 'release/${{ steps.nightly_version.outputs.RELEASE_TAG }}'
@@ -148,7 +148,7 @@ jobs:
148148
working-directory: './release'
149149

150150
- name: 'Create Issue on Failure'
151-
if: "${{ failure() && github.event.inputs.environment == 'prod' && (github.event_name == 'schedule' || github.event.inputs.dry_run != 'true') }}"
151+
if: "${{ failure() && github.event.inputs.environment != 'dev' && (github.event_name == 'schedule' || github.event.inputs.dry_run != 'true') }}"
152152
env:
153153
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
154154
RELEASE_TAG: '${{ steps.nightly_version.outputs.RELEASE_TAG }}'

.github/workflows/release-patch-0-from-comment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ jobs:
8989
inputs: {
9090
commit: '${{ steps.pr_status.outputs.MERGE_COMMIT_SHA }}',
9191
channel: channel,
92-
original_pr: '${{ github.event.issue.number }}'
92+
original_pr: '${{ github.event.issue.number }}',
93+
environment: 'prod'
9394
}
9495
});
9596

.github/workflows/release-patch-1-create-pr.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,19 @@ on:
2828
description: 'The original PR number to comment back on.'
2929
required: false
3030
type: 'string'
31+
environment:
32+
description: 'Environment'
33+
required: false
34+
type: 'choice'
35+
options:
36+
- 'prod'
37+
- 'dev'
38+
default: 'prod'
3139

3240
jobs:
3341
create-patch:
3442
runs-on: 'ubuntu-latest'
43+
environment: '${{ github.event.inputs.environment }}'
3544
permissions:
3645
contents: 'write'
3746
pull-requests: 'write'
@@ -49,26 +58,44 @@ jobs:
4958
node-version-file: '.nvmrc'
5059
cache: 'npm'
5160

61+
- name: 'configure .npmrc'
62+
uses: './.github/actions/setup-npmrc'
63+
with:
64+
github-token: '${{ secrets.GITHUB_TOKEN }}'
65+
5266
- name: 'Install Script Dependencies'
53-
run: 'npm install yargs'
67+
run: 'npm install yargs --no-package-lock'
5468

5569
- name: 'Configure Git User'
70+
env:
71+
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
72+
REPOSITORY: '${{ github.repository }}'
5673
run: |-
5774
git config user.name "gemini-cli-robot"
5875
git config user.email "gemini-cli-robot@google.com"
5976
# Configure git to use GITHUB_TOKEN for remote operations (has actions:write for workflow files)
60-
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
77+
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${REPOSITORY}.git"
6178
6279
- name: 'Create Patch'
6380
id: 'create_patch'
6481
env:
6582
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
6683
GH_TOKEN: '${{ secrets.GEMINI_CLI_ROBOT_GITHUB_PAT }}'
84+
CLI_PACKAGE_NAME: '${{ vars.CLI_PACKAGE_NAME }}'
85+
PATCH_COMMIT: '${{ github.event.inputs.commit }}'
86+
PATCH_CHANNEL: '${{ github.event.inputs.channel }}'
87+
ORIGINAL_PR: '${{ github.event.inputs.original_pr }}'
88+
DRY_RUN: '${{ github.event.inputs.dry_run }}'
6789
continue-on-error: true
6890
run: |
6991
# Capture output and display it in logs using tee
7092
{
71-
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 }}
93+
node scripts/releasing/create-patch-pr.js \
94+
--cli-package-name="${CLI_PACKAGE_NAME}" \
95+
--commit="${PATCH_COMMIT}" \
96+
--channel="${PATCH_CHANNEL}" \
97+
--pullRequestNumber="${ORIGINAL_PR}" \
98+
--dry-run="${DRY_RUN}"
7299
echo "EXIT_CODE=$?" >> "$GITHUB_OUTPUT"
73100
} 2>&1 | tee >(
74101
echo "LOG_CONTENT<<EOF" >> "$GITHUB_ENV"
@@ -87,14 +114,17 @@ jobs:
87114
REPOSITORY: '${{ github.repository }}'
88115
GITHUB_RUN_ID: '${{ github.run_id }}'
89116
LOG_CONTENT: '${{ env.LOG_CONTENT }}'
117+
TARGET_REF: '${{ github.event.inputs.ref }}'
90118
continue-on-error: true
91119
run: |
92-
git checkout '${{ github.event.inputs.ref }}'
120+
git checkout "${TARGET_REF}"
93121
node scripts/releasing/patch-create-comment.js
94122
95123
- name: 'Fail Workflow if Main Task Failed'
96124
if: 'always() && steps.create_patch.outputs.EXIT_CODE != 0'
125+
env:
126+
EXIT_CODE: '${{ steps.create_patch.outputs.EXIT_CODE }}'
97127
run: |
98-
echo "Patch creation failed with exit code: ${{ steps.create_patch.outputs.EXIT_CODE }}"
128+
echo "Patch creation failed with exit code: ${EXIT_CODE}"
99129
echo "Check the logs above and the comment posted to the original PR for details."
100130
exit 1

.github/workflows/release-patch-2-trigger.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
type: 'string'
1919
default: 'main'
2020
workflow_id:
21-
description: 'The workflow to trigger. Defaults to patch-release.yml'
21+
description: 'The workflow to trigger. Defaults to release-patch-3-release.yml'
2222
required: false
2323
type: 'string'
2424
default: 'release-patch-3-release.yml'
@@ -37,11 +37,20 @@ on:
3737
required: false
3838
type: 'boolean'
3939
default: false
40+
environment:
41+
description: 'Environment'
42+
required: false
43+
type: 'choice'
44+
options:
45+
- 'prod'
46+
- 'dev'
47+
default: 'prod'
4048

4149
jobs:
4250
trigger-patch-release:
4351
if: "(github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'hotfix/')) || github.event_name == 'workflow_dispatch'"
4452
runs-on: 'ubuntu-latest'
53+
environment: '${{ github.event.inputs.environment }}'
4554
permissions:
4655
actions: 'write'
4756
contents: 'write'
@@ -74,5 +83,7 @@ jobs:
7483
GITHUB_EVENT_PAYLOAD: '${{ toJSON(github.event) }}'
7584
FORCE_SKIP_TESTS: '${{ github.event.inputs.force_skip_tests }}'
7685
TEST_MODE: '${{ github.event.inputs.test_mode }}'
86+
ENVIRONMENT: '${{ github.event.inputs.environment }}'
87+
DRY_RUN: '${{ github.event.inputs.dry_run }}'
7788
run: |
78-
node scripts/releasing/patch-trigger.js --dry-run=${{ github.event.inputs.dry_run }}
89+
node scripts/releasing/patch-trigger.js --dry-run="${DRY_RUN}"

.github/workflows/release-patch-3-release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ jobs:
9090
id: 'patch_version'
9191
env:
9292
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
93+
PATCH_FROM: '${{ github.event.inputs.type }}'
94+
CLI_PACKAGE_NAME: '${{vars.CLI_PACKAGE_NAME}}''
9395
run: |
9496
# Use the existing get-release-version.js script to calculate patch version
9597
# Run from main checkout which has full git history and access to npm
96-
PATCH_JSON=$(node scripts/get-release-version.js --cli-package-name="${{vars.CLI_PACKAGE_NAME}}" --type=patch --patch-from=${{ github.event.inputs.type }})
98+
PATCH_JSON=$(node scripts/get-release-version.js --type=patch --cli-package-name="${CLI_PACKAGE_NAME}" --patch-from="${PATCH_FROM}")
9799
echo "Patch version calculation result: ${PATCH_JSON}"
98100
99101
RELEASE_VERSION=$(echo "${PATCH_JSON}" | jq -r .releaseVersion)
@@ -110,14 +112,13 @@ jobs:
110112
env:
111113
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
112114
CHANNEL: '${{ github.event.inputs.type }}'
115+
ORIGINAL_RELEASE_VERSION: '${{ steps.patch_version.outputs.RELEASE_VERSION }}'
116+
ORIGINAL_RELEASE_TAG: '${{ steps.patch_version.outputs.RELEASE_TAG }}'
117+
ORIGINAL_PREVIOUS_TAG: '${{ steps.patch_version.outputs.PREVIOUS_TAG }}'
113118
run: |
114119
echo "🔍 Verifying no concurrent patch releases have occurred..."
115120
116121
# Store original calculation for comparison
117-
ORIGINAL_RELEASE_VERSION="${{ steps.patch_version.outputs.RELEASE_VERSION }}"
118-
ORIGINAL_RELEASE_TAG="${{ steps.patch_version.outputs.RELEASE_TAG }}"
119-
ORIGINAL_PREVIOUS_TAG="${{ steps.patch_version.outputs.PREVIOUS_TAG }}"
120-
121122
echo "Original calculation:"
122123
echo " Release version: ${ORIGINAL_RELEASE_VERSION}"
123124
echo " Release tag: ${ORIGINAL_RELEASE_TAG}"

.github/workflows/release-promote.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,19 @@ jobs:
7777
id: 'versions'
7878
env:
7979
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
80+
STABLE_OVERRIDE: '${{ github.event.inputs.stable_version_override }}'
81+
PREVIEW_OVERRIDE: '${{ github.event.inputs.preview_version_override }}'
82+
REF_INPUT: '${{ github.event.inputs.ref }}'
8083
run: |
8184
set -e
82-
STABLE_COMMAND="node scripts/get-release-version.js --type=stable ${{ github.event.inputs.stable_version_override && format('--stable_version_override={0}', github.event.inputs.stable_version_override) || '' }}"
83-
PREVIEW_COMMAND="node scripts/get-release-version.js --type=preview ${{ github.event.inputs.preview_version_override && format('--preview_version_override={0}', github.event.inputs.preview_version_override) || '' }}"
85+
STABLE_COMMAND="node scripts/get-release-version.js --type=stable"
86+
if [[ -n "${STABLE_OVERRIDE}" ]]; then
87+
STABLE_COMMAND+=" --stable_version_override=${STABLE_OVERRIDE}"
88+
fi
89+
PREVIEW_COMMAND="node scripts/get-release-version.js --type=preview"
90+
if [[ -n "${PREVIEW_OVERRIDE}" ]]; then
91+
PREVIEW_COMMAND+=" --preview_version_override=${PREVIEW_OVERRIDE}"
92+
fi
8493
NIGHTLY_COMMAND="node scripts/get-release-version.js --type=promote-nightly"
8594
STABLE_JSON=$(${STABLE_COMMAND})
8695
PREVIEW_JSON=$(${PREVIEW_COMMAND})
@@ -97,7 +106,7 @@ jobs:
97106
echo "PREVIOUS_STABLE_TAG=$(echo "${STABLE_JSON}" | jq -r .previousReleaseTag)" >> "${GITHUB_OUTPUT}"
98107
echo "PREVIEW_VERSION=$(echo "${PREVIEW_JSON}" | jq -r .releaseVersion)" >> "${GITHUB_OUTPUT}"
99108
# shellcheck disable=SC1083
100-
REF="${{ github.event.inputs.ref }}"
109+
REF="${REF_INPUT}"
101110
SHA=$(git ls-remote origin "$REF" | awk '{print $1}')
102111
if [ -z "$SHA" ]; then
103112
if [[ "$REF" =~ ^[0-9a-f]{7,40}$ ]]; then
@@ -116,20 +125,30 @@ jobs:
116125
echo "NEXT_SHA=$SHA" >> "${GITHUB_OUTPUT}"
117126
118127
- name: 'Display Pending Updates'
128+
env:
129+
STABLE_VERSION: '${{ steps.versions.outputs.STABLE_VERSION }}'
130+
STABLE_SHA: '${{ steps.versions.outputs.STABLE_SHA }}'
131+
PREVIOUS_STABLE_TAG: '${{ steps.versions.outputs.PREVIOUS_STABLE_TAG }}'
132+
PREVIEW_VERSION: '${{ steps.versions.outputs.PREVIEW_VERSION }}'
133+
PREVIEW_SHA: '${{ steps.versions.outputs.PREVIEW_SHA }}'
134+
PREVIOUS_PREVIEW_TAG: '${{ steps.versions.outputs.PREVIOUS_PREVIEW_TAG }}'
135+
NEXT_NIGHTLY_VERSION: '${{ steps.versions.outputs.NEXT_NIGHTLY_VERSION }}'
136+
PREVIOUS_NIGHTLY_TAG: '${{ steps.versions.outputs.PREVIOUS_NIGHTLY_TAG }}'
137+
INPUT_REF: '${{ github.event.inputs.ref }}'
119138
run: |
120139
echo "Release Plan:"
121140
echo "-----------"
122-
echo "Stable Release: ${{ steps.versions.outputs.STABLE_VERSION }}"
123-
echo " - Commit: ${{ steps.versions.outputs.STABLE_SHA }}"
124-
echo " - Previous Tag: ${{ steps.versions.outputs.PREVIOUS_STABLE_TAG }}"
141+
echo "Stable Release: ${STABLE_VERSION}"
142+
echo " - Commit: ${STABLE_SHA}"
143+
echo " - Previous Tag: ${PREVIOUS_STABLE_TAG}"
125144
echo ""
126-
echo "Preview Release: ${{ steps.versions.outputs.PREVIEW_VERSION }}"
127-
echo " - Commit: ${{ steps.versions.outputs.PREVIEW_SHA }} (${{ github.event.inputs.ref }})"
128-
echo " - Previous Tag: ${{ steps.versions.outputs.PREVIOUS_PREVIEW_TAG }}"
145+
echo "Preview Release: ${PREVIEW_VERSION}"
146+
echo " - Commit: ${PREVIEW_SHA} (${INPUT_REF})"
147+
echo " - Previous Tag: ${PREVIOUS_PREVIEW_TAG}"
129148
echo ""
130-
echo "Preparing Next Nightly Release: ${{ steps.versions.outputs.NEXT_NIGHTLY_VERSION }}"
131-
echo " - Merging Version Update PR to Branch: ${{ github.event.inputs.ref }}"
132-
echo " - Previous Tag: ${{ steps.versions.outputs.PREVIOUS_NIGHTLY_TAG }}"
149+
echo "Preparing Next Nightly Release: ${NEXT_NIGHTLY_VERSION}"
150+
echo " - Merging Version Update PR to Branch: ${INPUT_REF}"
151+
echo " - Previous Tag: ${PREVIOUS_NIGHTLY_TAG}"
133152
134153
test:
135154
name: 'Test ${{ matrix.channel }}'

0 commit comments

Comments
 (0)