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-06-14cgroups: Only enable metrics if option is turned onjc-rename-cgroup-metricJohn Cai
On many cloud providers, cadvisor runs and keeps track of cgroups. To have Gitaly expose its own metrics is redundant at this point. Allow users to configure whether or not they would like Gitaly to collect its own metrics about cgroups. Changelog: added
2022-06-14cgroups: Adjust metric namesJohn Cai
Change the metric names to be more accurate. The memory.failcnt tracks how often the kernel has tried to reclaim memory. While this maps closely to the number of killed processes, they are not exactly the same thing. The cgroups cpu usage metrics are a running total. Add "total" at the end of the metric to indicate this. Changelog: changed
2022-06-13Merge branch 'pks-praefect-fix-remove-maintenance-jobs-migration' into 'master'Sami Hiltunen
datastore: Fix migration that prunes maintenance-style replication jobs Closes #4275 See merge request gitlab-org/gitaly!4608
2022-06-13Merge branch 'pks-user-delete-branch-structured-errors' into 'master'Patrick Steinhardt
operations: Use structured errors in UserDeleteBranch See merge request gitlab-org/gitaly!4605
2022-06-13Merge branch 'pks-proto-remove-deprecated-operation-error-fields' into 'master'Patrick Steinhardt
operations: Remove deprecated error fields See merge request gitlab-org/gitaly!4610
2022-06-10Merge branch 'pks-makefile-tooling-version-bumps' into 'master'Patrick Steinhardt
Makefile: Update our tooling See merge request gitlab-org/gitaly!4611
2022-06-10Merge branch 'toon-freeze-i-ma-bundler' into 'master'Patrick Steinhardt
Makefile: Run bundle install in frozen mode See merge request gitlab-org/gitaly!4613
2022-06-10Merge branch 'pks-catfile-request-queue-tests' into 'master'Toon Claes
catfile: Add tests which exercise the request queue See merge request gitlab-org/gitaly!4598
2022-06-10Makefile: Consistently require `v` prefix for tool versionsPatrick Steinhardt
While some of our tool versions require the `v` prefix of their tag to be present, others don't. This is inconsistent and a tag confusing. Unify this to always require the prefix. This also gives us more flexibility given that it's now easily possible to e.g. override the version with a commit ID.
2022-06-10Makefile: Update protoc to v21.1Patrick Steinhardt
Update protoc to v21.1. Note that this is quite a jump from our current v3.17.3. This isn't all that scary, but a result of upstream changing their versioning schema to drop the leading `3`. Our generated Go files remain unchanged.
2022-06-10Makefile: Update protoc-gen-go-grpc to v1.2.0Patrick Steinhardt
Update protoc-gen-go-grpc to v1.2.0. The most notable change is that we now have headers in our generated gRPC services that indicate the versions used to generate them. Other than that there are no changes in our generated files.
2022-06-10Makefile: Update protoc-gen-go to v1.28.0Patrick Steinhardt
Update protoc-gen-go to v1.28.0. No noticable changes come with this release, and most notably there are no changes in our generated Go files.
2022-06-10Makefile: Update go-licenses to v1.2.1Patrick Steinhardt
Update go-licenses to v1.2.1. One notable change is that the module now prints out warnings for files it doesn't recognize.
2022-06-10Makefile: Update gotestsum to v1.8.1Patrick Steinhardt
Update gotestsum to v1.8.1. There aren't any noteworthy changes in our context.
2022-06-10Makefile: Update goimports to v0.1.11Patrick Steinhardt
Update goimports to v0.1.11. The most important change in our context is that it now uses a cache, which "should speed up goimports -w *.go dramatically in cases where imports need to be added" (0133cac3 (cmd/goimports: reuse cached state, 2019-05-06)).
2022-06-10Makefile: Update protolint to v0.38.1Patrick Steinhardt
Update protolint to v0.38.1. The only interesting change is support for Protocol buffer 3's optional fields, but we don't currently use them anyway.
2022-06-10Makefile: Update golangci-lint to v1.46.1Patrick Steinhardt
Update to the most recent version of golangci-lint, which is v1.46.1. No interesting new linters have been added since v1.44.2.
2022-06-10Makefile: Run bundle in frozen modeToon Claes
Recently security concerns popped up about gems that might get compromised and get replaced with malicious content. To mitigate this, the Bundler team recommends[1] using bundler in --frozen or --deployment mode in CI and during deploys. We address this by exporting BUNDLE_FROZEN=true in the environment of the Makefile. This applies to all bundle commands ran by make, and will affect local development and CI. For omnibus deployments the fix is applied in omnibus-gitlab@4b18021f9 (Merge branch 'bundle-frozen' into 'master', 2022-05-24). The CNG changes are being made in https://gitlab.com/gitlab-org/build/CNG/-/merge_requests/1053. [1]: https://github.com/rubygems/rubygems.org/security/advisories/GHSA-hccv-rwq6-vh79 Issue: https://gitlab.com/gitlab-org/gitaly/-/issues/4225 Changelog: security
2022-06-10operations: Use structured errors in UserDeleteBranchpks-user-delete-branch-structured-errorsPatrick Steinhardt
UserDeleteBranch is returning successfully in some error cases. This is a pattern we want to get rid of, so let's convert the RPC to instead use the structured errors via the new `UserDeleteBranchError` message type. This fixes some cases where we know to create replication jobs because the `UserDeleteBranch` RPC returns successfully, but didn't cast a single vote. Changelog: fixed
2022-06-10Merge branch 'pks-lfs-process-filter' into 'master'Patrick Steinhardt
gitaly-lfs-smudge: Implement support for running as a long-running filter process Closes #4153 See merge request gitlab-org/gitaly!4595
2022-06-10repository: Use long-running filter process for converting LFS pointersPatrick Steinhardt
Wire up support for running gitaly-lfs-smudge as a long-running filter process to speed up conversion of LFS pointers into their converted objects. This should result in a signficant performance boost when creating archives for large repositories with many LFS pointers and avoid the "process-spawn storms" we saw in the past whenever such an archive was requested. Changelog: performance
2022-06-10cmd/gitaly-lfs-smudge: Implement support for long-lived filter protocolPatrick Steinhardt
Originally, Git only ever supported smudging the contents of a single blob by piping that blob to a filter process directly. This meant that for every blob that needs converting, we have to spawn a full process. Naturally, this doesn't scale well when repositories grow and when they have many blobs that do need converting. Git has thus introduced a long-running filter protocol: instead of spawning one process per blob that needs converting, Git will only spawn a single server and then communicate with that server via pktlines. Implement support for this protocol in gitaly-lfs-smudge so that we can start using it in our `GetArchive()` RPC.
2022-06-10cmd/gitaly-lfs-smudge: Introduce driver typesPatrick Steinhardt
Until now, gitaly-lfs-smudge only supports converting a single LFS pointer into its object. This is inefficient though, and Git has an alternative protocol that allows us to convert multiple LFS pointers in a single session via the long-running filter protocol. Introduce a new driver type so that we can easily discern which type of filter Git is expecting: either the old one-shot "filter", or the newer "process" type. For now, this functionality is neither implemented nor used.
2022-06-10repository: Don't manually inject the correlation IDPatrick Steinhardt
We're injecting the correlation ID into the Git process that'll create the archive for us in the `GetArchive()` RPC. This is not required though because we always inject the correlation ID via the command package because we use LabKit's environment injector. Remove the duplicate logic.
2022-06-10repository: Avoid injecting smudge filter configuration if not neededPatrick Steinhardt
We're currently always injecting configuration required for the LFS smudge filter, even if the caller of `GetArchive()` didn't ask us to convert LFS pointers. Refactor the code to only inject the configuration when required.
2022-06-10cmd/gitaly-lfs-smudge: Don't return a reader when request failsPatrick Steinhardt
There is only a single caller of `smudgeOneObject()`, and that caller will immediately bubble up any errors returned by this function. It is thus needless to return an `io.NopCloser()` in case `smudgeOneObject()` itself fails. Return `nil` instead of the `io.NopCloser()` to clarify the code flow.
2022-06-10cmd/gitaly-lfs-smudge: Rename functions and filePatrick Steinhardt
Rename the smudging functions to be better prepared for when we add support for the long-running filter process protocol. While at it, this commit also renames the hosting file to be called `smudge.go` instead of `lfs_smudge.go` to avoid some repetition.
2022-06-10cmd/gitaly-lfs-smudge: Move creation of the HTTP clientPatrick Steinhardt
The GitLab HTTP client is currently created closely before performing the request to retrieve the LFS pointers' smudged contents. This has been fine until now given that we only ever requested a single LFS pointer across the whole lifetime of the command. As we are about to implement the long-running filter protocol though this will change so that we may request an unbounded number of LFS pointers in a single session. Move out creation of the HTTP client so that it can be reused across calls to `smudgeContents()`. This avoids some overhead like re-reading contents of the GitLab secret from disk. Note that this is essentially a change in behaviour: previously, if we failed to create the HTTP client, then we'd have just silently returned the blob's clean contents. This easily papers over misconfigurations though and is thus not all that great. Now we do return errors in case we failed to create the client, which means that any such misconfigured instance may now error. This feels like a reasonable change though: better to complain about errors than to silently swallow then.
2022-06-10cmd/gitaly-lfs-smudge: Move creation of the context into `run()`Patrick Steinhardt
The context is currently created when smudging contents. We're about to add another code path to the `run()` function though that will also need a context. Move creation of the context higher up into `run()` so that it can be shared across both code paths.
2022-06-10pktline: Add helper function to retrieve and verify dataPatrick Steinhardt
While the pktline package already provides the `Data()` function to retrieve a pktline's payload, this function doesn't perform any sanity checks on retrieved data at all. Add a new function `Payload()` that verifies that the pktline header's claimed length matches the actual data's length. While it would be preferable to just change `Data()`, chances are high that this would cause unintended side effects.
2022-06-09operations: Remove deprecated GitError field from UserSquashpks-proto-remove-deprecated-operation-error-fieldsPatrick Steinhardt
The `GitError` field of the `UserSquash` response has been deprecated in e8413304d (operations: Always use structured errors for UserSquash, 2022-03-21) and is never set anymore. Let's remove it.
2022-06-09operations: Remove deprecated PreReceiveError field from UserMergeToRefPatrick Steinhardt
The `PreReceiveError` field of the `UserMergeToRef` response has been deprecated in 9aa0347a2 (proto: Deprecate PreReceiveError field in UserMergeToRefResponse, 2022-03-07) and is never set anymore. Let's remove it.
2022-06-09operations: Remove deprecated PreReceiveError field from UserMergeBranchPatrick Steinhardt
The `PreReceiveError` field of the `UserMergeBranch` response has been deprecated in 151bdfd96 (proto: Deprecate PreReceiveError field in UserMergeBranchResponse, 2022-03-07) and is never set anymore. Let's remove it.
2022-06-09Update VERSION filesv15.1.0-rc1GitLab Release Tools Bot
[ci skip]
2022-06-08Merge branch '3817_enable_ff_by_default' into 'master'Will Chandler
Enable feature flag exact_pagination_token_match by default See merge request gitlab-org/gitaly!4606
2022-06-08Merge branch 'pks-user-delete-branch-errors' into 'master'Will Chandler
proto: Introduce new UserDeleteBranchError message See merge request gitlab-org/gitaly!4604
2022-06-08datastore: Fix migration that prunes maintenance-style replication jobspks-praefect-fix-remove-maintenance-jobs-migrationPatrick Steinhardt
We 41ca8534e (praefect: Prune stale maintenance-style replication events, 2022-05-20), we have introduced a migration that prunes old maintenance-style replication jobs from our replication queue. That migration was a bit too naive though because it assumed that we had mostly drained the replication queue of such jobs already and that there aren't any stale locks which referenced these jobs. Naturally, the real world shows that such stale locks exist. And because these locks have a foreign-key constraint on the job without cascading deletes we fail to prune any such maintenance-style job that is referenced by a lock. Fix this issue by deleting job locks before deleting the jobs. Also, let's handle the case where there are acquired job locks that should be unlocked because all job are removed. Changelog: fixed
2022-06-08proto: Introduce new UserDeleteBranchError messagePatrick Steinhardt
We're about to convert UserDeleteBranch to use structured errors. As a first step we introduce a new UserDeleteBranchError message that hosts all errors that are expected failures and which may thus be handled by the client. The RPC is not yet converted to use the new error types because we first have to update clients to handle them.
2022-06-08operations: Improve test coverage for UserDeleteBranchPatrick Steinhardt
Improve test coverage for UserDeleteBranch to exercise failures caused by concurrent writes to the same references and when the call to Rails' `/internal/allowed` interface fails for access checks.
2022-06-07Enable feature flag exact_pagination_token_match by default3817_enable_ff_by_defaultVasilii Iakliushin
Contributes to https://gitlab.com/gitlab-org/gitaly/-/issues/3817 Changelog: changed
2022-06-07operations: Modernize test names in branches testsPatrick Steinhardt
Modernize test names to match our current coding style more closely.
2022-06-07operations: Modernize error messages returned by UserDeleteBranchPatrick Steinhardt
Modernize error messages returned by UserDeleteBranch to match our modern coding style more closely.
2022-06-07operations: Remove out-of-date commentPatrick Steinhardt
Remove comment stating that we don't verify the branch name and/or user in `UserCreateBranch()` while we do in `UserDeleteBranch()`: we do it in both, so this comment is clearly stale.
2022-06-07proto: Document UserDeleteBranch RPCPatrick Steinhardt
The UserDeleteBranch RPC is missing documentation. Add it to document its behaviour and expected error cases.
2022-06-07Merge branch 'sh-upgrade-bundler-2.3.15' into 'master'Toon Claes
chore: Update Gemfile.lock to use bundler v2.3.15 See merge request gitlab-org/gitaly!4603
2022-06-07Merge branch 'sh-update-lfs' into 'master'Patrick Steinhardt
gitaly-lfs-smudge: Update git-lfs module and dependencies See merge request gitlab-org/gitaly!4600
2022-06-07chore: Update Gemfile.lock to use bundler v2.3.15Stan Hu
This is just to minimize the versions of bundler used for development. The GDK runs `support/bundle-install` in this directory to obtain the version of bundler needed. This relates to https://gitlab.com/gitlab-org/gitlab/-/issues/364373.
2022-06-07catfile: Add tests which exercise the request queuepks-catfile-request-queue-testsPatrick Steinhardt
We do not currently have tests which directly exercise the request queue at a low level. Add some to improve our test coverage and assert that it continues to work alright for several edge cases.
2022-06-06Update changelog for 15.0.2GitLab Release Tools Bot
[ci skip]
2022-06-05Update NOTICE for git-lfs updatesh-update-lfsStan Hu
Regenerated via `make notice`