Skip to content

fix: use PascalCase for audit scope type annotations#518

Merged
scotwells merged 1 commit intomainfrom
fix/audit-scope-pascalcase
Mar 11, 2026
Merged

fix: use PascalCase for audit scope type annotations#518
scotwells merged 1 commit intomainfrom
fix/audit-scope-pascalcase

Conversation

@scotwells
Copy link
Copy Markdown
Contributor

Summary

Audit log scope annotations were being lowercased before being written, but the activity service queries for PascalCase values. This caused org/project-scoped activity queries to return no results.

What changed

The platform.miloapis.com/scope.type annotation now uses the same casing as the parent-type in user.extra:

  • Organization (was organization)
  • Project (was project)
  • User (was user)
  • global stays lowercase since it's an internal default

Background

Milo sets iam.miloapis.com/parent-type as "Project", "Organization", etc. (PascalCase). The audit filter was converting these to lowercase when setting the scope annotation, but the activity service expects PascalCase for ClickHouse queries.

🤖 Generated with Claude Code

Align scope.type annotation values with Kubernetes Kind naming convention
and how Milo sets parent-type in user.extra:

- "organization" → "Organization"
- "project" → "Project"
- "user" → "User"
- "global" remains lowercase (internal default, not from user.extra)

This aligns with the activity service which expects PascalCase values
for tenant scoping in ClickHouse queries.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@joggrbot
Copy link
Copy Markdown
Contributor

joggrbot bot commented Mar 11, 2026

📝 Documentation Analysis

All docs are up to date! 🎉


✅ Latest commit analyzed: b37deb1 | Powered by Joggr

@scotwells scotwells merged commit 11387d8 into main Mar 11, 2026
6 of 7 checks passed
@scotwells scotwells deleted the fix/audit-scope-pascalcase branch March 11, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants