[skip ci] Write state propagation outbox on namespace transitions

What does this MR do and why?

When a namespace (group or project) changes state (e.g., gets archived or deleted), we need to apply that same state change to all its child namespaces. This MR ensures that process is reliable by:

  1. Recording the pending work in the same database transaction as the state change itself. This guarantees we never "forget" to propagate a change, even if something crashes right after.

  2. Scheduling a background job to process the propagation after the transaction commits successfully. This prevents the job from seeing incomplete or rolled-back data.

  3. Handling duplicate requests gracefully. If the same state change is triggered twice before the first one finishes, we reuse the existing record instead of failing.

See visual explanation: https://claude.ai/artifacts/latest/d1d41b62-cb04-4ea2-8e58-35882899a85f

References

Screenshots or screen recordings

Before After

How to set up and validate locally

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.

Related to #599305 (closed)

Edited by Shane Maglangit

Merge request reports

Loading
Loading