Age | Commit message (Collapse) | Author |
|
|
|
While macOS is not a supported platform for Gitaly, most of the
developers at GitLab do infact use macOS as their development platform.
As such it is sensible to not regress the ability of developers to
run the full test suite on macOS.
While it would be nicest to just always run the CI job, it does take
significantly longer to finish than our other tests. So instead, we do
the same as for our FIPS jobs and run them whenever a merge request gets
added to a merge train.
|
|
Reorder the properties of our macOS job to match the order in which
other CI jobs are defined.
|
|
The macOS job is currently executing all steps in the `script` part.
Split it up into `before_script`, `script` and `after_script`. While
this is conceptually cleaner, it also means that the `after_script` will
get executed even if `script` fails to analyze tests for any panics.
|
|
The artifacts defined for macOS tests are the same as the one we have
defined for all other tests. Deduplicate them by using a JAML anchor.
|
|
ci: Fix FIPS job not running for merge trains
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5044
Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
|
|
The FIPS job is supposed to run whenever something gets merged onto the
default branch. This is supposed to happen by checking whether the
condition `CI_COMMIT_BRANCH == CI_DEFAULT_BRANCH` is true. But as it
turns out, this variable is not set in merge request pipelines.
Fix this by adding another condition that checks for the merge request
event type.
|
|
go: Update module github.com/stretchr/testify to v1.8.1
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4971
Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: James Fargher <proglottis@gmail.com>
Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
|
|
praefect: Remove global logger
Closes #4500
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5041
Merged-by: James Fargher <proglottis@gmail.com>
Approved-by: Justin Tobler <jtobler@gitlab.com>
Approved-by: James Fargher <proglottis@gmail.com>
Co-authored-by: Will Chandler <wchandler@gitlab.com>
|
|
hook: Standardize errors creation
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5045
Merged-by: Will Chandler <wchandler@gitlab.com>
Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: Will Chandler <wchandler@gitlab.com>
Co-authored-by: Pavlo Strokov <pstrokov@gitlab.com>
|
|
Now that the previous commit has removed the global logger from
Praefect, re-enable parallel testing for the impacted add-repositories
tests.
Changelog: fixed
|
|
Currently Praefect uses a global `logger` variable. When running
normally this is not an issue logged events occur serially.
However, in testing we try to run in parallel whenever possible, leading
to race-detector failures from events being logged concurrently. This
was occurring frequently in `TestAddRepositories_Exec()` in particular.
Make logger a local variable to resolve this.
|
|
[ci skip]
|
|
|
|
go: Update module google.golang.org/grpc to v1.50.1
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4928
Merged-by: Sami Hiltunen <shiltunen@gitlab.com>
Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: Sami Hiltunen <shiltunen@gitlab.com>
Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
|
|
go: Update module golang.org/x/sync to v0.1.0
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5022
Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: James Fargher <proglottis@gmail.com>
Approved-by: Toon Claes <toon@gitlab.com>
Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
|
|
'renovate-tools/golangci-lint/github.com-golangci-golangci-lint-1.x' into 'master'
tools/golangci-lint: Update module github.com/golangci/golangci-lint to v1.50.1
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4965
Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
|
|
Replace usage of status.Errorf() with helper.Err<StatusCode>() to
return proper error code with error unwrapping.
Replace old %v with new %w for proper error wrapping.
Replace fmt.Errorf() with errors.New() if used without a reason (no
parameters to inject into error text).
Check the error to convert it to the corresponding error code.
|
|
The errInvalidSidechannelAddress made exportable, so we can
check what is the cause of the error returned by the GetSidechannel()
function. It will be used to return InvalidArgument for RPC.
The error is also a bit refactored to have a value receiver for the
Error() method and now has explicit address field.
|
|
Makefile: Use Gitaly's tagged Git versions instead of ad-hoc patching
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5042
Merged-by: John Cai <jcai@gitlab.com>
Approved-by: Christian Couder <chriscool@tuxfamily.org>
Approved-by: karthik nayak <knayak@gitlab.com>
Approved-by: John Cai <jcai@gitlab.com>
Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
|
|
internalgitaly: Standardize errors creation
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5043
Merged-by: John Cai <jcai@gitlab.com>
Approved-by: John Cai <jcai@gitlab.com>
Co-authored-by: Pavlo Strokov <pstrokov@gitlab.com>
|
|
Return Internal code in case of an unexpected operation
failure instead of Undefined by using helper.ErrInternal().
Replace usage of status.Errorf() with helper.ErrNotFoundf() to
make error creation more standard.
|
|
git: Don't use '*' wildcard with curl
Closes #4607
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5037
Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: James Fargher <proglottis@gmail.com>
Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Co-authored-by: Karthik Nayak <knayak@gitlab.com>
|
|
Right now, the way we apply Git patches is by adding them to the Gitaly
project and using git-apply(1) to apply them ad-hoc. This is starting to
show its limits though:
- It is hard for us to provide a simple pointer to the Git sources
that we distribute to the customer.
- It is hard to execute tests for the patched Git version in an
automated fashion.
- It is hard to work on top of the already-patched Git distribution
to for example apply more patches.
These limitations are getting more noticeable now that we have split up
the Gitaly team into two teams, where we potentially want to backport
patches more aggressively.
With the split we have now made the repository at [1] the canonical Git
repository for all our efforts. This indeed opens up a much better way
to use custom Git versions: instead of hosting the patches in the Gitaly
repository, we start to tag Gitaly-specific releases in that repository.
These releases then carry all the additional patches on top.
This makes it trivial to use normal workflows:
- We can point customers to the Gitaly-specific tags which hold our
patches on top.
- We can automatically trigger CI pipelines on top of patched
Gitaly-specific releases by just pushing branches or tags.
- You can just clone the repository and checkout out the specific
tags.
Drop the infrastructure to patch releases in-place in favor of this new
architecture.
[1]: https://gitlab.com/gitlab-org/git.git
|
|
housekeeping: Remove usage of `Time.AddDate(...)`
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5035
Merged-by: Justin Tobler <jtobler@gitlab.com>
Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Approved-by: Justin Tobler <jtobler@gitlab.com>
Co-authored-by: Karthik Nayak <knayak@gitlab.com>
|
|
Extract a zero checksum constant
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5036
Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Co-authored-by: James Fargher <jfargher@gitlab.com>
|
|
Revert "Merge branch 'ps-ref-fix' into 'master'"
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5039
Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: karthik nayak <knayak@gitlab.com>
Co-authored-by: Pavlo Strokov <pstrokov@gitlab.com>
|
|
Currently we use `Time.AddDate(...)` in a few places in the housekeeping
package. The problem with this is that it directly adds/subtracts days
from the current time. This would not work well with DST changes. For
e.g. if you're subtracting day around the time of when DST changes
happen, you could potentially gain/loose an hour.
Instead lets use `Time.Add(...)` where we'd specify the number of hours
to be added/subtracted.
|
|
This reverts merge request !5027
|
|
objectpool: Standardize errors creation
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5033
Merged-by: Christian Couder <chriscool@tuxfamily.org>
Approved-by: Christian Couder <chriscool@tuxfamily.org>
Co-authored-by: Pavlo Strokov <pstrokov@gitlab.com>
|
|
Parse invalid reference name errors in Updater
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5034
Merged-by: Toon Claes <toon@gitlab.com>
Approved-by: Justin Tobler <jtobler@gitlab.com>
Co-authored-by: Sami Hiltunen <shiltunen@gitlab.com>
|
|
We are using the '*' wildcard for populating the `CURLOPT_RESOLVE`
option with an entry `*:$port:$resolved_ip`. This is done to pre-resolve
DNS names and prevent DNS rebinding issues.
The problem is that the wildcard support in curl was only added in v7.64
and newer. Our FIPS build images use curl v7.61 though, and thus curl's
pre-populated cache entry is not used at all. Consequentially, the
vulnerability still exists on such systems.
Lets directly use the hostname instead to ensure we cover all versions
of curl.
|
|
Replace usage of status.Errorf() with helper.Err<StatusCode>f() to
make error creation more standard.
Return Internal code in case of an unexpected operation
failure instead of Undefined by using helper.ErrInternal().
Replace old %v with new %w for proper error wrapping.
Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/4471
|
|
|
|
go: Update module golang.org/x/time to v0.2.0
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5024
Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Approved-by: Justin Tobler <jtobler@gitlab.com>
Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
|
|
Now that these tests are more clearly object hash agnostic, we can run
these tests in sha256 mode.
|
|
Previously when a constant zero checksum was required, it was retrieved
from object hash. The checksum hash is completely decoupled from the
object hash and so here we separate these concepts.
|
|
go: Update module github.com/prometheus/client_golang to v1.14.0
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5021
Merged-by: Will Chandler <wchandler@gitlab.com>
Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com>
Approved-by: Will Chandler <wchandler@gitlab.com>
Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
|
|
Our 'git update-ref' wrapper Updater doesn't currently parse the
the error messages and report invalid reference names with a typed
error. This commit adds support for that as it will be useful in
the future to report more useful errors when Gitaly verifies
references prior to accepting a transaction and logging it.
|
|
|
|
|
|
|
|
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.
|