Backfill `organisation_id` on existing audit logs
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 36/100
Piste de recherche
Start by reading #8888 and tracing the audit log model, organisation-scoped list and filter queries, webhooks, and integrations described in the issue. Identify the existing migration and backfill patterns, then assess how the backfill can run while writes, listing, search, and deliveries continue. Done means the acceptance criteria hold: every relevant API log has its organisation, queries are no slower, and results and deliveries are unchanged.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
After #8888, we gain a nullable AuditLog.organisation field for organisation-level audit logs.
Existing project and environment logs keep organisation_id = NULL, so every organisation-scoped read still has to look up the organisation through project:
organisation_id = X OR project.organisation_id = Xin the organisation and all-logs endpoints, and in the organisation filter. In/api/v1/audit/, this leads to two OR'd joins, which poses a duplicate row risk in results.- fallback chains through project in audit log webhooks and integrations.
Besides that, users see organisation: null in API responses for most logs.
We propose to backfill the field value for existing audit logs, which will gain us:
- One way to scope by organisation, index-friendly queries, and impler webhook + integrations code:
WHERE organisation_id = Xeverywhere instead of OR / joins / project fallback logic. Also, no duplicate row risk in/api/v1/audit/. - A clear meaning for "organisation-level":
project_id IS NULL AND environment_id IS NULL, with no reliance onNULLmeaning something by convention. - A complete API: organisation is set on every log that belongs to an organisation.
- Easier future work: organisation-wide features such as retention, export and analytics can rely on a single column.
Acceptance criteria
- Every audit log that belongs to a project or environment shows its organisation in the API (
organisationis notnull), including logs created before #8888. - The organisation audit log list is faster than existing p95 of 900ms, or at least no slower.
- Users see no impact while the backfill runs: audit logs keep being written and listed, and search keeps working.
- The organisation audit log shows exactly the same logs as before the backfill: none missing, none duplicated, and audit log webhooks and integrations are delivered exactly as before.
- Langage dominant
- Python
- Étoiles
- 7.1k
- Forks
- 603
- Merge moyen
- 3 j 8 h
- PR mergées (30 j)
- 102
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de Flagsmith/flagsmith
-
Expose whether an organisation is blocked for API usagePeut-être pris @PiUnknown l’a pris il y a 26 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Flagsmith/flagsmith#8773 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
Environment colors mismatch in audit log viewPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Flagsmith/flagsmith#8681 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
influx_query_manager doesn't catch ApiException, so Influx error responses 500Peut-être pris @SAY-5 l’a pris il y a 1 jour. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Flagsmith/flagsmith#8510 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Sales dashboard: download_org_data 500s with "Object of type generator is not JSON serializable"Peut-être pris @Iflaqbhat l’a pris il y a 46 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de Flagsmith/flagsmith
Issues similaires
-
agents nolte-linux security skills
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
nolte/claude-shared#732 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 2 jours
-
[Bug] Source archive filter: dry run excludes SystemVerilog (.sv) files with no preflight warningOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
FinanceFlash/unvibecode#906 ·
Les mainteneurs répondent en général sous 1 jour