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
2021-07-28Combine listenmux and streamrpc into a publicly exposed TestStream RPCqmnguyen0711/1151-combine-listenmux-and-streamrpc-into-a-publicly-exposed-test-rpcQuang-Minh Nguyen
- Add a new RPC TestStream to gitaly/proto, which uses the StreamRPC protocol - Put all the pieces together so that Gitaly can accept StreamRPC calls and handle the TestStream RPC over TCP, TLS, Unix sockets - The first iteration should include metrics, logging and authentication Changelog: added
2021-07-28Generalize grpc.Server to grpc.ServiceRegistrarQuang-Minh Nguyen
2021-07-22Merge branch 'smh-port-user-apply-patch' into 'master'Patrick Steinhardt
Port UserApplyPatch to Go Closes #3076 See merge request gitlab-org/gitaly!3066
2021-07-22Port UserApplyPatch to GoSami Hiltunen
This commit adds a Go port of UserApplyPatch. UserApplyPatch is an RPC that parses a stream of patches in unix mailbox format, applies them sequentially on top of the base commit and sets the target branch to point to the resulting commit. The original Ruby implementation basically just streamed the patches to `git am`. The Go port uses the same approach although returns more descriptive errors when the command fails. The RPC does not support setting a base branch. The Go implementation follows the same default branch discovery for determining the base commit as the Ruby implementation. Notably, neither support creating the first branch in the repository. This was initially implemented using libgit2. During the implementation, a bug was discovered in the patching routine. As the fix wasn't merged upstream in a long time, we've implemented this using a worktree for now to unblock the efforts to remove the Ruby sidecar.
2021-07-22Merge branch 'smh-remove-update-remote-mirror-ff' into 'master'Sami Hiltunen
Remove UpdateRemoteMirror Go port's feature flag See merge request gitlab-org/gitaly!3693
2021-07-22Remove UpdateRemoteMirror Go port's feature flagSami Hiltunen
UpdateRemoteMirror's Go port has been running successfully in production and was default enabled in 14.1. This commit removes the feature flag for so we can proceed removing the Ruby implementation in a later release. Changelog: removed
2021-07-21Add `git am` command descriptionSami Hiltunen
`git am` is going to be used for applying the patches in the Go port of UserApplyPatch. This commit adds the command description to our list of git commands.
2021-07-21Generalize newSquashWorktreePathSami Hiltunen
newSquashWorktreePath generates a worktree name to use for a squash operation. As we'll soon need to generate worktree names for git am operations, this commit generalizes the function so we can reuse it for generating the worktree paths.
2021-07-21Extend test coverage of UserApplyPatchSami Hiltunen
UserApplyPatch' test coverage is very lacking at the moment. The original tests are using gitlab/gitlab-test and applying various patches to them. Some of the target branches have changed since then with the patches not applying cleanly anymore. This commit extends the suite with a bunch of new tests to nail down the behavior in various cases. The test suite generates the state needed on the fly to avoid testing against the moving target of gitlab/gitlab-test.
2021-07-21Update changelog for 14.1.0GitLab Release Tools Bot
[ci skip]
2021-07-21Merge branch 'ps-remove-orphan-repos' into 'master'Pavlo Strokov
Remove orphan repository replicas Closes #3480 See merge request gitlab-org/gitaly!3674
2021-07-21Merge branch 'bump-gitlab-shell-dep' into 'master'Zeger-Jan van de Weg
Bump gitlab-shell dependency See merge request gitlab-org/gitaly!3695
2021-07-21Remove orphan repository replicasPavlo Strokov
When repository removal operation fails for secondaries for max attempts to process the job the repositories remain on the disk with no use. It happens because the entry is removed from repositories table when removal operation runs for the primary storage. That is why we should extend our reconciler to handle removal of those orphan repositories stored on the secondary gitaly nodes. Because of the delete_replica_unique_index it is possible to schedule only a single removal operation for one reconciliation run. But eventually all repositories will be removed. In order to return a single storage into proper state faster we use ordering for the scheduling, it also simplifies testing. Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/3480 Changelog: fixed
2021-07-21Merge branch 'pks-git-end-of-options' into 'master'Patrick Steinhardt
git: Fix ordering of `--end-of-options` and mark commands as supporting the separator See merge request gitlab-org/gitaly!3676
2021-07-21Bump gitlab-shell dependencyIgor Wiedler
Changelog: changed
2021-07-21Merge branch 'pks-blob-remove-lfs-pointers-pipeline-flag' into 'master'Sami Hiltunen
blob: Remove LFSPointersPipeline feature flag Closes #3681 See merge request gitlab-org/gitaly!3692
2021-07-21Merge branch 'sh-paginate-tree-entries' into 'master'Sami Hiltunen
Add pagination to GetTreeEntries RPC See merge request gitlab-org/gitaly!3611
2021-07-21git: Adjust trivial cases of commands which support `--end-of-options`Patrick Steinhardt
Adjust trivial cases of commands which support `--end-of-options` without requiring any changes in our codebase. All other commands where we cannot enable this separator are documented, stating why we must keep the flag.
2021-07-21git: Mark git-clone(1) as supporting `--end-of-options`Patrick Steinhardt
The git-config(1) command is currently labelled as not supporting the `--end-of-options` separator, even though Git supports this just fine. There is currently only a single callsite which keeps us from marking the command as supporting `--end-of-options`, which is the implementation of `DeleteConfig()`. What we do there is that we abuse a `git.ValueFlag` to pass `--unset-all $value`, even though this is in fact a flag plus a positional argument. This causes Git to misinterpret the command, where it thinks that `--end-of-options` is a value pattern to use for `--unset-all`. Fix the callsite to pass the value as a proper positional argument and mark the command as supporting the separator.
2021-07-21git: Mark git-clone(1) as supporting `--end-of-options`Patrick Steinhardt
The git-clone(1) command is currently labelled as not supporting the `--end-of-options` separator, even though Git supports this just fine. What it doesn't support though is intermixed use of this separator with the `--` separator, but this is exactly how we use it in several of the callsites because we pass arguments as post-separator arguments. Adjust the callsites to not pass the revision as a post-separator argument, but instead as a normal argument. By marking this command as supporting `--end-of-options`, this has exactly the same semantics given that both separators can be used interchangeably in this context, but it now automatically injects the separator.
2021-07-21git: Mark git-ls-tree(1) as supporting `--end-of-options`Patrick Steinhardt
The git-ls-tree(1) command is currently labelled as not supporting the `--end-of-options` separator, even though Git supports this just fine. What it doesn't support though is intermixed use of this separator with the `--` separator, but this is exactly how we use it in one of the callsites. Adjust the callsites to not pass the revision as a post-separator argument, but instead as a normal argument. By marking this command as supporting `--end-of-options`, this has exactly the same semantics given that both separators can be used interchangeably in this context, but it now automatically injects the separator.
2021-07-21git: Mark git-for-each-ref(1) as supporting `--end-of-options`Patrick Steinhardt
While git-for-each-ref(1) is currently marked as not supporting the `--end-of-options` separator, it is perfectly capable of supporting it. One callsite that keeps us from using the separator though is a custom command implementation for git-for-each-ref(1), which has been introduced via e54e89905 (Add PostArgFlags, 2019-10-22). This implementation overrides the validation of arguments such that we can use flags after positional arguments, which is of course incompatible with `--end-of-options`. It's unclear why this is done though: the only callsite of this custom implementation uses it to move the `--contains` flag after the other reference pattern argument, but git-for-each-ref(1) is perfectly happy to have that flag as a leading flag. Remove the custom implementation of the `git.Cmd` interface. With this code gone, we can now mark the command as supporting `--end-of-options`.
2021-07-21git: Fix ordering of `--end-of-options`Patrick Steinhardt
Git commands support two kinds of separators to disambiguate command line options: `--end-of-options` tells it that from here on, option parsing has concluded and that all remaining options are to be considered normal positional command line parameters. And `--` typically separates revisions from paths for positional arguments, like for example in git-log(1). A command using both would thus e.g. like the following: $ git log --follow --end-of-options HEAD -- Makefile As it turns out, our Git DSL puts both types of separators in the same place though, ending up with the following equivalent instead: $ git log --follow HEAD --end-of-options -- Makefile This command does work the same in this case, but it is not how it's intended to work given that we may now potentially interpret "HEAD" as an option. While we do validate that no positional arguments start with leading dashes, this is rather about safety in depth. Fix this bug and move `--end-of-options` immediately after all flags and before the positional arguments. Note that this change requires us to label git-rev-list(1) as a command which doesn't support `--end-of-options`: we use `--all` and `--not`, whose order interacts with other positional arguments. But if the separator is specified, then the command will not even accept pseudo revisions as parameters anymore. We're still safe against injection though given that we have custom logic in place to verify the command's positional arguments.
2021-07-21blob: Remove LFSPointersPipeline feature flagPatrick Steinhardt
The LFSPointersPipeline feature flag, which enables finding LFS Pointers via the new gitpipe package, has been default enabled in 5c43dfe6f (featureflag: Default-enable LFS pointers pipeline, 2021-07-08). Given that this commit is part of v14.1.0, we can now remove the feature flag altogether. Changelog: changed
2021-07-21Merge branch 'sh-enable-resolve-conflicts-with-hooks-flag' into 'master'Patrick Steinhardt
Enable ResolveConflictsWithHooks feature flag by default See merge request gitlab-org/gitaly!3639
2021-07-21Add pagination to GetTreeEntries RPCStan Hu
If a page limit larger than 0 is set, this RPC will only retrieve that number of entries from the list. If a page token is set, this RPC will return entries after this OID. This reduces the amount of recursive calls needed to flatten a path. Relates to https://gitlab.com/gitlab-org/gitaly/-/issues/2704 Changelog: added
2021-07-21Enable ResolveConflictsWithHooks feature flag by defaultStan Hu
This fix was shipped in GitLab 14.1 behind a feature flag and should be enabled by default in GitLab 14.2 since it fixes the issue described in https://gitlab.com/gitlab-org/gitlab/-/issues/18917. Changelog: changed
2021-07-20Merge branch 'ps-changelog' into 'master'Pavlo Strokov
documentation: Changelog creation instructions See merge request gitlab-org/gitaly!3679
2021-07-20documentation: Changelog creation instructionsPavlo Strokov
2021-07-20Merge branch 'zj-switch-default-ref-main' into 'master'Zeger-Jan van de Weg
HEAD: default to main for new repositories Closes gitlab#331906 See merge request gitlab-org/gitaly!3537
2021-07-20Merge branch 'pks-git2go-object-quarantine' into 'master'Pavlo Strokov
git2go: Implement support for object quarantine directories See merge request gitlab-org/gitaly!3680
2021-07-20Update changelog for 14.0.6GitLab Release Tools Bot
[ci skip]
2021-07-20Merge branch 'pks-tx-coordinator-replication-relax-primary-error' into 'master'Sami Hiltunen
coordinator: Only schedule replication for differing error states See merge request gitlab-org/gitaly!3660
2021-07-20Merge branch 'pks-operations-squash-opportunistic' into 'master'Patrick Steinhardt
operations: Squash via patches if commits are not directly related See merge request gitlab-org/gitaly!3685
2021-07-20Merge branch 'sh-add-sort-for-get-tree-entries' into 'master'Sami Hiltunen
Add sort capability for GetTreeEntries See merge request gitlab-org/gitaly!3671
2021-07-20operations: Squash via patches if commits are not directly relatedPatrick Steinhardt
In commit 640b4de09 (operations: Implement squashing without worktrees, 2021-07-19), we've introduced a new squashing implementation which creates commits via git-commit-tree(1) based on the observation that a squashed merge of two commits which have a direct parent-child relation is exactly the same as a new commit with the parent's parent and the child's tree. As it turns out, the assumption that squashes are always performed on a line of history where child and parent are on the same first-parent-chain isn't correct though, and thus causes test failures in QA. Fix the issue by falling back to patch-based squashing in the case where the start commit is not an ancestor of the end commit. Changelog: fixed
2021-07-20Merge branch 'pks-gitpipe-small-tweaks' into 'master'Sami Hiltunen
gitpipe: Smallish tweaks See merge request gitlab-org/gitaly!3681
2021-07-20Merge branch '3627-grpc-1.39' into 'master'Zeger-Jan van de Weg
Bump grpc to 1.38.0 Closes #3627 See merge request gitlab-org/gitaly!3659
2021-07-20conflitcs: Implement object quarantine for ResolveConflictsPatrick Steinhardt
Now that we can make Git2Go use object quarantine directories, this commit converts ResolveConflicts as a first proof of concept to set up object quarantine directories. Like this, we'll stage both objects fetched from the target directory as well as the resolved commit in a temporary quarantine directory. Only if we successfully compute the commit and execute the pre-receive, update and reference-transaction hook will the objects then be migrated into the target repository. This change helps both correctness (rejected objects don't end up in the repository) and performance (authentication checks can now use the quarantine directory to speed up enumeration of objects). Changelog: performance
2021-07-20gitaly-git2go: Honor environment variables when opening reposPatrick Steinhardt
When executing Git commands, Git will look for a bunch of environment variables which influence how the repository will be opened. Next to environment variables like GIT_CEILING_DIRECTORIES and GIT_DISCOVER_ACROSS_FILESYSTEM, which both influence the lookup itself, it'll also consider variables which modify locations of the Git directory via GIT_DIR or of object directories via GIT_OBJECT_DIRECTORY and GIT_ALTERNATE_OBJECT_DIRECTORIES. In Gitaly, we use the latter in object quarantine directories such that we can locate objects which are not part of main object directory. While Git uses these environment variables by default, libgit2 and thus Git2Go do not. As a result, our gitaly-git2go binary will not correctly honor quarantine directories but only use the "normal" repository structures. While this hasn't yet been a problem given that the binary never runs in any context where we do have an object quarantine, we'll eventually want to use manual quarantine directories in this context such that we can stage, check and migrate new objects with Git2Go, too. To support this, we need to instruct libgit2 to honor above environment variables: if they're unset, then it'll behave the same as before. If set, then libgit2 will not do default discovery of the repository but instead use values as set in the environment. Given that there shouldn't be any RPCs using gitaly-git2go which make use of object quarantine directories, this change shouldn't have any user-visible effect yet. Users of this new capability will land at a later point in time when we start to make use of manual quarantine directories in Git2Go-based RPCs.
2021-07-20gitaly-git2go: Unify code to open Git2Go repositoryPatrick Steinhardt
In order to make it easier to change the way how we open Git2Go repositories across all gitaly-git2go subcommands, this commit unifies the logic into a single `git2goutil.OpenRepository()` function. No functional change is expected from this commit given that it still does the same thing as all codesites did before.
2021-07-20git2go: Inject info about alternate object directoriesPatrick Steinhardt
While we already know to inject info about alternate object directories into all Git commands, we don't do the same for the gitaly-git2go command. As a result, if we receive a request which has those alternate directories set up via the repository protobuf, then we wouldn't honor them at all. Prepare for a fix by injecting necessary environment variables into the spawned gitaly-git2go executable. No functional change is expected from this given that we still use `git2go.OpenRepository()`, which doesn't honor environment variables at all.
2021-07-20git2go: Inject repository into subcommandsPatrick Steinhardt
In order to support use of alternative object directories for a repository, we'll need to inject it into subcommands such that we can extract relevant information. Add a `repository.GitRepo` parameter to all subcommands to enable for this. No functional change is expected from this commit given that we do not yet use the repository.
2021-07-20git2go: Implement running commands on top of executorPatrick Steinhardt
Both `run()` and `runWithGob()` are implemented as standalone functions, even though they would neatly fit as a receiver function of the `Executor` struct. Let's thus refactor them to be receiver functions, which will also make it easier to inject additional dependencies without having to change signatures of these functions.
2021-07-20git2go: Unify all serialization-related codePatrick Steinhardt
We have two ways of serializing parameters for git2go subcommands, once via JSON and once via gob. They're both located in separate files, even though they're thematically related. Refactor the code and move them into a single "serialization" code unit.
2021-07-20git2go: Implement submodule on top of the executorPatrick Steinhardt
We're about to extend dependencies required to run gitaly-git2go subcommands, which will make calling them tedious. This commit thus refactors the submodule subcommand to be implemented on top of the `Executor` structure, which encapsulates all required dependencies and thus avoids the additional complexity.
2021-07-20git2go: Implement set-config on top of the executorPatrick Steinhardt
We're about to extend dependencies required to run gitaly-git2go subcommands, which will make calling them tedious. This commit thus refactors the set-config subcommand to be implemented on top of the `Executor` structure, which encapsulates all required dependencies and thus avoids the additional complexity.
2021-07-20git2go: Implement revert on top of the executorPatrick Steinhardt
We're about to extend dependencies required to run gitaly-git2go subcommands, which will make calling them tedious. This commit thus refactors the revert subcommand to be implemented on top of the `Executor` structure, which encapsulates all required dependencies and thus avoids the additional complexity.
2021-07-20git2go: Implement resolve-conflicts on top of the executorPatrick Steinhardt
We're about to extend dependencies required to run gitaly-git2go subcommands, which will make calling them tedious. This commit thus refactors the resolve-conflicts subcommand to be implemented on top of the `Executor` structure, which encapsulates all required dependencies and thus avoids the additional complexity.
2021-07-20git2go: Implement rebase on top of the executorPatrick Steinhardt
We're about to extend dependencies required to run gitaly-git2go subcommands, which will make calling them tedious. This commit thus refactors the rebase subcommand to be implemented on top of the `Executor` structure, which encapsulates all required dependencies and thus avoids the additional complexity.