Add migration to create missing terraform module metadata
Context
On 2024-10-18 we had the time slot during which, the terraform module metadata wasn't created due to the issue Terraform module metadata is not created (#499808 - closed). There're about ~700 packages that miss metadata.
Now, as the issue was fixed, we could create the background job to re-enqueue the background worker that will trigger the necessary services and create metadata.
What does this MR do and why?
Add migration to create missing terraform module metadata, that weren't created due to the temporary
ActiveRecord::AssociationTypeMismatch error in ::Packages::TerraformModule::Metadata::CreateService.
References
Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- Re-enqueue Packages::TerraformModule::ProcessPa... (#500034 - closed)
- Terraform module metadata is not created (#499808 - closed)
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
No.
How to set up and validate locally
-
Create the terraform module without metadatum
# stub file upload def fixture_file_upload(*args, **kwargs) Rack::Test::UploadedFile.new(*args, **kwargs) end p = FactoryBot.create(:terraform_module_package, created_at: Date.parse('2024-10-18')) # write somewhere the ID -
Run the migration
$ rails db:migrate:main -
When the migration is finished, and the background job is completed, verify that metadatum was created
::Packages::TerraformModule::Package.find(p.id).terraform_module_metadatum
Related to #500034 (closed)