Skip to content

test(forks): assert the sync-default audit fan-out against real audit_log rows - #8418

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/fork-sync-default-audit-integration
Sep 29, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/fork-sync-default-audit-integration

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The setForkSyncDefault audit fan-out is now asserted against real audit_log rows in fork-sync.integration.ts: one entry per changed lineage member, filed in that member's own workspace, under the stored workspace name, with the origin workspace in metadata
  • Removed the unit test that mocked every collaborator and asserted on recordAudit mock calls (repo testing rules; flagged on v0.9.6: search improvements, forking fixes, tables correctness #8410). sync-default.test.ts keeps only the lineage-moved 409 guard, the one branch real Postgres can't stage
  • Expected names come from the workspace table, not the use case's own RETURNING, so a wrong name can't agree with itself

Type of Change

  • Bug fix

Testing

  • fork-sync.integration.ts (real Postgres): 13/13
  • Mutation-checked: filing entries in the caller's workspace, naming entries by id, and a RETURNING that yields the id as the name each turn the integration test red
  • sync-default.test.ts: 1/1
  • bun run lint, type-check, check:audits (52/52), docs-manifest:check

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 29, 2026 5:20pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/workspaces/__integration__/fork-sync.integration.ts Outdated
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Test changes for fork sync audit logging.

The PR appears safe to merge; no outstanding finding remains.

Summary

The PR replaces a mocked audit assertion with checks against persisted audit rows and strengthens the reverse-change test to cover every live lineage member. Both previous findings are addressed in the current test.

Reviews (4) · Last reviewed commit: "test(forks): derive the reverse fan-out ..."

Comment thread apps/sim/lib/workspaces/__integration__/fork-sync.integration.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/sim/lib/workspaces/__integration__/fork-sync.integration.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1
waleedlatif1 merged commit 3533353 into staging Sep 29, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/fork-sync-default-audit-integration branch September 29, 2026 18:07
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

This branch was previously deployed

1 inactive deployment
Preview — 372ca00d Deployed Sep 29, 2026 by vercel[bot]
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.

1 participant