Extend TransferTracker to support INSERT statements

What does this MR do and why?

Extends TransferTracker (test infrastructure) to support tracking INSERT statements in addition to UPDATE statements. This enables the tracker to detect find-or-create transfer patterns, where a record is created in the target organization rather than updated in place.

This functionality is used in a follow up MR Transfer topics on organization group transfer (!243722 - merged)

Changes

  • Extract extract_statement_info: Refactors the inline UPDATE parsing into a dedicated method that handles both UPDATE and INSERT SQL statements
  • Add EXCLUDED_CALL_PATHS: Filters out SQL triggered by internal user creation (lib/users/internal.rb) to avoid false positives in transfer tracking
  • Increase caller_locations depth: From 50 to 200 to ensure we capture the service caller in deeper call stacks
  • Mark organization_users as supported: Updates db/docs/organization_users.yml from todo to supported since the table is already handled by transfer specs

References

Relates to #594592 (closed)

MR acceptance checklist

  • Tests pass locally
  • RuboCop passes with no offenses
  • Lefthook passes
Edited by tim mccarthy

Merge request reports

Loading
Loading