mmodzelewski commented on code in PR #3095:
URL: https://github.com/apache/iggy/pull/3095#discussion_r3071236858
##########
.github/actions/rust/pre-merge/action.yml:
##########
@@ -59,6 +59,42 @@ runs:
esac
shell: bash
+ # DAG-based test scoping: compute affected crates from cargo metadata +
git diff
+ # to avoid running the full test suite when only a subset of crates
changed.
+ # Safety: cargo check/clippy run on the full workspace separately,
catching all
+ # compilation errors. This only scopes test BUILD and EXECUTION.
+ - name: Fetch base branch for DAG analysis
+ if: startsWith(inputs.task, 'test-')
+ run: git fetch origin master --depth=1 2>/dev/null || true
+ shell: bash
+
+ - name: Compute affected crates (DAG-based)
+ if: startsWith(inputs.task, 'test-')
+ id: affected
+ run: |
+ NEXTEST_FILTER=""
+ PACKAGES=""
+
+ if python3 scripts/ci/affected-crates.py --base-ref origin/master
--format nextest-filter > /tmp/nextest-filter.txt 2>/tmp/affected-stderr.txt;
then
+ NEXTEST_FILTER=$(cat /tmp/nextest-filter.txt)
+ fi
+ if python3 scripts/ci/affected-crates.py --base-ref origin/master
--format packages > /tmp/packages.txt 2>/tmp/affected-stderr.txt; then
+ PACKAGES=$(cat /tmp/packages.txt)
+ fi
+
+ if [[ -n "$NEXTEST_FILTER" ]]; then
+ CRATE_COUNT=$(echo "$NEXTEST_FILTER" | grep -o 'package(' | wc -l)
+ echo "::notice::DAG analysis: ${CRATE_COUNT} affected crates (of 43
total)"
+ echo "scoped=true" >> $GITHUB_OUTPUT
Review Comment:
The `scoped` parameter is not used later in the flow, so I assume it can be
safely removed.
##########
.github/actions/rust/pre-merge/action.yml:
##########
@@ -59,6 +59,42 @@ runs:
esac
shell: bash
+ # DAG-based test scoping: compute affected crates from cargo metadata +
git diff
+ # to avoid running the full test suite when only a subset of crates
changed.
+ # Safety: cargo check/clippy run on the full workspace separately,
catching all
+ # compilation errors. This only scopes test BUILD and EXECUTION.
+ - name: Fetch base branch for DAG analysis
+ if: startsWith(inputs.task, 'test-')
+ run: git fetch origin master --depth=1 2>/dev/null || true
+ shell: bash
+
+ - name: Compute affected crates (DAG-based)
+ if: startsWith(inputs.task, 'test-')
+ id: affected
+ run: |
+ NEXTEST_FILTER=""
+ PACKAGES=""
+
+ if python3 scripts/ci/affected-crates.py --base-ref origin/master
--format nextest-filter > /tmp/nextest-filter.txt 2>/tmp/affected-stderr.txt;
then
+ NEXTEST_FILTER=$(cat /tmp/nextest-filter.txt)
+ fi
+ if python3 scripts/ci/affected-crates.py --base-ref origin/master
--format packages > /tmp/packages.txt 2>/tmp/affected-stderr.txt; then
+ PACKAGES=$(cat /tmp/packages.txt)
+ fi
+
+ if [[ -n "$NEXTEST_FILTER" ]]; then
+ CRATE_COUNT=$(echo "$NEXTEST_FILTER" | grep -o 'package(' | wc -l)
+ echo "::notice::DAG analysis: ${CRATE_COUNT} affected crates (of 43
total)"
Review Comment:
Can we replace the 43 total with a dynamic value? Nobody will remember to
update this later on :) Or at least remove it, so it doesn't confuse anyone in
the future. (Same with the comments at the end of the flow).
##########
scripts/ci/affected-crates.py:
##########
Review Comment:
Did you check if there isn't any existing cargo utility for this? Feels like
it shouldn't be our isolated issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]