GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||
GeezerVison is showing github.com — refactor(audit): derive updatedFields through one shared helper by waleedlatif1 · Pull Request #6604 · simstudioai/sim Conversation
Collaborator
Summary
Sites converted
Testing-mock note
Type of Change
Testing
Local-verification caveat worth knowing: this was developed in a git worktree whose Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
PR SummaryLow Risk Overview Also renames the admin organization update audit metadata key from Reviewed by Cursor Bugbot for commit 9c6d5b6. Configure here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Greptile SummaryThe PR centralizes audit updated-field derivation in
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/audit/src/updated-fields.ts | Introduces the shared helper that returns written keys while excluding updatedAt. |
| apps/sim/app/api/v1/admin/organizations/[id]/route.ts | Reuses one derived field list for logging and standardized organization audit metadata. |
| apps/sim/lib/credentials/orchestration/index.ts | Replaces inline audit-field derivation with the shared helper. |
| apps/sim/lib/mcp/orchestration/server-lifecycle.ts | Uses the shared helper for updated fields returned from MCP server updates. |
| apps/sim/lib/mcp/orchestration/workflow-mcp-lifecycle.ts | Uses the shared helper in workflow MCP server and tool update audit paths. |
| packages/testing/src/mocks/audit.mock.ts | Exposes auditUpdatedFields through the shared audit test mock. |
Reviews (2): Last reviewed commit: "test(audit): pin the testing mock's copy..." | Re-trigger Greptile
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Six copies of Object.keys(updateData).filter(k => k !== 'updatedAt') across four files decided, independently, which columns an audit row reports. The exclusion set is an audit convention, not a local detail, so it moves to @sim/audit as auditUpdatedFields and the exclusion becomes a single edit. The admin organizations route evaluated the expression twice in one handler and filed it under the metadata key `fields` while every other site uses `updatedFields`, so any consumer filtering on updatedFields silently missed org updates. It now computes once and uses the shared key; nothing reads metadata.fields. auditMock carries the real implementation rather than a stub, since callers under test derive their audit metadata through it. The two suites that hand-roll an @sim/audit factory source it from there.
@sim/audit devDepends on @sim/testing, so the mock cannot import the real helper without closing a package cycle. Assert parity from the audit side instead, where the dependency already runs the safe direction, so a change to the exclusion convention cannot leave mocked callers validating behavior the deployed helper no longer has.
1257a97 to
9c6d5b6
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9c6d5b6. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
9c6d5b6b
Deployed
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.