3 Commits

Author SHA1 Message Date
ef639679d1 Merge pull request 'fix(sidecar): apply rustfmt to the protocol 3.0 cutover code' (#22) from fix/rustfmt-release into main
All checks were successful
sync-project-tree / sync (push) Successful in 8s
SonarQube / analysis (push) Successful in 42s
Release sidecar / release (push) Successful in 6m22s
Reviewed-on: #22
Reviewed-by: Colby Whitlock <whitlocktech@gmail.com>
2026-08-01 06:41:46 +00:00
8c4dc0ee93 fix(sidecar): apply rustfmt to the protocol 3.0 cutover code
The release workflow's first gate is `cargo fmt --check`, and the 3.0
cutover merge (2301c57) landed two rustfmt violations in the
`world.ruleset` path, so the run failed before it could build or tag:

- main.rs: the `upsert_ruleset(..)` call fits on one line
- store.rs: the `upsert_ruleset` signature does not

No behavior change — formatting only.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-01 01:40:03 -05:00
2301c57768 Merge pull request 'feat(sidecar)!: Protocol 3.0 cutover — X-UOLink-Version 2 → 3' (#21) from edge into main
Some checks failed
sync-project-tree / sync (push) Successful in 7s
SonarQube / analysis (push) Successful in 48s
Release sidecar / release (push) Failing after 59s
Reviewed-on: #21
Reviewed-by: Colby Whitlock <whitlocktech@gmail.com>
2026-08-01 06:34:19 +00:00
2 changed files with 7 additions and 6 deletions

View File

@@ -262,11 +262,7 @@ async fn main() -> anyhow::Result<()> {
// lets a reader tell a re-send from an actual config change. // lets a reader tell a re-send from an actual config change.
"world.ruleset" => { "world.ruleset" => {
if let Err(e) = event_store if let Err(e) = event_store
.upsert_ruleset( .upsert_ruleset(ev.value.get("rev").and_then(|r| r.as_str()), &text, t)
ev.value.get("rev").and_then(|r| r.as_str()),
&text,
t,
)
.await .await
{ {
tracing::warn!(error = %e, "failed to upsert ruleset"); tracing::warn!(error = %e, "failed to upsert ruleset");

View File

@@ -299,7 +299,12 @@ impl Store {
/// `world.ruleset` frame per connect describing how it is configured, and only the latest one /// `world.ruleset` frame per connect describing how it is configured, and only the latest one
/// matters. `rev` is the shard's FNV-1a of the body, kept so a reader can tell "same ruleset, /// matters. `rev` is the shard's FNV-1a of the body, kept so a reader can tell "same ruleset,
/// re-sent on reconnect" from "the operator changed something" without diffing the JSON. /// re-sent on reconnect" from "the operator changed something" without diffing the JSON.
pub async fn upsert_ruleset(&self, rev: Option<&str>, json: &str, t: i64) -> anyhow::Result<()> { pub async fn upsert_ruleset(
&self,
rev: Option<&str>,
json: &str,
t: i64,
) -> anyhow::Result<()> {
sqlx::query( sqlx::query(
"INSERT INTO ruleset (id, rev, json, updated_t) VALUES (1, ?, ?, ?) "INSERT INTO ruleset (id, rev, json, updated_t) VALUES (1, ?, ?, ?)
ON CONFLICT(id) DO UPDATE SET rev = excluded.rev, json = excluded.json, updated_t = excluded.updated_t", ON CONFLICT(id) DO UPDATE SET rev = excluded.rev, json = excluded.json, updated_t = excluded.updated_t",