Skip to content

Pass snapshot repository's relative path to Gitaly in tests

Sami Hiltunen requested to merge smh-pass-snapshot-relative-path into master

What does this MR do and why?

Pass snapshot repository's relative path to Gitaly in tests

Gitaly passes the repository's relative path to Rails when it calls the internal API. The relative path passed is the transaction's snapshot repository's relative path. Without it Gitaly will not be able to apply the repository's quarantine correctly as the quarantine paths are relative to the snapshot repository.

While the relative path is passed in production code, tests haven't been updated to pass the relative to Gitaly. This leads to test failures when transactions are enabled in Gitaly.

Pass the relative path of the repository in the tests to ensure its present when transactions are enabled. The relative path passed in tests is the same as the actual relative path of the repository. In reality the two paths would be different. As Gitaly is stubbed out in the tests, it doesn't start a transaction and rewrite the relative path so we use the original one.

Fixes the pipeline failures in https://gitlab.com/gitlab-org/gitlab/-/jobs/6646624902 which occur when transactions are enabled: !144582 (merged)

Closes gitaly#5984 (closed)

Edited by Sami Hiltunen

Merge request reports