Add KSA support to the metadata tester - #2
Merged
Conversation
- 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.
averageksp
approved these changes
Jul 4, 2026
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds Kitten Space Agency support to the metadata tester, mirroring how KSP2 was added in KSP-CKAN#91:
Ksagame class inckan_meta_tester/game.py, with the build map fromKSAModding/KSA-CKAN-meta(branchmain).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.ckancompatibility fields carry those normalized values, so_versions_from_jsonnormalizes 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-pieceBUILD_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_iddispatchesKSAand names it in the unknown-id error;action.ymldocuments the new game input value.tests/game.py(registered intests/__init__.py, which is how the suite collects tests): mockedfrom_iddispatch including theBUILDS_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/metadataDocker image built from upstream KSP-CKAN/CKAN, which rejects--game KSAuntil 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 makesckan instance fake --game KSAwork (raw version strings accepted, revision-exact build-map gate,Content/Versionsfile written for detection).Testing
builds.jsonthrough theKsaclass: 147 versions, every build counter 0, latest2026.7.0.4826, and revision-range compatibility (2026.6.0.4700..2026.7.0.4826) selects exactly the expected versions.Closes #1.