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-08-10services: Don't needlessly skip repo creation via APIpks-gittest-create-repo-consolidationPatrick Steinhardt
While it makes sense for tests to skip repository creation via the `CreateRepository()` RPC when they are not testing in a context where they have a gRPC server available, there should in the general case not be a reason to skip this in our service-related tests. There still is a bunch of tests that do this though. Adjust the tests to not skip the RPC calls to create the repository and refactor some that didn't make the server address available via the Gitaly configuration. Note that we need to some touch up some tests which erroneously created the repository multiple times, which would now fail with Praefect.
2022-08-10gittest: Consolidate unused InitRepo and CloneRepo functionsPatrick Steinhardt
Consolidate the unused InitRepo and CloneRepo functions. All existing callers are using CreateRepository with `SkipCreationViaService` set to `true.
2022-08-10gittest: Convert callers of CloneRepo to use CreateRepositoryPatrick Steinhardt
Convert all callers of CloneRepo to use CreateRepository.
2022-08-10gittest: Convert callers of InitRepo to use CreateRepositoryPatrick Steinhardt
Convert all callers of InitRepo to use CreateRepository.
2022-08-10gittest: Make CreateRepository handle repo creation without gRPC servicePatrick Steinhardt
We have two sets of functions to create repositories for testing purposes: - CreateRepository creates the repository by calling the respective RPCs of the RepositoryService. This allows us to properly test with Praefect as a proxy, which requires the RPC to be called so that it can set up the repositories in the database. - InitRepo and CloneRepo, which both will create the repository without doing an RPC call. These should only be used in contexts where we don't have a gRPC service available. It's confusing at times which of both should be used, and we're not quite consistent. Unify all functionality to create repositories into CreateRepository and add a new option `SkipCreationViaService`. If set, this will behave the same as InitRepo and CloneRepo, which allows us to consolidate the functions into a single one. Callers that want to skip creation via the RepositoryService will thus need to explicitly opt-in to this behaviour and cannot just use InitRepo respectively CloneRepo without knowing about the ramifications.
2022-08-10Merge branch ↵Toon Claes
'4257-usermergebranch-does-not-verify-it-got-a-user-name-and-email' into 'master' usermergebranch: add validation for user.{email, name} Closes #4257 See merge request gitlab-org/gitaly!4800
2022-08-10Merge branch 'pks-operations-convert-test-hook-to-bash' into 'master'Patrick Steinhardt
operations: Convert test hooks to use Bash instead of Ruby See merge request gitlab-org/gitaly!4803
2022-08-10operations: Validate user.{email, name} in UserMergeBranchKarthik Nayak
While 'UserMergeBranch' verifies that it got a user as part of the first request, it doesn't verify that the user actually has a name and email set. This leads to an Internal error at a later point when trying to create the merge commit because you cannot create merge commits with either of them being empty. This commit improves our validation to check these parameters and return an InvalidArgument error if unset. We add a new test 'TestUserMergeBranch_failure' to test the validation logic in 'UserMergeBranch'. Signed-off-by: Karthik Nayak <knayak@gitlab.com>
2022-08-10operations: Convert test hooks to use Bash instead of RubyPatrick Steinhardt
As we're progressing with out conversion of Ruby-based code we're drawing ever closer to a future where there is no Ruby in Gitaly's code base anymore. Some of our tests still depend on Ruby though because they use a set of custom hooks that are implemented in it. Refactor these scripts to use Bash instead of Ruby. This requires less boilerplate code and gets rid of the last set of custom hooks in our tests that use Ruby.
2022-08-10gitaly-hooks: Convert test to use Bash instead of Ruby for hooksPatrick Steinhardt
One of our tests for gitaly-hooks asserts that both the command line arguments and environment seen by the process match our expectations. This is done by writing some custom hooks, where one of the hooks is currently written in Ruby. Refactor the hook to use Bash instead in order to reduce our reliance on Ruby. While at it, convert the test to use `gittest.InitRepo()` instead of `gittest.InitRepo()`: we don't depend on any references or objects anyway, so there is not much of a point to use a completely seeded repository.
2022-08-09Merge branch 'ps-clock-sync-threshold' into 'master'Pavlo Strokov
server: Introduce drift_threshold with proper type to replace drift_threshold_millis Closes #4412 See merge request gitlab-org/gitaly!4788
2022-08-09proto: Use drift_threshold instead of drift_threshold_millisPavlo Strokov
As drift_threshold_millis field is deprecated we use a newly added drift_threshold field instead. To support backwards compatibility the old drift_threshold_millis is taken into account if there is no value provided for the drift_threshold field. Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/4412
2022-08-09proto: Introduce drift_threshold to replace drift_threshold_millisPavlo Strokov
The existing drift_threshold_millis field uses int64 type, but instead it should be of type google.protobuf.Duration. The new field drift_threshold of the proper type added to be used instead. Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/4412
2022-08-09Merge branch 'toon-linguist-no-zeroes' into 'master'Toon Claes
linguist: Ensure empty files are omitted in totals Closes #4416 See merge request gitlab-org/gitaly!4791
2022-08-09linguist: Update version to invalidate cacheToon Claes
In the previous commit we've created a fix in the language stats, but there still might be faulty values cached. To invalidate those, update the version so we'll always recalculate stats from scratch unless it was calculated with the fix in place.
2022-08-09linguist: Ensure empty files are omitted in totalsToon Claes
Empty files should not be taken into account when calculation totals, because the totals should have no languages that have a count of zero. The linguist gem did this correctly already, but the newer Go implementation didn't. Issue: https://gitlab.com/gitlab-org/gitaly/-/issues/4416 Changelog: fixed
2022-08-09linguist: Use proper type in testToon Claes
The ByteCountPerLanguage type is equal to map[string]uint64, so use the type definition instead.
2022-08-09linguist: Convert to table-based testToon Claes
To make sure test cases are independent from eachother, convert the existing test cases to table-based tests that set up a repository from scratch each run.
2022-08-09Update VERSION filesv15.3.0-rc4GitLab Release Tools Bot
[ci skip]
2022-08-09Merge branch 'ps-praefect-readiness-check' into 'master'Pavlo Strokov
praefect: Check of the service readiness with RPC call See merge request gitlab-org/gitaly!4674
2022-08-08linguist: Change tests to use dynamically created commitsToon Claes
Don't start of with a pre-existing repo, but instead build the commits dynamically on demand. This prepares for testing with the SHA256 object hashes.
2022-08-08linguist: Remove duplicate testToon Claes
The test coverage of TestInstance_Stats_incremental and TestInstance_Stats/old_cache is nearly identical, so remove the duplicate test.
2022-08-08gittest: Correctly detect if both Content and OID are setToon Claes
I noticed when none of both fields is set, the user is presented with the error saving "entry cannot have both OID and content". And when both fields are set, no error is given. Fix this by correctly error out when length of both is greater than zero.
2022-08-08praefect: Check of the service readiness with RPC callps-praefect-readiness-checkPavlo Strokov
For the praefect binary we have a sub-command to verify if praefect service can operate without issues. The verification process checks if migrations were applied, if gitaly nodes are reachable, if the clock synced, etc. This check can be done only when you have direct access to the binary. With introducing of ReadinessCheck RPC we now can run the same verification process mentioned above by issuing an RPC call. The new RPC will be part of the gitlab:gitaly:check task. It is noop for the gitaly service as of now. Part of: https://gitlab.com/gitlab-org/gitlab/-/issues/348174
2022-08-08praefect: Make readiness checks injectablePavlo Strokov
It is hard to test ReadinessCheck RPC because the set of the checks that is executed is hard or not possible to mock or substitute. Those we made check an injectable to provide from outside. It will help us to write better tests for the RPC.
2022-08-08praefect: Make runPraefectServer exportablePavlo Strokov
To test ReadinessCheck RPC we need to run praefect service. The runPraefectServer function does what we need, but it is not exportable. This change moves and renames runPraefectServer and related code, so it can be re-used in other packages for testing.
2022-08-08praefect: Move of the service checksPavlo Strokov
The set of the checks that is used to make sure praefect is ready to serve the requests is moved to another location. That is done because we should be able to call them from the RPC handler as they will be used by the ReadinessCheck RPC. Part of: https://gitlab.com/gitlab-org/gitlab/-/issues/348174
2022-08-08proto: RPC to check service readinessPavlo Strokov
The new ReadinessCheck RPC added. It will allow to check the service readiness and should be triggered before putting traffic on to the service. In case of the failure the details about an error and the check name would be returned to the caller. Part of: https://gitlab.com/gitlab-org/gitlab/-/issues/348174
2022-08-08Merge branch 'pks-git-lstree-sha256' into 'master'Sami Hiltunen
lstree: Support SHA256 object hash See merge request gitlab-org/gitaly!4789
2022-08-08Merge branch 'pks-write-ref-fix-resolve-revision' into 'master'Patrick Steinhardt
repository: Fix passing zero OID to WriteRef See merge request gitlab-org/gitaly!4794
2022-08-08repository: Fix passing zero OID to WriteRefPatrick Steinhardt
In ceb9161b1 (repository: Resolve revisions passed to the WriteRef RPC, 2022-07-29) we have refactored the `WriteRef()` RPC to resolve both old and new revision before executing git-update-ref(1) in order to ensure that the objects we want to update to actually exist. This refactoring broke the case though where the client passes the all-zeroes object ID either as old or new reference, which both have a well-defined meaning in this context. Fix this bug by special-casing the all-zeroes object ID. Changelog: fixed
2022-08-05Merge branch 'jc-remove-pack-objects-logging-ff' into 'master'Justin Tobler
hook: Remove PackObjectsMetric feature flag See merge request gitlab-org/gitaly!4786
2022-08-05Merge branch 'renovate/gitlab.com-gitlab-org-gitlab-shell-v14-14.x' into ↵John Cai
'master' go: Update module gitlab.com/gitlab-org/gitlab-shell/v14 to v14.10.0 See merge request gitlab-org/gitaly!4764
2022-08-05Merge branch 'pks-git-updateref-sha256' into 'master'John Cai
updateref: Support repositories with SHA256 object hashes See merge request gitlab-org/gitaly!4778
2022-08-05Merge branch 'renovate/github.com-hashicorp-yamux-0.x' into 'master'John Cai
go: Update module github.com/hashicorp/yamux to v0.1.1 See merge request gitlab-org/gitaly!4749
2022-08-05Merge branch 'pks-git-fetch-disable-show-forced-updates' into 'master'John Cai
git: Speed up fetches by disabling the logic to show forced updates Closes #4377 See merge request gitlab-org/gitaly!4783
2022-08-05Merge branch 'create_fork_errors' into 'master'John Cai
Capture stderr on CreateFork See merge request gitlab-org/gitaly!4785
2022-08-05Merge branch 'pks-git-default-v2.37.1.gl1' into 'master'John Cai
git: Upgrade default Git distribution to v2.37.1.gl1 Closes #4193 See merge request gitlab-org/gitaly!4787
2022-08-05Merge branch 'gin_cve' into 'master'John Cai
Exclude github.com/gin-gonic/gin vulnerable to CVE-2020-28483 Closes #3629 See merge request gitlab-org/gitaly!4784
2022-08-05Merge branch 'pks-git-v2.37.1.gl1-default-enable' into 'master'Sami Hiltunen
git: Default-enable use of Git v2.37.1.gl1 See merge request gitlab-org/gitaly!4782
2022-08-05lstree: Enable testing with SHA256pks-git-lstree-sha256Patrick Steinhardt
The lstree package supports both SHA1 and SHA256-based repositories. Enable testing of the SHA256 object hash.
2022-08-05lstree: Detect object hash in `ListEntries()`Patrick Steinhardt
Detect the object hash used by the repository for which we should list tree entries to support SHA256-based repositories.
2022-08-05lstree: Inject the object hash used to parse tree entriesPatrick Steinhardt
Inject the object hash used to parse tree entries so that the tree entry parser can easily support parsing both SHA1 and SHA256 tree entries. For the time being all callers just inject SHA1. They will be converted over time to inject the correct value.
2022-08-05lstree: Don't use seeded repository to test `ListEntries()`Patrick Steinhardt
We're using a seeded repository to test `ListEntries()` even though we generate all test data at runtime anyway. Convert the tests to use `gittest.InitRepo()` instead.
2022-08-05lstree: Refactor parser test to generate data at runtimePatrick Steinhardt
The lstree's parser tests use static data of git-ls-tree(1) that has been written into a set of files. This makes it hard to test this package with SHA256 given that the output of course contains SHA1 object hashes. Refactor the tests to instead generate data at runtime. Note that we're removing one of the two testcases in this process: both testcases do in fact exercise the exact same logic, only that one of both has a space in one of its tree entries. So we just retain the test for the tree entry with the space and discard the other one given that they don't really test different things anyway.
2022-08-05gittest: Allow `WriteTree()` to write submodule tree entriesPatrick Steinhardt
The `WriteTree()` helper function doesn't allow writing tree entries referring to a submodule right now. Add this functionality.
2022-08-05git: Upgrade default Git distribution to v2.37.1.gl1Patrick Steinhardt
Now that we have default-enabled bundled Git v2.37.1.gl1 we can also switch our default Git distribution to that newer Git version. Do so. Changelog: changed
2022-08-05updateref: Support repositories using SHA256 object hashesPatrick Steinhardt
The updateref package needs to be able to verify object hashes, which mandates that it must be able to tell which object hash format a repo is using and to provide the correct zero object ID. Add object hash detection logic and enable testing the package with SHA256.
2022-08-05updateref: Accept object IDs instead of bare stringsPatrick Steinhardt
Change the updateref package to accept object IDs as old and new target of the reference that is to be updated. This increases type safety and better documents the intent of provided functions.
2022-08-05updateref: Prepare tests to be object hash-agnosticPatrick Steinhardt
One of our tests for the `UpdaterWithHooks` structure is hardcoding the use of the SHA1 object hash. Refactor it to instead use the current default object hash as dictated by the `gittest` package. While at it, set up the Git command factory that the test will start to require when we auto-detect the object hash used by a repository.