feat(audit_log): stamp entries with tenant, tenant column/filter (#372) [stack 7/11] - #391
Merged
Merged
Conversation
… column/filter (#372) AuditEntry gets a nullable, indexed tenant_id (NULL = platform action) stamped from current_tenant_id in the capture callback, plus a (tenant_id, created_at) index. Deliberately not MultiTenantMixin: platform writes have no tenant and strict mode would raise inside the flush. /admin/audit-log stays platform-wide with a tenant column and filter on browse, API and CSV export. Claude-Session: https://claude.ai/code/session_01F8RiTBUJQnZmSq56qReZeV
Deploying simple-module-python with
|
| Latest commit: |
1caa633
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d3eef324.simple-module-python.pages.dev |
| Branch Preview URL: | https://tenancy-07-audit-log.simple-module-python.pages.dev |
…nal (review of #372) - BrowseEmpty showed the raw __platform__ sentinel in its filter summary; map it to audit_log.filters.tenant_platform (Browse passes the value). - The CSV export appends tenant_id after changes instead of inserting it before, so positional consumers keep finding every old column. - Document that a platform admin's actions are attributed to their active organisation when one is active. Claude-Session: https://claude.ai/code/session_01F8RiTBUJQnZmSq56qReZeV
antosubash
added this pull request to stack #397
October 1, 2026 16:14
antosubash
marked this pull request as ready for review
October 1, 2026 16:16
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #372. Stack 7/11 of the tenancy-adoption series (base: #390).
What
AuditEntrygets a nullable, indexedtenant_id, stamped incapture.pyfromcurrent_tenant_id. NULL means a platform action. There is noMultiTenantMixin: platform-table writes have no tenant, and strict mode would raise inside the flush.(tenant_id, created_at)composite index. Migrationa7c2e91d4b58on the audit_log chain; existing rows stay NULL./admin/audit-logstays platform-wide:tenant_idcolumn.audit_logdoesn't depend ontenants.Tests
test_tenancy.pycovers:tenant_contextall_tenants()make test-py: 3382 passed.make test-js: 463 passed.make lintandmake doctorare clean.https://claude.ai/code/session_01F8RiTBUJQnZmSq56qReZeV