Backfill `organisation_id` on existing audit logs
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 36/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 7.1k
- Forks
- 603
- Merge medio
- 3 d 8 h
- PR fusionados (30 d)
- 102
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Flagsmith/flagsmith
-
Expose whether an organisation is blocked for API usagePosiblemente ocupada @PiUnknown la tomó hace 26 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Flagsmith/flagsmith#8773 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Environment colors mismatch in audit log viewPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Flagsmith/flagsmith#8681 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
influx_query_manager doesn't catch ApiException, so Influx error responses 500Posiblemente ocupada @SAY-5 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Flagsmith/flagsmith#8510 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Sales dashboard: download_org_data 500s with "Object of type generator is not JSON serializable"Posiblemente ocupada @Iflaqbhat la tomó hace 45 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
Todos los issues de Flagsmith/flagsmith
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
-
area:other help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
WingedGuardian/GENesis-AGI#4734 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
peach-mitao/peach#693 ·
Los mantenedores suelen responder en 1 día
-
Failed result serialization destroys a previously saved JSON resultPosiblemente ocupada @chessing234 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
huggingface/evaluate#867 ·
-
FTP reads inside a transaction use a nonexistent staging pathPosiblemente ocupada @Harsh23Kashyap la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
fsspec/filesystem_spec#2463 ·
Los mantenedores suelen responder en 1 día