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-13Set minimum supported version of git to 2.36jc-cat-file-use-batch-commandJohn Cai
2022-10-13service: Modify call sites that still call ObjectInfoReaderJohn Cai
Now that we've gotten rid of ObjectInfoReader, remove the calls to it and use the existing ObjectReader to request metadata.
2022-10-13gitpipe: Use ObjectReader instead of ObjectInfoReaderJohn Cai
Modify places where we still call ObjectInfoReader and replace with ObjectReader. Also change a callsite where RequestRevision is still being called to calling RequestContents.
2022-10-13catfile: Modify tree entry functions to only use ObjectReaderJohn Cai
Now that ObjectReader can request both contents and info, we don't need both in the TreeEntry functions. Get rid of the ObjectInfoReaders.
2022-10-13catfile: Consolidate ObjectReaderInfo to ObjectReaderJohn Cai
Now that git cat-file has a --batch-command option, we no longer need to keep both an ObjectReader and an ObjectInfoReader around. The ObjectReader can provide both object metadata as well as content.
2022-10-13catfile: Move ObjectInfoReader functionality to ObjectReaderJohn Cai
Move the Info() function over to ObjectReader. This also means that instead of two queues, we only need one to issue commands to in `cat-file --batch-command` mode.
2022-10-13catfile: Teach requestQueue to request both content and infoJohn Cai
Modify requestQueue to be able to request both object metadata as well as content. Under `cat-file --batch-command` mode, issuing a info deadbeef command will return the object metadata, while contents deadbeef will return the object metadata as well as the contents. This will allow the transition to only using one requestQueue instead of two.
2022-10-13Merge branch 'jc-restore-99b5528b6' into 'master'Patrick Steinhardt
Revert "Merge branch 'pks-revert-delete-refs-fix' into 'master'" See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4923 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: John Cai <jcai@gitlab.com>
2022-10-13Merge branch 'sh-update-tool-versions-1.18.7' into 'master'James Fargher
Update .tool-versions to Go 1.18.7 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4938 Merged-by: James Fargher <proglottis@gmail.com> Approved-by: James Fargher <proglottis@gmail.com> Co-authored-by: Stan Hu <stanhu@gmail.com>
2022-10-12Update .tool-versions to Go 1.18.7Stan Hu
Security announcement: https://groups.google.com/g/golang-announce/c/xtuG5faxtaU Part of https://gitlab.com/groups/gitlab-org/-/epics/8843
2022-10-12Revert "Merge branch 'pks-revert-delete-refs-fix' into 'master'"John Cai
This reverts commit e49ea29543b2d8e71bfe4bdc3b295f785bd24fb1, reversing changes made to 99b5528b66b23c1a8399027ecdef306267e668ae.
2022-10-12Merge branch 'jc-improve-ref-validation' into 'master'Justin Tobler
git: Validate \\ in refname See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4921 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-12Merge branch 'renovate-tools/protolint/github.com-yoheimuta-protolint-0.x' ↵Justin Tobler
into 'master' tools/protolint: Update module github.com/yoheimuta/protolint to v0.41.0 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4926 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2022-10-12Merge branch 'renovate/ruby-dependencies' into 'master'Stan Hu
ruby: Update dependency gitlab-labkit to '~> 0.25' See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4854 Merged-by: Stan Hu <stanhu@gmail.com> Approved-by: Stan Hu <stanhu@gmail.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-10-12ruby: Update dependency gitlab-labkit to '~> 0.25'GitLab Renovate Bot
2022-10-12ruby: Constrain Redis Gem to version '~> 4.7.1'Patrick Steinhardt
Rails is currently blocked on the version upgrade to Redis v5.0.0 and newer, but the upcoming bump to gitlab-labkit Gem will cause us to pull in this major Redis version upgrade. Constrain the Redis Gem version to '~> 4.7.1' to not pull in the new version until Rails has upgraded. This is the same version that Rails currently uses.
2022-10-12Merge branch 'revert-f8c627ee' into 'master'Justin Tobler
Revert "Merge branch 'qmnguyen0711/add-limit-offset-to-search-files-by-names' into 'master'" See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4931 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: James Fargher <proglottis@gmail.com>
2022-10-11Revert "Merge branch ↵James Fargher
'qmnguyen0711/add-limit-offset-to-search-files-by-names' into 'master'" This reverts merge request !4911
2022-10-11Merge branch 'sh-disable-libgit2-python' into 'master'James Fargher
Disable building of libgit2 tests See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4927 Merged-by: James Fargher <proglottis@gmail.com> Approved-by: James Fargher <proglottis@gmail.com> Co-authored-by: Stan Hu <stanhu@gmail.com>
2022-10-11Disable building of libgit2 testsStan Hu
The tests require Python, which is not present on Cloud Native GitLab images. Relates to https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4912#note_1132067823
2022-10-11Merge branch 'pks-libgit2-v1.5.0' into 'master'Sami Hiltunen
Makefile: Upgrade libgit2 to v1.5.0 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4912 Merged-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-10-11Merge branch 'qmnguyen0711/add-limit-offset-to-search-files-by-names' into ↵Quang-Minh Nguyen
'master' Add limit and offset to SearchFilesByName RPC See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4911 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com>
2022-10-11Add limit and offset to SearchFilesByNameRequestQuang-Minh Nguyen
In the current implementation of SearchFilesByName RPC, all matched files are returned back. In most cases, clients don't need all of them. Instead, they perform pagination at their side. It makes sense to add pagination from Gitaly side so that this RPC returns a reasonable subset of files. This improvement would remove redundant payload in the response. To keep backward-compatibility, Gitaly doesn't enforce default limit or offset. It's client's call. Issue: https://gitlab.com/gitlab-org/gitaly/-/issues/4449 Changelog: added
2022-10-11Merge branch 'renovate/github.com-rubenv-sql-migrate-1.x' into 'master'Patrick Steinhardt
go: Update module github.com/rubenv/sql-migrate to v1.2.0 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4867 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: James Fargher <proglottis@gmail.com> Approved-by: John Cai <jcai@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2022-10-11tools/protolint: Update module github.com/yoheimuta/protolint to v0.41.0GitLab Renovate Bot
2022-10-11Merge branch 'xx/rename-package-for-tools' into 'master'Patrick Steinhardt
tools: Keep package name consistent with module name See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4925 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: blanet <moweng.xx@alibaba-inc.com>
2022-10-11Merge branch 'renovate/github.com-go-git-go-git-v5-5.x' into 'master'Patrick Steinhardt
go: Update module github.com/go-git/go-git/v5 to v5.4.2 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4909 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2022-10-11go: Update module github.com/rubenv/sql-migrate to v1.2.0GitLab Renovate Bot
2022-10-11tools: Keep package name consistent with go.modblanet
The new tools mechanism is great, this commit just changes the package name for external tools from `gofumpt` to its own module name, to fix a small nits from MR#4910. Signed-off-by: blanet <moweng.xx@alibaba-inc.com>
2022-10-11Makefile: Upgrade libgit2 to v1.5.0Patrick Steinhardt
Upstream has released libgit2 v1.5.0 on July 14th already, but so far we had been blocked from upgrading as Git2go didn't yet support it. This has now changed with the release of Git2go v34, so let's upgrade both so that we run with the latest version. Notable upstream changes include: - Initial work on support for SHA256 as object hash. - Fixes for CVE 2022-24765 and CVE 2022-29187, which could lead to arbitrary code execution in repositories not owned by the current user. libgit2 was not directly impacted, but the fixes now align behaviour with Git and thus refuses to open repositories owned by a different user. - Several fixes for MIDX files, which might be beneficial with our plans to start using them. - The rename-detection limit for merges was bumped from 200 to 1000 files to match Git's behaviour. There are many other changes, but due to our limited use of libgit2 most of them aren't relevant to us.
2022-10-11Merge branch 'renovate/github.com-go-enry-go-enry-v2-2.x' into 'master'James Fargher
go: Update module github.com/go-enry/go-enry/v2 to v2.8.3 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4917 Merged-by: James Fargher <proglottis@gmail.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: James Fargher <proglottis@gmail.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2022-10-10Merge branch 'wc/update-sast-ci' into 'master'Justin Tobler
Update SAST to use Semgrep instead of Gosec See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4913 Merged-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Philippe Lafoucrière <plafoucriere@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: Will Chandler <wchandler@gitlab.com>
2022-10-10Merge branch 'pks-makefile-per-tool-mods' into 'master'Toon Claes
Makefile: Track Go tool versions via separate Go modules See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4910 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-10-10ci: Don't move go cache outside of project dirWill Chandler
With Gosec phased out in favor of the much faster Semgrep-based SAST scanner, the performance implications of scanning the go cache are minimal. Jobs which moved the cache[0] those that left it in-place[1] are all taking roughly 20 to 30 seconds. We are also not seeing vulnerabilities in depencies being reported against Gitaly itself, which Gosec had been doing[2]. Remove the before_script to move the cache out of tree from the project source. [0] https://gitlab.com/gitlab-org/gitaly/-/jobs/3138452280#L29 [1] https://gitlab.com/gitlab-org/gitaly/-/jobs/3138531794#L29 [2] https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4341
2022-10-10ci: Switch to semgrep-based SAST scanningWill Chandler
As of GitLab 15.4 Gosec is not longer a supported scanner for SAST[0]. Switch over the the recommended Semgrep-based job. [0] https://docs.gitlab.com/ee/update/deprecations#sast-analyzer-consolidation-and-cicd-template-changes
2022-10-10ci: Remove unused sast variablesWill Chandler
As of aa31a30ac3b4 (Removes SAST_DEFAULT_ANALYZERS variable, 2021-06-08), GitLab no longer checks the 'SAST_DEFAULT_ANALYZERS' variable. In addition, with 0f577f559cbb (Make SAST_DISABLE_DIND true, 2020-05-14) the `SAST_DISABLE_DIND` now defaults to `true` and no longer needs to be explicitly set. Remove these variables from our .gitlab-ci.yml as they do nothing.
2022-10-10Merge branch 'lint-fixes' into 'master'karthik nayak
Makefile: Add `lint-fix` command See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4900 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: John Cai <jcai@gitlab.com>
2022-10-10Merge branch 'sh-improve-ntp-host-debug-message' into 'master'Will Chandler
Improve NTP connectivity error message See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4916 Merged-by: Will Chandler <wchandler@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Co-authored-by: Stan Hu <stanhu@gmail.com>
2022-10-10git: Validate \\ in refnameJohn Cai
In ae728915 (refs: Return structured errors for DeleteRefs 2022-05-12), we started to validate ref format and return a structured error. The existence of a backslash is not something we currently validate, and instead we rely on the `prepare` step to catch this error. We should catch this in the ref validation step instead. Changelog: changed
2022-10-10tools: Update go-licenses to v1.4.0Patrick Steinhardt
Update go-licenses to v1.4.0 by executing the following commands: ``` $ cd tools/go-licenses $ go get github.com/google/go-licenses@latest $ go mod tidy ``` There are no noteworthy updates in this release.
2022-10-10tools: Update gotestsum to v1.8.2Patrick Steinhardt
Update gotestsum to v1.8.2 by executing the following commands: ``` $ cd tools/gotestsum $ go get gotest.tools/gotestsum@latest $ go mod tidy ``` There are no noteworthy updates in this release.
2022-10-10Makefile: Regroup remaining dependency versionsPatrick Steinhardt
Now that most dependency versions are tracked via `go.mod` files it makes more sense to keep the remaining versions in our Makefile close to where they are used. So let's regroup them for improved locality.
2022-10-10Makefile: Track Go tool versions via separate Go modulesPatrick Steinhardt
Right now we track versions of our Go tooling directly in our Makefile. While this is simple, it has several drawbacks: - We're susceptible to supply-chain attacks in case an adversary manages to replace the code used to build any of our tools. - We cannot use proper dependencies in our Makefile, which adds the need for `*.version` files. - It is hard to build the tools outside of our Makefile as we don't have a way to properly pull in the correct version. - Upgrading our tooling requires us to manually hunt down new releases for all of our tools. We can fix these issues by following the approach that is efficially recommended by the Go project [1]: every tool has its own Go module in `tools/` with a "tool.go" file that imports the tool of interest. Like this we can use Go's normal tooling to keep track of versions: - We record hashes of the tool's sources as well as all of its dependencies, making supply-chain attacks almost impossible. - We can now provide proper dependencies in our Makefile: every tool depends on "tool.go", "go.mod" and "go.sum". If any of them changes we need to rebuild. - The tools can be installed in the correct version simply by using `go install` with the correct `go.mod` file. - Upgrading tools is as simple as running `go get -u`, so no more manual hunting for new versions. While these benefits are great on their own already, we can go even further with this refactoring: now that each tool has its own `go.mod` file we can adapt the Renovate bot to pick up these files. This means that we don't have to remember upgrading at all anymore, but instead the bot will automatically upgrade them for us. [1]: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
2022-10-10Makefile: Group together recipes to build our toolsPatrick Steinhardt
Reorder the recipes so that our tools-related ones are grouped together.
2022-10-10lint: Remove space after `nolint:`Karthik Nayak
With recent changes `gofmt` [1] started reformatting godoc comments. This causes a problem wherein it reformats `//nolint: staticcheck` to `// nolint: staticcheck`. But it does ignore directives [2]. So let's change all our nolint to directive format. This avoids the conflict with `gofmt`. This fix was done by running `grep -r --include="*.go" -E "//nolint: .*"` and manually fixing the issues. [1]: https://github.com/golangci/golangci-lint/issues/1658#issuecomment-1183148066 [2]: https://github.com/golangci/golangci-lint/issues/3098#issuecomment-1214364533
2022-10-10makefile: Add `lint-fix` commandKarthik Nayak
Similar to the lint command, add a new `lint-fix` command which will write the fixes back to the files.
2022-10-10Merge branch 'pks-gofumpt-v0.4.0' into 'master'John Cai
Makefile: Update gofumpt to v0.4.0 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4907 Merged-by: John Cai <jcai@gitlab.com> Approved-by: karthik nayak <knayak@gitlab.com> Approved-by: John Cai <jcai@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-10-10Merge branch 'pks-revert-delete-refs-fix' into 'master'Toon Claes
ref: Revert fix for DeleteRefs that broke QA See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4919 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2022-10-10ref: Revert fix for DeleteRefs that broke QAPatrick Steinhardt
With 80d62284b (ref: Return structured error when update error is not ErrAlreadyLocked, 2022-09-28) we have fixed a case where we still returned successfully on error even though the feature flag to use structured errors was enabled. This fix caused breakage in our QA jobs though: 1st Try error in ./spec/lib/gitlab/git/repository_spec.rb:463: expected Gitlab::Git::Repository::GitError, got #<Gitlab::Git::CommandError: 13:unable to prepare: state update to "prepare" failed: EOF, stderr: "fatal: invalid ref format: refs\\heads\\fix\n".> with backtrace: downstream QA Revert this change for now to unblock deployments.
2022-10-07Improve NTP connectivity error messageStan Hu
On hosts where pool.ntp.org is not reachable, it's not obvious which NTP server the clock synchronization check attempted to use and that `NTP_HOST` can be set. This commit improves the error message. For example, with `NTP_HOST` set to `example.com`, we can see: Before: ``` FAIL: clock synchronization: praefect: query ntp: read udp 192.168.1.109:56948->93.184.216.34:123: i/o timeout ``` After: ``` FAIL: clock synchronization: praefect: query ntp host example.com: read udp 192.168.1.109:56948->93.184.216.34:123: i/o timeout ``` Or if `NTP_HOST` is not set: Before: ``` FAIL: clock synchronization: praefect: query ntp host: read udp 192.168.1.109:56948->51.255.142.175:123: i/o timeout ``` After: ``` FAIL: clock synchronization: praefect: query ntp host pool.ntp.org: read udp 192.168.1.109:56948->51.255.142.175:123: i/o timeout (NTP_HOST was not set) ``` Changelog: changed