Collect release evidence at release timestamp
What does this MR do?
When a Release is created, determine if it is a Release, an Upcoming Release or a Historical Release. Passing the
released_at field to the API is the deciding factor.
after_commit hook on Release will be removed, and instead the
CreateEvidenceWorker call will be made in the API controller, after the Release object is successfully created.
after_commit :create_evidence!, on: :create, unless: :importing?
released_at field is not passed, it is defaulted to the current timestamp and the Evidence is created. The
CreateEvidenceWorker will be scheduled as
If a future
released_at timestamp is provided via the API, the
CreateEvidenceWorker will be scheduled for the future timestamp using the Sidekiq Scheduled Jobs feature, noting that it may not run exactly at the provided
released_at timestamp is provided and is in the past, an Evidence object will not be provided for this release.
Upcoming Releases are indicated as such, until the
released_at date passes. This is already implemented and not added by this MR.
Does this MR meet the acceptance criteria?
- Changelog entry
- [-] Documentation - Handled in separate MR.
- Code review guidelines
- Merge request performance guidelines
- Style guides
- [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
- Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Part of #38103 (closed)