Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-09-05gitaly-git2go: Remove the now-unused commandPatrick Steinhardt
Remove the now-unused gitaly-git2o command as well as its supporting infrastructure.
2023-09-05cmd/gitaly-git2go: Use log writer instead of splicing log outputsPatrick Steinhardt
When spawning gitaly-git2go processes, we redirect their stderr to print to the writer used by our global logging mechanism. This should in the general case be stderr of the Gitaly process, which means that any logs would get spliced into the main logging stream generated by Gitaly. The mechanism isn't great though, and we're about to get rid of the global logging instance in favor of the injected ones. Given that this is the last instance where we still rely on the global logger's internal workings, and that the gitaly-git2go command is going away in a release or two anyway, there is thus a strong urge to adapt it to unblock our remaining logging refactorings. And that's exactly what we do now. Instead of reaching into the global logging instance to retrieve its writer, we simply construct a writer from the logger and pass that to the newly created process. Now this has the downside that we're unable to control the log level, and furthermore it will cause the log messages themselves to be encoded in JSON again. But as said, this is only a temporary measure that we can get rid of in the near future by removing the complete gitaly-git2go command. This change removes the last instance where we rely on our logger to be a `logrus.Logger` and is also the last user of `log.Default()`.
2023-08-30git2go: Move errors used by UserUpdateSubmodule RPCPatrick Steinhardt
The "internal/git2go" package still hosts a bunch of errors which are used by the UserUpdateSubmodulie RPC and nothing else. Furthermore, two of the three errors are actually never raised anymore, so there is no point in handling them. Move the single error that is still being used over to where its used.
2023-08-30git2go: Move errors used by UserCommitFiles RPCPatrick Steinhardt
The "internal/git2go" package still hosts a bunch of errors which are used by the UserCommitFiles RPC and nothing else. Let's move them over and make them private.
2023-08-22cmd/gitaly-git2go: Remove now-unused cherry-pick implementationPatrick Steinhardt
We have removed the feature flag that was guarding the Git based implementation of UserCherryPick, which makes the Git2go-based cherry-pick implementation unused. Remove it.
2023-08-17Revert "Merge branch 'jc/remove-cherry-pick-ff' into 'master'"John Cai
This reverts commit acfe013b5e5e7c3992a889058a73ec8f7f1b4de7, reversing changes made to 023c2a7d02fa92926cb3db390357149e5ac1151c.
2023-08-16Merge branch 'xx/user-rebase-pure-git' into 'master'Patrick Steinhardt
operations: Implement UserRebaseConfirmable in pure git Closes #4579 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6176 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Xing Xin <moweng.xx@alibaba-inc.com> Reviewed-by: John Cai <jcai@gitlab.com> Co-authored-by: Xing Xin <xingxin.xx@bytedance.com>
2023-08-11signature: Move signature to internal/gitXing Xin
The type `Signature` is originally used by git2go to help generating signatures for committer and author of a commit. The package git2go would reach the end of its life so we should put `Signature` to a more suitable package for future use. And the declaration of `Signature` and `NewSignature` in git2go are kept to avoid too many code changes. Signed-off-by: Xing Xin <xingxin.xx@bytedance.com>
2023-08-08gitaly-git2go: Remove cherry pickJohn Cai
Now that we don't use git2go's cherry pick subcommand anywhere, let's remove it.
2023-08-03Merge branch 'jc/remove-revert-ff' into 'master'Will Chandler
operations Remove RevertPureGit feature flag See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6165 Merged-by: Will Chandler <wchandler@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com> Co-authored-by: John Cai <jcai@gitlab.com>
2023-08-02gitaly-git2go: Remove revertJohn Cai
Now that git2go's revert is not called anywhere, remove it.
2023-08-01gitaly-git2go: Remove MergeJohn Cai
Now that Merge is no longer used anywhere in the codebase, let's remove it.
2023-07-24git2go: Remove code around `ResolveConflicts` RPCKarthik Nayak
Since `ResolveConflicts` RPC is now using a pure git implementation, we can remove the unused git2go code.
2023-07-20git2go: Enable testing of Git2go feature flags with SHA256Patrick Steinhardt
The feature flags test for Git2go doesn't access any Git objects, so it can be trivially enabled to test with SHA256.
2023-07-11git2go: Move commit actions to UserCommitFilesPatrick Steinhardt
The commit actions are still declared in the `internal/git2go` package even though they have nothing to do with Git2go anymore. Let's move them to their only site of usage, which is next to the `UserCommitFiles()` implementation. Note that we also rename the structure from `Action` to `commitAction`. This is done to avoid local name conflicts.
2023-07-11git2go: Rename "commit.go" to "errors.go"Patrick Steinhardt
In the preceding commit we have removed the implementation of the "commit" subcommand. But as "commit.go" still contains a bunch of shared error types we cannot remove that file yet, but it's name does not match its contents anymore. Rename it to "errors.go" to better reflect what it contains.
2023-07-11gitaly-git2go: Drop "commit" subcommandPatrick Steinhardt
We have recently converted UserCommitFiles to stop using Git2go and instead use plain Git, which was finalized via 69c6de1fb (operations: Remove CommitFilesInGit feature flag, 2023-06-28). We couldn't remove the "commit" subcommand from `gitaly-git2go` though because the "apply" subcommand still depended on it. But now that the latter has been removed we can also remove the "commit" subcommand now. Let's do so.
2023-07-11gitaly-git2go: Drop "apply" subcommandPatrick Steinhardt
The "apply" subcommand has never really been used in production due to a bug in libgit2 that causes certain patches to misapply. As we have never been able to get the fix upstreamed, we were barred from using libgit2 here and instead still continue to use a worktree and git-apply(1). As we have essentially deprecated libgit2, this is also not going to change either. We still had a dependency on the "apply" subcommand in our tests for RawDiff and RawPatch. These have been refactored now though, removing the last usage of the command. So let's drop the implementation of the "apply" subcommand altogether.
2023-06-29Merge branch 'id-verify-signature' into 'master'Patrick Steinhardt
Extend GetCommitSignatures to return Signer See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5961 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Igor Drozdov <idrozdov@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Will Chandler <wchandler@gitlab.com> Co-authored-by: Igor Drozdov <idrozdov@gitlab.com>
2023-06-29Define Verify function for SigningKey interfaceIgor Drozdov
This function verifies the signature and checks whether it's been signed by the signing key
2023-06-28git2go: Remove Git2Go Submodule commandJohn Cai
Now that we are no longer calling Git2Go submodule anywhere, we can remove all the code except for the error messages we still rely on.
2023-06-27Merge branch 'id-extract-ssh-into-library' into 'master'Will Chandler
Move SSH signing function to library See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5960 Merged-by: Will Chandler <wchandler@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Approved-by: John Cai <jcai@gitlab.com> Reviewed-by: Igor Drozdov <idrozdov@gitlab.com> Reviewed-by: John Cai <jcai@gitlab.com> Co-authored-by: Igor Drozdov <idrozdov@gitlab.com>
2023-06-27Merge branch '5098-feature-flag-git-merge-tree-for-listconflictfiles' into ↵karthik nayak
'master' git2go: Remove the `Conflicts` function See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5894 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: John Cai <jcai@gitlab.com> Approved-by: Christian Couder <chriscool@tuxfamily.org> Reviewed-by: karthik nayak <knayak@gitlab.com>
2023-06-22Move SSH signing function to libraryIgor Drozdov
This commit: - Moves SSH to a library - Creates SigningKey interface - GPG and SSH keys are implementing this interface
2023-06-20Move extractSignature into internal packageJohn Cai
extractSignature is useful for testing if a commit has been properly signed. It was used by git2go, but now that we are about to sign commits manually in the localrepo package, we will want to test it there to. Prepare for this by extracting the function into a helper in an internal package. Also, extractSignature does not support sha256 since the gpg prefix for sha256 is different. Fix this as well. Finally, the oid parameter actually never gets used. Let's remove it as well.
2023-06-14git2go: Remove code around 'conflicts'Karthik Nayak
In the previous commit, we removed the only user of git2go's conflict functionality. With this we can remove all code in git2go around conflict which is no longer used. We move out a stray `Merge` function from `cmd/gitaly-git2go/conflicts.go` to `cmd/gitaly-git2go/merge.go` as its still being used.
2023-06-09Add go:generate to generate SSH keys and signaturesIgor Drozdov
2023-06-07Use SSH for signing commitsIgor Drozdov
This commit uses x/crypto library instead of its fork in order to implement signing via SSH Changelog: changed
2023-06-02repository: Move GitRepo interface into storage packagePatrick Steinhardt
The `repository.GitRepo` interface provides a set of functions that allow us to locate a repository in our storage. It lives in a separate package outside of the `internal/git` module in order to avoid a set of cyclic dependencies. The current location is kind of weird though, as this interface is inherently tied to our storage details instead of being a generic Git thing. Move the definition of the interface into `internal/gitaly/storage` so that it is defined close to where it is used. This should also be a relatively safe location as any package that depends on the interface should implicitly already depend on the storage package given that it will typically be passed down into any kind of storage locator. While at it, rename it to `storage.Repository`.
2023-05-16featureflag: Move into standalone packagePatrick Steinhardt
The feature flag logic is currently hosted inside of `internal/metadata/featureflag`. And while they do have something to do with metadata, they really are a standalone concept. Move the package to `internal/featureflag` to reflect this.
2023-05-10go: Bump module version from v15 to v16Patrick Steinhardt
We're about to release Gitaly v16.0. As we've landed a bunch of previously announced removals it's thus time to bump our Go module version from v15 to v16.
2023-04-27tests: Enable sha256 testingKarthik Nayak
Some of the tests don't need any modification for being run with sha256 support. Let's remove the build flag block for such tests.
2023-03-31Refactor git2go commit and apply testsIgor Drozdov
- It uses repo.ReadCommit instead of parsing on its own - Provides interface for testing other signatures (like SSH)
2023-03-16lint: Fix manual quote interpolation offensesQuang-Minh Nguyen
This commit fixes manually quoted string interpolation with '%s' and "%s". Quoting this way doesn't escape special characters such as endline and makes debugging harder later. We encourage to use %q verb instead.
2022-12-06git2go: Return structured errors for IndexErrorPatrick Steinhardt
The function `IndexError.GrpcError()` returns an error that is wrapped in the correct gRPC error code. Convert it to return a structured error instead that has the same error code.
2022-11-30Revert "Revert "Merge branch 'wc/user-commit-files-structured-errors' into ↵Will Chandler
'master'"" This reverts commit 52c5d3444a671264cda5b5725fb94e626a400a21. Reintroduce the changes originally merged with MR 4988 that were subsequently reverted.
2022-11-16Revert "Merge branch 'wc/user-commit-files-structured-errors' into 'master'"Patrick Steinhardt
This reverts merge request !4988
2022-11-14git2go: Add new IndexError with multiple variantsWill Chandler
In preparation for converting the `UserCommitFiles` RPC to structured errors, we need to capture the specific problem that occurred. There are six error types that we track, and while creating a separate error type for each of these works fine, it's also verbose and requires significant boilerplate to convert the error to a proto response. To mitigate this, create a new `IndexError` type that contains an enum to specify the type of error. This allows us to cover all six error types with a single case statement when returning from `UserCommitFiles`, and centralizes the definition of the potential errors that can be returned. This is similar to the approach taken with `updateref.CustomHookError`. The `Proto()` method will be used in the following commit.
2022-11-14git2go: Rename IndexError to UnknownIndexErrorWill Chandler
Currently we may receive one of six distinct error types from `git2go` when executing the `UserCommitFiles` RPC, one for each specific failure we check, such as file not found, and a generic `IndexError` used for invalid paths and problems returned from `libgit2` itself. In preparation for converting `UserCommitFiles` to return structured errors, we will convert all defined error types into a single error struct with an internal enum specifying the error type. This will most logically be named `IndexError`, but to use that name we must first rename the existing `IndexError` type. Given that we return the latter in cases where an undefined problem has occurred in `libgit2`, let's rename it to `UnknownIndexError`.
2022-10-28gitaly-git2go: Extract CommitNotFoundErrorJames Fargher
We are looking to expose the fact that a commit was not found at the RPC level. In order to do this we need to distinguish the error in git2go by creating a new error type over gob.
2022-10-14global: Reorder `testing.TB` before `context.Context` argumentsPatrick Steinhardt
A few weeks ago we have decided that `testing.TB` arguments should be first, `context.Context` second. This is rather a matter of perssnal taste instead of correctness, but we should strive for consistency. Reorder all arguments to match the agreed-upon style.
2022-08-23feat(gitaly-git2go): sign commits with OpenPGP keySavely Krasovsky
2022-08-11golangci-lint: Enforce consistent naming of `testing.TB` variablesPatrick Steinhardt
Enforce consistent naming of `testing.TB` variables, which should be called `tb`, and adapt tests that violate this rule.
2022-08-11gittest: Convert callers of InitRepo to use CreateRepositoryPatrick Steinhardt
Convert all callers of InitRepo to use CreateRepository.
2022-08-02Rename gitaly-git2go-v15 to gitaly-git2gosmh-dont-install-aux-binariesSami Hiltunen
With the auxiliary binaries packed into the gitaly binary and deployed as a single unit, we no longer need to maintain backwards compatibility between them and Gitaly. This commit drops the now unnecessary major version suffix from the gitaly-git2go binary which was needed due to the major version upgrades causing the type paths to change and thus breaking the Gob protocol between the binaries.
2022-07-20Merge branch 'pks-git-objectids-sha256' into 'master'Will Chandler
git: Encapsulate object hash specific information See merge request gitlab-org/gitaly!4720
2022-07-20git: Move `NewObjectIDFromHex()` into `ObjectHash` structurePatrick Steinhardt
Move the `NewObjectIDFromHex()` function into the `ObjectHash` structure to make it dependent on the hash function used.
2022-07-20command: Accept command arguments instead of an `exec.Cmd`Patrick Steinhardt
In order to spawn a command via our command package the caller has to pass in an `exec.Cmd`. This calling convention is weird and opens up the window for unexpected behaviour in case the caller passes in a command that is initialized with state unexpected by the command package. Refactor the package to instead accept a set of arguments. Like this, the assembled `exec.Cmd` is fully controlled by the command package.
2022-07-18test: Disable all test with tag sha256Toon Claes
We're about to add the ability to test with SHA256 hashes. We assume none of the tests work with this object format. With this change we add the build constraint to not run any test when the tag 'gitaly_test_sha256' is set.
2022-07-15Centralize binary finding logicSami Hiltunen
Gitaly needs to locate auxiliary binaries in various places to pass them as arguments and call them. Currently, the logic to do so is spread around the code base where the cfg.BinDir is joined with the binary name. Soon we'll have to make a distinction between binaries that are in the BinDir and binaries that are unpacked into a runtime directory on start up. To support this, this commit centralizes the binary finding logic to BinaryPath helper added to Gitaly's config. For now, it simply join BinDir with the binary name as each of the call sites were doing. In a later commit, it will also help with locating the unpacked binaries correctly.