Skip to content

Geo: Fix JobArtifact verification when object storage is used

When object storage is used for trace artifacts the file is uploaded locally first, then to OS. We need to prevent the unneeded state object creation in that case.

By default SSF has the checks in https://gitlab.com/gitlab-org/gitlab/-/blob/7b599774714a110febb94fc65185cfca3c6ab35e/ee/app/models/concerns/geo/verifiable_model.rb#L17-19:

return unless self.class.verifiables.primary_key_in(self).exists?

But it doesn't work correctly because of the two-stage process we save files in (file is considered local in this phase).

The second problem is that when job artifacts are created we try to run verification immediately and it runs checksummable? method to check if we need verification which only works correctly when run after the file is migrated to OS.

So what we effectively do in this MR, we ensure that the file is migrated to OS before we run:

  • save_verification_details
  • replicator.handle_after_create_commit

Issue #361489 (closed)

Edited by Valery Sizov

Merge request reports