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-09Makefile: Consistently require `v` prefix for tool versionspks-makefile-tooling-version-bumpsPatrick 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 flexbiility given that it's now easily possible to e.g. override the version with a commit ID.
2022-06-09Makefile: 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-09Makefile: 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-09Makefile: 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-09Makefile: 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-09Makefile: Update gotestsum to v1.8.1Patrick Steinhardt
Update gotestsum to v1.8.1. There aren't any noteworthy changes in our context.
2022-06-09Makefile: Update goimports to v0.1.10Patrick Steinhardt
Update goimports to v0.1.10. 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 impotrs need to be added."
2022-06-09Makefile: 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-09Makefile: 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-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-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-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`
2022-06-05gitaly-lfs-smudge: Update git-lfs module and dependenciesStan Hu
This version of git-lfs resolves https://github.com/advisories/GHSA-4g4p-42wc-9f3m, although this shouldn't affect Gitaly since it only occurs on Windows. Relates to https://gitlab.com/gitlab-org/gitaly/-/issues/4208 Changelog: changed
2022-06-03Merge branch 'pks-catfile-request-queue-isdirty-deadlock' into 'master'Patrick Steinhardt
catfile: Fix deadlock between reading a new object and accessing it See merge request gitlab-org/gitaly!4590
2022-06-03catfile: Keep request queue dirty if reading object info failsPatrick Steinhardt
When reading the object info fails we're currently returning the request queue back to the state where it pretends to not be reading an object anymore. This means that it is now not considered dirty anymore and may be used for additional requests, or even be returned to the catfile cache. This is dangerous though: we do not know why reading the object info has failed, and chances are high that the error is not recoverable. And in that case we certainly don't want to return the catfile process to the cache. Fix this isssue by not unsetting `isReadingObject` when `ReadObject()` fails. The only exception is when we got a `NotFound` error, which is a graceful failure and doesn't dirty the git-cat-file(1) process.
2022-06-03Simplify request queue dirtiness trackingSami Hiltunen
The dirtiness tracking in request queue is somewhat hard to understand as it bounces between multiple types. The Object type is tracking the number of bytes read. The queue retains a reference to the latest read object to check whether it has been fully read or not. This back and forth can be simplified by managing the dirtiness state completely in the queue. This commit simplifies the tracking by marking the queue dirty when an object is returned, and composing the readers in a manner that flicks the dirtiness bit off once the reading has been completed. This moves all of the dirtiness logic to the queue, making it easier to understand. The object is reading from the stdout of a cat-file process. Closing the cat-file process also closes the underlying reader the Object is using. There's no need to have a separate closing mechanism for the Object so the close and isClosed is removed as part of this change. They were only called from the queue and it is no longer tracking the currentObject so it can't close the object separately. The behavior to return os.ErrClosed on reading when the queue is closed is still retained as some tests rely on it. A later commit can adjust the tests to remove the assertions and the behavior. The tests incorrectly assert that nothing could be read after the process is closed. The io is buffered and it is possible that something can still be read from the buffer even after the underlying process is already closed.
2022-06-03Merge branch 'wc-capture-panic' into 'master'John Cai
ci: Capture panic stack traces See merge request gitlab-org/gitaly!4593
2022-06-01Merge remote-tracking branch 'dev/master'GitLab Release Tools Bot
2022-06-01Update changelog for 14.9.5GitLab Release Tools Bot
[ci skip]
2022-06-01Update changelog for 14.10.4GitLab Release Tools Bot
[ci skip]
2022-06-01Update changelog for 15.0.1GitLab Release Tools Bot
[ci skip]
2022-06-01catfile: Fix deadlock between reading a new object and accessing itpks-catfile-request-queue-isdirty-deadlockPatrick Steinhardt
When we read in a new object via `ReadObject()`, then we must perform an I/O operation to learn about its header. This operation is currently done under the `currentObjectLock()`, but this can easily cause us to deadlock when the I/O operation stalls. Consequentially, it's impossible to access this object now anymore by other callers. Most importantly, this means that both `close()` and `isDirty()` are blocked from making any progress. But because those are used to determine whether processes of the request queue should be killed in the first place we are now in a deadlock-state. Fix this issue by splitting up the lock into a read-lock for the current object whose scope is a lot more fine-grained and only used when we access the field or when we write to it. The second atomic lock is used to only lock writing access across the whole lifetime of `ReadObject()` so that no other caller can call it at the same time. Changelog: fixed
2022-05-31ci: Capture panic stack traceswc-capture-panicWill Chandler
The `short` formatting option for `gotestsum` will usually suppress panics and their stack traces, making it difficult to understand why a panicking test failed. Using `standard-verbose` will display the full trace, but this also gives us the full output of `go test -v`, removing the readability improvements that `gotestsum` provides. To work around this, we use the `--jsonfile` option to write out the full output of `go test -json`, then search for panics in an `after_script` section with results in a pre-collapsed section. To avoid unused log files piling up in local testing, by default the full job output is written to `/dev/null`, with this setting overriden in the CI config.
2022-05-31Merge branch 'pks-postgres-with-praefect-flakiness' into 'master'Will Chandler
ci: Hopefully decrease flakiness in `test-with-praefect` See merge request gitlab-org/gitaly!4583
2022-05-31Merge branch 'pks-streamcache-fix-flaky-test' into 'master'Sami Hiltunen
streamcache: Unlock waiters after cache keys have been pruned See merge request gitlab-org/gitaly!4589
2022-05-31Merge branch 'pks-ci-fix-test-reports' into 'master'Patrick Steinhardt
ci: Fix test reports not being uploaded See merge request gitlab-org/gitaly!4594
2022-05-31ci: Fix test reports not being uploadedPatrick Steinhardt
With 1c112bb7c (ci: Move test reports into temporary directory, 2022-01-13), we have moved our test reports into a temporary directory to prepare for running tests as an unprivileged user. This change broke our ability to upload these test reports as artifacts though because GitLab only supports artifacts which are relative to the build root. Fix this issue by instead writing test reports into a new directory in our build root that's writeable by the unprivileged test user. While at it, pull out the test user ID into a separate variable so that it can be documented better.
2022-05-30ci: Increase connection limit for Postgrespks-postgres-with-praefect-flakinessPatrick Steinhardt
We regularly get CI failures when running with Praefect, which is most likely caused by an exhaustion of the database's connection pool. Increase the limit so that we can hopefully get to a more stable state. Note that we cannot set `PGOPTIONS` here as that causes the Postgres services to not come up. Instead, we work around this by manually adding the configuration to the executed command.
2022-05-30catfile: Fix dirtiness check when current object has been fully readPatrick Steinhardt
We always return the currently pending object's dirty state in case the request queue has an object set. In case the object has been fully read without yet having been closed though this won't account for the queue's outstanding requests. So ultimately, the queue may now says its clean even though it still got requests pending. Fix this issue by not returning early in case there is an object. This causes us to correctly discard any such processes instead of returning them to the cache with still-pending requests. This is an issue we have indeed been observing in RPCs which have limits, like ListLFSPointers. Amend one of our tests to enable cache reuse of catfile processes, which does surface the issue previous to this fix. Changelog: fixed
2022-05-30Merge branch 'pks-lfs-smudge-refactor' into 'master'Patrick Steinhardt
gitaly-lfs-smudge: Refactor code to be more readily extensible See merge request gitlab-org/gitaly!4587
2022-05-30gitaly-lfs-smudge: Remove unused parameterPatrick Steinhardt
Remove the unused `to io.Writer` parameter from `handleSmudge()`. We alreay return an `io.ReadCloser` that the contents can be read from, so there is no need to receive a writer.
2022-05-30repository: Convert GetArchive to use new smudge configurationPatrick Steinhardt
The `GetArchive()` RPC can optionally convert LFS pointers to their actual contents via the gitaly-lfs-smudge filter. The configuration of this filter happens via a set of environment variables, which we have replaced with a single structure in this commit series. Convert `GetArchive()` to use the new `smudge.Config` to inject the environment.
2022-05-30gitaly-lfs-smudge: Move configuration-code into separate packagePatrick Steinhardt
Move the configuration-related code of gitaly-lfs-smudge into a separate package so that we can access and inject it in Gitaly's services.
2022-05-30gitaly-lfs-smudge: Allow passing configuration as a single envvarPatrick Steinhardt
The gitaly-lfs-smudge binary accepts its configuration as a set of environment variables, which is required so that we can pass it through Git. Using separate environment variables doesn't scale though: there is no easily accessible documentation about what is accepted and what is not, and furthermore every new configuration needs another environment variable. Refactor our code to accept a single `GITALY_LFS_SMUDGE_CONFIG` variable that contains everything needed by gitaly-lfs-smudge to operate. The old environment variables still exist for backwards-compatibility reasons, but are overridden in case the new environment variable exists.
2022-05-30gitaly-lfs-smudge: Refactor config-handling to have a central structPatrick Steinhardt
The gitaly-lfs-smudge binary accepts a set of environment variables to configure it. Because of this the configuration of the binary is kind of hard to extend: for every piece of information that is required, we need to add a new environment variable. Ultimately, this leads to a design where we have lots of magic environment variables injected with no clear indicator about which ones are used and which ones aren't, similar to the case we had with gitaly-hooks before introducing the hooks payload. Refactor the code and create a central `Config` struct which holds all the configuration required. This prepares us for a fix where we can do the same like we did for the hooks payload where we only inject a single JSON-encoded environment variable that can then be parsed into this struct.
2022-05-30env: Add helper to extract environment variables from an arrayPatrick Steinhardt
Add a helper function that can extract environment variables by their key from an array of environment variables.
2022-05-30gitaly-lfs-smudge: Move config-related code into its own filePatrick Steinhardt
We're about to refactor the way the configuration is handled, which also includes moving the configuration code into a separate package. Split it out into a separate file for now to prepare for this move.
2022-05-30gitaly-lfs-smudge: Split out a new `run()` functionPatrick Steinhardt
We're about to move loading the configuration out of `smudge()` so that it doesn't need to depend on any global state anymore. Prepare for this by pulling out a separate `run()` function so that we can continue to log any errors and exit with an error code in a single location, only.