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-10-03linguist: Bump language stats versiontoon-git-check-attrToon Claes
We've implemented a bunch of fixes to the language calculation. To ensure we recalculate repositories using these new rules, bump up the version in the cache file.
2022-10-03linguist: Recalculate when .gitattributes changedToon Claes
When the user has modified .gitattributes since last time the stats where calculated, the numbers might be completely different for files that aren't modified. To overcome any miscalculation in this case, just do a full recalculation when .gitattributes was modified.
2022-10-03linguist: Split function to initialize languageStatsToon Claes
The functionality of newLanguageStats() was a bit overloaded. Split it up and stop returning pointers.
2022-10-03linguist: Take .gitattributes into accountToon Claes
Users can override [1] the linguist behavior by writing things in gitattributes(5). This change copies that behavior into the go implementation. [1]: https://github.com/github/linguist/blob/master/docs/overrides.md
2022-10-03linguist: Exclude some files from statsToon Claes
Files that are either documentation, vendored, or generated should be excluded from the stats.
2022-10-03gitpipe: Allow setting LsTree skip functionToon Claes
In 5da3e9a23 (gitpipe: Add LsTree that calls git-ls-tree(1), 2022-06-14) we've added a skipResult function to the gitpipe.lsTreeConfig, but there was no way to actually use that feature outside the gitpipe package. This change adds LsTreeWithSkip() so a user of LsTree() can specify a skip function, similar to DiffTreeWithSkip().
2022-10-03linguist: Move individual file handling into separate fileToon Claes
As an extra step to prep for more features, this change moves the determining the language of a single file into a separate file and struct.
2022-10-03linguist: Refactor how language is determinedToon Claes
We're about to make to override language statistics using gitattributes(5). This change would make the inner loop for handling each file a lot more complex. To prepare for this added complexity, refactor the code so it's easier to extend.
2022-10-03linguist: Move some variables to linguist InstanceToon Claes
To make it easier to split out code in smaller functions, move some variables we need to the linguist.Instance struct. This will allow future refactoring.
2022-10-03linguist: Remove linguist instantiation dependencyToon Claes
Now linguist no longer loads colors when it's created, there's no more need to create an instance when Gitaly is started. So remove linguist as a dependency.
2022-10-03config: Remove linguist languages pathToon Claes
Now we're no longer loading language colors from a json file, it also does not make sense to make the path of this json file configurable. So remove it from the config.
2022-10-03linguist: Use the colors from go-enryToon Claes
We're about to go all-in on go-enry for the language detection. Which means we'll soon no longer can load the language colors from a json file provided by the linguist gem. We could copy the file, but go-enry provides colors as well. So use those instead. This also made it possible so turn the Color() function into a normal function, instead of a receiver function. This has a little disadvantage: it's no longer possible to load a custom set of colors. We believe this isn't used, so we're willing to give up on that.
2022-10-03linguist: Rewrite Color testsToon Claes
To have a little bit of insurance the colors on the languages don't change at random, test a handful of languages and their color.
2022-10-03linguist: Remove git.CommandFactory variableToon Claes
The linguist Instance does not use the git.CommandFactory variable, so we can safely remove it.
2022-09-30Merge branch 'pks-refactor-ioutil-readdir-usages' into 'master'Sami Hiltunen
Refactor remaining users of the ioutil package See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4899 Merged-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: James Fargher <proglottis@gmail.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-09-29Merge remote-tracking branch 'dev/master'GitLab Release Tools Bot
2022-09-29cache: Convert file cleanup to use `os.ReadDir()`pks-refactor-ioutil-readdir-usagesPatrick Steinhardt
Go 1.15 has deprecated the `ioutil` package and made replacements available in the `io` or `os` packages. While we have already migrated most callsites away, one notable omission was `ioutil.ReadDir()` as this function doesn't have an exact replacement: the new `os.ReadDir()` function does not stat all directory entries anymore. Refactor the cleanup of stale cached files in the `cache` package to use the new function.
2022-09-29cache: Convert lease cleanup to use `os.ReadDir()`Patrick Steinhardt
Go 1.15 has deprecated the `ioutil` package and made replacements available in the `io` or `os` packages. While we have already migrated most callsites away, one notable omission was `ioutil.ReadDir()` as this function doesn't have an exact replacement: the new `os.ReadDir()` function does not stat all directory entries anymore. Refactor the cleanup of stale leases in the `cache` package to use the new function.
2022-09-29repository: Convert keep-around ref cleanup to use `os.ReadDir()`Patrick Steinhardt
Go 1.15 has deprecated the `ioutil` package and made replacements available in the `io` or `os` packages. While we have already migrated most callsites away, one notable omission was `ioutil.ReadDir()` as this function doesn't have an exact replacement: the new `os.ReadDir()` function does not stat all directory entries anymore. Refactor the cleanup of stale keep-around references in the `GarbageCollect` RPC to use the new function.
2022-09-29housekeeping: Convert worktree cleanup to use `os.ReadDir()`Patrick Steinhardt
Go 1.15 has deprecated the `ioutil` package and made replacements available in the `io` or `os` packages. While we have already migrated most callsites away, one notable omission was `ioutil.ReadDir()` as this function doesn't have an exact replacement: the new `os.ReadDir()` function does not stat all directory entries anymore. Refactor the cleanup of stale worktrees in the `housekeeping` package to use the new function.
2022-09-29stats: Convert `GetPackfiles()` to use `os.ReadDir()`Patrick Steinhardt
Go 1.15 has deprecated the `ioutil` package and made replacements available in the `io` or `os` packages. While we have already migrated most callsites away, one notable omission was `ioutil.ReadDir()` as this function doesn't have an exact replacement: the new `os.ReadDir()` function does not stat all directory entries anymore. Refactor `stats.GetPackfiles()` to use the new function and manually stat the packfiles at callsites as required.
2022-09-29tempdir: Convert cleaning to use `os.ReadDir()`Patrick Steinhardt
Go 1.15 has deprecated the `ioutil` package and made replacements available in the `io` or `os` packages. While we have already migrated most callsites away, one notable omission was `ioutil.ReadDir()` as this function doesn't have an exact replacement: the new `os.ReadDir()` function does not stat all directory entries anymore. Refactor the `tempdir` package's clean walker to use the new function and manually stat the directory entries as required.
2022-09-29Update changelog for 15.2.5GitLab Release Tools Bot
[ci skip]
2022-09-29Update changelog for 15.3.4GitLab Release Tools Bot
[ci skip]
2022-09-29Update changelog for 15.4.1GitLab Release Tools Bot
[ci skip]
2022-09-29Merge branch 'pks-proto-deprecations-for-errors-in-responses' into 'master'Patrick Steinhardt
proto: Deprecate embedded errors See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4894 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com>
2022-09-29proto: Set removal date for deprecated UserDeleteBranch embedded errorPatrick Steinhardt
While the embedded error in the UserDeleteBranchResponse message has been deprecated already, there is no information when the field will be removed. Add it so we don't forget to clean it up.
2022-09-29proto: Deprecate embedded errors in UserCherryPickResponsePatrick Steinhardt
The UserCherryPick RPC was converted to return structured errors instead of embedding errors in a successful response. These embedded errors are thus never set by Gitaly anymore and should be phased out. Mark them as deprecated and slate them for removal in release 16.0. Change: deprecated
2022-09-29proto: Deprecate embedded errors in UserCreateBranchResponsePatrick Steinhardt
The UserCreateBranch RPC was converted to return structured errors instead of embedding errors in a successful response. These embedded errors are thus never set by Gitaly anymore and should be phased out. Mark them as deprecated and slate them for removal in release 16.0. Change: deprecated
2022-09-29proto: Deprecate embedded errors in UserCreateTagResponsePatrick Steinhardt
The UserCreateTag RPC was converted to return structured errors instead of embedding errors in a successful response. These embedded errors are thus never set by Gitaly anymore and should be phased out. Mark them as deprecated and slate them for removal in release 16.0. Change: deprecated
2022-09-29Merge branch 'wc/track-repos-logger-race' into 'master'Patrick Steinhardt
praefect: fix race condition on logger Closes #4457 and #4473 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4886 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: Will Chandler <wchandler@gitlab.com>
2022-09-28praefect: run track-repositories tests seriallywc/track-repos-logger-raceWill Chandler
The `praefect` command has a global logger that is passed to any subcommands executed. When executing normally this is fine as each process will only run a single subcommand. However, in testing this creates a risk of race conditions when tests are run in parallel, as each test goroutine will share this logger. To resolve race detector failures on `TestAddRepositories_Exec()` and `TestAddRepositories_Exec()`, we will now run these tests serially. This has minimal impact on test execution time, increasing from 4.663s to 5.129s. In the medium-term we should replace the global logger with a local that allows parallel testing. Issue #4500[0] has been opened for this. [0] https://gitlab.com/gitlab-org/gitaly/-/issues/4500
2022-09-27Merge branch 'wc/makefile-override-append' into 'master'John Cai
make: use 'override' when adding to TEST_OPTIONS See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4890 Merged-by: John Cai <jcai@gitlab.com> Approved-by: Pavlo Strokov <pstrokov@gitlab.com> Approved-by: John Cai <jcai@gitlab.com> Co-authored-by: Will Chandler <wchandler@gitlab.com>
2022-09-27Merge branch 'pks-remove-user-create-tag-structured-errors-ff' into 'master'John Cai
operations: Always use structured errors in UserCreateTag RPC Closes #4372 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4882 Merged-by: John Cai <jcai@gitlab.com> Approved-by: John Cai <jcai@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-09-27Merge branch 'pks-docs-document-rpc-business-boundary' into 'master'Patrick Steinhardt
doc: Clarify GitLab/Gitaly boundary for RPCs See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4878 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Andras Horvath <ahorvath@gitlab.com> Approved-by: Mark Wood <mwood@gitlab.com>
2022-09-27Merge branch 'sh-update-golang-1.18.6' into 'master'Patrick Steinhardt
Bump .tool-versions to use Go 1.18.6 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4892 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: Stan Hu <stanhu@gmail.com>
2022-09-27Bump .tool-versions to use Go 1.18.6Stan Hu
The GitLab Development Kit is moving to 1.18.6, so let's make all the versions consistent to reduce the number of interpreters needed for development. Part of https://gitlab.com/groups/gitlab-org/-/epics/8843
2022-09-26Merge branch 'renovate/github.com-google-go-cmp-0.x' into 'master'Toon Claes
go: Update module github.com/google/go-cmp to v0.5.9 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4863 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2022-09-24make: use 'override' when adding to TEST_OPTIONSwc/makefile-override-appendWill Chandler
When `TEST_OPTIONS` is specified as an argument to `make`, any options specified in the `Makefile` will be overwritten with the user-provided value. In several targets we append arguments to `TEST_OPTIONS`, making them vulnerable to being squashed inadvertently. For example, if running `make race-go TEST_OPTIONS='-run=<TEST> -count=20'` to reproduce a race condition, the intended command would be: gotestsum --format short -- -run <TEST> -count 20 -race ./... But because `TEST_OPTIONS` is specified, this is actually executed as: gotestsum --format short -- -run <TEST> -count 20 ./... Resolve this by using the `override` directive in targets that attempt to append to `TEST_OPTIONS`. This will allow the user to add custom options without squashing the target's additions.
2022-09-23Merge branch ↵Toon Claes
'4455-feature-flag-roll-out-user_create_branch_structured_errors' into 'master' operations: Structured errors in UserCreateBranch Closes #4455 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4883 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Co-authored-by: Karthik Nayak <knayak@gitlab.com>
2022-09-23Merge branch 'revert-9498ab94' into 'master'Patrick Steinhardt
Revert "Merge branch... See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4888 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: karthik nayak <knayak@gitlab.com>
2022-09-23Merge branch 'pks-remove-fetch-into-object-pool-prune-refs-ff' into 'master'Patrick Steinhardt
objectpool: Always prune refs on fetches to fix D/F conflicts Closes #4394 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4885 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com>
2022-09-23objectpool: Always prune refs on fetches to fix D/F conflictsPatrick Steinhardt
With 018958fb1 (objectpool: Fix conflicting references when fetching into pools, 2022-07-27) we have started to prune references in object pools that have been removed in their primary pool member. This is a necessity to avoid conflicting references in the object pool and its member, which would otherwise break updating such pools completely. This code has been rolled out to production on August 11th without any observed negative fallout, and the flag was subsequently enabled by default. Remove the feature flag guarding it. Changelog: changed
2022-09-23Merge branch 'pks-golangci-lint-errcheck-improvements' into 'master'Patrick Steinhardt
golangci-lint: Stop excluding many `Close` and `Serve` functions from errcheck linter See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4810 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Pavlo Strokov <pstrokov@gitlab.com>
2022-09-23Revert "Merge branch ↵karthik nayak
'4452-feature-flag-roll-out-simplify_find_local_branches_response' into 'master'" This reverts merge request !4884
2022-09-23packed_binaries: Check error code when closing packed filePatrick Steinhardt
We don't properly verify the error code when closing the file that corresponds to the packed binary. While this doesn't really matter in the first place, fixing this one case lets us drop another exception to our linting rules.
2022-09-23praefect: Fix missing error checks for factory's `Serve()` functionPatrick Steinhardt
Many of our tests don't properly verify the error returned by the server factory's `Serve()` function. Fix this shortcoming, which surfaces that we mistakenly close some listeners manually that should indeed be closed by gRPC itself. Drop the corresponding linting exception.
2022-09-23http: Fix missing error checks for `Serve()` functionPatrick Steinhardt
The `http.Server.Serve()` function will return an error when the HTTP server has either failed unexpectedly or in case it wasn't properly shut down. We don't check this error in many places though, which both causes the errcheck linter to complain and hides issues we have with some of our test setups. Fix the missing error checks via a new `testhelper.MustServe()` helper function that does the error checking for us. Drop the corresponding linting exceptions.
2022-09-23grpc: Fix missing error checks for `Serve()` functionPatrick Steinhardt
The `grpc.Server.Serve()` function will return an error when the gRPC server has either failed unexpectedly or in case it wasn't properly shut down. We don't check this error in many places though, which both causes the errcheck linter to complain and hides issues we have with some of our test setups. Fix the missing error checks via a new `testhelper.MustServe()` helper function that does the error checking for us. This surfaces some test errors for tests that forget to shut down the server or that manually close the listener, which should be handled by gRPC itself. All of those errors are fixed while at it. Drop the corresponding linting exceptions.
2022-09-23sidechannel: Check `Close()` errors returned by the waiterPatrick Steinhardt
We don't properly check the error when closing the `SidechannelWaiter` in many places. Fix this and drop the corresponding linting exceptions.