Skip to content

Add KSA support to the metadata tester - #2

Merged
Maximilian-Nesslauer merged 1 commit into
masterfrom
ksa-game-support
Jul 4, 2026
Merged

Add KSA support to the metadata tester#2
Maximilian-Nesslauer merged 1 commit into
masterfrom
ksa-game-support

Conversation

@Maximilian-Nesslauer

Copy link
Copy Markdown
Member

What

Adds Kitten Space Agency support to the metadata tester, mirroring how KSP2 was added in KSP-CKAN#91:

  • New Ksa game class in ckan_meta_tester/game.py, with the build map from KSAModding/KSA-CKAN-meta (branch main).
  • KSA versions are year.month.buildcounter.revision, where the build counter (3rd piece) is per-build-machine and non-monotonic while the revision (4th piece) is the real ordinal. The CKAN client pins the counter to 0 on every KSA version it stores (KittenSpaceAgency.NormalizeBuildCounter), and the inflated .ckan compatibility fields carry those normalized values, so _versions_from_json normalizes the raw build-map strings the same way (2026.7.3.4826 -> 2026.7.0.4826) and then deduplicates same-revision builds. This is deliberately NOT KSP2's strip-the-last-piece BUILD_PATTERN, which would drop the revision. Entries that are not raw 4-piece version strings are skipped instead of crashing the run or passing through un-normalized.
  • Game.from_id dispatches KSA and names it in the unknown-id error; action.yml documents the new game input value.
  • New tests/game.py (registered in tests/__init__.py, which is how the suite collects tests): mocked from_id dispatch including the BUILDS_URL, unknown-id message, normalization with a real non-monotonic pair from February 2026, same-revision dedup, and malformed-entry skipping.

Sequencing

The tester executes inside the kspckan/metadata Docker image built from upstream KSP-CKAN/CKAN, which rejects --game KSA until the client support is merged there, so the upstream PR for this change waits for the client. The client-side prerequisite in the fork is already merged: KSAModding/CKAN-KSA#34 makes ckan instance fake --game KSA work (raw version strings accepted, revision-exact build-map gate, Content/Versions file written for detection).

Testing

  • mypy green.
  • Full unittest suite with the netkan package installed: all game tests green (14 tests total)
  • A live check fetched the real builds.json through the Ksa class: 147 versions, every build counter 0, latest 2026.7.0.4826, and revision-range compatibility (2026.6.0.4700..2026.7.0.4826) selects exactly the expected versions.

Closes #1.

- Add a Ksa game class: build map from KSAModding/KSA-CKAN-meta (branch main); _versions_from_json pins the per-machine, non-monotonic build counter (3rd version piece) to 0 and keeps the revision (4th), matching how the CKAN client and the inflated .ckan compatibility fields store KSA versions, then deduplicates same-revision builds. Entries that are not raw 4-piece version strings are skipped instead of crashing the run or passing through un-normalized.
- Dispatch KSA in Game.from_id and include it in the unknown-id error message.
- Document the KSA value for the action's game input.
- Tests: from_id dispatch with a mocked build-map fetch, unknown-id message, build-counter normalization (including a real non-monotonic pair from February 2026), same-revision dedup, and malformed-entry skipping. Register the new module in tests/__init__.py, since the suite collects tests through the package namespace rather than file discovery.
@Maximilian-Nesslauer Maximilian-Nesslauer added enhancement New feature or request infrastructure Work on the KSA CKAN infrastructure (bot, tester, status page) labels Jul 4, 2026
@github-project-automation github-project-automation Bot moved this to Todo in CKAN-KSA Jul 4, 2026
@Maximilian-Nesslauer Maximilian-Nesslauer moved this from Todo to In Progress in CKAN-KSA Jul 4, 2026
@Maximilian-Nesslauer
Maximilian-Nesslauer merged commit f833d72 into master Jul 4, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in CKAN-KSA Jul 4, 2026
@Maximilian-Nesslauer
Maximilian-Nesslauer deleted the ksa-game-support branch July 4, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request infrastructure Work on the KSA CKAN infrastructure (bot, tester, status page)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add KSA support to the metadata tester

2 participants