diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-05-06 15:18:48 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-05-07 12:53:36 +0300 |
commit | 7e3e286bcc78108ae48b788ba12c2f1eb4a96f58 (patch) | |
tree | 730079e7233cc0c3244067614a1aec0e2f9626bd /internal/gitaly/service/repository/apply_gitattributes.go | |
parent | 2982990541d6980bf5035987996e976042c8ccc6 (diff) |
voting: Move Vote and VoteHash types into shared package
The infrastructure for transactional voting is currently duplicated
across Praefect and Gitaly. As a preparatory step to fix this and unify
both, this commit moves Gitaly's `Vote` and `VoteHash` types into a new
agnostic package "internal/transaction/voting".
It would be more idiomatic to call the package "vote" instead of
"voting", or to have the implementation in "internal/transaction". But
the former is creating problems because one cannot name local variables
"vote" anymore, while the latter causes problems because we now have
import conflicts in a lot of places (e.g. "internal/gitaly/transaction"
vs "internal/transaction"). As such, "voting" seems like the best
compromise to avoid both issues.
Diffstat (limited to 'internal/gitaly/service/repository/apply_gitattributes.go')
-rw-r--r-- | internal/gitaly/service/repository/apply_gitattributes.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/gitaly/service/repository/apply_gitattributes.go b/internal/gitaly/service/repository/apply_gitattributes.go index 7a876fb81..6d7586973 100644 --- a/internal/gitaly/service/repository/apply_gitattributes.go +++ b/internal/gitaly/service/repository/apply_gitattributes.go @@ -11,8 +11,8 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" - "gitlab.com/gitlab-org/gitaly/internal/gitaly/transaction" "gitlab.com/gitlab-org/gitaly/internal/praefect/metadata" + "gitlab.com/gitlab-org/gitaly/internal/transaction/voting" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -108,7 +108,7 @@ func (s *server) vote(ctx context.Context, oid git.ObjectID) error { return fmt.Errorf("vote with invalid object ID: %w", err) } - vote, err := transaction.VoteFromHash(hash) + vote, err := voting.VoteFromHash(hash) if err != nil { return fmt.Errorf("cannot convert OID to vote: %w", err) } |