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-11-26testing: Deduplicate server and client setupzj-test-suiteZeger-Jan van de Weg
Continuing the work of the parent commit, this change deduplicates the server and client setup. As such the tests have very little boilerplate left. The next item is probably the context.Context. Visually the code is less cluttered now, and less seems to be going on.
2020-11-26testing: Add testify/suite to remove boilerplateZeger-Jan van de Weg
This change introduces the suite utilities in one test to showcase how we can use it to remove boilerplate from our test suite. As first iteration the setup and teardown of the repository was choosen, though it can be expanded trivially to include the service server and client. As with many things, there's a tradeoff when executing tests. For automated testing `make test` will work as expected, though `go test -run=` will not work as easily as before. Currently I don't see a way around that, as the regexp support for the `run` argument requires a match on the suite name too. `-m` does work. With the small commit we've got now, upon merging we'd devise a strategy to include this throughout the Gitaly code base. Though it must be noted that this can be done piece meal. Additionally the output changes slightly with this change ``` === RUN TestRepositoryService === RUN TestRepositoryService/TestGetInfoAttributesExisting --- PASS: TestRepositoryService (0.02s) --- PASS: TestRepositoryService/TestGetInfoAttributesExisting (0.02s) --- PASS: TestRepositoryTestSuite/TestGetInfoAttributesExisting (0.02s) ```
2020-11-26Merge branch 'smh-apply-subcommand' into 'master'James Fargher
Gitaly-git2go apply subcommand See merge request gitlab-org/gitaly!2676
2020-11-25Merge branch 'ps-up-to-date-storages-cache' into 'master'Sami Hiltunen
Introduction of in-memory cache for reads distribution Closes #1466 and #3053 See merge request gitlab-org/gitaly!2738
2020-11-25gitaly-git2go apply subcommandSami Hiltunen
Implements apply subcommand for gitaly-git2go that allows for applying patches from diffs. Similar to 'git am', three-way merge is attempted as a fallback if the patch does not apply cleanly.
2020-11-24Logging of reads distributions caching statePavlo Strokov
To provide more visibility if reads distributions caching enabled or not we log a message about it on startup. It helps to understand if configuration used to start service allows caching or not. Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/2699
2020-11-24Verification of disable cache logging messagePavlo Strokov
To detect if cache was disabled we could search for corresponding log message. Unused parameters removed from 'tryCache' method. Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/2699
2020-11-24Refactor potential flaky test.Pavlo Strokov
Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/1466
2020-11-24Restructure GetSyncedNodesPaul Okstad
2020-11-24Introduction of in-memory cache for reads distributionPavlo Strokov
With enabled distributed_reads feature each read operation leads to a database query execution to get state of the storages for particular repository. More read calls leads to more database access operations, so the pressure to it increases in linear (or even worse). To mitigate this problem it was decided to introduce an in-memory cache added before accessing the database. Invalidation happens on receiving notification events from the database. The events are send by the triggers attached to the repositories (delete) and storage_repositories (insert, delete, update) tables. To monitor the cache a new counter was added: gitaly_praefect_uptodate_storages_cache_access_total. It tracks amount of cache hits, misses and populates and evicts per virtual repository. And to track an error rate of the notifications processing the gitaly_praefect_uptodate_storages_errors_total was added with type set to one of: retrieve, notification_decode. Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/3053
2020-11-24Merge branch 'pks-tests-tmpdir-pt2' into 'master'Pavlo Strokov
tests: Convert remaining tests which write data into the repo See merge request gitlab-org/gitaly!2822
2020-11-24Merge branch 'sh-update-rouge-3.25' into 'master'Toon Claes
Update Rouge gem to v3.25.0 See merge request gitlab-org/gitaly!2829
2020-11-24Merge branch 'pks-hooks-validation' into 'master'Christian Couder
hooks: Improved validation and testing See merge request gitlab-org/gitaly!2824
2020-11-24ci: Assure we don't writing test data into the repoPatrick Steinhardt
We used to write most of our test data into the Gitaly repository directly. This slowed done tests, left behind state and slowed down several tools. This antipattern was corrected to instead write all data into temporary directories. In order to avoid such tests creeping into our code base again, this commit changes our CI such that it makes most of our directories read-only before executing tests. The exception here is our build directory which is required to be writable for test preparations as well as the Ruby directory.
2020-11-24gitignore: Remove now unneeded testdata patternsPatrick Steinhardt
Our gitignore files contain quite a lot of rules for testdata. As we shouldn't generate any data inside of the repository during tests anymore, this commit cleans up our gitignore files to get rid of them.
2020-11-24Makefile: Move test repositoriesPatrick Steinhardt
Our test repositories are currently located in `internal/testhelper`. They're quite hard to discover there and are intermingled with any static test data which is part of the repo. This commit instead moves the test repository into `_build`.
2020-11-24tempdir: Move "clean" root directory into global test directoryPatrick Steinhardt
Inside our "tempdir" tests, we're using a "clean" directory to store temporary storages, which is currently created in our "testdata". This commit instead moves it into our global temporary test directory.
2020-11-24client: Move "gitaly.socket" into global test directoryPatrick Steinhardt
In order to test relative symlinks in combination with sockets, we create a relative symlink in our testdata directory. This commit instead moves it into the global temporary test directory.
2020-11-24namespace: Stop writing data into "testdata"Patrick Steinhardt
We're creating a set of custom storages in our "namespace" tests. These storages are currently created in "testdata/", but should instead be created in a temporary directory Fix tests to use `ioutil.TempDir()`. As we don't have a test context available at time of creation, we cannot use `testhelper.TempDir()`.
2020-11-24operations: Move "gitlab-shell" data into global test directoryPatrick Steinhardt
We're currently creating the "gitlab-shell" test directory in "testdata". This commit instead moves it into the global temporary test directory.
2020-11-24gitaly-ssh: Move "gitaly.socket" into global test directoryPatrick Steinhardt
In order to test relative symlinks in combination with sockets, we create a relative symlink in our testdata directory. This commit instead moves it into the global temporary test directory.
2020-11-24testhelper: Stop writing environment into testdataPatrick Steinhardt
In order to capture the environment for both hooks and Git itsel, we're writing a custom scripts which write the environment into `tesdata/`. This commit converts them to instead use the global temporary test directory.
2020-11-24server: Move "gitlab-shell" data into temporary directoryPatrick Steinhardt
Instead of creating "gitlab-shell" in testdata, this commit moves it into the global temporary test directory.
2020-11-24packfile: Create "empty.git" in temporary directoryPatrick Steinhardt
We're currently creating the test Git repository in testdata. This commit instead moves it into the global temporary test directory.
2020-11-24config: Use global temporary directoryPatrick Steinhardt
Instead of creating a temporary directory in "testdata/", this let's just use a global one which is likely in "/tmp".
2020-11-24log: Don't log hook dafa if GITALY_LOG_DIR is unsetPatrick Steinhardt
If calling `log.NewHookLogger()`, then we'll use the environment variable GITALY_LOG_DIR to figure out where to write the logfile to. But in case it's unset, we end up simply writing into the current directory, wherever that is. Fix the issue by creating a nil-logger in case the variable is unset or empty.
2020-11-23Merge branch 'avar-ci-run-with-git-git-next' into 'master'Ævar Arnfjörð Bjarmason
CI: also test the 'next' branch in git.git See merge request gitlab-org/gitaly!2716
2020-11-23Merge branch 'ci-enable-secret-detection' into 'master'Paul Okstad
Enable security related CI jobs See merge request gitlab-org/gitaly!2785
2020-11-23Don't use alias reference for job rulesMichael Henriksen
Referencing an alias for the job rules generated an incompatible list, so I had to give up on DRYing the rules.
2020-11-23Merge branch 'smh-add-has-branches' into 'master'Pavlo Strokov
Add HasBranches method to Repository See merge request gitlab-org/gitaly!2806
2020-11-23Update CHANGELOG.md for 13.6.1GitLab Release Tools Bot
[ci skip]
2020-11-23upgrade git2go to v30.0.18Sami Hiltunen
Upgrades git2go to v30.0.18 which contains the bindings for ApplyToTree.
2020-11-23Merge branch 'pks-makefile-protodiff' into 'master'Toon Claes
Makefile: Don't write proto.diff into source directory See merge request gitlab-org/gitaly!2823
2020-11-23Merge branch 'pks-reftx-hook-preparations' into 'master'Sami Hiltunen
Prepare for global reference-transaction hook executions See merge request gitlab-org/gitaly!2825
2020-11-23use common HasBranches implementations in repositories serviceSami Hiltunen
Repositories service has some duplicated code with `git.LocalRepository`. This changes the service to reuse the existing implementation to check if the repository contains branches.
2020-11-23dial in the constructor of remote repositorySami Hiltunen
Change remote repository to dial in the constructor once and to reuse the connection in method calls. Deduplicates some of the code and simplifies the struct as we have to hold less information.
2020-11-23add HasBranches to RepositorySami Hiltunen
Adds HasBranches to Repository for checking whether the repository has local branches or not. Some operations service calls need to know whether a repository has branches or not.
2020-11-23Merge branch 'ps-fetch-remote-ssh-flags' into 'master'Sami Hiltunen
Wrong flag names in FetchRemote ported to Go Closes #1466 See merge request gitlab-org/gitaly!2817
2020-11-23ci: also test the 'next' branch in git.gitÆvar Arnfjörð Bjarmason
Improve on a62c6639 ("ci: Add scheduled jobs testing against Git master", 2020-09-02) by also testing the 'next' branch in git.git. This'll give us more advanced warning of any breakages, and the 'next' branch is really quite stable (e.g. Google runs it internally, it's in Debian experimental etc.). We could also add "seen" here, but that branch is far more likely to produce false positives. Testing this requires pushing a commit which removes the schedule rule: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9940ca11..9302df43 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -175,8 +175,6 @@ nightly:git: - GO_VERSION: "1.14" GIT_VERSION: ["master", "next"] TARGET: [ test, test-with-proxies, test-with-praefect ] - rules: - - if: '$CI_PIPELINE_SOURCE == "schedule"' cover: <<: *cache_definition As can be seen on https://gitlab.com/gitlab-org/gitaly/-/pipelines/219137470 it passes now. There was an issue where the "next" branch on our mirror wasn't being updated, but as of writing it's what's in github.com/git/git's "next": https://gitlab.com/gitlab-org/gitlab-git/-/tree/next The "seen" branch is still stale from 4 months ago. Maybe someone kicked or setup a rule for "next", but not "seen": https://gitlab.com/gitlab-org/gitlab-git/-/tree/seen ? On naming: This used to be "test:master" before this change, and we have a "test" target that's testing the matrix of go versions. I originally went for "test:git_git" (as in git.git) here. Let's try make it obvious that we're testing various git versions in the name, but also that this is the nightly CI job, not run in the regular pipeline. Originally we changed the test target name here, but now we can keep "nightly:git".
2020-11-23ci: rename "test:master" to include "nightly"Ævar Arnfjörð Bjarmason
Rename the job added in a62c66394 (ci: Add scheduled jobs testing against Git master, 2020-09-02). This is per the discussion in https://gitlab.com/gitlab-org/gitaly/-/merge_requests/2716 and on slack where Patrick wanted to have "nightly" in the job name somewhere.
2020-11-23Merge branch 'vendor-v1.0.0' into 'master'Pavlo Strokov
Update LabKit library to v1.0.0 See merge request gitlab-org/gitaly!2827
2020-11-23Merge branch 'avar/hook-stdout-and-stderr-like-ruby' into 'master'Zeger-Jan van de Weg
Fix hook std(err|out) hook handling to be like Ruby See merge request gitlab-org/gitaly!2804
2020-11-23Merge branch 'doc-libgit2' into 'master'James Fargher
docs: Remove text that Gitaly doesn't use Git2Go See merge request gitlab-org/gitaly!2815
2020-11-23docs: Remove text that Gitaly doesn't use Git2GoZeger-Jan van de Weg
2020-11-23Merge branch 'pks-nodes-context' into 'master'James Fargher
nodes: Use context to perform database queries See merge request gitlab-org/gitaly!2796
2020-11-22Update Rouge gem to v3.25.0Stan Hu
This matches what is used in GitLab EE/CE and saves a little disk space in an Omnibus install.
2020-11-20Merge branch 'rs-doc-asdf' into 'master'Paul Okstad
Document the ASDF_DATA_DIR workaround See merge request gitlab-org/gitaly!2828
2020-11-20Document the ASDF_DATA_DIR workaroundRobert Speicher
2020-11-20Update LabKit library to v1.0.0Andrew Newdigate
LabKit has reached a 1.0.0 milestone :tada: See https://gitlab.com/gitlab-org/labkit/-/releases/v1.0.0
2020-11-20updateReferenceWithHooks: fix hook std(err|out) handling to be like RubyÆvar Arnfjörð Bjarmason
In the Ruby code in GitLab::Git::Hook we return either stderr if there's anything there, or fall back to stdout. This behavior dates back to gitlab-org/gitlab@926a8ab4765 ("Handle custom Git hook result in GitLab UI", 2016-07-04). The current Ruby code Gitaly runs was copy/pasted into the tree in 5d0dc144 ("Implement CommitService.FindCommits", 2017-08-14). When this was ported to Go in f7bb6743 ("operations: Port UserMergeBranch from Ruby to Go", 2020-09-09) this logic error of always using stdout was introduced. Fix it. This makes the test added in the previous commit work. I'm fixing this to be bug-compatible with the Ruby implementation which uses/used ".blank?". I asked @vsizov whether he could recall whether the ".blank?" test was needed or just some mistaken idiom for "empty string". He thought it was safe to change it in Go to just use the len() test, but wasn't sure. I'm keeping the ".blank?" emulation here not so much out of the paranoia of being bug-compatible, but because it's easier to run the tests without things being conditionally different under the in-flight features to migrate functionality to Go.