Make Sbom::SyncArchivedStatusWorker compatible with group archival
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Problem
The Sbom::SyncArchivedStatusWorker currently subscribes to ProjectArchivedEvent but doesn't handle group archival scenarios. When a group is archived, all projects within it are effectively archived, but the worker doesn't receive the appropriate events to sync the archived status for SBOM (Software Bill of Materials) data of those projects.
This is part of the broader issue tracked in epic &19492.
Solution
We need to ensure that Sbom::SyncArchivedStatusWorker handles group archival by either:
-
Creating a new subscriber for
GroupArchivedEvent(recommended approach) - Create a new worker or extend the existing one to also subscribe toGroupArchivedEventand process all projects within the archived group. -
Making the existing worker handle both events - Modify the current subscriber to handle both
ProjectArchivedEventandGroupArchivedEvent, though this may make the code more complex to maintain.
The relevant calls to project.archived should be replaced with project.self_or_ancestors_archived?. Refer to the list under SBOM here.
Acceptance Criteria
-
Analyze the current Sbom::SyncArchivedStatusWorkerimplementation -
Determine the best approach (new subscriber vs extending existing) -
Implement the chosen solution to handle group archival -
Ensure SBOM archived status is properly synced when groups are archived -
Add appropriate tests for the new functionality -
Verify that downstream SBOM services remain consistent when groups are archived
Related
- Epic: &19492
- Worker location:
app/workers/sbom/sync_archived_status_worker.rb