Skip to content

Conversation

@haniyakonain
Copy link
Contributor

@haniyakonain haniyakonain commented Oct 6, 2025

Add snapshot-based regression testing for coordinate extraction

  • Snapshot mode (default): Tests against fixed data to detect code regressions
  • Live data mode: Tests against current Wikipedia to detect data changes
  • Snapshot management: --generate-fixed, --update-fixed with revision tracking
  • 100+ test cases covering all continents and hemispheres
  • Configurable pass threshold (default 80%)
  • Detailed failure reporting with mismatch analysis

Usage:
./coords-integration-test.sh --generate-fixed # Create initial snapshot
./coords-integration-test.sh # Run regression tests
./coords-integration-test.sh --update-fixed # Update changed pages only
./coords-integration-test.sh --live-data # Monitor environment changes
./coords-integration-test.sh --threshold 90 # Set pass threshold

Summary by CodeRabbit

  • New Features

    • Configurable test runner with modes to generate/update fixed snapshots or run against live data, plus command-line options, adjustable pass threshold, and debug output.
    • Improved coordinate extraction and validation across multiple input formats with contamination checks, per-page diagnostics, and clearer pass/fail reporting.
  • Tests

    • Added comprehensive fixed coordinate dataset and revision metadata to enable reproducible runs and richer reporting.

@coderabbitai
Copy link

coderabbitai bot commented Oct 6, 2025

Walkthrough

Replaces a prior top-level Bash test flow with a data-driven integration test harness supporting modes (generate-fixed, update-fixed, live-data), Wikipedia revision lookup, API querying, multi-pattern coordinate extraction/validation, per-page diagnostics, and snapshot files for fixed coordinates and revisions.

Changes

Cohort / File(s) Summary
Bash test harness and control flow
scripts/src/main/bash/coords-integration-test.sh
New main() entrypoint with CLI parsing, modes: --generate-fixed, --update-fixed, --live-data, threshold handling, connectivity checks, load_fixed_data(), generate_fixed_data(), get_wikipedia_revision(), test_api_endpoint(), extract_coords_from_response(), test_specific_page(), per-page status tracking, debug/logging and detailed pass/partial/fail reporting.
Fixed coordinate snapshot data
scripts/src/main/bash/test_data_fixed.txt
New snapshot file with locale-prefixed country/location → lat,lon mappings (many additions: ~159 lines) used to drive tests.
Revision snapshot data
scripts/src/main/bash/test_data_revisions.txt
New snapshot file mapping entries to Wikipedia revision IDs and optional markers; used for repeatable validation and update workflows.
Documentation / test coverage table
dump/src/test/resources/shaclTestsCoverageTable.md
Updated rows: replaced/updated resource URIs and added issue-tracking references and localization entries across multiple table rows.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Script as coords-integration-test.sh
  participant Fixed as test_data_fixed.txt
  participant Revs as test_data_revisions.txt
  participant Wiki as Wikipedia API
  participant LocalAPI as local mappings API

  User->>Script: run (--generate-fixed | --update-fixed | --live-data | --threshold)
  Script->>Script: parse args, set mode & thresholds
  Script->>Fixed: load_fixed_data()
  alt generate or update mode
    loop per page
      Script->>Wiki: get_wikipedia_revision(page)
      Wiki-->>Script: revisionId
      Script->>LocalAPI: test_api_endpoint(page)
      LocalAPI-->>Script: response
      Script->>Script: extract_coords_from_response(response)
      Script->>Fixed: write/update coordinates
      Script->>Revs: write/update revisionId
    end
  else live-data / test mode
    loop per page
      Script->>LocalAPI: test_api_endpoint(page)
      LocalAPI-->>Script: response
      Script->>Script: extract_coords_from_response(response)
      Script->>Script: test_specific_page(expected, found)
      Script-->>User: per-page status (ok/partial/fail)
    end
    Script-->>User: summary, pass rate, exit code (threshold-based)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

I thump the shell, I sniff the thread,
Modes bloom where revisions tread.
I fetch, I parse, I hop to see,
Coordinates neat as carrot tea.
Snapshot saved — my whiskers gleam,
Tests pass bright in orange-beam. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the main enhancement in this changeset by indicating the addition of snapshot-based regression testing for coordinate extraction, directly aligning with the expanded Bash test harness and new testing modes introduced in the PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e91b21 and 9b6461c.

📒 Files selected for processing (3)
  • scripts/src/main/bash/coords-integration-test.sh (8 hunks)
  • scripts/src/main/bash/test_data_fixed.txt (1 hunks)
  • scripts/src/main/bash/test_data_revisions.txt (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.11.0)
scripts/src/main/bash/coords-integration-test.sh

[warning] 364-364: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 376-376: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 413-413: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).

(SC2188)


[warning] 422-422: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 425-425: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 427-427: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 430-430: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 439-439: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 441-441: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 632-632: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 640-640: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 641-641: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 651-651: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 652-652: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 659-659: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 660-660: Declare and assign separately to avoid masking return values.

(SC2155)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: build
  • GitHub Check: build

Comment on lines +448 to +462
# CRITICAL FIX: Preserve entry even if extraction fails
local expected="${KNOWN_COORDS[$lang_page]}"
echo "${lang_page}=${expected}" >> "$temp_file"
echo "${lang_page}=${expected}|${current_revid}|EXPECTED" >> "$temp_rev"
echo -e "${YELLOW}NO COORDS - Using expected${NC}"
failed=$((failed + 1))
fi
else
# CRITICAL FIX: Preserve entry even if API fails
local expected="${KNOWN_COORDS[$lang_page]}"
echo "${lang_page}=${expected}" >> "$temp_file"
echo "${lang_page}=${expected}|${current_revid}|EXPECTED" >> "$temp_rev"
echo -e "${YELLOW}FAILED - Using expected${NC}"
failed=$((failed + 1))
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Preserve previous snapshot values on update failures.

When --update-fixed encounters an extraction/API failure, we fall back to the hard-coded KNOWN_COORDS baseline. That baseline can drift from the authoritative snapshot (e.g., after manual curation or earlier runs), so a single failed fetch will silently revert the stored coordinates to outdated values. We should reuse the last committed snapshot entry whenever it exists, and only fall back to the baseline if no prior snapshot is available.

-                # CRITICAL FIX: Preserve entry even if extraction fails
-                local expected="${KNOWN_COORDS[$lang_page]}"
-                echo "${lang_page}=${expected}" >> "$temp_file"
-                echo "${lang_page}=${expected}|${current_revid}|EXPECTED" >> "$temp_rev"
+                local fallback="$old_coords"
+                [[ -z "$fallback" ]] && fallback="${KNOWN_COORDS[$lang_page]}"
+                echo "${lang_page}=${fallback}" >> "$temp_file"
+                echo "${lang_page}=${fallback}|${current_revid}|EXPECTED" >> "$temp_rev"
                 echo -e "${YELLOW}NO COORDS - Using expected${NC}"
                 failed=$((failed + 1))
             fi
         else
             # CRITICAL FIX: Preserve entry even if API fails
-            local expected="${KNOWN_COORDS[$lang_page]}"
-            echo "${lang_page}=${expected}" >> "$temp_file"
-            echo "${lang_page}=${expected}|${current_revid}|EXPECTED" >> "$temp_rev"
+            local fallback="$old_coords"
+            [[ -z "$fallback" ]] && fallback="${KNOWN_COORDS[$lang_page]}"
+            echo "${lang_page}=${fallback}" >> "$temp_file"
+            echo "${lang_page}=${fallback}|${current_revid}|EXPECTED" >> "$temp_rev"
             echo -e "${YELLOW}FAILED - Using expected${NC}"
             failed=$((failed + 1))
         fi

Make sure old_coords is set alongside old_entry near the top of the loop so the fallback prefers the last committed value.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# CRITICAL FIX: Preserve entry even if extraction fails
local expected="${KNOWN_COORDS[$lang_page]}"
echo "${lang_page}=${expected}" >> "$temp_file"
echo "${lang_page}=${expected}|${current_revid}|EXPECTED" >> "$temp_rev"
echo -e "${YELLOW}NO COORDS - Using expected${NC}"
failed=$((failed + 1))
fi
else
# CRITICAL FIX: Preserve entry even if API fails
local expected="${KNOWN_COORDS[$lang_page]}"
echo "${lang_page}=${expected}" >> "$temp_file"
echo "${lang_page}=${expected}|${current_revid}|EXPECTED" >> "$temp_rev"
echo -e "${YELLOW}FAILED - Using expected${NC}"
failed=$((failed + 1))
fi
local fallback="$old_coords"
[[ -z "$fallback" ]] && fallback="${KNOWN_COORDS[$lang_page]}"
echo "${lang_page}=${fallback}" >> "$temp_file"
echo "${lang_page}=${fallback}|${current_revid}|EXPECTED" >> "$temp_rev"
echo -e "${YELLOW}NO COORDS - Using expected${NC}"
failed=$((failed + 1))
fi
else
# CRITICAL FIX: Preserve entry even if API fails
local fallback="$old_coords"
[[ -z "$fallback" ]] && fallback="${KNOWN_COORDS[$lang_page]}"
echo "${lang_page}=${fallback}" >> "$temp_file"
echo "${lang_page}=${fallback}|${current_revid}|EXPECTED" >> "$temp_rev"
echo -e "${YELLOW}FAILED - Using expected${NC}"
failed=$((failed + 1))
fi

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
scripts/src/main/bash/coords-integration-test.sh (1)

432-445: On update failures, prefer previous snapshot entry over baseline.

When extraction/API fails in update mode, you fall back to KNOWN_COORDS, potentially regressing curated snapshots. Prefer old_coords from the last committed snapshot when available; only fall back to KNOWN_COORDS if absent. Also precompute old_entry/old_coords outside the “up-to-date” branch so they’re available for fallback.

Apply:

-        if [[ "$mode" == "update" && -f "$REVISION_FILE" ]]; then
-            local old_entry=$(grep "^${lang_page}=" "$REVISION_FILE" 2>/dev/null)
+        # Load previous snapshot entry (if any) for safer fallbacks
+        local old_entry=""
+        local old_coords=""
+        if [[ "$mode" == "update" && -f "$REVISION_FILE" ]]; then
+            old_entry=$(grep "^${lang_page}=" "$REVISION_FILE" 2>/dev/null || true)
+            if [[ -n "$old_entry" ]]; then
+                old_coords=$(echo "$old_entry" | cut -d'=' -f2 | cut -d'|' -f1)
+            fi
+        fi
+        if [[ "$mode" == "update" && -n "$old_entry" ]]; then
-            if [[ -n "$old_entry" ]]; then
                 local stored_revid=$(echo "$old_entry" | cut -d'|' -f2)
                 if [[ "$stored_revid" == "$current_revid" && "$current_revid" != "unknown" ]]; then
                     echo -e "${CYAN}UP-TO-DATE${NC}"
-                    local old_coords=$(echo "$old_entry" | cut -d'=' -f2 | cut -d'|' -f1)
                     echo "${lang_page}=${old_coords}" >> "$temp_file"
                     echo "$old_entry" >> "$temp_rev"
                     skipped=$((skipped + 1))
                     continue
                 fi
-            fi
+            fi
         fi
@@
-                # CRITICAL FIX: Preserve entry even if extraction fails
-                local expected="${KNOWN_COORDS[$lang_page]}"
-                echo "${lang_page}=${expected}" >> "$temp_file"
-                echo "${lang_page}=${expected}|${current_revid}|EXPECTED" >> "$temp_rev"
+                # Preserve previous snapshot when extraction fails (fallback to baseline if none)
+                local fallback="$old_coords"
+                [[ -z "$fallback" ]] && fallback="${KNOWN_COORDS[$lang_page]}"
+                echo "${lang_page}=${fallback}" >> "$temp_file"
+                echo "${lang_page}=${fallback}|${current_revid}|EXPECTED" >> "$temp_rev"
                 echo -e "${YELLOW}NO COORDS - Using expected${NC}"
                 failed=$((failed + 1))
@@
-            # CRITICAL FIX: Preserve entry even if API fails
-            local expected="${KNOWN_COORDS[$lang_page]}"
-            echo "${lang_page}=${expected}" >> "$temp_file"
-            echo "${lang_page}=${expected}|${current_revid}|EXPECTED" >> "$temp_rev"
+            # Preserve previous snapshot when API fails (fallback to baseline if none)
+            local fallback="$old_coords"
+            [[ -z "$fallback" ]] && fallback="${KNOWN_COORDS[$lang_page]}"
+            echo "${lang_page}=${fallback}" >> "$temp_file"
+            echo "${lang_page}=${fallback}|${current_revid}|EXPECTED" >> "$temp_rev"
             echo -e "${YELLOW}FAILED - Using expected${NC}"
             failed=$((failed + 1))

Also applies to: 456-470

🧹 Nitpick comments (8)
scripts/src/main/bash/coords-integration-test.sh (8)

421-422: Fix redirection no-op (ShellCheck SC2188).

Redirect with a no-op to avoid warning.

-        > "$temp_rev"
+        : > "$temp_rev"

500-507: Add curl timeouts to connectivity check to avoid hanging.

Without timeouts, CI/user runs can block indefinitely if localhost is unreachable.

-    local status=$(curl -s -o /dev/null -w "%{http_code}" "$url")
+    local status
+    status=$(curl -sS --connect-timeout 5 --max-time 10 -o /dev/null -w "%{http_code}" "$url")

519-521: Remove unused encoded_title (dead code).

Variable is computed but unused; --data-urlencode already handles encoding.

-    local encoded_title=$(url_encode "$page")
-    local formats=("trix" "rdfxml" "ntriples" "ttl")
+    local formats=("trix" "rdfxml" "ntriples" "ttl")

Additionally, if nothing else uses url_encode(), consider removing that helper.


490-493: Remove unused url_encode helper (now unused).

If you accept the previous change, this function becomes dead code.

-# URL encode helper
-url_encode() {
-    local string="$1"
-    python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1], safe=''))" "$string"
-}
+

371-374: Address SC2155: declare and assign separately to preserve exit codes.

Pattern local var=$(cmd) can mask return values and triggers SC2155. Split declaration and assignment. Apply broadly across the file (examples below).

-    local first_rev=$(head -1 "$REVISION_FILE" | cut -d'|' -f2)
+    local first_rev
+    first_rev=$(head -1 "$REVISION_FILE" | cut -d'|' -f2)
@@
-    local response=$(curl -s -G "$api_url" \
+    local response
+    response=$(curl -s -G "$api_url" \
         --data-urlencode "action=query" \
         ...
         --max-time 10 2>/dev/null)
@@
-        local current_revid=$(get_wikipedia_revision "$lang" "$page")
+        local current_revid
+        current_revid=$(get_wikipedia_revision "$lang" "$page")
@@
-        local response=$(test_api_endpoint "$lang" "$page" "false")
+        local response
+        response=$(test_api_endpoint "$lang" "$page" "false")
@@
-    lat=$(printf "%.4f" "$lat" 2>/dev/null || echo "$lat")
-    long=$(printf "%.4f" "$long" 2>/dev/null || echo "$long")
-    elat=$(printf "%.4f" "$elat" 2>/dev/null || echo "$elat")
-    elong=$(printf "%.4f" "$elong" 2>/dev/null || echo "$elong")
+    lat=$(printf "%.4f" "$lat" 2>/dev/null || echo "$lat")
+    long=$(printf "%.4f" "$long" 2>/dev/null || echo "$long")
+    elat=$(printf "%.4f" "$elat" 2>/dev/null || echo "$elat")
+    elong=$(printf "%.4f" "$elong" 2>/dev/null || echo "$elong")
@@
-    local diff_lat=$(echo "$lat - $elat" | bc -l | sed 's/-//')
-    local diff_long=$(echo "$long - $elong" | bc -l | sed 's/-//')
+    local diff_lat
+    diff_lat=$(echo "$lat - $elat" | bc -l | sed 's/-//')
+    local diff_long
+    diff_long=$(echo "$long - $elong" | bc -l | sed 's/-//')

Apply similarly to other instances flagged by ShellCheck. Based on hints

Also applies to: 384-391, 430-431, 447-449, 659-666, 667-668


541-545: Expected parameter is unused in extraction; either wire it or drop it.

$3 is passed but never used for “smart validation,” which can confuse readers.

  • Option A: Implement the intended validation using expected (e.g., sign disambiguation).
  • Option B: Remove the param from call sites and the unused local in the function.

Minimal change:

-    local expected="${3:-}"  # Pass expected coordinates for smart validation

And later, remove the third arg at call site if you don’t plan to use it.

Also applies to: 623-624


732-742: Guard pass rate against zero total.

Edge-safe even if KNOWN_COORDS ends up empty (future changes).

-    local pass_rate=$(( (ok * 100) / total ))
+    local pass_rate=0
+    if (( total > 0 )); then
+        pass_rate=$(( (ok * 100) / total ))
+    fi

495-509: Preflight dependency checks (curl, python3, bc, grep -P) to fail fast.

Script relies on these tools; add a quick check to improve UX.

Add near the top (and call it in main before use):

check_deps() {
  local missing=0
  for cmd in curl python3 bc grep; do
    command -v "$cmd" >/dev/null 2>&1 || { echo -e "${RED}Missing dependency: $cmd${NC}"; missing=1; }
  done
  # Ensure grep supports -P
  if ! echo test | grep -oP 't' >/dev/null 2>&1; then
    echo -e "${YELLOW}grep -P not supported; install GNU grep or adjust patterns${NC}"
  fi
  return $missing
}

Then:

check_deps || exit 1
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b6461c and d80aa4b.

📒 Files selected for processing (1)
  • scripts/src/main/bash/coords-integration-test.sh (9 hunks)
🧰 Additional context used
🪛 Shellcheck (0.11.0)
scripts/src/main/bash/coords-integration-test.sh

[warning] 372-372: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 384-384: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 421-421: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).

(SC2188)


[warning] 430-430: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 433-433: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 435-435: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 438-438: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 447-447: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 449-449: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 640-640: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 648-648: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 649-649: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 659-659: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 660-660: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 667-667: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 668-668: Declare and assign separately to avoid masking return values.

(SC2155)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: build
  • GitHub Check: build

Implement comprehensive coordinate extraction testing framework:

- Add snapshot-based testing to detect code regressions vs data changes
- Support 100+ test cases covering all continents and hemispheres
- Implement Wikipedia revision tracking for incremental updates
- Add --generate-fixed and --update-fixed modes for snapshot management
- Add --live-data mode for environment monitoring (separate use case)
- Support multiple RDF formats (TRiX, RDF/XML, N-Triples, Turtle)
- Include configurable pass thresholds and detailed test reporting
- Add comprehensive coordinate validation and extraction patterns

The snapshot approach freezes the test environment, ensuring that test
failures indicate code regressions rather than Wikipedia data changes.
This enables reliable CI/CD integration and code quality monitoring.
@sonarqubecloud
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
scripts/src/main/bash/coords-integration-test.sh (1)

424-461: Preserve snapshot value when update fails.

In update mode we should fall back to the last committed snapshot (old_entry) before touching the hard-coded baseline. Today, any extraction/API hiccup rewrites the snapshot with KNOWN_COORDS[$lang_page], discarding curated values and reintroducing stale data—the exact regression noted previously. Load old_coords immediately after old_entry is read and prefer it everywhere the fallback is needed, only using KNOWN_COORDS when no historical value exists.

-        if [[ "$mode" == "update" && -f "$REVISION_FILE" ]]; then
-            local old_entry=$(grep "^${lang_page}=" "$REVISION_FILE" 2>/dev/null)
+        local old_coords=""
+        if [[ "$mode" == "update" && -f "$REVISION_FILE" ]]; then
+            local old_entry
+            old_entry=$(grep "^${lang_page}=" "$REVISION_FILE" 2>/dev/null)
             if [[ -n "$old_entry" ]]; then
+                old_coords=$(echo "$old_entry" | cut -d'=' -f2 | cut -d'|' -f1)
                 local stored_revid=$(echo "$old_entry" | cut -d'|' -f2)
                 if [[ "$stored_revid" == "$current_revid" && "$current_revid" != "unknown" ]]; then
                     echo -e "${CYAN}UP-TO-DATE${NC}"
-                    local old_coords=$(echo "$old_entry" | cut -d'=' -f2 | cut -d'|' -f1)
                     echo "${lang_page}=${old_coords}" >> "$temp_file"
                     echo "$old_entry" >> "$temp_rev"
                     skipped=$((skipped + 1))
                     continue
                 fi
             fi
         fi
@@
-                local expected="${KNOWN_COORDS[$lang_page]}"
-                echo "${lang_page}=${expected}" >> "$temp_file"
-                echo "${lang_page}=${expected}|${current_revid}|EXPECTED" >> "$temp_rev"
+                local fallback="$old_coords"
+                [[ -z "$fallback" ]] && fallback="${KNOWN_COORDS[$lang_page]}"
+                echo "${lang_page}=${fallback}" >> "$temp_file"
+                echo "${lang_page}=${fallback}|${current_revid}|EXPECTED" >> "$temp_rev"
@@
-            local expected="${KNOWN_COORDS[$lang_page]}"
-            echo "${lang_page}=${expected}" >> "$temp_file"
-            echo "${lang_page}=${expected}|${current_revid}|EXPECTED" >> "$temp_rev"
+            local fallback="$old_coords"
+            [[ -z "$fallback" ]] && fallback="${KNOWN_COORDS[$lang_page]}"
+            echo "${lang_page}=${fallback}" >> "$temp_file"
+            echo "${lang_page}=${fallback}|${current_revid}|EXPECTED" >> "$temp_rev"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d80aa4b and e9133ec.

📒 Files selected for processing (4)
  • dump/src/test/resources/shaclTestsCoverageTable.md (14 hunks)
  • scripts/src/main/bash/coords-integration-test.sh (8 hunks)
  • scripts/src/main/bash/test_data_fixed.txt (1 hunks)
  • scripts/src/main/bash/test_data_revisions.txt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/src/main/bash/test_data_fixed.txt
  • scripts/src/main/bash/test_data_revisions.txt
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
dump/src/test/resources/shaclTestsCoverageTable.md

29-29: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


29-29: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


30-30: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


30-30: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


31-31: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


31-31: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


32-32: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


32-32: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


43-43: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


43-43: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


54-54: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


54-54: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


64-64: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


64-64: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


65-65: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


65-65: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


66-66: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


66-66: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


67-67: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


67-67: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


68-68: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


68-68: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


69-69: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


69-69: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


70-70: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


70-70: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


71-71: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


71-71: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


82-82: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


82-82: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


92-92: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


92-92: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


93-93: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


93-93: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


94-94: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


94-94: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


95-95: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


95-95: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


104-104: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


104-104: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


114-114: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


114-114: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


124-124: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


124-124: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


125-125: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


125-125: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


126-126: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


126-126: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


127-127: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


127-127: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


128-128: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


128-128: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


129-129: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


129-129: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


130-130: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


131-131: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


131-131: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


132-132: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


132-132: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


133-133: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


133-133: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


134-134: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


134-134: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


135-135: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


135-135: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


136-136: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


136-136: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


137-137: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


137-137: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


138-138: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


138-138: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


139-139: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


139-139: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


148-148: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


148-148: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


159-159: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


159-159: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


160-160: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


160-160: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


161-161: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


161-161: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


162-162: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


162-162: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


163-163: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


163-163: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


164-164: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


164-164: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


165-165: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


165-165: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


166-166: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


166-166: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


167-167: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


167-167: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


168-168: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


168-168: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


169-169: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


169-169: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


170-170: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


170-170: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


171-171: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


171-171: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


172-172: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


172-172: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


173-173: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


174-174: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


174-174: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


218-218: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


218-218: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


219-219: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


219-219: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


231-231: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


231-231: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


255-255: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


255-255: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


256-256: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


256-256: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


257-257: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


257-257: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)

🪛 Shellcheck (0.11.0)
scripts/src/main/bash/coords-integration-test.sh

[warning] 364-364: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 376-376: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 413-413: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).

(SC2188)


[warning] 422-422: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 425-425: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 427-427: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 430-430: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 439-439: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 441-441: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 632-632: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 640-640: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 641-641: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 651-651: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 652-652: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 659-659: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 660-660: Declare and assign separately to avoid masking return values.

(SC2155)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: build
  • GitHub Check: build

Comment on lines +29 to 33
[http://de.dbpedia.org/resource/Arthur_Schopenhauer](http://dief.tools.dbpedia.org/server/extraction/de/extract?title=Arthur_Schopenhauer&revid=&format=trix&extractors=custom) |
[http://de.dbpedia.org/resource/Berlin](http://dief.tools.dbpedia.org/server/extraction/de/extract?title=Berlin&revid=&format=trix&extractors=custom) |
[http://el.dbpedia.org/resource/Βερολίνο](http://dief.tools.dbpedia.org/server/extraction/el/extract?title=Βερολίνο&revid=&format=trix&extractors=custom) |
[http://en.dbpedia.org/resource/%3F_(film)](http://dief.tools.dbpedia.org/server/extraction/en/extract?title=%3F_(film)&revid=&format=trix&extractors=custom) | [http://dbpedia.org/ontology/abstract](http://dbpedia.org/ontology/abstract) #en_abstract_validation |
[http://en.dbpedia.org/resource/%3F_(film)](http://dief.tools.dbpedia.org/server/extraction/en/extract?title=%3F_(film)&revid=&format=trix&extractors=custom) | [http://books.google.com/books%3Fvid=ISBN978-0-8014-4515-6](http://books.google.com/books%3Fvid=ISBN978-0-8014-4515-6) #%3F_(film)_citation1 | [https://github.com/dbpedia/extraction-framework/issues/625](https://github.com/dbpedia/extraction-framework/issues/625) |
[http://en.dbpedia.org/resource/%3F_(film)](http://dief.tools.dbpedia.org/server/extraction/en/extract?title=%3F_(film)&revid=&format=trix&extractors=custom) | [http://dbpedia.org/property/accessDate](http://dbpedia.org/property/accessDate) #Citation_english_languagа_accessDate_datatype_validation |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix broken table row markup.

Rows like Line 29 only emit one column separator (... | ). With a four-column header, markdown requires three pipes per row (e.g. ... | | | ). The current markup trips MD055/MD056 and renders columns misaligned. Please pad each of these rows with the missing separators.

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

29-29: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


29-29: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


30-30: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


30-30: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


31-31: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


31-31: Table column count
Expected: 4; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)


32-32: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


32-32: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)


33-33: Table pipe style
Expected: no_leading_or_trailing; Actual: trailing_only; Unexpected trailing pipe

(MD055, table-pipe-style)


33-33: Table column count
Expected: 4; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)

🤖 Prompt for AI Agents
In dump/src/test/resources/shaclTestsCoverageTable.md around lines 29 to 33,
several table rows only include a single pipe separator while the header defines
four columns; update each affected row so it contains three pipe separators
(e.g. "col1 | col2 | col3 | col4") by padding missing empty columns with
trailing " | " where needed to ensure every row has four columns and the
markdown table renders correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants