Repository navigation
fix: type the audit-log renderers (CM-1528) - #4903
Conversation
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
…r (CM-1528) Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
PR SummaryLow Risk Overview Each per-action renderer is updated with concrete state types (e.g. affiliation rows, work-experience rows, identity maps, integration The segment log Changes UI now holds Reviewed by Cursor Bugbot for commit 09093c4. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟡 Changes recommended
Three renderer contracts conflict with actual audit-log payloads and can cause exceptions or incorrect output.
3 open findings
What changed in this PR
Adds stronger TypeScript contracts for audit-log state and renderer output, reducing the frontend type-check baseline.
Changes:
- Genericized
AuditLogand renderer configuration types. - Typed member, organization, integration, and merge renderers.
- Reduced baseline errors from 538 to 494.
| File | Description |
|---|---|
frontend/typecheck-baseline.json |
Updates error baseline. |
frontend/src/modules/lf/segments/types/AuditLog.ts |
Adds generic state types. |
frontend/src/modules/lf/segments/components/logs/sections/log-changes.vue |
Types rendered changes. |
frontend/src/modules/lf/config/audit-logs/log-rendering/index.ts |
Defines shared renderer contracts. |
.../organizations-unmerge.ts |
Types unmerge state. |
.../organizations-merge.ts |
Types merge state. |
.../organizations-edit-profile.ts |
Types profile state. |
.../organizations-edit-identities.ts |
Types identity state. |
.../organizations-create.ts |
Types creation state. |
.../members-unmerge.ts |
Types unmerge state. |
.../members-merge.ts |
Types merge state. |
.../members-edit-profile.ts |
Types profile state. |
.../members-edit-organizations.ts |
Types work-experience state. |
.../members-edit-manual-affiliation.ts |
Types affiliation state. |
.../members-edit-identities.ts |
Types identity state. |
.../members-create.ts |
Types creation state. |
.../integrations-reconnect.ts |
Types integration state. |
.../integrations-connect.ts |
Types integration state. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| import { lfIdentities } from '@/config/identities'; | ||
|
|
||
| const membersEditIdentities: LogRenderingConfig = { | ||
| type MemberIdentitiesState = Record<string, string[]>; |
There was a problem hiding this comment.
This PR only adds types here; the renderer logic is unchanged from main, so the behaviour you describe exists today and is out of scope for CM-1528. Noted for a separate look at the producer/renderer contract.
| }; | ||
|
|
||
| const membersEditOrganizations: LogRenderingConfig = { | ||
| const membersEditOrganizations: LogRenderingConfig<MemberOrganizationStateRow[]> = { |
There was a problem hiding this comment.
This PR only adds types here; the renderer logic is unchanged from main, so the behaviour you describe exists today and is out of scope for CM-1528. Noted for a separate look at the producer/renderer contract.
| import { lfIdentities } from '@/config/identities'; | ||
|
|
||
| const organizationsEditIdentities: LogRenderingConfig = { | ||
| type OrganizationIdentitiesState = Record<string, { value: string; type: string; verified: boolean }[]>; |
There was a problem hiding this comment.
This PR only adds types here; the renderer logic is unchanged from main, so the behaviour you describe exists today and is out of scope for CM-1528. Noted for a separate look at the producer/renderer contract.
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
| @@ -1 +1 @@ | |||
| { "errors": 534 } | |||
| { "errors": 488 } | |||
There was a problem hiding this comment.
Description corrected to 534 -> 488.



Summary
Types the audit-log renderers
members-edit-manual-affiliation.tsandmembers-edit-organizations.ts, plus the related organization renderers andAuditLogtypes they share. The type-check baseline drops from 534 to 488 (46 errors). No renderer logic changes.JIRA: https://linuxfoundation.atlassian.net/browse/CM-1528