Skip to content

fix(catalog-engine): unreachable_code on never-typed error breaks rust CI (stable 1.99) - #856

Merged
viethqb merged 1 commit into
mainfrom
fix/clippy-unreachable-code
Nov 13, 2026
Merged

viethqb merged 1 commit into
mainfrom
fix/clippy-unreachable-code

Conversation

@viethqb

@viethqb viethqb commented Nov 13, 2026

Copy link
Copy Markdown
Member

What

The CI rust job fails on main (and therefore on every code PR) because the repo's rust-toolchain.toml pins the floating stable channel, and the current stable (rustc 1.99.0) now infers the tower catalog-loader's .oneshot(req).await error as the never type. That makes .map_err(|e| e.to_string())? trip error: unreachable_code under -D warnings.

Surfaced by PR #854's rust job; the file is unchanged on that branch and identical here — this is a pre-existing, toolchain-driven breakage, not a change from any feature branch.

Fix

One line in crates/egret-catalog-engine/src/table_hook.rs (drop_registered):

-        .map_err(|e| e.to_string())?;
+        .unwrap_or_else(|e| match e {});

The error is uninhabited, so match e {} is exhaustive and unwrap_or_else takes the value directly — no dead .to_string() closure, no change in behaviour. A full-workspace cargo clippy --workspace --all-targets -- -D warnings is clean after this (only this one site was affected) and cargo fmt --check passes.

Verification

  • cargo clippy --workspace --all-targets -- -D warnings → clean (exit 0).
  • cargo fmt --check → clean.

🤖 Generated with Claude Code

…s unreachable_code

The floating `stable` toolchain (rustc 1.99.0) now infers the tower loader's
`.oneshot(req).await` error as the never type, so `.map_err(|e| e.to_string())?`
trips `unreachable_code` under `-D warnings` and breaks the rust CI job on main.
Replace it with `.unwrap_or_else(|e| match e {})` — the error is uninhabited, so
this takes the value directly, preserving behaviour with no dead closure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@viethqb
viethqb merged commit 9996fde into main Nov 13, 2026
9 checks passed
viethqb added a commit that referenced this pull request Nov 13, 2026
…e mask gate

SP3a gates StarRocks column masks and row filters on the egret fork image
level (>= 3). These pre-existing DB-gated fixtures seeded their StarRocks
engine with an official (or absent) image tag, which resolves to no fork
level, so the gate lowered every mask and row filter to a deny — dropping
the MASK_HASH the rename tests assert and hiding the row-filter tie the
boot-pass test asserts. The failures surfaced only now because the
unreachable_code compile break (fixed in #856) had kept the DB-gated rust
job from ever reaching them.

Point the fixtures at the fork image egret runs in production
(ghcr.io/egret-data/egret-starrocks-fe:4.1.7-egret.4, level 4):

- table_hook_db / view_rename_db: renamed table/column/view keep their mask.
- recompile_on_tag_write: assign recompiles the bound profile (mask + deny).
- governance_attention: the tied row-filter rules reach the engine, so the
  compile fails and the boot-pass refusal names both rules. Its k_sr_eng is
  now inserted inline with the fork image; the shared engine() helper seeds
  no image, and the plugin_unmodelled test still needs the floating tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
viethqb added a commit that referenced this pull request Nov 13, 2026
…int framing (#854)

* feat(engine-mgmt): parse the egret fork image level from an image tag

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style(engine-mgmt): cargo fmt the egret image level test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(perm-ir): carry the egret image level on the EP input

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(perm-ir): gate StarRocks mask/row filter on the fork image level; mixed EP = least capable

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(perm-ir): wire the egret image gate into the lowering and enforcement paths

The matrix image dimension was inert: no production path consulted the real
per-engine image level. lower_rules now passes the EP's most-restrictive
effective image level into lower_rule (a StarRocks mask / row filter below
egret.3 is reported as a skip, not lowered), AttachedEngine carries the level
for the NotEnforced reporting, and load_ep reads the engines' image levels
before any rule is lowered. Byte-identical on fork images (effective level
>= 3); fixtures that ran StarRocks on official or unpinned images now pin the
fork image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(perm-ir): an image-gated StarRocks mask / row filter lowers to a deny, not to nothing

Below egret.3 a missing mask policy served the column in cleartext. The gated
rule now lowers to a withhold of its columns / tables to everyone but the
exemptions, rendered as an access deny attributed to the rule, and is still
reported in the compile summary. The enforcement report uses the same
EP-wide most-restrictive image level as the lowering.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(ui): call the governance profile an enforcement point

Surface text only: UI labels and help text, OpenAPI descriptions and the
no-tag-service warning. Identifiers, JSON keys, routes and the table are unchanged.
openapi.json and the generated client are regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style(gov): rustfmt the enforcement-point rename's rewrapped strings

Task 5's profile->enforcement-point rename lengthened three warning-string
consts past the wrap point; cargo fmt had not been re-run on them. Whitespace
only; no behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(perm-ir): seed StarRocks fixtures on the egret fork image for the mask gate

SP3a gates StarRocks column masks and row filters on the egret fork image
level (>= 3). These pre-existing DB-gated fixtures seeded their StarRocks
engine with an official (or absent) image tag, which resolves to no fork
level, so the gate lowered every mask and row filter to a deny — dropping
the MASK_HASH the rename tests assert and hiding the row-filter tie the
boot-pass test asserts. The failures surfaced only now because the
unreachable_code compile break (fixed in #856) had kept the DB-gated rust
job from ever reaching them.

Point the fixtures at the fork image egret runs in production
(ghcr.io/egret-data/egret-starrocks-fe:4.1.7-egret.4, level 4):

- table_hook_db / view_rename_db: renamed table/column/view keep their mask.
- recompile_on_tag_write: assign recompiles the bound profile (mask + deny).
- governance_attention: the tied row-filter rules reach the engine, so the
  compile fails and the boot-pass refusal names both rules. Its k_sr_eng is
  now inserted inline with the fork image; the shared engine() helper seeds
  no image, and the plugin_unmodelled test still needs the floating tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant