Skip to content

Migrations and models for consolidated streaming destination for groups

Hitesh Raghuvanshi requested to merge 436601-group-destinations into master

What does this MR do and why?

Currently we have multiple tables for storing audit events external streaming destinations for top-level groups. Different tables are for storing configs of different types of destinations, currently custom http, aws and GCP. This changes intends to unify all of those tables into a single one for ease and increasing speed of integrations. This part of proposal made in &12339.

  1. As part of this MR, we are adding table and model for storing configs of different types of audit event streaming destinations for top-level group.
  2. We will be adding the validations of different types of configs in later MRs.
  3. I have added a concern and shared examples for `externally_streamable.rb` by keeping in mind that we are soon going to do the same for instance level audit event streaming destinations too. So, for now it may seem redundant but it is going to be used.

Migrations

Up

bundle exec rake db:migrate:up:main VERSION=20240112124030

main: == [advisory_lock_connection] object_id: 115880, pg_backend_pid: 69674
main: == 20240112124030 CreateAuditEventsGroupExternalStreamingDestinations: migrating
main: -- create_table(:audit_events_group_external_streaming_destinations)
main: -- quote_column_name(:name)
main:    -> 0.0000s
main: -- quote_column_name(:type)
main:    -> 0.0000s
main:    -> 0.0090s
main: == 20240112124030 CreateAuditEventsGroupExternalStreamingDestinations: migrated (0.0343s)main: == [advisory_lock_connection] object_id: 115880, pg_backend_pid: 69674

Down

bundle exec rake db:migrate:down:main VERSION=20240112124030

main: == [advisory_lock_connection] object_id: 117080, pg_backend_pid: 69108
main: == 20240112124030 CreateAuditEventsGroupExternalStreamingDestinations: reverting
main: -- drop_table(:audit_events_group_external_streaming_destinations)
main:    -> 0.0096s
main: == 20240112124030 CreateAuditEventsGroupExternalStreamingDestinations: reverted (0.0218s)main: == [advisory_lock_connection] object_id: 117080, pg_backend_pid: 69108

MR acceptance checklist

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

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #436601 (closed)

Edited by Hitesh Raghuvanshi

Merge request reports