Skip to content

Commit 528a63f

Browse files
gnodetclaude
andcommitted
fix(ci): filter structural XML elements from property detection
When a new dependency is added to parent/pom.xml, the diff contains structural XML elements like <groupId>, <artifactId>, <version> which were incorrectly extracted as "changed properties" by detectChangedProperties. This caused the script to search for modules using ${artifactId} or ${groupId} as property references, which either matched nothing useful or caused spurious failures. Fix: filter out known structural POM element names (groupId, artifactId, version, scope, type, etc.) so only actual property names like "pgvector-version" or "openai-java-version" are detected. Fixes the CI script bug seen in PR #22207 where adding a new component to parent/pom.xml caused the dependency detection to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1558872 commit 528a63f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/actions/incremental-build/incremental-build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,19 @@ extractPomDiff() {
104104

105105
# Detect which properties changed in a pom.xml diff.
106106
# Returns one property name per line.
107+
# Filters out structural XML elements (groupId, artifactId, version, etc.)
108+
# to only return actual property names (e.g. openai-java-version).
107109
detectChangedProperties() {
108110
local diff_content="$1"
109111

112+
# Known structural POM elements that are NOT property names
113+
local structural_elements="groupId|artifactId|version|scope|type|classifier|optional|systemPath|exclusions|exclusion|dependency|dependencies|dependencyManagement|parent|modules|module|packaging|name|description|url|relativePath"
114+
110115
echo "$diff_content" | \
111116
grep -E '^[+-][[:space:]]*<[^>]+>[^<]*</[^>]+>' | \
112117
grep -vE '^\+\+\+|^---' | \
113118
sed -E 's/^[+-][[:space:]]*<([^>]+)>.*/\1/' | \
119+
grep -vE "^(${structural_elements})$" | \
114120
sort -u || true
115121
}
116122

0 commit comments

Comments
 (0)