Skip to content

Commit aa7bbc1

Browse files
gnodetclaude
andcommitted
ci: fix script bugs found during fork testing
- Fix empty associative array crash under set -u in checkManualItTests() by using a counter variable instead of ${#it_sources[@]} - Fix duplicate modules in CI comment by stripping [packaging] suffix from Maven reactor output before deduplication Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3924b3e commit aa7bbc1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ checkManualItTests() {
228228

229229
declare -A it_commands
230230
declare -A it_sources
231+
local it_found=0
231232

232233
while IFS=: read -r source_id it_module command; do
233234
# Skip comments and empty lines
@@ -241,11 +242,12 @@ checkManualItTests() {
241242
if [[ "$(basename "$module_path")" == "$source_id" ]]; then
242243
it_commands["$it_module"]="$command"
243244
it_sources["$it_module"]="${it_sources[$it_module]:-}${it_sources[$it_module]:+, }\`${module_path}\`"
245+
it_found=1
244246
fi
245247
done
246248
done < "$mapping_file"
247249

248-
if [[ ${#it_sources[@]} -gt 0 ]]; then
250+
if [[ "$it_found" -eq 1 ]]; then
249251
echo "" >> "$comment_file"
250252
echo ":bulb: **Manual integration tests recommended:**" >> "$comment_file"
251253
for it_module in "${!it_sources[@]}"; do
@@ -561,7 +563,7 @@ main() {
561563
# Append reactor module list from build log
562564
if [[ -f "$log" ]]; then
563565
local reactor_modules
564-
reactor_modules=$(grep '^\[INFO\] Camel ::' "$log" | sed 's/\[INFO\] //' | sed 's/ \..*$//' | sort -u || true)
566+
reactor_modules=$(grep '^\[INFO\] Camel ::' "$log" | sed 's/\[INFO\] //' | sed 's/ \..*$//' | sed 's/ *\[.*\]$//' | sort -u || true)
565567
if [[ -n "$reactor_modules" ]]; then
566568
local count
567569
count=$(echo "$reactor_modules" | wc -l | tr -d ' ')

0 commit comments

Comments
 (0)