Skip to content

Commit 1fd50cc

Browse files
authored
Merge branch 'master' into fix/flaky-postgres-restart-test
2 parents a1aa10b + 5a2939a commit 1fd50cc

9 files changed

Lines changed: 220 additions & 75 deletions

File tree

.config/rail.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# cargo-rail change detection configuration
19+
# See: https://github.com/loadingalias/cargo-rail
20+
21+
[change-detection]
22+
# Changes to these paths trigger a full workspace rebuild/retest
23+
infrastructure = [
24+
"Cargo.lock",
25+
"rust-toolchain.toml",
26+
".cargo/**",
27+
".github/**",
28+
]

.github/actions/rust/pre-merge/action.yml

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,50 @@ runs:
5959
esac
6060
shell: bash
6161

62+
# DAG-based test scoping: use cargo-rail to compute affected crates from the
63+
# workspace dependency graph + git diff, avoiding the full test suite when only
64+
# a subset of crates changed.
65+
# Safety: cargo check/clippy run on the full workspace separately, catching all
66+
# compilation errors. This only scopes test BUILD and EXECUTION.
67+
- name: Fetch base branch for DAG analysis
68+
if: startsWith(inputs.task, 'test-')
69+
run: git fetch origin master --depth=1 2>/dev/null || true
70+
shell: bash
71+
72+
- name: Install cargo-rail
73+
if: startsWith(inputs.task, 'test-')
74+
uses: taiki-e/install-action@v2
75+
with:
76+
tool: cargo-rail
77+
78+
- name: Compute affected crates (cargo-rail)
79+
if: startsWith(inputs.task, 'test-')
80+
run: |
81+
TOTAL_CRATES=$(cargo metadata --format-version 1 --no-deps 2>/dev/null | jq '.workspace_members | length' 2>/dev/null || echo "?")
82+
echo "$TOTAL_CRATES" > /tmp/total-crates.txt
83+
84+
PLAN_JSON=$(cargo rail plan --since origin/master -f json 2>/tmp/affected-stderr.txt || echo "")
85+
86+
if [[ -n "$PLAN_JSON" ]]; then
87+
MODE=$(echo "$PLAN_JSON" | jq -r '.scope.mode')
88+
if [[ "$MODE" == "crates" ]]; then
89+
CRATES=$(echo "$PLAN_JSON" | jq -r '.scope.crates[]')
90+
CRATE_COUNT=$(echo "$CRATES" | wc -l)
91+
# Build -p flags for cargo build/test
92+
echo "$CRATES" | sed 's/^/-p /' | tr '\n' ' ' > /tmp/packages.txt
93+
# Build nextest filter expression for cargo nextest run
94+
echo "$CRATES" | sed 's/^/package(/; s/$/)/' | paste -sd ' | ' > /tmp/nextest-filter.txt
95+
echo "::notice::DAG analysis: ${CRATE_COUNT} affected crates (of ${TOTAL_CRATES} total)"
96+
else
97+
echo "::notice::Full workspace affected (${TOTAL_CRATES} crates)"
98+
fi
99+
else
100+
STDERR=$(cat /tmp/affected-stderr.txt 2>/dev/null || echo "")
101+
echo "::warning::Could not compute affected crates, running full test suite. ${STDERR}"
102+
rm -f /tmp/nextest-filter.txt /tmp/packages.txt
103+
fi
104+
shell: bash
105+
62106
# Individual lint tasks for parallel execution
63107
- name: Cargo check
64108
if: inputs.task == 'check'
@@ -117,16 +161,45 @@ runs:
117161
echo "::notice::Running test partition ${PARTITION_INDEX}/2"
118162
fi
119163
164+
# Read DAG-based affected crate filter (computed in earlier step)
165+
NEXTEST_FILTER=""
166+
PACKAGE_FLAGS=""
167+
TOTAL_CRATES="?"
168+
if [[ -f /tmp/nextest-filter.txt ]]; then
169+
NEXTEST_FILTER=$(cat /tmp/nextest-filter.txt)
170+
fi
171+
if [[ -f /tmp/packages.txt ]]; then
172+
PACKAGE_FLAGS=$(cat /tmp/packages.txt)
173+
fi
174+
if [[ -f /tmp/total-crates.txt ]]; then
175+
TOTAL_CRATES=$(cat /tmp/total-crates.txt)
176+
fi
177+
178+
if [[ -n "$PACKAGE_FLAGS" ]]; then
179+
CRATE_COUNT=$(echo "$NEXTEST_FILTER" | grep -o 'package(' | wc -l)
180+
echo "::notice::DAG-scoped build: ${CRATE_COUNT} crates (cargo check/clippy cover full workspace separately)"
181+
else
182+
echo "::notice::Full workspace build (no DAG filter available)"
183+
fi
184+
120185
source <(cargo llvm-cov show-env --export-prefix)
121186
122187
bins_start=$(date +%s)
123-
cargo build --locked
188+
if [[ -n "$PACKAGE_FLAGS" ]]; then
189+
cargo build --locked $PACKAGE_FLAGS
190+
else
191+
cargo build --locked
192+
fi
124193
bins_end=$(date +%s)
125194
bins_duration=$((bins_end - bins_start))
126195
echo "::notice::Binaries and libraries built in ${bins_duration}s ($(date -ud @${bins_duration} +'%M:%S'))"
127196
128197
compile_start=$(date +%s)
129-
cargo test --locked --no-run
198+
if [[ -n "$PACKAGE_FLAGS" ]]; then
199+
cargo test --locked --no-run $PACKAGE_FLAGS
200+
else
201+
cargo test --locked --no-run
202+
fi
130203
compile_end=$(date +%s)
131204
compile_duration=$((compile_end - compile_start))
132205
echo "::notice::Tests compiled in ${compile_duration}s ($(date -ud @${compile_duration} +'%M:%S'))"
@@ -144,12 +217,20 @@ runs:
144217
145218
test_start=$(date +%s)
146219
if command -v cargo-nextest &> /dev/null; then
147-
cargo nextest run --locked --no-fail-fast --profile ci $PARTITION_FLAG
220+
if [[ -n "$NEXTEST_FILTER" ]]; then
221+
cargo nextest run --locked --no-fail-fast --profile ci $PARTITION_FLAG -E "$NEXTEST_FILTER"
222+
else
223+
cargo nextest run --locked --no-fail-fast --profile ci $PARTITION_FLAG
224+
fi
148225
else
149226
if [[ -n "$PARTITION_FLAG" ]]; then
150227
echo "::error::cargo-nextest not found, falling back to cargo test without partitioning (all tests will run on every partition)"
151228
fi
152-
cargo test --locked --no-fail-fast
229+
if [[ -n "$PACKAGE_FLAGS" ]]; then
230+
cargo test --locked --no-fail-fast $PACKAGE_FLAGS
231+
else
232+
cargo test --locked --no-fail-fast
233+
fi
153234
fi
154235
test_end=$(date +%s)
155236
test_duration=$((test_end - test_start))
@@ -159,6 +240,12 @@ runs:
159240
total_duration=$((build_duration + test_duration))
160241
echo ""
161242
echo "========================================="
243+
if [[ -n "$PACKAGE_FLAGS" ]]; then
244+
CRATE_COUNT=$(echo "$NEXTEST_FILTER" | grep -o 'package(' | wc -l)
245+
echo "DAG scope: ${CRATE_COUNT}/${TOTAL_CRATES} crates"
246+
else
247+
echo "DAG scope: full workspace (${TOTAL_CRATES} crates)"
248+
fi
162249
echo "All targets build: ${bins_duration}s ($(date -ud @${bins_duration} +'%M:%S'))"
163250
echo "Tests compile: ${compile_duration}s ($(date -ud @${compile_duration} +'%M:%S'))"
164251
echo "Tests execute: ${test_duration}s ($(date -ud @${test_duration} +'%M:%S'))"

.github/config/components.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,17 @@ components:
5151
paths:
5252
- "core/common/**"
5353

54+
# Leaf crate: zero-copy I/O buffer, depended on by binary_protocol and cluster
55+
rust-iobuf:
56+
depends_on:
57+
- "rust-workspace"
58+
paths:
59+
- "core/iobuf/**"
60+
5461
rust-binary-protocol:
5562
depends_on:
5663
- "rust-workspace" # Protocol is affected by workspace changes
64+
- "rust-iobuf" # binary_protocol depends on iobuf
5765
- "ci-infrastructure" # CI changes trigger full regression
5866
paths:
5967
- "core/binary_protocol/**"
@@ -67,10 +75,13 @@ components:
6775
- "rust-cluster"
6876
paths:
6977
- "core/server/**"
78+
- "core/server-ng/**"
7079

7180
rust-cluster:
7281
depends_on:
7382
- "rust-workspace"
83+
- "rust-iobuf" # cluster crates depend on iobuf
84+
- "rust-binary-protocol" # cluster crates depend on binary_protocol
7485
paths:
7586
- "core/clock/**"
7687
- "core/consensus/**"
@@ -79,18 +90,28 @@ components:
7990
- "core/metadata/**"
8091
- "core/message_bus/**"
8192
- "core/partitions/**"
93+
94+
# Standalone simulation tool, does NOT affect server binary or foreign SDKs.
95+
# Split from rust-cluster to avoid triggering SDK tests on simulator-only changes.
96+
rust-simulator:
97+
depends_on:
98+
- "rust-workspace"
99+
- "rust-cluster"
100+
paths:
82101
- "core/simulator/**"
83102

84103
# Main Rust workspace testing
85104
rust:
86105
depends_on:
87106
- "rust-workspace"
107+
- "rust-iobuf"
88108
- "rust-configs"
89109
- "rust-sdk"
90110
- "rust-common"
91111
- "rust-binary-protocol"
92112
- "rust-server"
93113
- "rust-cluster"
114+
- "rust-simulator"
94115
- "rust-tools"
95116
- "rust-cli"
96117
- "rust-bench"

Cargo.lock

Lines changed: 0 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ clap = { version = "4.6.0", features = ["derive", "wrap_help"] }
102102
clap_complete = "4.6.0"
103103
clock = { path = "core/clock" }
104104
colored = "3.1.1"
105-
comfy-table = "7.2.2"
105+
comfy-table = { version = "7.2.2", default-features = false }
106106
compio = { version = "0.18.0", features = [
107107
"runtime",
108108
"macros",

DEPENDENCIES.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ crossbeam-epoch: 0.9.18, "Apache-2.0 OR MIT",
219219
crossbeam-queue: 0.3.12, "Apache-2.0 OR MIT",
220220
crossbeam-utils: 0.8.21, "Apache-2.0 OR MIT",
221221
crossfire: 3.1.7, "Apache-2.0",
222-
crossterm: 0.29.0, "MIT",
223-
crossterm_winapi: 0.9.1, "MIT",
224222
crunchy: 0.2.4, "MIT",
225223
crypto-bigint: 0.5.5, "Apache-2.0 OR MIT",
226224
crypto-common: 0.1.7, "Apache-2.0 OR MIT",
@@ -287,7 +285,6 @@ dlopen2: 0.8.2, "MIT",
287285
dlopen2_derive: 0.4.3, "MIT",
288286
dlv-list: 0.5.2, "Apache-2.0 OR MIT",
289287
docker_credential: 1.3.2, "Apache-2.0 OR MIT",
290-
document-features: 0.2.12, "Apache-2.0 OR MIT",
291288
dotenvy: 0.15.7, "MIT",
292289
downcast: 0.11.0, "MIT",
293290
dtoa: 1.0.11, "Apache-2.0 OR MIT",
@@ -574,7 +571,6 @@ linked-hash-map: 0.5.6, "Apache-2.0 OR MIT",
574571
linux-raw-sys: 0.4.15, "Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT",
575572
linux-raw-sys: 0.12.1, "Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT",
576573
litemap: 0.8.2, "Unicode-3.0",
577-
litrs: 1.0.0, "Apache-2.0 OR MIT",
578574
local-channel: 0.1.5, "Apache-2.0 OR MIT",
579575
local-waker: 0.1.4, "Apache-2.0 OR MIT",
580576
lock_api: 0.4.14, "Apache-2.0 OR MIT",

LICENSE

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,34 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.
202+
203+
===============================================================================
204+
APACHE IGGY (INCUBATING) SUBCOMPONENTS
205+
===============================================================================
206+
207+
This product bundles third-party software. The following third-party
208+
components are distributed alongside the Apache Iggy (Incubating) source
209+
release and are licensed separately as described below.
210+
211+
-------------------------------------------------------------------------------
212+
Gradle Wrapper
213+
-------------------------------------------------------------------------------
214+
215+
Files:
216+
bdd/java/gradlew
217+
bdd/java/gradle/wrapper/gradle-wrapper.properties
218+
examples/java/gradlew
219+
examples/java/gradle/wrapper/gradle-wrapper.properties
220+
foreign/java/gradlew
221+
foreign/java/gradle/wrapper/gradle-wrapper.properties
222+
223+
Copyright (c) 2015 the original authors.
224+
225+
Licensed under the Apache License, Version 2.0 (the "License"); you may
226+
not use this file except in compliance with the License. You may obtain
227+
a copy of the License at:
228+
229+
http://www.apache.org/licenses/LICENSE-2.0
230+
231+
Upstream project: https://github.com/gradle/gradle

0 commit comments

Comments
 (0)