This repository was archived by the owner on Sep 9, 2026. It is now read-only.
Make instance fake work for KSA - #34
Merged
Maximilian-Nesslauer merged 2 commits intoJul 4, 2026
Merged
Maximilian-Nesslauer merged 2 commits into
Maximilian-Nesslauer merged 2 commits into
Conversation
- Normalize the requested version (build counter pinned to 0) in FakeInstance and the CmdLine fake path, so raw in-game version strings like 2026.6.9.4750 are accepted - Write a minimal Content/Versions/v<year>.<month>.X.<revision>.json with the build field so KsaBuildVersionProvider detects the faked version and the instance is valid; the path, file name, and body helpers live next to the provider so reader and writer share the contract - Validate the full KSA version including the revision against the build map, and reject unknown fully defined versions in the CLI instead of silently substituting a different known revision - Reject the KSP-only --MakingHistory/--BreakingGround options for other games instead of creating bogus KSP DLC folders in the faked instance - Tests: Core fake-instance cases (raw, normalized, unknown) and CmdLine end-to-end cases (raw version works, unknown revision fails, DLC options fail)
# Conflicts: # Tests/CmdLine/GameInstanceTests.cs
averageksp
approved these changes
Jul 4, 2026
This was referenced Jul 4, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
instance fake --game KSAalways failed, for the two stacked reasons described in #30. This makes it work end to end; it is the client-side prerequisite for the xKAN-meta_testing step of KSP-CKAN#4457 (the metadata tester verifies mods by installing them into a fake instance).FakeInstanceand the CmdLine fake path normalize the requested version (build counter pinned to 0, matching how every KSA version is stored since Ignore KSA's non-monotonic build counter for version ordering #14), so the raw in-game version string (2026.6.9.4750) is accepted.FakeInstancewrites a minimalContent/Versions/v<year>.<month>.X.<revision>.jsonwith thebuildfield, which is the only on-disk version sourceKsaBuildVersionProviderreads (KSP2 falls back to its known-versions list, KSA does not). The faked instance now has a detectable version and passesAddInstance. The directory, file name, and body helpers live next to the provider so reader and writer share the contract, mirroring theKspBuildIdVersionProvider.buildIDfilenamesprecedent.Hardening on top, from a code-review pass over the change:
WithoutBuild(the pre-existing gate) would have degenerated the check to year.month for KSA and accepted revisions that never shipped.--MakingHistory/--BreakingGroundoptions are rejected for other games instead of creating bogus KSP DLC folders inside the faked instance (previously reachable for KSP2 as well).Testing
BadGameVersionKraken.Closes #30.