Skip to content

Add started_at/completed_at timestamps to Elasticsearch migrations

Dylan Griffith requested to merge 282557-timestamps-with-migrations into master

What does this MR do?

Elasticsearch migrations were introduced in !46672 (merged) . This is a framework similar to Rails DB migrations that is used to apply schema changes to our Elasticsearch data. This MR just extends this slightly to persist timestamps in the saved migration record.

When saving Elasticsearch migrations we set a started_at and completed_at value. This will help us with debugging as this information will make it much easier to find relevant logs for what happened. As this index was not declared with strict dynamic mapping it is totally safe to just add new fields to the payload without them existing already in the configuration and I have tested locally that this works as well.

For the sake of clarity, however, we have added them to the mappings as there is no reason not to.

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

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 @gitlab-com/gl-security/appsec
  • 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

Related to #282557 (closed)

Edited by Dylan Griffith

Merge request reports