Geo primary verification API: Add checksum endpoint to data management API

What does this MR do and why?

This MR adds a new endpoint that recalculate the checksum of the passed model.

References

#537712 (closed)

How to set up and validate locally

  1. Enable the feature flag in Rails console Feature.enable(:geo_primary_verification_view);
  2. Find a replicable model record and change its checksum value. For example, in the Rails console:
SnippetRepository.find(19).update(verification_checksum: 'abcd')
  1. Test the new API endpoint as an admin user with the model name and ID:
# Replace YOUR_ADMIN_TOKEN with an actual admin personal access token
curl -H "Authorization: Bearer YOUR_ADMIN_TOKEN" -X POST \
     "http://localhost:3000/api/v4/admin/data_management/snippet_repository/19/checksum"
  1. The object is returned, with its updated checksum 🎉
  2. You can also go into the Rails console and check the record. verification_started_at should be close to the timestamp when you made the above request.

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.

Edited by Chloe Fons

Merge request reports

Loading