Environment variable overrides - #47
Conversation
…DOT_VERSION WAVEDASH_UNITY_VERSIONenv var overrides
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Claude finished @The64thRealm's task in 3m 57s —— View job Code Review — Environment variable overrides
The design here is genuinely nice: privatizing the 1. Blank
|
…or toml file if env vars cover all of the necessary items
|
Claude finished @The64thRealm's task in 5m 26s —— View job Code Review — Environment variable overrides
The three findings from the last round are all properly fixed, and two of the fixes went further than what was asked. Removing clap's Four things on the new commit. 1.
|
WavedashConfig held a merged view: apply_env_overrides wrote the WAVEDASH_* values into the struct when the config was read off disk, and validated them there too. Two of those checks only concern a build, but load runs for every command that opens a config, so a stale WAVEDASH_ENTRYPOINT under a [godot] config aborted `stat`, `achievement`, and `publish` — none of which read an entrypoint. Passing --game-id skipped the load entirely, so the same shell gave opposite results depending on an unrelated flag. The overrides are now captured into an EnvOverrides snapshot and each accessor falls back through them: env, then file, then default. That makes the refusals land on the reads that would have ignored the value — entrypoint_with_source for an inert WAVEDASH_ENTRYPOINT, active_engine for the two version conflicts, both reached by `build push` and `dev` and by nothing else. reject_engine_conflict had the same defect and is folded into active_engine, which now holds every engine rule in one place. Deleted along the way: the notice vec, entrypoint_from_env, and the merge step itself. The source of an entrypoint now falls out of which fallback answered. entrypoint/engine_version return Result, and entrypoint_with_source no longer swallows a two-engine config into a None. Tests: resolve_game_id's flag > env > file precedence and load's file-optional rule had no coverage; both are now tested through the same injected-environment seam, which is a captured EnvOverrides rather than a lookup fn. Also adds .github/workflows/ci.yml. Nothing in .github ran cargo — release.yml resolves to `dist plan` on a pull request and never invokes the compiler — so neither these tests nor the build were checked by anything.
Found while diffing old and new CLI behavior: JSDOS/Ruffle/Ren'Py have no version override, so engine_version used to read their section directly. They now come through declared_engine with everything else, and nothing tested that.
|
Claude finished @The64thRealm's task in 5m 3s —— View job Code Review — Environment variable overrides
The Three things, one of them carried over unfixed. 1.
|
--token was the only string arg left without the non-empty parser, so `auth login --token " "` printed success over a key `auth status` then reported as unauthenticated. store_credentials refuses one as well: it is the one funnel every login path goes through, and the read side already treats a blank stored key as a corrupt file.
[godot] version = "" was the last place blank didn't mean unset: it went to the API as the build's engine version, and built a play URL for version "" in dev. Unset field by field rather than by dropping the whole section, so WAVEDASH_GODOT_VERSION still fills in what the section left out and WAVEDASH_UNITY_VERSION is still refused as an engine switch — dropping it would have silently allowed both. A blank executable and loader_url get the same treatment.
|
Claude finished @The64thRealm's task in 6m 3s —— View job Code Review — Environment variable overrides
Both carried findings are closed, and one of them was fixed better than proposed.
Three things left, none of them in the new commits. 1.
|
|
Claude finished @The64thRealm's task in 3m 30s —— View job Code Review — Environment variable overrides
The only change since the last round is One new finding from the merge, and three carried over. 1.
|
|
Claude finished @The64thRealm's task in 3m 4s —— View job Code Review — Environment variable overrides
The two dedups are also the right ones. Four verbatim Two things from this commit, three carried. 1.
|
|
Claude finished @The64thRealm's task in 2m 51s —— View job Code Review — Environment variable overrides
1.
|
|
Claude finished @The64thRealm's task in 2m 51s —— View job Code Review — Environment variable overrides
Two things about the new string, then the three carried findings. 1. On a flag's own help, "override with WAVEDASH_GAME_ID" says the opposite of the precedence
The intended reading is "override the file with the variable", and that's accurate. But this text is attached to Concretely, that's the CI shape this PR exists for: env:
WAVEDASH_GAME_ID: 12345
run: wavedash stat create --game-id "$LEGACY_ID" --identifier KILLS --name KillsA reader who took the help at face value expects Something that does both — file first, and no claim about beating the flag: help = "Game ID (default: game_id in wavedash.toml; WAVEDASH_GAME_ID overrides the file)"Two smaller things in the same string while it's being touched:
2. The string is hand-copied seven times, and it has already drifted onceThis commit had to edit seven identical literals to change one sentence, and the reason all seven needed editing is that the previous round found A 3.
|
Added environment variable overrides:
tool will announce when it's using an override when a command is run
The two builds are uploaded to different games:

This pr is required for the planned godot plugin that integrates cli features.