[go: up one dir, main page]

Add new database table triggers for work item descriptions

Sync Work Items Description Table with Issues

Overview

This merge request implements comprehensive synchronization between the issues table and the new work_items_description table to ensure data consistency across the application.

Changes

1. Database Triggers for Real-time Sync

  • Added database triggers to automatically sync new and updated records from the issues table to the work_items_description table
  • Triggers ensure that any changes to relevant fields are immediately reflected in the new table structure
  • Provides real-time data consistency without application-level intervention

2. Search Vector Synchronization

  • Integrated saving to the work_items_description table alongside existing PG full text search updates on the issues table
  • Ensures search vectors remain synchronized across both table structures

3. Project and Group Transfer Event Handling

  • Added subscription to project transfer and group transfer events
  • Automatically updates root_namespace_id in work_items_description records when namespace changes occur during transfers
  • Processing handled as background jobs via Sidekiq for optimal performance
  • Batch processing prevents database overload during large transfer operations

Technical Notes

  • All synchronization mechanisms work together to maintain data integrity
  • Background job processing ensures transfers don't impact application performance
  • Batch operations provide scalability for large namespace changes

References

#556921 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

1. Test Issue Description Sync

  1. Create an issue in any project
  2. In the Rails console, run this query to verify synchronization:
    # Check if work_item_description record matches issue description
    WorkItem.last.work_item_description
  3. Update the issue description and verify the work_item_description table reflects the changes

2. Test Project Transfer

  1. Transfer the project to another root namespace
  2. Verify that the root_namespace_id in the work_item_description table has been updated to match the new namespace

3. Test Epic Behavior

  • Repeat the same validation steps for epics in groups
  • Epic synchronization should behave identically to issue synchronization

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Gosia Ksionek

Merge request reports

Loading