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-11-10listenmux: Allow tests to run in sha256 modejf_sha256_low_hangingJames Fargher
The implementation of listenmux is object hash agnostic.
2022-11-10grpcstats: Allow test to run in sha256 modeJames Fargher
The implementation of grpcstats is object hash agnostic.
2022-11-10safe: Allow test to run in sha256 modeJames Fargher
The implementation of safe is object hash agnostic.
2022-11-10supervisor: Allow test to run in sha256 modeJames Fargher
Now that ps and helper have been checked, we can be sure that supervisor is object hash agnostic.
2022-11-10ps: Run tests in sha256 modeJames Fargher
The implementation of ps is object hash agnostic.
2022-11-10helper: Run tests in sha256 modeJames Fargher
All of the helper packages are object hash agnostic.
2022-11-10command: Enable tests in sha256 modeJames Fargher
The implementation of command is object hash agnostic.
2022-11-10git/conflict: Enable tests in sha256 modeJames Fargher
These tests are object hash agnostic.
2022-11-10localrepo: Stop skipping objects test in sha256 modeJames Fargher
This test was originally skipped because catfile did not yet support sha256. Now it does we can remove the exception.
2022-11-10pktline: Run tests in sha256 modeJames Fargher
The pkt-line format is independent of object hash format.
2022-11-10pktline: Update package documentationJames Fargher
Fix the broken link and uses the rendered documentation instead. Changes the comment to the format expected of a package comment.
2022-11-10pktline: Rename test file to match the file it testsJames Fargher
2022-11-10auth: Run tests in sha256 modeJames Fargher
These tests know nothing of object hashes and so are safe to run.
2022-11-10streamio: Enable tests in sha256 modeJames Fargher
These tests know nothing of object hashes and so are safe to run.
2022-11-10protoc-gen-gitaly-lint: Enable tests in sha256 modeJames Fargher
These tests know nothing of object hashes and so are safe to run.
2022-11-09Merge branch 'qmnguyen0711/expose-test-logs-as-artifaccts' into 'master'Quang-Minh Nguyen
Expose logs as artifacts when running tests on CI See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5002 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-11-09Merge branch 'toon-better-test' into 'master'Quang-Minh Nguyen
testing: Add some improvements to running tests See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4986 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: Toon Claes <toon@gitlab.com>
2022-11-09Merge branch 'ps-ref-fix' into 'master'Pavlo Strokov
ref: Standardization of errors creation See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5027 Merged-by: Pavlo Strokov <pstrokov@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Approved-by: Christian Couder <chriscool@tuxfamily.org>
2022-11-09Merge branch 'renovate/github.com-getsentry-sentry-go-0.x' into 'master'Patrick Steinhardt
go: Update module github.com/getsentry/sentry-go to v0.14.0 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4905 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2022-11-09Expose logs as artifacts when running tests on CIQuang-Minh Nguyen
Gitaly test suite on CI doesn't expose any logs. Sometimes, it's not easy to re-produce the tests on local environment. This commit exposes the logs generated while running tests. Those logs are then persisted as the artifacts of CI jobs for a reasonable amount of time. The folder storing logs are configured from TEST_LOG_DIR env variable. The dir is created and injected into testcfg builder and testserver as the dependency of started Gitaly server. We can also produce the logs on the local environment with TEST_LOG_DIR=/tmp/gitaly-logs make test-go Changelog: other
2022-11-09ref: Standardize error creationPavlo Strokov
Replace usage of status.Errorf() with helper.Err<StatusCode>f() to make error creation more standard. Replace old %v with new %w for proper error wrapping. Replace fmt.Errorf() with errors.New() if used without a reason (no wrapping or extra parameters for error text). Remove redundant prefix from error returned by RPC call. Return Internal code in case of an unexpected operation failure instead of Undefined by using helper.ErrInternal(). Add context to the error to make it more descriptive and standard. Check error type to convert it to the corresponding error code. Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/4471
2022-11-09ci: Trigger QA on merged resultToon Claes
When merged result pipelines are enabled we had to set GITALY_SERVER_VERSION to the source branch SHA of the MR, otherwise QA wouldn't find this commit. This issue was reported in [1], and that's now fixed. So we can now remove that work around and run QA against merged result commits. [1]: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6482
2022-11-09Makefile: Make benchmark more verboseToon Claes
The default TEST_FORMAT is 'short', which doesn't output any expect for success or failure. This is pretty useless in the case of benchmarks, because you want to see the numbers of the benchmark. Therefore override the TEST_FORMAT to 'standard-verbose' for the 'bench' target.
2022-11-09Makefile: Ensure benchmark.git exists when running benchToon Claes
The 'bench' target relied on Make handling the prerequisites in order, never the less, this is not guaranteed. To fix this, specify the recipe explicitly so all prerequisites are met before the benchmark is started.
2022-11-09go: Update module github.com/getsentry/sentry-go to v0.15.0GitLab Renovate Bot
2022-11-09Merge branch 'pks-git-pick-same-cgroups-more-often' into 'master'Toon Claes
git: Pick same cgroups more often See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5025 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: James Fargher <proglottis@gmail.com> Approved-by: Toon Claes <toon@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-11-09Merge branch 'pks-golang-support-v1.19' into 'master'Quang-Minh Nguyen
go: Add support for Go 1.19 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5000 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-11-09Merge branch 'pks-ruby-remove-version-file' into 'master'karthik nayak
ruby: Remove version file See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5031 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-11-09golangci-lint: Disable linters incompatible with Go 1.18Patrick Steinhardt
Some of our enabled linters are still incompatible with Go 1.18. Disable them.
2022-11-09proto: Regenerate sources with Go 1.19Patrick Steinhardt
The Go sources generated from our Protobuf definitions are dependent on the Go version as they seem to internally use gofmt. With Go 1.19, gofmt changed the way that comments are formatted, and this in turn impacts our generated code. Now that we have upgraded our CI to run with Go 1.19 by default we need to regenerate the Go code to match the new formatting. Do so.
2022-11-09go: Add support for Go 1.19Patrick Steinhardt
Update the relevant infrastructure to support Go 1.19. Update our README.md to reflect this change.
2022-11-09Merge branch 'renovate/gocloud.dev-0.x' into 'master'Patrick Steinhardt
go: Update module gocloud.dev to v0.27.0 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4902 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2022-11-09ruby: Remove version filePatrick Steinhardt
We have recently rewritten the way our Protobuf Gem is generated. As part of that rewrite we have removed all generated Protobuf code from our codebase as it is not needed anymore and instead generated ad-hoc when building the Gem. Part of this generated code is also `version.rb`, which contains the current Gitaly version. This file is being written by the Release tools bot when tagging a new release, but it is not really required as the same version is also present in our `VERSION` file. We thus also started to generate this file by seeding it with the contents of our `VERSION` and have subsequently removed it from our tree in 326913168 (ruby: Remove stale generated Protobuf code, 2022-10-27). Given that the Release tools bot hasn't yet been upgraded though to stop writing this file it was reintroduced in a later commit. The change to the bot has since landed though, which effectively means that the file is now stale and won't ever be updated anymore. So let's remove it.
2022-11-09go: Update module gocloud.dev to v0.27.0GitLab Renovate Bot
2022-11-08Merge branch 'ps-err-to-status' into 'master'Justin Tobler
Construct status based on the error Closes #4587 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5013 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: Pavlo Strokov <pstrokov@gitlab.com>
2022-11-08Merge branch 'pks-reintroduce-object-pools-dont-rely-on-init-via-fetch' into ↵karthik nayak
'master' objectpool: Reintroduce error if pool does not exist on fetch See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5014 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-11-08git: Drop unused `NewWithDir()` functionPatrick Steinhardt
The `NewWithDir()` function had been used to set up Git commands in a specific worktree. As the only caller that used this has been converted to use `WithWorktree()` instead this function is not required anymore. Remove it.
2022-11-08operations: Stop using `NewWithDir()` for worktreesPatrick Steinhardt
Same as with the preceding commit, we put the Git commands that operate on worktrees into a different cgroup than Git commands that work on a bare repository. There is only a single such RPC left though, which is `UserApplyPatch`. Convert this RPC to use a new Git option `WithWorktree()`. If set, this option causes us to execute Git commands with the `-C` switch instead of with `--git-dir` so that the command is executed as if it was executed in the given worktree. Like this, we spawn those Git commands in the same cgroup as would get picked in most of the other RPCs. Changelog: fixed
2022-11-08global: Fix use of different cgroups when serving reposPatrick Steinhardt
There are several Git commands required for serving repositories to clients that typically don't get spawned in the repository itself, but which get the repository path as argument. These are git-upload-pack(1), git-upload-archive(1) and git-receive-pack(1), all of which we use in our `smarthttp` and `ssh` services. And because they don't require us to set up the repository via the `--git-dir` option, we're currently using `NewWithoutRepo()` to spawn them. This has a major downside in the context of cgroups though. In order to decide the cgroup bucket into which we put spawned commands, we either hash the repository's information or, if not present, the command line. As we're not passing a repo when serving them, it means that we always use the command line for them. This is different from most of the other RPCs though, where we use the repository information instead. Ultimately this means that every repository has two different cgroups it frequently gets assigned to, and that's of course not great. Fix this bug by switching to `New()` instead of `NewWithoutRepo()`. While not really necessary, it also shouldn't harm us either to make the Git directory known to git-upload-pack(1) et al. And given that we now have a repository context available, it means that we will put serving commands into the same cgroup as for all the other commands. Changelog: fixed
2022-11-08git: Refactor cgroups tests to use `gittest` packagePatrick Steinhardt
The `git` package cannot use either the `testcfg` nor `gittest` packages due to a cyclic dependency. As such, we have to do a lot of manual setup in such tests. Refactor the `cgroup` tests and move them into a separate `git_test` package to fix this cyclic dependency. This simplifies the test setup and allows us to easily create a test repository via the `gittest` package so that we can switch from `gitCmdFactory.NewWithDir()` to `New()`.
2022-11-08tests: Refactor to use `gittest` package instead of `NewWithoutRepo()`Patrick Steinhardt
We want to reduce the number of calls to `git.NewWithoutRepo()` to a bare minimum. Refactor tests to use `gittest.NewCommand()` and similar to get rid of some calls to `NewWithoutRepo()`.
2022-11-08middleware: Construct status based on the errorPavlo Strokov
Each response has a status code. It is based on error returned from the handler. If no error is returned the status is OK, but if there is an error entity, it would be used to produce the correct error code. Usually the status package is used to create an error with proper code to be returned, but in some cases the proper wrapping with helper or explicit status creation is not used. In these cases the Unknown code is returned as a result of the method invocation. Because the error occurs on the backend side it should be an Internal code instead. The existing cancelhandler package renamed and now contains unary and stream interceptors that are modify returned error according to the context state and error returned by handler. Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/4587
2022-11-08cancelhandler: Extend test coveragePavlo Strokov
The package doesn't have any tests. As it is going to be changed we extend test coverage to make sure nothing is broken. Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/4587
2022-11-08Merge branch 'ps-standardize-errors' into 'master'Sami Hiltunen
service: Standardize validation of Repository existence Closes #3717 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4860 Merged-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com> Co-authored-by: Pavlo Strokov <pstrokov@gitlab.com>
2022-11-08gitaly/service: Use 'service.ValidateRepository()' to validate inputPavlo Strokov
Replace simple non-nil check with call of the ValidateRepository() functions that also validates RelativePath and StorageName fields. Part of https://gitlab.com/gitlab-org/gitaly/-/issues/3717
2022-11-08praefect: Use 'service.ValidateRepository()' to validate inputPavlo Strokov
Replace simple non-nil check with call of the ValidateRepository() function that also validates RelativePath and StorageName fields. Part of https://gitlab.com/gitlab-org/gitaly/-/issues/3717
2022-11-08gitaly/service: Shared request validation functionalityPavlo Strokov
A lot of RPCs take a Repository as an input parameter. It is a required parameter in most cases if not at all. Those we need to validate it is provided, and it has all required fields set as well. For that purpose the 'ValidateRepository' function is declared. It accepts repository entity and checks the repository is not nil, and it has StorageName and RelativePath fields set and non-blank. If something is missing the corresponding error will be returned. Part of https://gitlab.com/gitlab-org/gitaly/-/issues/3717
2022-11-08internal/errors: New shared validation errorsPavlo Strokov
The new validation errors now added to the shared 'errors' package. The main idea is to re-use these in the services instead of creating a new error in place. The 'ErrEmptyStorageName' error signals that the repository doesn't have 'StorageName' field set to non-blank value. The 'ErrEmptyRelativePath' does the same, but only for the 'RelativePath' field. Part of https://gitlab.com/gitlab-org/gitaly/-/issues/3717
2022-11-08testhelper: More descriptive name for GitalyOrPraefectPavlo Strokov
GitalyOrPraefect now renamed to GitalyOrPraefectMessage as it is more descriptive.
2022-11-08service/conflicts: Improve validation of inputPavlo Strokov
Gitaly should return the same error for all RPCs where the Repository input parameter is missing. The test coverage extended to cover changed code. The error verification is done not only for the code, but for the message as well. It gives us confidence that a proper path is tested.