Skip to content

Commit 8db34a3

Browse files
authored
Merge origin/master into dependabot/maven/aws.sdk.version-2.44.9
2 parents d1c7da1 + f2f0ad9 commit 8db34a3

10 files changed

Lines changed: 316 additions & 89 deletions

File tree

.github/workflows/bazel.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
# Cache layers used:
77
# 1. Repository cache – downloaded JARs / external repositories
88
# 2. Disk cache – action output cache (build artifacts)
9-
# Both are saved to GitHub Actions cache keyed on the OS, Bazel module lock,
10-
# and Maven artifact list so cache hits are maximized across identical runs.
9+
# Repository cache is shared across OS runners; disk cache remains OS-scoped.
1110

1211
name: bazel
1312

@@ -102,7 +101,16 @@ jobs:
102101
# The disk cache stores compiled action outputs; the repository cache
103102
# stores downloaded external files (JARs, etc.).
104103
# ----------------------------------------------------------------
105-
- name: Restore Bazel caches
104+
- name: Restore Bazel repository cache (cross-OS)
105+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
106+
with:
107+
path: ~/.cache/bazel/cache/repos/v1
108+
key: bazel-repos-java${{ matrix.java }}-${{ hashFiles('MODULE.bazel', '.bazelversion', 'maven_install.json') }}
109+
restore-keys: |
110+
bazel-repos-java${{ matrix.java }}-
111+
bazel-repos-
112+
enableCrossOsArchive: true
113+
- name: Restore Bazel disk cache
106114
id: bazel-cache
107115
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
108116
with:

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ jobs:
5050
java-version: 17.0.x
5151
# Initializes the CodeQL tools for scanning.
5252
- name: Initialize CodeQL
53-
uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4
53+
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4
5454
with:
5555
languages: ${{ matrix.language }}
5656
build-mode: none
5757

5858
- name: Perform CodeQL Analysis
59-
uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4
59+
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: dependabot-sync-bazel-backfill
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
backfill_open_prs:
7+
description: "Sync all currently open Dependabot pom.xml PRs"
8+
required: true
9+
type: boolean
10+
default: false
11+
12+
jobs:
13+
sync-open-dependabot-prs:
14+
if: >-
15+
github.event_name == 'workflow_dispatch' &&
16+
github.event.inputs.backfill_open_prs == 'true'
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
pull-requests: read
21+
env:
22+
BAZELISK_SKIP_VERSION_CHECK: "1"
23+
24+
steps:
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
26+
27+
- name: Set up Java 17
28+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
29+
with:
30+
distribution: temurin
31+
java-version: 17
32+
33+
- name: Install Bazelisk
34+
run: |
35+
mkdir -p "$HOME/.local/bin"
36+
curl -fsSL \
37+
https://github.com/bazelbuild/bazelisk/releases/download/v1.24.1/bazelisk-linux-amd64 \
38+
-o "$HOME/.local/bin/bazel"
39+
chmod +x "$HOME/.local/bin/bazel"
40+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
41+
42+
- name: Preserve Bazel sync script
43+
run: |
44+
cp scripts/sync_bazel_dependencies.py "${RUNNER_TEMP}/sync_bazel_dependencies.py"
45+
46+
- name: Sync all open Dependabot pom.xml PRs
47+
shell: bash
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
run: |
51+
set -euo pipefail
52+
53+
git config user.name "github-actions[bot]"
54+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
55+
56+
api="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}"
57+
open_prs_json='[]'
58+
page=1
59+
while :; do
60+
page_json="$(curl -fsSL \
61+
-u "x-access-token:${GITHUB_TOKEN}" \
62+
-H "Accept: application/vnd.github+json" \
63+
"${api}/pulls?state=open&per_page=100&page=${page}")"
64+
open_prs_json="$(jq -s 'add' \
65+
<(printf '%s' "${open_prs_json}") \
66+
<(printf '%s' "${page_json}"))"
67+
if [[ "$(jq 'length' <<< "${page_json}")" -lt 100 ]]; then
68+
break
69+
fi
70+
page=$((page + 1))
71+
done
72+
73+
while IFS=$'\t' read -r number head_ref head_repo base_ref author; do
74+
if [[ "${author}" != "dependabot[bot]" ]]; then
75+
continue
76+
fi
77+
if [[ "${base_ref}" != "master" ]]; then
78+
continue
79+
fi
80+
if [[ "${head_repo}" != "${GITHUB_REPOSITORY}" ]]; then
81+
echo "Skipping #${number}; head repo ${head_repo} is not ${GITHUB_REPOSITORY}."
82+
continue
83+
fi
84+
if [[ "${head_ref}" != "dependabot/"* ]]; then
85+
echo "Skipping #${number}; branch ${head_ref} is not a Dependabot branch."
86+
continue
87+
fi
88+
89+
pr_files_json="$(curl -fsSL \
90+
-u "x-access-token:${GITHUB_TOKEN}" \
91+
-H "Accept: application/vnd.github+json" \
92+
"${api}/pulls/${number}/files?per_page=100")"
93+
if ! jq -e '.[] | select(.filename == "pom.xml")' >/dev/null <<< "${pr_files_json}"; then
94+
echo "Skipping #${number}; root pom.xml was not changed."
95+
continue
96+
fi
97+
98+
echo "Processing Dependabot PR #${number} (${head_ref})"
99+
git fetch origin "${head_ref}"
100+
git checkout -B "dependabot-sync-work" "origin/${head_ref}"
101+
# Ensure each PR branch starts from a clean checkout before sync.
102+
git reset --hard
103+
git clean -fd
104+
105+
python3 "${RUNNER_TEMP}/sync_bazel_dependencies.py" --root "$PWD"
106+
REPIN=1 bazel run @maven//:pin
107+
108+
if git diff --quiet -- MODULE.bazel maven_install.json; then
109+
echo "No Bazel dependency changes needed for #${number}."
110+
continue
111+
fi
112+
113+
git add MODULE.bazel maven_install.json
114+
git commit -m "Sync Bazel dependencies for Dependabot update (#${number})"
115+
git push origin "HEAD:${head_ref}"
116+
done < <(jq -r '.[] | [.number, .head.ref, .head.repo.full_name, .base.ref, .user.login] | @tsv' <<< "${open_prs_json}")
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: dependabot-sync-bazel
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize, reopened]
6+
branches: ["master"]
7+
paths:
8+
- "pom.xml"
9+
10+
jobs:
11+
sync-bazel-dependencies:
12+
if: >-
13+
github.event.pull_request.user.login == 'dependabot[bot]' &&
14+
github.event.pull_request.head.repo.full_name == github.repository
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: read
19+
env:
20+
BAZELISK_SKIP_VERSION_CHECK: "1"
21+
22+
steps:
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
24+
with:
25+
ref: ${{ github.event.pull_request.head.sha }}
26+
27+
- name: Set up Java 17
28+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
29+
with:
30+
distribution: temurin
31+
java-version: 17
32+
33+
- name: Install Bazelisk
34+
run: |
35+
mkdir -p "$HOME/.local/bin"
36+
curl -fsSL \
37+
https://github.com/bazelbuild/bazelisk/releases/download/v1.24.1/bazelisk-linux-amd64 \
38+
-o "$HOME/.local/bin/bazel"
39+
chmod +x "$HOME/.local/bin/bazel"
40+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
41+
42+
- name: Sync Bazel dependency files
43+
run: |
44+
python3 scripts/sync_bazel_dependencies.py
45+
REPIN=1 bazel run @maven//:pin
46+
47+
- name: Commit regenerated Bazel files
48+
shell: bash
49+
run: |
50+
if git diff --quiet -- MODULE.bazel maven_install.json; then
51+
echo "No Bazel dependency file changes detected."
52+
exit 0
53+
fi
54+
git config user.name "github-actions[bot]"
55+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
56+
git add MODULE.bazel maven_install.json
57+
git commit -m "Sync Bazel dependencies for Dependabot update"
58+
git push origin "HEAD:${{ github.event.pull_request.head.ref }}"

.github/workflows/spring.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,48 @@ jobs:
1111
matrix:
1212
java: [ 17, 21, 25, 26 ]
1313
runs-on: ubuntu-latest
14+
env:
15+
BAZELISK_SKIP_VERSION_CHECK: "1"
1416
steps:
1517
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1618
- name: Setup Java
1719
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
1820
with:
1921
distribution: 'temurin'
2022
java-version: ${{ matrix.java }}
21-
- name: Cache local Maven repository
23+
- name: Install Bazelisk
24+
run: |
25+
mkdir -p "$HOME/.local/bin"
26+
curl -fsSL \
27+
https://github.com/bazelbuild/bazelisk/releases/download/v1.24.1/bazelisk-linux-amd64 \
28+
-o "$HOME/.local/bin/bazel"
29+
chmod +x "$HOME/.local/bin/bazel"
30+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
31+
- name: Restore Bazel repository cache (cross-OS)
2232
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
2333
with:
24-
path: ~/.m2/repository
25-
key: ${{ runner.os }}-maven-spring-${{ matrix.java }}-${{ hashFiles('pom.xml', '**/pom.xml') }}
26-
- name: Build Spring modules with Maven
27-
run: ./mvnw -q -B --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -pl spring,spring-aot -am clean test
34+
path: ~/.cache/bazel/cache/repos/v1
35+
key: bazel-repos-${{ matrix.java }}-${{ hashFiles('MODULE.bazel', '.bazelversion', 'maven_install.json') }}
36+
restore-keys: |
37+
bazel-repos-${{ matrix.java }}-
38+
bazel-repos-
39+
enableCrossOsArchive: true
40+
- name: Restore Bazel disk cache
41+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
42+
with:
43+
path: ~/.cache/bazel-disk-cache
44+
key: bazel-${{ runner.os }}-java${{ matrix.java }}-${{ hashFiles('MODULE.bazel', '.bazelversion', 'maven_install.json') }}
45+
restore-keys: |
46+
bazel-${{ runner.os }}-java${{ matrix.java }}-
47+
bazel-${{ runner.os }}-
48+
- name: Pin Maven dependencies
49+
run: REPIN=1 bazel run @maven//:pin
50+
- name: Build Spring integrations with Bazel
51+
run: >-
52+
bazel build --config=ci
53+
//spring:client-java-spring-integration
54+
//spring-aot:client-java-spring-aot-integration
55+
- name: Test Spring integrations with Bazel
56+
run: >-
57+
bazel test --config=ci
58+
//spring:tests

MODULE.bazel

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ maven.install(
7070
"com.squareup.okio:okio-jvm:3.16.4",
7171
"com.flipkart.zjsonpatch:zjsonpatch:0.4.16",
7272
# ---- spring (Java 17+ modules) ----
73-
"org.springframework:spring-core:6.2.8",
74-
"org.springframework:spring-aop:6.2.8",
75-
"org.springframework:spring-beans:6.2.8",
76-
"org.springframework:spring-context:6.2.8",
77-
"org.springframework:spring-expression:6.2.8",
78-
"org.springframework:spring-test:6.2.8",
73+
"org.springframework:spring-core:7.0.7",
74+
"org.springframework:spring-aop:7.0.7",
75+
"org.springframework:spring-beans:7.0.7",
76+
"org.springframework:spring-context:7.0.7",
77+
"org.springframework:spring-expression:7.0.7",
78+
"org.springframework:spring-test:7.0.7",
7979
# ---- test ----
8080
"ch.qos.logback:logback-classic:1.5.32",
8181
"ch.qos.logback:logback-core:1.5.32",
@@ -103,7 +103,7 @@ maven.install(
103103
)
104104

105105
# Spring Boot 4.0.6 artifacts declared with exclusions to keep
106-
# spring-framework pinned to 6.2.8.
106+
# spring-framework pinned to 7.0.7.
107107
_SPRING_FRAMEWORK_EXCLUSIONS = [
108108
"org.springframework:spring-core",
109109
"org.springframework:spring-aop",

0 commit comments

Comments
 (0)