Backend: Scan a catalog resource for components
Context
When a release is created for a catalog resource, we need to validate that it contains components.
Proposed solution
Create a new service that is called during the release creation process. When a release is created, this service will scan the catalog resource repository for valid components. This scan will happen synchronously unless we determine that it is too slow.
A valid component is a component that has a valid directory structure.
NOTE: the valid directory structure for a catalog resource repository is still under discussion in &10728 (comment 1420078585)
If the release is not valid, an error should be raised to the user. NOTE: this might need design if we are displaying the error on the release creation UI page
If the release contains valid CI components:
- Add a record to catalog_resource_versions
- Add a record to catalog_resource_components for each component found
- Mark the catalog resource as published if it is not already published
NOTE: The work noted in #428956 (closed) to introduce components per release limits will be handled in this issue too.
Implementation Table
NOTE: Backend: Create a migration to update state and... (#416292 - closed) can (and should) be worked on immediately after Backend: Scan a catalog resource for components (#415413 - closed)
This issue is being broken down into multiple MRs:
Problem | MR | Status |
---|---|---|
|
done | |
knowledge from |
done | |
|
done | |
to use previously created service |
done previously blocked by: #429256 (closed), which is now merged |
|
|
done | |
Group | Issue Link |
---|---|
backend | #425726 (closed) |
frontend | #424967 (closed) |
backend |
|
backend | #416292 (closed) |
backend | #427170 (closed) |
backend | #427169 (closed) |
backend | #415414 (closed) |