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-06cmd/git2go: Update to git2go v34 and libgit2 v1.5.0wc/update-git2go-v34Will Chandler
Upgrade to the latest versions of git2go and libgit2. Changelog: changed
2022-10-06Merge branch 'jc-fix-delete-refs' into 'master'Justin Tobler
ref: Return structured error when update error is not ErrAlreadyLocked Closes #4497 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4897 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: John Cai <jcai@gitlab.com>
2022-10-05ref: Return structured error when update error is not ErrAlreadyLockedJohn Cai
We have a bug wherein we still return a successful response with an error embedded in the response if the Prepare() step fails with an error but the error is not an ErrAlreadyLocked. Fix the code such that we return an error instead of a response when there is a non ErrAlreadyLocked error during the Prepare() call. Changelog: fixed
2022-10-05Merge branch 'revert-f955266a' into 'master'Toon Claes
Revert "Merge branch 'jc-spawn-git-in-pgid' into 'master'" See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4908 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Co-authored-by: John Cai <jcai@gitlab.com>
2022-10-05Revert "Merge branch 'jc-spawn-git-in-pgid' into 'master'"John Cai
This reverts merge request !4889
2022-10-05Merge branch 'jc-spawn-git-in-pgid' into 'master'karthik nayak
command: Add option to spawn a command with a pgid Closes #4493 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4889 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: John Cai <jcai@gitlab.com>
2022-10-05Merge branch 'toon-git-check-attr' into 'master'James Fargher
linguist: Support linguist overrides in .gitattributes Closes #4451 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4877 Merged-by: James Fargher <proglottis@gmail.com> Approved-by: Pavlo Strokov <pstrokov@gitlab.com> Approved-by: James Fargher <proglottis@gmail.com> Co-authored-by: Toon Claes <toon@gitlab.com>
2022-10-04git: Add gitalyPid option to NewExecCommandFactoryJohn Cai
We want all git commands to be tied to a pgid, the gitaly process. This way, when gitaly gets killed, all git processes can be killed alongside it, in case there are any zombie processes hanging around. Add a gitalyPid option to the NewExecCommandFactory() constructor, and update the callsites with the option. Changelog: changed
2022-10-04command: Add option to spawn a command with a pgidJohn Cai
Processes can be spawned with pgid [1], which can then be used to kill a process and all child processes that were spawned with that pid as a pgid. This allows us to, in a later commit, tie all Git commands to the main Gitaly process. When a Gitaly process exits, a sys admin, a script, or Gitlab Omnibus can do a `kill -9 -<old gitaly pid>` to kill any process that has <old gitaly pid> as its pgid. Add an option to allow commands to be instantiated with a parent pid. 1. https://pkg.go.dev/syscall#SysProcAttr
2022-10-04Update changelog for 15.4.2GitLab Release Tools Bot
[ci skip]
2022-10-04Merge branch 'wc/fix-revive-lints' into 'master'karthik nayak
golangci-lint: Restore default revive lints See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4903 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Will Chandler <wchandler@gitlab.com>
2022-10-04Merge branch 'id-fix-jwt-tokens' into 'master'Patrick Steinhardt
Trim secret before signing JWT tokens See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4898 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Pavlo Strokov <pstrokov@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: Igor Drozdov <idrozdov@gitlab.com>
2022-10-04Merge branch 'ps-popup-code' into 'master'James Fargher
helper: Preserve status code of underlying error See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4895 Merged-by: James Fargher <proglottis@gmail.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Approved-by: James Fargher <proglottis@gmail.com> Co-authored-by: Pavlo Strokov <pstrokov@gitlab.com>
2022-10-03Merge branch 'toon-license-followups' into 'master'Justin Tobler
repository: Small fixes in FindLicense handling See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4851 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Pavlo Strokov <pstrokov@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: Toon Claes <toon@gitlab.com>
2022-10-03Merge branch 'renovate/github.com-protonmail-go-crypto-digest' into 'master'Will Chandler
go: Update github.com/ProtonMail/go-crypto digest to c6815a8 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4904 Merged-by: Will Chandler <wchandler@gitlab.com> Approved-by: James Fargher <proglottis@gmail.com> Approved-by: Will Chandler <wchandler@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
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-10-03repository: Nickname "Other" license to "LICENSE"Toon Claes
The nickname is used as primary source for the text in the license badge in the UI. Using "LICENSE" is a lot more informative than "Other"
2022-10-03repository: Omit broken "other" license URLToon Claes
The URL used by the "Other" license gives a 404, so remove it.
2022-09-30golangci-lint: Restore default revive lintswc/fix-revive-lintsWill Chandler
With 7e87131ed (golangci-lint: Allow `testing.T` as first parameter, 2022-08-10) we set `context-as-argument` the sole argument to `revive:rules`. This causes golangci-lint to disable all revive lints that were previously enabled by default. Re-enable the default revive lints by explicitly listing them in our config. This triggers a large number of lint errors, resolve these as well in this commit.
2022-09-30Trim secret before signing JWT tokensid-fix-jwt-tokensIgor Drozdov
With this change we don't rely on the secret to either contain a newline or not contain it. Changelog: fixed
2022-09-30go: Update github.com/ProtonMail/go-crypto digest to c6815a8GitLab Renovate Bot
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-29helper: Preserve status code of underlying errorps-popup-codePavlo Strokov
The variations of the Err<StatusCode>() and Err<StatusCode>f() functions don't verify if the passed in error wraps gRPC error already on some nested level except the upper one only. That is why initially InvalidArgument code error could be returned with Internal code and wrapped inside the message, so it would look like there was another RPC method invocation. The GrpcCode is refactored here as well, to follow the same approach. Now it unwraps the errors and looks for the initial status most deeply nested. If found it becomes the final for the RPC invocation and send to the caller.
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