Skip to content

Enforce submodule-only AsyncTI4 data loading and add PR gate for pbd22635 analysis + unit tests - #38

Merged
adam133 merged 2 commits into
mainfrom
copilot/fix-data-loading-issues
Apr 17, 2026
Merged

Enforce submodule-only AsyncTI4 data loading and add PR gate for pbd22635 analysis + unit tests#38
adam133 merged 2 commits into
mainfrom
copilot/fix-data-loading-issues

Conversation

Copilot AI commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

The analyze workflow was partially loading data from non-repo locations, which caused missing datasets (notably hyperlanes) and fallback behavior that masked data integrity issues. This change makes data loading strict: all required datasets must come from the local AsyncTI4 submodule, or execution fails fast.

  • Data source hardening (no partial fallbacks)

    • Added centralized submodule resource discovery in scripts/_data_paths.py.
    • Replaced brittle path assumptions (e.g., deriving from installed package location) with repository/submodule resolution.
    • Enforced hard errors when required data directories/files are missing or empty (technologies, leaders, planets, systems, attachments, units, hyperlanes).
  • Removed incomplete/remote fallback paths

    • Removed strategy-card and strategy-card-set remote URL fallback logic.
    • Removed silent “return empty” fallback branches for required datasets.
    • Kept behavior aligned with requirement: local submodule data is the single source of truth.
  • Workflow coverage for this regression

    • Added .github/workflows/pr-unit-tests.yml on pull_request to main.
    • Runs ti4-analyze "pbd22635" and then python -m pytest tests.
  • Tests updated for strict behavior

    • Reworked strategy-card loader tests to assert local-data loading and hard failures when local data is absent.
    • Added new tests for hard-error behavior across tech, leader, planet, system, and hyperlane loaders.
# before: silently degraded
# except (OSError, ValueError):
#     return {}

# now: fail fast on missing/invalid required data
with _HYPERLANES_DATA_FILE.open(encoding="utf-8") as fh:
    ...

@adam133
adam133 marked this pull request as ready for review April 17, 2026 01:48
@adam133
adam133 merged commit a153af1 into main Apr 17, 2026
1 check passed
@adam133
adam133 deleted the copilot/fix-data-loading-issues branch April 17, 2026 01:51
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