Skip to content

feat(engines): StarRocks engine posture: profiles on create, Not governed, Security upgrade - #847

Merged
viethqb merged 19 commits into
mainfrom
feat/starrocks-engine-posture
Nov 10, 2026
Merged

viethqb merged 19 commits into
mainfrom
feat/starrocks-engine-posture

Conversation

@viethqb

@viethqb viethqb commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Package B of the StarRocks follow-ups. This change shows which StarRocks engines egret does not govern or protect, and lets an admin fix them.

  • Unbound engines (KI-336).

    • With Ranger on, a StarRocks create now gets a policy profile the way a Trino create does. Add engine has a new Policy profile select, which by default creates a profile named after the engine.
    • An engine with no profile shows Not governed in the list and on its page.
  • Legacy engines.

    • A provisioned StarRocks engine shows Security upgrade needed when any of these holds:
      • its FE image is older than egret-starrocks-fe:4.1.7-egret.4 (the image that closes KI-340, KI-345 and the other fork patches);
      • its FE root has no password;
      • its last upgrade did not finish applying.
    • Upgrade security (POST /api/control-plane/engines/{id}/security-upgrade, engine:update) does three things:
      • mints the root password;
      • moves the FE and CN images to the defaults, unless that would downgrade the FE;
      • applies the engine.

    It is idempotent, so pressing it again finishes a partial run.

Spec: docs/en/specs/2026-11-09-starrocks-engine-posture-design.md. Plan: docs/en/plans/2026-11-09-starrocks-engine-posture.md.

Changes

  • egret-perm::engine_images:
    • is_patched_starrocks_fe. A ref that carries a digest is judged by the digest alone, which counts a mirrored image. A ref without a digest is judged by its tag.
    • starrocks_fe_upgrade_target, which refuses a downgrade. The frontend copy of this rule is removed.
  • KI-336:
    • plan_profile and bind_profile are shared by Trino and StarRocks.
    • PolicyPort::ensure_starrocks_def: a StarRocks profile has no tag service.
    • A create refuses with 409 a named profile of the wrong type, or one another engine binds.
    • The DTO gains notGoverned.
  • Engine DTO, list, detail, create and update responses:
    • securityUpgradeNeeded;
    • securityUpgradeReasons (unpatchedImage, noRootPassword, notApplied);
    • securityUpgradeFeImage;
    • securityUpgradeBlockedRelease.
  • Migration 0217_engine_security_upgrade_pending.sql: a flag that is set before the upgrade's apply and cleared on a successful apply. The image write is a jsonb_set of the two keys only.
  • Provisioner: the {name}-initpwd Job is deleted with Background propagation, and the apply waits (bounded, 30 s) until the old Job is gone. Before, every second apply patched the terminating Job, so the Job vanished and orphan pods piled up. This was found in the live check.
  • Frontend:
    • the profile picker;
    • the Not governed and Security upgrade needed badges;
    • the upgrade warning and confirmation dialog;
    • the old metadata-tables warning is hidden while the upgrade warning shows.

Test plan

  • Every behaviour change has a test plus a mutant of the change that the test kills, recorded in the task reports.
  • cargo fmt, and clippy -D warnings clean.
  • egret-perm 28 passed.
  • egret-engine-mgmt (DB) 546 passed.
  • egret-provisioner 221 passed.
  • Frontend: typecheck and lint clean; vitest for control-plane and governance/engines 878/878.
  • Live check on kind (StarRocks operator v1.11.6, egret release binary on the host):
    • A legacy engine on official 4.1.6 with a passwordless root showed the badge.
    • After Upgrade security:
      • mysql -uroot with no password got ERROR 1045 and the stored password logged in;
      • the FE ran 4.1.7-egret.4 and the CN ran 4.1.7;
      • the badge was gone.
    • KI-336: a StarRocks create with Ranger on made and bound a profile, and an engine with no profile showed Not governed.
    • The initpwd fix was re-checked with the release binary of this branch: 3 upgrades back to back each left a fresh, non-terminating Job, the last one succeeded, and no new orphan pods were left.
    • Not checked live:
      • the downgrade guard, because Docker Hub has no 4.1.8 or 4.2 tag;
      • egret's own root login, because egret ran on the host and could not resolve the FE's cluster DNS name. The password was read from the Secret egret rendered.

Documentation

egret-data/docs#74 covers:

  • the Engine detail page: badge, warning, Upgrade security, Not governed;
  • Add engine: the profile picker;
  • the upgrade notes;
  • known issues: KI-336 fixed, and KI-340/KI-345 point to the upgrade;
  • the Engines REST reference;
  • four new screenshots.

Checklist

  • Linked to an issue (no issue; package B of the StarRocks follow-ups)
  • Tests added or updated
  • Docs updated in egret-data/docs for any user-visible feature, UI, API or config change
  • Commit messages follow Conventional Commits
  • No secrets, tokens or real data added

🤖 Generated with Claude Code

viethqb and others added 18 commits November 10, 2026 17:25
Package B of the StarRocks follow-ups: KI-336 (StarRocks gets a policy
profile like Trino, and a "Not governed" warning) and legacy engines (a
"Security upgrade needed" badge and an upgrade action that moves the FE
and CN to the patched default images and sets a root password).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seven tasks: the patched-image rule in egret-perm, KI-336 profile at
StarRocks create plus notGoverned, the security-upgrade DTO fields, the
security-upgrade route, the frontend, a live check on kind, and docs.
Section 0 corrects three spec statements against main 26016f9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and DTO fields

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rget live in egret-perm

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ensure_starrocks_def sits beside ensure_trino_def and calls
service_def::seed_starrocks, so engine-mgmt can create a starrocks
profile for a new StarRocks engine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…create (KI-336)

plan_trino_profile/bind_trino_profile become plan_profile/bind_profile,
taking the engine type. Trino keeps its plans, its <name>_tag tag
service and its messages. A StarRocks create now plans the profile
before minting anything and binds it before the first provision: with
Ranger on and no authzServiceId it creates the starrocks profile <name>
(no tag service) or adopts an unbound same-name one; a same-name profile
of another type or bound elsewhere is a 409. An authzServiceId naming no
profile stays a 400. A failed create deletes only a profile it made.

EngineDto gains notGoverned: true for a provisioned or external
StarRocks engine bound to no profile while Ranger is on.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /api/control-plane/engines/{id}/security-upgrade (engine:update) mints
a FE root password when the engine has none, moves FE and CN to the default
patched images unless the engine runs a newer release, and re-applies the
engine so the provisioner's initpwd Job sets the password on the running FE.
Nothing is applied when nothing changed. External engines get 409
engine_is_external, non-StarRocks engines 409.

openapi.json is regenerated; it also carries the Task 2/3 EngineDto fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a repeat finishes it

The upgrade stored the root password secret and the patched images before
its apply, so a failed or interrupted apply left the engine reporting no
upgrade needed and a repeat call applied nothing. Migration 0217 adds
engine_mgmt.engines.security_upgrade_pending: the route sets it before it
writes, always re-applies, and any accepted StarRocks apply (apply_built or
the settings PUT) clears it. While set the engine reports the new
notApplied security upgrade reason.

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

Add engine's StarRocks branch gets a Policy profile select: the default
creates a profile named after the engine (no authzServiceId), the other
options are free StarRocks profiles (KI-336).

Engines whose DTO says notGoverned show a "Not governed" warning on their
page and a badge in the list. Provisioned StarRocks engines that need a
security upgrade show a "Security upgrade needed" badge and a warning that
names each reason, with an Upgrade security button and a confirmation
dialog that lists the image, CN and root password changes.

isPatchedStarRocksImage is gone: the pages read the server's verdict
(securityUpgradeReasons), and the old metadata-table warning on a
provisioned engine yields to the upgrade warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ref that carries a digest is judged by that digest, since the digest is
what the node pulls; the egret tag rule now applies only to a digest-less
ref. A patched tag pinned to the egret.3 digest, or to an unknown digest,
is unpatched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…only the upgrade's image keys

- plan_profile: an authzServiceId naming a profile of another type, or one
  another engine binds, is a 409 on both the Trino and the StarRocks
  create; the StarRocks pre-check is folded in, so profiles are listed
  once and an id naming no profile stays a 400 for StarRocks.
- The security upgrade writes starrocksConfig.feImage and .cnImage with
  jsonb_set (new EngineMgmtStore::set_starrocks_images, status-guarded),
  so a spec change committed by a concurrent PUT is kept.
- Every EngineDto response (create, PUT, external register and PATCH)
  goes through with_runtime, so notGoverned and runtime match the GET.
- Tests: the new 409s leave nothing behind; a StarRocks engine with no
  recorded FE image is unpatched; the failed-create test asserts both
  errors are the injected provision failure.

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

Plain "root" in the reason sentence; the server's blocked-release
sentence in the dialog; "the current image (not recorded)" for an absent
FE image; reasons this client does not know are left out (the generic
line stays); the dialog warns that egret's own admin statements fail
until the FE takes the new root password. imageVerdict takes the
generated SecurityUpgradeReason[]. Tests cover the 502 re-read and the
engines list invalidation.

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

A StarRocks create now refuses a trino profile while planning its profile,
with plan_profile's wording, so the cross-type assertion reads that
wording, and the guarded-bind test gives its StarRocks half a starrocks
profile so the create still reaches the guarded bind.

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

Delete with Background propagation and poll until NotFound (30 s bound);
surface delete errors instead of ignoring them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t on read errors

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
viethqb added a commit that referenced this pull request Nov 10, 2026
…848)

focusHeadingOnArrival polls for up to 10 s. When a test ends first, its next
tick ran after jsdom tore down document and threw an uncaught ReferenceError,
which fails the whole vitest run (seen on main 1418484 and PR #847, from
RulePageDelete.test.tsx).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@viethqb
viethqb merged commit e565d7b into main Nov 10, 2026
9 checks passed
@viethqb
viethqb deleted the feat/starrocks-engine-posture branch November 10, 2026 13:29
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