aquametalabs / aquameta

Web development platform built entirely in PostgreSQL
GNU General Public License v3.0
1.1k stars 52 forks source link

bundle: per-bundle ignore rules #287

Open erichanson opened 9 months ago

erichanson commented 9 months ago

Right now there's just one global table for ignored_schema, ignored_relation, ignored_row and ignored_column, and trackable_nontable_relation. The rows in these tables are verson-controlled, so when you checkout a commit, the entire bundle system's behavior can be modified. This needs to change. There's a use for global ignore rules (e.g. ignoring bundle's internal tables), but there also needs to be per-bundle "scope of concern" setting. Some bundles will want to track schema (e.g. putting a meta row in trackable_nontable_relation), others will not.

erichanson commented 9 months ago

This dovetails into the whole question of "What even is a trackable row."

Knowns:

Proposal:

  1. Keep global ignore rules, to be maintained by the system administrator, that override everything, and ideally prevent Aquameta from making modifications to anything ignored.
  2. Introduce per-bundle tracking rules
    • per-bundle rules are opt-in rather than opt-out. Say what is to be tracked, rather than to be ignored, aka bundle.bundle_tracked_relation
    • typically used for bundles that create their own schema
    • we could say that a bundle that creates its own schema MAY (not must) auto-track rows in their tables
    • all kinds of hybrid patterns here where one bundle creates schema and another adds rows to it
    • murky, try it and find out
erichanson commented 9 months ago

There may be an analog here to the infamous Oops, You Wrote a Database w.r.t. grant, policies, roles, and row-level security. All of this can probably be declared and enforced by policy in an elegant way. Bears much consideration.

Oops, You Wrote a ACL