Separate refused access and unreadable grants from drift in guidance checks

Aperta
#1,761 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
clickhouse, python
Ambito
backend, databases

Direzione di ricerca

Start with #1176, then read server/tracker/domain/contract.py, server/tracker/app/contract.py, and server/tracker/app/onboarding.py to understand the existing type checks and grant reads. The issue proposes new declared-object and grant-scope handling, with behavior that must be validated against a live source fixture. Done means the listed outcomes, retained results, tenant isolation, and metadata-only access all pass the acceptance fixture.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
Company

ClickHouse

Component

Knowledge (documents)

Use case

#1176 checks a maintained query recipe against the source it describes and requires that "revoked access, an unavailable source and a missing column remain distinct outcomes."

If a metadata read through the source's credential hides a table the credential can no longer see, a dropped table and a revoked grant look the same: the table is absent. That behaviour of system.columns is expected and not yet confirmed on a live source. A check that reads absence as drift then flags every recipe on that table when a grant is revoked. A check that cannot read the grants has no basis for either answer.

Describe the solution you'd like

Define the check's outcome contract inside #1176's first delivery: registered tracker sources, metadata only. This is a proposal; nothing is implemented or measured.

  • Declared objects. The object list #1176 attaches to a guidance revision is the maintainer's declaration: database, table, column and an expected type family per column. No model writes or extends it.
  • Reason on unable. #1176 already defines the three outcomes and binds a result to the guidance revision and the check definition. This adds a reason to unable: source_unavailable, access_refused, grants_unreadable, timeout or source_removed.
  • Fail closed. A table absent from the metadata read is access_refused when the credential's grants no longer cover it and drift when they do. If the grants cannot be read, the outcome is unable with grants_unreadable, never drift or passed.
  • No cascade. Removing a source registration deletes no check definition and no result. Later checks return unable with source_removed. Rows leave through namespace or user erasure.
  • A renamed column reports as missing. Suggesting the new name is outside this proposal.

What Loom has that this builds on:

  • family_ok and _check_columns in server/tracker/domain/contract.py compare a live column type with an expected family.
  • server/tracker/app/contract.py reads system.columns through the source's credential.
  • The registration probe in server/tracker/app/onboarding.py reads the credential's SHOW GRANTS output, and review_grants checks that every access type in it is read-only. It does not decide which tables a grant covers, so that comparison is new code.
  • tracker.source.check reports a source's state.
  • diff in the same domain module is tied to the tracker's fixed contract, so describing declared objects is new code.

Acceptance fixture, added to #1176's renamed-column scenario:

  1. A revoked grant returns unable with access_refused, not drift.
  2. A failed grant read returns unable with grants_unreadable.
  3. A stopped source returns unable with source_unavailable.
  4. After the registration is removed, a check returns unable with source_removed and the earlier results are still listed.
  5. A second tenant cannot list the results.
  6. No model call is made, and only metadata and grant reads reach the source.

Evidence still needed before rollout:

  • How system.columns hides objects by grant, confirmed on a live source in the fixture, before access_refused is trusted.
  • How a grant is matched to a declared table when access comes through a role, a database-wide scope or a view, with wrong access_refused and wrong drift outcomes counted in the fixture.
  • How often a view's computed column types read as drift under the type-family comparison.
Describe alternatives you've considered
  • Read an absent table as drift. A revoked grant then reports every dependent recipe as broken.
  • Probe each table with a SELECT. That reads data, and #1176's first delivery reads metadata only.
  • Delete checks and results with their source registration. That deletes rows no writer asked to delete and loses the history #1176 keeps.
Where the need comes from

An AI tool suggested this feature

Additional context

Found by source review; no source was queried and no drift was reproduced.

#1755 is separate: it reads a query-history definition draft's table and column lists from the query log. A later extension of this check could use those lists.

Related: Proposed as part of #1176. Roadmap: #1232.

Lingua principale
Python
Stelle
263
Fork
47
Merge medio
14h 21m
PR unite (30g)
873

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ClickHouse/loom

Tutte le issue di ClickHouse/loom

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.