Fix SQL errors in organization group transfer

What does this MR do?

Fixes two SQL-related errors raised when running Organizations::ActivateService.

  1. traversal_ids type mismatch — Organizations::Transfer::TopicsService#old_topics compared the namespaces.traversal_ids column (bigint[]) against an ARRAY[?]::bigint[] literal, which Postgres inferred as integer[] and rejected:

    PG::UndefinedFunction: ERROR:  operator does not exist: integer[] @> bigint[]

    Switched to the '{?}' array-literal form that coerces to the column type, matching every other traversal_ids @> call site in the codebase.

  2. Logging against an aborted transaction — once the query above failed, the surrounding transaction was aborted. Organizations::Transfer::GroupsService error logging then issued DB reads (group.full_path) against the aborted transaction, raising:

    PG::InFailedSqlTransaction: ERROR:  current transaction is aborted

    Log fields are now captured before the transaction starts, so error logging performs no database reads. The previously commented-out log fields are re-enabled as a result.

Tests

  • Added a deeply-nested-group case to topics_service_spec.rb exercising the traversal_ids query.
  • Existing groups_service_spec.rb error-logging coverage exercises the re-enabled log fields.

Merge request reports

Loading
Loading