neiam
/vigil
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
Roadmap: grouping strategies side by side; org membership from IdP groups
d8ccd1c · gmorell · 2026-12-01 21:19
Message
{commit_body(@commit)}
Files changed
modified
ROADMAP.md
+23
−3
@@ -204,7 +204,17 @@ libraries to the images.
| 204 | 204 | - **API tokens:** per user, labelled, scopes, stored as a SHA-256 hash and shown once. A `Bearer` plug computes effective scopes as token scopes ∩ the user's role scopes in the target org (GlitchTip ignores the role). |
| 205 | 205 | - **LiveView:** org switcher and create; org settings (members, invites, teams); project create (platform picker and a DSN snippet per SDK); project settings (keys); account → API tokens. |
| 206 | 206 | - `Vigil.Partitions` and the maintenance cron job exist here, so later slices only declare their tables. |
| 207 | −- **Exit:** a user can create an org and project, copy a DSN, and mint a token. | |
| 207 | +- **Org membership from identity-provider groups**, configurable per org: | |
| 208 | + - **Rules:** an `org_group_rules` table of `(org, provider or any, group, role, teams[])`. Owners edit it in org settings. It can also be declared in config and applied at boot, e.g. group `neiam` → member and `neiam-admins` → admin for org `neiam`, so a fresh install comes up already wired. | |
| 209 | + - **When it runs:** `NeiamAuthAdapter.apply_groups/2`, which neiam_auth calls on every login for providers with `GROUPS_CLAIM`, just after it has updated the identity's stored groups. | |
| 210 | + - **How it computes:** the sync reads every identity the user has (`NeiamAuth.identities/1`: provider and groups), not the callback's bare group list, so rules can be scoped per provider. A user's role in an org is the highest role among the rules that match. | |
| 211 | + - **Managed vs manual memberships:** each membership records `source: manual | group`. Sync creates, promotes and demotes only `group` memberships. Manual ones are left alone, unless the org opts to let group rules raise a manual member's role. | |
| 212 | + - **Losing a group:** an org setting picks remove (the default), demote to member, or keep. | |
| 213 | + - **The last owner is never removed or demoted.** Every change is written to an audit log. | |
| 214 | + - **Lag:** changes apply at the user's next login. There is no LDAP or SCIM polling. "Re-sync" in the org settings re-applies the rules to the groups stored from each member's last login. | |
| 215 | + - **Account creation stays with neiam_auth's `OIDC_PROVISION_GROUPS`** (decided 2026-12-01), an env list per provider, set to the same groups as the rules. The rules decide org membership only. If that ever needs to be configurable in the app, the change is an optional `provision?(claims)` adapter callback in neiam_auth, answered from `org_group_rules`. | |
| 216 | + - A first SSO login that matches no rule follows the usual invite-only path. | |
| 217 | +- **Exit:** a user can create an org and project, copy a DSN, and mint a token. A NEIAM login in group `neiam-admins` lands as admin of org `neiam`. | |
| 208 | 218 | |
| 209 | 219 | ### 1. Ingest edge · large |
| 210 | 220 | - `Vigil.Ingest.Plug` covering everything under **Wire contract**: auth with a negative cache, decoders with caps, envelope framing, CORS, rate limits with outcome headers, the buffer and the Drain job. |
@@ -228,7 +238,17 @@ libraries to the images.
| 228 | 238 | - **Threads:** an exception without a stacktrace borrows one from `threads`. |
| 229 | 239 | - **Contexts:** browser, OS and device are filled from the User-Agent (`vigil_ua`). |
| 230 | 240 | - **Title, culprit and metadata:** ported from 2019 Sentry and GlitchTip's `sentry/` subset. `culprit` is persisted, which GlitchTip forgets to do. |
| 231 | −- **Grouping** (a decision; see below). Recommended: port 2019 Sentry's `newstyle:2019-10-29` strategy (stacktrace components with in-app frames first, exception type, message fallback), with `fingerprint` and `{{ default }}`. Store `(config, hash)` on `issue_hashes` so a later strategy can add hashes without regrouping. | |
| 241 | +- **Grouping: several strategies side by side.** | |
| 242 | + - Each strategy is a `Vigil.Grouping.Config` module with an id: | |
| 243 | + - `newstyle:2019-10-29`, the default, ported from 2019 Sentry (BSD): stacktrace components with in-app frames first, exception type, message fallback; | |
| 244 | + - `legacy:2019-03-12`, also from 2019 Sentry; | |
| 245 | + - `glitchtip:compat`, GlitchTip's `md5(title + culprit + type)`. | |
| 246 | + - All of them honour `fingerprint` and `{{ default }}`. | |
| 247 | + - Each project picks a primary strategy, as in 2019 Sentry's `sentry:grouping_config`. Each event records the strategy it was grouped with. | |
| 248 | + - Every event yields several hashes: 2019 Sentry already makes one per variant (in-app, system), and an event joins whichever existing issue matches **any** of them. | |
| 249 | + - `issue_hashes` rows are `(project, config, hash)`. Switching a project's strategy starts a transition window, during which events are hashed under both the old and new strategies. Existing issues keep matching through the old hashes and pick up new ones, so nothing splits. | |
| 250 | + - A **preview** shows how another strategy would group the last N events of a project, as a dry run without writing issues, so a switch can be judged first. | |
| 251 | + - Two *live* parallel issue sets for the same events are possible on this schema but double the issue, count and tag storage. Left out unless needed. | |
| 232 | 252 | - **Issues:** |
| 233 | 253 | - Short id from a per-project counter upsert: `PROJ-1A`. |
| 234 | 254 | - Status: unresolved, resolved, resolved-in-release, ignored. |
@@ -375,7 +395,7 @@ This is new: GlitchTip throws `check_in` items away.
| 375 | 395 | |
| 376 | 396 | | # | Question | Recommendation | |
| 377 | 397 | |---|---|---| |
| 378 | −| 1 | **Grouping:** GlitchTip's `md5(title + culprit + type)`, or 2019 Sentry's stacktrace grouping? | 2019 Sentry `newstyle` (BSD), versioned per hash. Title-based grouping merges unrelated errors that share a message, and splits one error whose message carries ids. Changing strategy later means regrouping, so choose before data arrives | | |
| 398 | +| 1 | **Grouping:** which strategy by default? | Every strategy is supported side by side (slice 2). The default is 2019 Sentry `newstyle:2019-10-29`, because title-based grouping merges unrelated errors that share a message and splits one error whose message carries ids. `glitchtip:compat` is there for anyone who wants GlitchTip's behaviour | | |
| 379 | 399 | | 3 | **Where ingest payloads wait:** a buffer table plus Drain jobs, or payloads in Oban args? | The buffer table (see Architecture) | |
| 380 | 400 | | 4 | **Org invites and registration invites:** one table or two? | Two tables, one flow. An org invite to an address without an account behaves as an addressed registration invite | |
| 381 | 401 | | 5 | **Span volume:** every span in Postgres? | Yes, partitioned daily with short retention (7 to 14 days) and rollups kept longer. Revisit cold storage (Parquet) only if volume demands it | |
Parents: 78a7bd9