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
2022-05-06proto: Enforce comment-linting for message fieldspks-protolint-commentsPatrick Steinhardt
Enforce that message fields must have a comment and add a placeholder for all instances where such a comment is missing.
2022-05-06proto: Enforce comment-linting for enum fieldsPatrick Steinhardt
Enforce that enum fields must have a comment and add a placeholder for all instances where such a comment is missing.
2022-05-06proto: Enforce comment-linting for enum definitionsPatrick Steinhardt
Enforce that enum definitions must have a comment and add a placeholder for all instances where such a comment is missing.
2022-05-06proto: Enforce comment-linting for message definitionsPatrick Steinhardt
Enforce that message definitions must have a comment and add a placeholder for all instances where such a comment is missing.
2022-05-06proto: Enforce comment-linting for RPC definitionsPatrick Steinhardt
Enforce that RPC definitions must have a comment and add a placeholder for all instances where such a comment is missing.
2022-05-06proto: Enforce comment-linting for servicesPatrick Steinhardt
Enforce that services must have a comment and add a placeholder for all instances where such a comment is missing.
2022-05-06Merge branch 'pks-makefile-protoc-plugin-fixes' into 'master'Patrick Steinhardt
Makefile: Fix protoc linting not working See merge request gitlab-org/gitaly!4515
2022-05-06noticegen: Fix skipping of own licensesPatrick Steinhardt
In order to generate our `NOTICE` file, we first export all Go sources referenced by our project into a directory and then walk that directory to gather any licenses. The result is that the generated `NOTICE` file contains the licenses of all our dependencies. Ideally, the `NOTICE` file wouldn't need to contain any licenses that we have as part of our own sources. These may for example include licenses of test files, but also licenses of vendored dependencies. But because we are already bundling their licenses into our sources in the first place it shouldn't be necessary to also put them into our `NOTICE` file. In fact, it seems like we already intended to skip soaking up any such license files in our own tree: we initially determine the module path of ourselves, and then return early in `filepath.Walk()` when hitting a directory path that matches. We only return a `nil` pointer though, which means we only skip that single directory. That doesn't seem to make a whole lot of sense though, and it feels like the intent was to instead skip walking that whole directory. So let's fix this by returning `filepath.SkipDir` instead so that we never collect licenses part of our own source tree.
2022-05-06tools: Move `noticegen` into top-level `tools/` directoryPatrick Steinhardt
Move the `noticegen` tool into the top-level `tools/` directory so that all of our custom build tools are in one place. This also makes its sources discoverable for our formatter.
2022-05-06tools: Move `module-updater` into top-level `tools/` directoryPatrick Steinhardt
Move the `module-updater` tool into the top-level `tools/` directory so that all of our custom build tools are in one place. This also makes its sources discoverable for our formatter.
2022-05-06tools: Move Protoc plugins into top-level `tools/` directoryPatrick Steinhardt
The Protoc plugins we use are hidden away deep into the `proto/` directory, which makes it very hard to discover them when one doesn't already know about their existence. Let's move them into a new top-level `tools/` directory.
2022-05-06protoc-gen-gitaly-lint: Absorb internal `linter` packagePatrick Steinhardt
There is no real reason why the `protoc-gen-gitaly-lint` package requires another internal package to provide the actual logic. Furthermore, we want to move this plugin into a top-level `tools` directory to make it easier to discover. Absorb the `linter` package to make it easier to move the code around.
2022-05-06Makefile: Fix cyclic dependencies when generating Protobuf definitionsPatrick Steinhardt
The `protoc-gen-gitaly-lint` plugin requires the Protobuf definitions in order to work correctly, but it itself is added already when generating these definitions in the first place. This is a cyclic dependency which breaks generation of Protobufs when starting from scratch. Now that functionality of `protoc-gen-gitaly` has been split up into two different plugins we can easily fix this cyclic dependency by moving use of the linting part into `lint-proto`. This refactoring also makes sense on its own.
2022-05-06protoc-gen-gitaly: Split up plugin by functionalityPatrick Steinhardt
The `protoc-gen-gitaly` plugin provides two different functionalities: - It lints our Protobuf definitions to make sure they conform to our coding guidelines. - It generates a `protolist.go` file, which contains a list of all Protobuf files. This is conflating two otherwise unrelated concerns, and thus makes the divide between our `proto` and `lint-proto` Makefile targets a bit blurry. Furthermore, it is creating a cyclic dependency: the linting logic requires that the Protobuf files must have already been generated, but we can only generate them when we have plugin compiled. Prepare for a fix by splitting up functionality of this plugin into two separate plugins: `protoc-gen-gitaly-lint` is responsible for linting our definitions, while `protoc-gen-gitaly-protolist` will generate the list of Protobuf files.
2022-05-06Makefile: Fix protoc linting not workingPatrick Steinhardt
With 2a333822f (Use protoc_gen_gitaly plugin when regenerating protobuf definitions, 2022-04-29), we have merged usage of Gitaly's protoc plugin into the use of `make proto`. This was done because the plugin doesn't only lint sources, but it also generates some data structures on its own. This process has broken use of the plugin completely though. While we make the plugin's path known to `protoc` via the `--plugin` option, it is not getting used at all because we didn't also move `--gitaly_out`. This option is required though for the plugin to actually be used. Fix this bug by adding the option back in.
2022-05-06Merge branch 'smh-fix-coverage-key' into 'master'Patrick Steinhardt
Update test coverage artifact key See merge request gitlab-org/gitaly!4533
2022-05-06Update test coverage artifact keySami Hiltunen
The artifact key for the test coverage report was recently changed. This commit updates the key in our gitlab-ci.yml to the new one.
2022-05-06Merge branch 'pks-gitaly-fix-version-log' into 'master'John Cai
cmd/gitaly: Fix log message announcing Gitaly version See merge request gitlab-org/gitaly!4529
2022-05-05Merge branch 'revert-smh-no-up-to-date-replicas-error' into 'master'John Cai
Revert "Return correct error when repository has no up to date replicas" See merge request gitlab-org/gitaly!4531
2022-05-05Revert "Return correct error when repository has no up to date replicas"John Cai
This reverts commit 7c78dcb8514bba6195993f83706bacebe3b71dd4.
2022-05-05cmd/gitaly: Fix log message announcing Gitaly versionPatrick Steinhardt
On startup, Gitaly is printing its version. The message is currently quite garbled though: Starting GitalyversionGitaly, version 14.10.0 Fix the message to be less confused: Starting Gitaly, version 14.10.0
2022-05-05Merge branch 'pks-gitaly-internal-sockets-trim-max-length' into 'master'Patrick Steinhardt
gitaly: Shorten maximum internal socket path length See merge request gitlab-org/gitaly!4523
2022-05-05Merge branch 'jc-remove-gomod-exclude-directive' into 'master'Patrick Steinhardt
go.mod: Remove exclude directive See merge request gitlab-org/gitaly!4525
2022-05-05gitaly: Shorten maximum internal socket path lengthPatrick Steinhardt
With the migration to the new runtime directory, Gitaly has moved its internal socket directory as well. Unfortunately, this change resulted in an expansion of the internal socket path length, and because Unix systems put a limit on Unix socket paths this has caused Gitaly to not come up on some systems anymore. This problem is entirely fixable by the administrator by configuring a different runtime directory path that has a shorter prefix. But we can at least try to shorten the paths we generate a bit. Right now, Gitaly creates three different types of internal sockets: - The internal socket that is used e.g. by `gitaly-hooks` to connect back to Gitaly. This file is created as `internal_${PID}.sock`. Including the PID is not required anymore though: the runtime directory always contains `gitaly-${PID}` anyway. So we can easily shorten this to just `intern`. This leaves us with a socket name length of 6. - The Ruby worker sockets, which are created as `ruby.$N`. `$N` is the number of any worker, and typically shouldn't be larger than in the tens. This leaves us with a typical socket name length of 7. - The internal test socket that is created to verify whether we can create and connect to internal sockets. This is done as a sanity check to alert administrators early on in case the socket path length exceeds the system's limits. Right now it's created as `test-XXXX.sock`, but given that we're about to change the naming strategy we must only ensure that it's as long as the longest socket we're creating. Furthermore, we don't need to create it with a random part anymore given that the runtime directory is keyed by PID. We thus use `tsocket`, which has a socket name length of 7. With these changes in place we reduce the maximum socket name length from 19 characters to 7 characters, which gives us administrators 12 characters more room to play with.
2022-05-05Merge branch 'toon-danger-exclude-gen-proto' into 'master'Patrick Steinhardt
Danger: Exclude generated protobuf files in size See merge request gitlab-org/gitaly!4526
2022-05-05Merge branch 'jc-limithandler-return-structured-limits' into 'master'Patrick Steinhardt
limithandler: Return structured errors Closes #4197 See merge request gitlab-org/gitaly!4507
2022-05-04Merge branch 'pks-services-reduce-usage-of-worktrees' into 'master'John Cai
tests: Reduce usage of Git worktrees in service tests See merge request gitlab-org/gitaly!4519
2022-05-04Update changelog for 14.10.2GitLab Release Tools Bot
[ci skip]
2022-05-04Update VERSION filesv15.0.0-rc2GitLab Release Tools Bot
[ci skip]
2022-05-04Danger: Exclude generated protobuf files in sizetoon-danger-exclude-gen-protoToon Claes
This change adds a lightly adjusted version of the changes_size rule. This version excludes the generated protobuf files *.pb.go and *_pb.rb.
2022-05-04go.mod: Remove exclude directivejc-remove-gomod-exclude-directiveJohn Cai
Remove the exlude directive that prevented us from pulling in a a buggy version of grpc/grpc-go. We don't use this package anymore, so there's no reason to keep this directive. Also, newer versions of grpc/grpc-go has fixed the bug that's mentioned as the reason for the exclude. Changelog: other
2022-05-04Merge branch 'smh-no-up-to-date-replicas-error' into 'master'Toon Claes
Return correct error when repository has no up to date replicas See merge request gitlab-org/gitaly!4518
2022-05-04conflicts: Drop ability to create test commit service with worktreesPatrick Steinhardt
There are no tests left which require a worktree for their test setup, and we don't want to encourage anybody adding such tests back in. After all, production never uses non-bare repositories, and thus we don't want to change any assumptions by using them in our tests. Drop the ability to create worktrees in these tests.
2022-05-04conflicts: Rewrite `ListConflictFiles()` tests to not use worktreePatrick Steinhardt
Rewrite `ListConflictFiles()` tests to not use a worktree. Tests should instead use `gittest.WriteCommit()` and `gittest.WriteTree()` to set up the repository state, which both don't require a worktree.
2022-05-04commit: Drop ability to create test commit service with worktreesPatrick Steinhardt
There are no tests left which require a worktree for their test setup, and we don't want to encourage anybody adding such tests back in. After all, production never uses non-bare repositories, and thus we don't want to change any assumptions by using them in our tests. Drop the ability to create worktrees in these tests.
2022-05-04commit: Rewrite `TreeEntries()` tests to not use worktreePatrick Steinhardt
Rewrite `TreeEntries()` tests to not use a worktree. Tests should instead use `gittest.WriteCommit()` and `gittest.WriteTree()` to set up the repository state, which both don't require a worktree.
2022-05-04commit: Rewrite `ListLastCommitsForTree` test to not use worktreePatrick Steinhardt
Rewrite a `ListLastCommitsForTree()` test to not use a worktree. Tests should instead use `gittest.WriteCommit()` and `gittest.WriteTree()` to set up the repository state, which both don't require a worktree.
2022-05-04commit: Convert trivial cases of tests needlessly using worktreesPatrick Steinhardt
Two tests in the `CommitService` code use worktrees without really needing them. Refactor them to not use worktrees.
2022-05-04gittest: Introduce option to write commits with tree IDPatrick Steinhardt
While we already have an option that allows writing a commit with a root tree generated from a set of tree entries, we don't have any to create a commit with a precomputed tree ID. Add a new option `WithTree()` to allow this usecase.
2022-05-04Merge branch 'pks-git-v2.36.0' into 'master'Patrick Steinhardt
Makefile: Install bundled Git v2.36.0.gl1 Closes #4190 See merge request gitlab-org/gitaly!4516
2022-05-03limithandler: Return structured errorsjc-limithandler-return-structured-limitsJohn Cai
In order to alert upstream clients that Gitaly has reached capacity, return a structured error of gitalypb.LimitError that clients like workhorse, gitlab-shell, and rails can parse and take action on. These errors all have the gRPC status Unavailable. Changelog: changed
2022-05-03Merge branch 'jc-cherry-pick-structured-errors-proto' into 'master'John Cai
proto: Add CherryPickError type for UserCherryPick structured errors See merge request gitlab-org/gitaly!4497
2022-05-03proto: Add UserCherryPickError type for UserCherryPick structured errorsJohn Cai
In UserCherryPick, there are some error conditions where instead of returning an error, we return OK and embed the error in the response. Instead of doing this, we want to return structured errors. This change adds the proto definition for this error.
2022-05-03Return correct error when repository has no up to date replicassmh-no-up-to-date-replicas-errorSami Hiltunen
GetConsistentStorages retrieves the up to date replicas of a repository. If the repository has no up to date replicas, it returns a repository not found error. This is incorrect as the repository may still exist from Praefect's point of view, it's just that the replicas with the latest changes have been lost. This commit changes GetConsistentStorages to return a more descriptive error for this scenario instead of a repository not found error. Changelog: fixed
2022-05-03Merge branch 'pks-check-objects-exist-improvements' into 'master'Sami Hiltunen
commit: Various fixes for `CheckObjectsExist()` See merge request gitlab-org/gitaly!4510
2022-05-03Merge branch 'pks-remove-pack-objects-hook' into 'master'Sami Hiltunen
proto: Remove deprecated `PackObjectsHook()` RPC Closes #4138 See merge request gitlab-org/gitaly!4508
2022-05-03proto: Remove deprecated `PackObjectsHook()` RPCPatrick Steinhardt
The `PackObjectsHook()` RPC is deprecated and its implementation has been removed in 473e3540f (Deprecate PackObjectsHook, 2021-10-25). Now that v15.0 is close, let's also remove the Protobuf definitions. Changelog: removed
2022-05-03git: Disallow more whitespace characters in revisionsPatrick Steinhardt
Revisions cannot contain any whitespace characters, and this is an assumption that we make in many parts of our application. Let's make the enforcement of this stricter by also verifying that there are no tabs or newlines in revision names.
2022-05-03git: Refactor revision-validation testsPatrick Steinhardt
Refactor revision-validation tests to be more conformant with our current coding style. Furthermore, extend these tests to also verify that `ValidateRevisionAllowEmpty()` behaves as expected.
2022-05-03git: Rename file hosting revision verification logicPatrick Steinhardt
The logic to verify that revisions are valid revisions that can safely be passed to various Git components is hosted in a file `proto.go`. This is probably a historic artifact, but it doesn't make a lot of sense nowadays. Rename the file to `revision.go` to make it easier to find. While at it, this commit also moves related tests into `revision_test.go`.