Skip to content

fix: unbreak Backend CI (validation + archiving compile errors) - #1181

Merged
chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
abdulwaarith0:fix/validation-backend-ci
Sep 2, 2026
Merged

fix: unbreak Backend CI (validation + archiving compile errors)#1181
chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
abdulwaarith0:fix/validation-backend-ci

Conversation

@abdulwaarith0

Copy link
Copy Markdown
Contributor

Backend CI is red on main: cargo test --workspace doesn't compile, so no tests run and every open backend PR inherits the red. A few crates were merged non-compiling. This fixes two of them; the rest is tracked in #1180.

validation:

  • The async redis calls (get/incr/expire/set_ex) need the AsyncCommands trait in scope. It wasn't imported.
  • Arc is used by ValidationWebSocketHandler but std::sync::Arc wasn't imported.
  • position_cache is mutated through &self (the validator is shared via Arc), so a plain HashMap field can't work. Wrapped it in a Mutex with short locked sections that don't span awaits, and fixed a borrow-of-moved in parse_uci_move (compute is_castling before moving from_square/to_square into the struct).

archiving:

  • reqwest needs its multipart feature for the Arweave upload.
  • cost_usd is Option<f64> but was assigned an unwrapped f64 in two branches.
  • metadata.tags is a Vec, not an Option.
  • form_data mixes literal and formatted keys, so it needs String keys.
  • a format string had an unbalanced brace.

Verified locally: both crates compile and cargo test -p validation / -p chess pass. This doesn't fully green CI on its own (the metrics crate, see #1180, still needs fixing), but it clears two of the blockers.

@abdulwaarith0

Copy link
Copy Markdown
Contributor Author

On the red CI here: this clears the validation and archiving compile errors, but main also has the metrics crate not compiling on its own (it calls .with_label_values(...) on plain Counter/Histogram). So the workspace still won't fully build until metrics is fixed too, and this PR's CI will stay red until then.

I left metrics out because the fix is a labeled-metrics design choice (CounterVec/HistogramVec + label names) that's really yours to make. The full picture and repro is in #1180.

@chinweobtagaz
chinweobtagaz merged commit cdeafc6 into OpenKnight-Foundation:main Sep 2, 2026
2 of 3 checks passed
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