Skip to content

Commit f2884dc

Browse files
Merge branch 'main' into observability/tracing-attr-error-type-transfer
2 parents c117355 + f644a19 commit f2884dc

File tree

2,022 files changed

+555324
-13200
lines changed

Some content is hidden

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

2,022 files changed

+555324
-13200
lines changed
4.68 KB
Binary file not shown.

.github/scripts/release_manager_merge_bot.go

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,16 @@ func main() {
213213
}
214214

215215
state = *status.State
216-
log.Printf("Overall status: %s", state)
216+
log.Printf("Overall commit status: %s", state)
217+
if pr.MergeableState != nil {
218+
log.Printf("PR mergeable state: %s", *pr.MergeableState)
219+
if *pr.MergeableState == "dirty" {
220+
fatalError("PR #%d has merge conflicts (dirty).", prNumber)
221+
}
222+
if *pr.MergeableState == "draft" {
223+
fatalError("PR #%d is a draft.", prNumber)
224+
}
225+
}
217226

218227
switch state {
219228
case "failure":
@@ -230,7 +239,19 @@ func main() {
230239
}
231240
retryCount++
232241
case "success":
233-
log.Println("All checks have passed. Merging the pull request...")
242+
// Check if the PR is truly mergeable. MergeableState can be "blocked" if required
243+
// check runs (e.g. GitHub Actions) or reviews are missing, even if CombinedStatus is "success".
244+
// If it's nil, GitHub is still calculating mergeability.
245+
if pr.MergeableState == nil || *pr.MergeableState == "blocked" || *pr.MergeableState == "behind" {
246+
stateStr := "nil"
247+
if pr.MergeableState != nil {
248+
stateStr = *pr.MergeableState
249+
}
250+
log.Printf("Commit status is success, but PR mergeable state is %q. Waiting...", stateStr)
251+
goto wait
252+
}
253+
254+
log.Println("All checks have passed and PR is mergeable. Merging the pull request...")
234255
commitMessage := fmt.Sprintf("Merge pull request #%d from %s/%s", prNumber, owner, repo)
235256
mergeResult, _, err := client.PullRequests.Merge(ctx, owner, repo, prNumber, commitMessage, &github.PullRequestOptions{
236257
MergeMethod: "squash",

.github/workflows/sdk-platform-java-dependency_compatibility_test.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ jobs:
6969

7070
# Set up local showcase server to run the showcase ITs
7171
- name: Parse showcase version
72-
working-directory: sdk-plaform-java/java-showcase/gapic-showcase
72+
working-directory: sdk-platform-java/java-showcase/gapic-showcase
7373
run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV"
74-
working-directory: sdk-platform-java
7574
- name: Install showcase server
7675
run: |
7776
sudo mkdir -p /usr/src/showcase

.github/workflows/sdk-platform-java-downstream_protobuf_compatibility_check_nightly.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ jobs:
3030
- 'sdk-platform-java/**'
3131
downstream-protobuf-test:
3232
needs: filter
33-
if: ${{ needs.filter.outputs.library == 'true' }}
3433
# This job runs if any of the three conditions match:
3534
# 1. PR is raised from Release-Please (PR comes from branch: release-please--branches-main)
3635
# 2. Job is invoked by the nightly job (scheduled event)
3736
# 3. Job is manually invoked via Github UI (workflow_dispatch event)
38-
if: github.head_ref == 'release-please--branches--main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
37+
if: needs.filter.outputs.library == 'true' && (github.head_ref == 'release-please--branches--main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
3938
runs-on: ubuntu-22.04
4039
strategy:
4140
fail-fast: false

.github/workflows/sdk-platform-java-shared_dependencies.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ jobs:
2525
- 'sdk-platform-java/**'
2626
upper-bound-check:
2727
needs: filter
28-
if: ${{ needs.filter.outputs.library == 'true' }}
28+
if: needs.filter.outputs.library == 'true' && github.repository_owner == 'googleapis'
2929
name: Shared Dependencies BOM upper-bound check
3030
runs-on: ubuntu-latest
31-
if: github.repository_owner == 'googleapis'
3231
steps:
3332
- uses: actions/checkout@v4
3433
- uses: actions/setup-java@v4

.github/workflows/sdk-platform-java-sonar.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ jobs:
2222
- 'sdk-platform-java/**'
2323
build:
2424
needs: filter
25-
if: ${{ needs.filter.outputs.library == 'true' }}
25+
if: needs.filter.outputs.library == 'true' && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request')
2626
name: Build
27-
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
2827
runs-on: ubuntu-22.04
2928
steps:
3029
- uses: actions/checkout@v3

.github/workflows/sdk-platform-java-verify_library_generation.yaml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ jobs:
5555
head_repo_name: ${{ github.event.pull_request.head.repo.full_name }}
5656
base_repo: ${{ github.repository }}
5757
library-generation-unit-tests:
58-
needs: filter
59-
if: ${{ needs.filter.outputs.library == 'true' }}
58+
needs: [filter, should-run-library-generation-tests]
59+
if: needs.filter.outputs.library == 'true' && needs.should-run-library-generation-tests.outputs.should_run == 'true'
6060
runs-on: ubuntu-22.04
61-
needs: should-run-library-generation-tests
62-
if: needs.should-run-library-generation-tests.outputs.should_run == 'true'
6361
steps:
6462
- uses: actions/checkout@v4
6563
- uses: actions/setup-python@v5
@@ -85,11 +83,9 @@ jobs:
8583
set -x
8684
python -m unittest discover -s hermetic_build -p "*unit_tests.py"
8785
library-generation-lint-shell:
88-
needs: filter
89-
if: ${{ needs.filter.outputs.library == 'true' }}
86+
needs: [filter, should-run-library-generation-tests]
87+
if: needs.filter.outputs.library == 'true' && needs.should-run-library-generation-tests.outputs.should_run == 'true'
9088
runs-on: ubuntu-22.04
91-
needs: should-run-library-generation-tests
92-
if: needs.should-run-library-generation-tests.outputs.should_run == 'true'
9389
steps:
9490
- uses: actions/checkout@v4
9591
- name: Run ShellCheck
@@ -101,11 +97,9 @@ jobs:
10197
ignore_paths:
10298
.kokoro
10399
library-generation-lint-python:
104-
needs: filter
105-
if: ${{ needs.filter.outputs.library == 'true' }}
100+
needs: [filter, should-run-library-generation-tests]
101+
if: needs.filter.outputs.library == 'true' && needs.should-run-library-generation-tests.outputs.should_run == 'true'
106102
runs-on: ubuntu-22.04
107-
needs: should-run-library-generation-tests
108-
if: needs.should-run-library-generation-tests.outputs.should_run == 'true'
109103
steps:
110104
- uses: actions/checkout@v4
111105
- uses: actions/setup-python@v5

.kokoro/common.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,20 +344,20 @@ function run_graalvm_tests() {
344344
function generate_graalvm_presubmit_modules_list() {
345345
modules_assigned_list=()
346346
generate_modified_modules_list
347-
if [[ ${#modified_module_list[@]} -gt 4 ]]; then
348-
# Too many modules modified, run a subset
349-
echo "Too many modules modified, running a subset"
350-
module_list="java-aiplatform,java-compute"
351-
elif [[ ${#modified_module_list[@]} -gt 0 ]]; then
347+
if [[ ${#modified_module_list[@]} -gt 0 && ${#modified_module_list[@]} -lt 5 ]]; then
352348
# If only a few modules have been modified, focus presubmit testing only on them.
353349
module_list=$(
354350
IFS=,
355351
echo "${modified_module_list[*]}"
356352
)
357353
else
358-
# no modules modified
359-
echo "No modules modified"
360-
module_list=""
354+
# If no modules have been modified or if too many have been modified, just test the modules
355+
# specified in the MAVEN_MODULES env var.
356+
if [ -z "${MAVEN_MODULES}" ]; then
357+
echo "MAVEN_MODULES not defined in environment."
358+
exit 1
359+
fi
360+
module_list=${MAVEN_MODULES}
361361
fi
362362
}
363363

.kokoro/presubmit/graalvm-native-a-presubmit.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ env_vars: {
3131
key: "SECRET_MANAGER_KEYS"
3232
value: "cloud-java-ci-it-service-account, java-bigqueryconnection-samples-secrets"
3333
}
34+
35+
env_vars: {
36+
key: "MAVEN_MODULES"
37+
value: "java-aiplatform,java-compute"
38+
}

.kokoro/presubmit/graalvm-native-b-presubmit.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ env_vars: {
3131
key: "SECRET_MANAGER_KEYS"
3232
value: "cloud-java-ci-it-service-account, java-bigqueryconnection-samples-secrets"
3333
}
34+
35+
env_vars: {
36+
key: "MAVEN_MODULES"
37+
value: "java-aiplatform,java-compute"
38+
}

0 commit comments

Comments
 (0)