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
2020-12-15Updater: dispatch to update-ref create/delete/updateavar/use-update-ref-delete-and-createÆvar Arnfjörð Bjarmason
Instead of always issuing "update" commands, use the "create" and "delete" verbs too. This doesn't make any difference in the result as git does the same dispatching internally, but makes things a bit more obvious if you're tracing the output.
2020-12-15Move now-safe Update() deletion use to now-safe Delete()Ævar Arnfjörð Bjarmason
Change the two users of Update(ref, <nullsha1>, <oldvalue>) to use the shorter form of Delete(ref, <oldvalue>) instead, which is now just as safe since we're making it take a mandatory oldvalue after the last commit's refactoring.
2020-12-15Do not use unsafe "delete" without <oldvalue>Ævar Arnfjörð Bjarmason
Change the only users of the updateref.Delete() method (aside from its own tests) to use the safer "Update" instead. Why not teach Delete() to also take <oldvalue>? The next commit will do that & change these to use *.Delete() back, but this refactoring was easier to do atomically this way.
2020-12-15Merge branch 'pks-hooks-payload-gl-values' into 'master'Ævar Arnfjörð Bjarmason
hooks: Convert GL_ values to be injected via the hooks payload Closes #3201 See merge request gitlab-org/gitaly!2913
2020-12-15Merge branch 'po-user-update-submodule-ff-default' into 'master'James Fargher
Enable feature flag gitaly_go_user_update_submodule by default Closes #3290 See merge request gitlab-org/gitaly!2917
2020-12-15Enable feature flag gitaly_go_user_update_submodule by defaultPaul Okstad
2020-12-14Merge branch 'avar/tags-test-misc-follow-up-mr-2881' into 'master'Sami Hiltunen
UserTag tests: minor cleanups & improvements See merge request gitlab-org/gitaly!2905
2020-12-14Merge branch 'pks-objectpool-fetch-disable-hooks' into 'master'Patrick Steinhardt
Disable hooks when fetching See merge request gitlab-org/gitaly!2923
2020-12-14Tags tests: test fewer nesting levelsÆvar Arnfjörð Bjarmason
Amend test code I added in 5896fdaf4 (UserCreateTag tests: test nested annotated tags, 2020-12-08) to be less expensive. As pointed out in [1] we're not getting anything extra from testing 10 nested levels, and spending a lot of time doing so. Also change the loop test from "<" to "<=" so the nested level refers to the level of nested tags. I.e. tag->tag->commit is just 1 level of nesting, not 2 or 3. 1. https://gitlab.com/gitlab-org/gitaly/-/merge_requests/2905#note_465020107
2020-12-14Tags tests: don't assign back to testCase reference in test loop (again)Ævar Arnfjörð Bjarmason
Follow-up the last commit (see its commit message) and fix another assignment to testCase, this one was added in 2ad030438 (Implement UserCreateTag RPC, 2017-09-26). While we're at it let's be consistent here with later tests I've added and test the entire response, not just response.Tag. That re-alignment of "[]byte(inputTagName)" is "make format" being stupid, why not align all the key-values just because there's a tiny comment in the middle, but I guess it's something that makes sense for larger comments...
2020-12-14Tags tests: don't assign back to testCase reference in test loopÆvar Arnfjörð Bjarmason
Fix a logic error of mine in b1f09d511 (UserCreateTag: fix internal error in tree/blob tag creation, 2020-12-04). It makes no sense to be assigning to our test data itself during the loop. As @toon points out in [1] the testCase variable is a reference. This didn't introduce a logic error in the test itself, since we're only using each item in the testCase array once, so it's OK for the test results if we mutate it as we go along. But let's change this to something more sensible anyway & change our transitory responseOk variable instead. This anti-pattern was itself copied from earlier code in 2ad030438 (Implement UserCreateTag RPC, 2017-09-26). A follow-up commit will fix that test case. 1. https://gitlab.com/gitlab-org/gitaly/-/merge_requests/2881#note_463363831
2020-12-14Tags tests: pass nested tags through hooksÆvar Arnfjörð Bjarmason
Amend the test I added in 5896fdaf4 (UserCreateTag tests: test nested annotated tags, 2020-12-08) to use the hook setup boilerplate like the tests before it. I should have added this to 5896fdaf4 (part of gitlab-org/gitaly!2881), but I didn't because I ran into an issue in some WIP code with these hooks that turned out to be trivial. See [1]. 1. https://gitlab.com/gitlab-org/gitaly/-/merge_requests/2905#note_465020107
2020-12-14Tags tests: unify inline Ruby update hook scriptÆvar Arnfjörð Bjarmason
Change the pre-receive hook script to use an "expected_object_type" variable like the update script. Initially I'd intended to change this script further in a follow-up commit, but that commit turned out not to make any sense and has been rebased out. Still, the consistency here looks better.
2020-12-14changelogs: Add entry noting that we disabled hooks for fetchesPatrick Steinhardt
2020-12-14remote: Disable transactions for FetchInternalRemotePatrick Steinhardt
With the same reasoning as the preceding commit, this disables the reference-transaction hook for `FetchInternalRemote`. Note that the test change to create a single commit in the source repository is sufficient to demonstrate that hooks aren't executed anymore. Previously, there simply weren't any changes which were fetched, which caused us to invoke no hooks at all. With this change, we now create a commit and would thus update a reference in the target repository, but as the test setup was incomplete and didn't set up the hooks service at all, it would've failed to execute the hook now. But as we now disabled hooks, it continues to succeed.
2020-12-14objectpool: Disable transactions for FetchIntoObjectPoolPatrick Steinhardt
When executing git-fetch(1), git will currently create one referecne transaction per reference that is to be modified. This is quite inefficient when used together with the reference-transaction hook, as it effectively means that we execute the hook once for each reference. If fetching hundreds of thousands of references, this directly translates to hundreds of thousands of spawned processes, which means an extreme performance hit. Fix the issue for `FetchIntoObjectPool` by disabling the reference-transaction hook for now. This is only a stop-gap measure until we land the equivalent of `git fetch --atomic`, which creates a single transaction only.
2020-12-14updateref: Add option to disable reference-transactionsPatrick Steinhardt
The updateref package will currently alwyas set up the Updater in such a way that it uses the reference-transaction hook. This may not be wanted in some contexts, which is why this commit now sets up a new option to disable hooks altogether. The way Options are implemented is really quite simplistic and extremely limited. It's likely we won't ever add new options though, which makes it fit for the current task at hand but for nothing else. It should be easy enough to extend though, and using options is preferred to introducing a new required parameter as the latter would require us to change all callers.
2020-12-14Merge branch 'smh-enable-user-commit-files' into 'master'Sami Hiltunen
Enable Go port of UserCommitFiles by default See merge request gitlab-org/gitaly!2922
2020-12-14Merge branch 'sh-fix-issue-3305' into 'master'Patrick Steinhardt
Run housekeeping on pool repository See merge request gitlab-org/gitaly!2916
2020-12-14enable Go port of UserCommitFiles by defaultSami Hiltunen
Enables the Go port of UserCommitFiles by default. The port has been successfully tested in production without issues.
2020-12-14Run housekeeping on pool repositoryStan Hu
https://gitlab.com/gitlab-org/gitaly/-/merge_requests/2885 added housekeeping on the origin repository during a FetchIntoObjectPool RPC, but not on the pool repository itself. We now remove housekeeping from origin repo and only clean up the pool repository. Relates to https://gitlab.com/gitlab-org/gitaly/-/issues/3305
2020-12-14Merge branch 'ps-clean-up-params-usage' into 'master'Sami Hiltunen
Clean up of the internals of the Coordinator type See merge request gitlab-org/gitaly!2920
2020-12-14Merge branch 'ps-remove-unused-field' into 'master'Patrick Steinhardt
Removal of unused RepositoryStore dependency See merge request gitlab-org/gitaly!2919
2020-12-14Merge branch 'revert-22c928dc' into 'master'Patrick Steinhardt
Revert "Merge branch 'sh-create-fork-with-object-pool' into 'master'" See merge request gitlab-org/gitaly!2918
2020-12-14Removal of redundant verification stepPavlo Strokov
The method directRepositoryScopedMessage is used only in one place inside of the StreamDirector method. And as the method is already has a verification of the targetRepo before directRepositoryScopedMessage method call it has no sense to do it once again inside it.
2020-12-14Clean up params usage for the methods of the CoordinatorPavlo Strokov
The grpcCall struct was introduced in the c954a53a1 (Praefect: proper multi-virtual storage support, 2020-04-28) commit to reduce the number of parameters used in methods. It contains all info needed to execute proxy operation and there is no need to pass target repository or anything like that as a separate parameter because those are already present in the grpcCall. This commit removes redundant parameters from the methods and substitutes their usage with usage of the grpcCall parameter that has the same value.
2020-12-14Removal of unused RepositoryStore dependencyPavlo Strokov
As the strategy of interacting with the repository changes there is no more need to provide RepositoryStore into Mgr as a dependency as it has no usage. This commit removes RepositoryStore from the list of the input parameters of the constructor function and from the list of fields of the Mgr struct.
2020-12-14Revert "Merge branch 'sh-create-fork-with-object-pool' into 'master'"Stan Hu
This reverts merge request !2887
2020-12-14Merge branch 'po-resolve-conflicts-handle-nil-entries' into 'master'Paul Okstad
Handle nil index entries in resolve conflicts See merge request gitlab-org/gitaly!2895
2020-12-14Handle nil index entries in resolve conflictsPaul Okstad
2020-12-11Merge branch 'fix_require_equal' into 'master'Paul Okstad
Stop using require.Error to compare error values See merge request gitlab-org/gitaly!2896
2020-12-11Update VERSION filesv13.7.0-rc4GitLab Release Tools Bot
[ci skip]
2020-12-11Update VERSION filesv13.7.0-rc3GitLab Release Tools Bot
[ci skip]
2020-12-11Merge branch 'sh-create-fork-with-object-pool' into 'master'Stan Hu
Support cloning with an object pool in CreateFork See merge request gitlab-org/gitaly!2887
2020-12-11Support cloning with an object pool in CreateForkStan Hu
This is needed to support fast forking. When an object pool is provided, forking can cheap in terms of disk space and time since the clone only needs to fetch the references. The `git clone` can take in a `--reference <repository>` flag and will output an alternates file with absolute paths. To maintain the use of relative paths, after the fork is successful we recreate the alternates file. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/24523
2020-12-11hooks: Convert to use ReceiveHooksPayloadPatrick Steinhardt
As the preceding commit has established that we can correctly use the fallback mechanism for the new ReceiveHooksPayload, this commit now converts all users to inject the payload instead of the GL_ environment variables.
2020-12-11hooks: Start using ReceiveHooksPayloadPatrick Steinhardt
This commit converts the hooks to use the ReceiveHooksPayload instead of relying on the GL_ values. As callers don't yet inject the payload but instead still inject the old GL_ environment variables, this nicely demonstrates that the fallback mechanism works as expected.
2020-12-11hooks: Introduce ReceiveHooksPayloadPatrick Steinhardt
Next to the values we already inject via the HooksPayload, there's also some information which only applies to the git-receive-pack(1) hooks pre-receive, update and post-receive. This includes information about the user and about the protocol which is used for the push, both which are used to establish whether the current push is allowed to proceed. This commit thus introduces a new optional ReceiveHooksPayload structure to the HooksPayload, which contains this information. As with the other fields, we also need to have fallback code in place to enable zero-downtime upgrades where the server is still running the old code, while the gitaly-hooks executable was already updated. We thus have a fallback in place to read the GL_PROTOCOL, GL_ID and GL_USERNAME values in case no payload was provided.
2020-12-11hooks: Stop injecting GL_PROJECT_PATH into the hooks environmentPatrick Steinhardt
Same as with GL_REPOSITORY, we already have information about the GL_PROJECT_PATH available via the protobuf Repo. So this commit stops injecting the variable explicitly into the hooks environment and instead extends `customHooksEnv()` to derive it from the Repo.
2020-12-11hooks: Stop injecting GL_REPOSITORY into the hooks environmentPatrick Steinhardt
Now that we use the Repo protobuf to derive the value of GL_REPOSITORY, this commit converts all callsites to stop injecting this value directly. Instead, we derive it via a new function `customHooksEnv()` such that custom hooks still get the expected environment.
2020-12-11hooks: Derive GL_REPOSITORY from passed in repoPatrick Steinhardt
One of the GL_ values is GL_REPOSITORY, which is used both for authentication against GitLab's API as well as for the custom hooks environment. It's currently passed as an explicit variable when invoking hooks, but this is in fact not at all necessary as we already have the `gitalypb.Repo`. Simplify the code to not expect GL_REPOSITORY as an explicit variable anymore, instead deriving it from the Repo protobuf.
2020-12-11hooks: Document transaction fields for HooksPayloadPatrick Steinhardt
The transaction fields for the HooksPayload are currently missing documentation, which this commit adds.
2020-12-11hooks: Discern expected and actual environment for custom hook testsPatrick Steinhardt
Right now, our custom hook tests expect the same environment for the invoked custom hooks as the environment that we provide. This is going to change though as we move more variables into the hooks payload. As such, the input environment is only going to contain the payload, while the custom hooks environment will stay the same. Let's prepare for this change by converting tests to discern between actual and expected environment to make it easier to change.
2020-12-11Stop using require.Error to compare error valuesJames Fargher
2020-12-11Merge branch 'pks-hooks-env-cleanup' into 'master'James Fargher
hooks: Clean up unused leftover Ruby variables Closes #2679 See merge request gitlab-org/gitaly!2900
2020-12-10Merge branch 'ps-cgroups-osx-tests' into 'master'Paul Okstad
Fix tests for cgroups that depends on linux-only library See merge request gitlab-org/gitaly!2902
2020-12-10Update CHANGELOG.md for 13.6.3GitLab Release Tools Bot
[ci skip]
2020-12-10Merge branch 'revert-09c6d25d' into 'master'Patrick Steinhardt
Revert "On each read/write operation praefect requires to know which" See merge request gitlab-org/gitaly!2907
2020-12-10Revert "On each read/write operation praefect requires to know which"Pavlo Strokov
This reverts commit 09c6d25de370446ac855a8241d8f821ed3f1ceec
2020-12-10On each read/write operation praefect requires to know whichPavlo Strokov
gitaly node is a primary. For mutator operations it used to define from what node the response will be returned back to the client. For the read operations it is used to redirect request to or as a fallback option for reads distribution in case it is enabled. The default strategy for defining the primary is an 'sql' which means the primary is tracked inside Postgres database and praefect issues select statement into it each time it needs to define current primary. It creates a high load on the database when there are too many read operations (the outcome of the performance testing). To resolve this problem we change logic of retrieving set of up to date storages to return all storages including primary. So now we don't need to know the current primary and use any storage that has latest generation of the repository to serve the requests. As this information is cached by the in-memory cache praefect won't create a high load on the database anymore. This change also makes check IsLatestGeneration for the primary node redundant as it won't be present in the set of consistent storages if its generation not the latest one. Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/3337