Age | Commit message (Collapse) | Author |
|
The implementation of listenmux is object hash agnostic.
|
|
The implementation of grpcstats is object hash agnostic.
|
|
The implementation of safe is object hash agnostic.
|
|
Now that ps and helper have been checked, we can be sure that supervisor
is object hash agnostic.
|
|
The implementation of ps is object hash agnostic.
|
|
All of the helper packages are object hash agnostic.
|
|
The implementation of command is object hash agnostic.
|
|
These tests are object hash agnostic.
|
|
This test was originally skipped because catfile did not yet support
sha256. Now it does we can remove the exception.
|
|
The pkt-line format is independent of object hash format.
|
|
Fix the broken link and uses the rendered documentation instead.
Changes the comment to the format expected of a package comment.
|
|
|
|
These tests know nothing of object hashes and so are safe to run.
|
|
These tests know nothing of object hashes and so are safe to run.
|
|
These tests know nothing of object hashes and so are safe to run.
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
Some of our enabled linters are still incompatible with Go 1.18. Disable
them.
|
|
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.
|
|
Update the relevant infrastructure to support Go 1.19. Update our
README.md to reflect this change.
|
|
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>
|
|
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.
|
|
|
|
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>
|
|
'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>
|
|
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.
|
|
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
|
|
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
|
|
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()`.
|
|
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()`.
|
|
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
|
|
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
|
|
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>
|
|
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
|
|
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
|
|
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
|
|
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
|
|
GitalyOrPraefect now renamed to GitalyOrPraefectMessage
as it is more descriptive.
|
|
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.
|