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
2023-06-07WIPtoon-flaky-mcflake-fixToon Claes
2023-06-07gitaly-hooks: Make the tests SHA256 compatibleToon Claes
Stop seeding the repositories in test from an existing repository.
2023-06-07Merge branch 'pks-locator-improve-invalid-repo-reporting' into 'master'Patrick Steinhardt
config/locator: Improve error reporting for invalid repositories See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5891 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Pavlo Strokov <pstrokov@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Pavlo Strokov <pstrokov@gitlab.com> Reviewed-by: Justin Tobler <jtobler@gitlab.com>
2023-06-07config/locator: Improve error reporting for invalid repositoriesPatrick Steinhardt
The config.Locator structure optionally verifies whether a repository path maps to a valid Git repository, which helps us to get better error reporting when trying to execute Git commands in repositories that don't actually exist or which are corrupt. But the error reporting in this function is quite lacking as we used to call `IsGitRepository()`, which only gave us a boolean to indicate whether the path corresponds to a Git repository that is indeed a valid. Consequentially, all we were able to report in this case was that the repository is missing. We have since replaced `IsGitRepository()` with `ValidateRepository()`, which provides more detailed error reporting in the case where the path does not point to a valid repository. We can thus now report detailed information to the caller why exactly we think that a repository is not valid. Refactor the function to bubble up this error. This should significantly improve our ability to diagnose why we think a specific repository is invalid and gives callers the ability to act accordingly. As an added benefit, the refactoring removes paths from error messages in favor of error metadata, which should help us to further deduplicate errors in Sentry.
2023-06-07storage: Provide information about why repositories are invalidPatrick Steinhardt
The `IsGitDirectory()` function accepts a path and then checks whether it corresponds to a valid Git repository or not. This information is returned via a boolean, but that is indeed quite lacking given that the caller cannot figure out _why_ a specific path would not be a valid repository. This is noticable in our error reporting, where we don't discern between a missing and a corrupt repository. Refactor the function to instead return an error, renaming it to `ValidateRepository()` to better match its new semantics. The newly introduced errors are not yet being used to improve our error reporting as it would be seen in our logs.
2023-06-07commonerr: Move repository-related errors into storage packagePatrick Steinhardt
The commonerr package bundles a set of common errors that we use across the project. Right now the current set only includes storage-related errors though that relate to repositories being missing or invalid. And while we use these common errors only in the Praefect codebase right now, it would make sense to have Praefect and Gitaly share these errors so that we ideally have a single source of truth for these. Move the errors into the storage package so that it becomes less awkward to share them between Gitaly and Praefect. This feels like a natural place for these errors given that the errors can be directly attributed to the storage level.
2023-06-07storage: Consolidate `GetPath()` in favor of `GetRepoPath()`Patrick Steinhardt
The `storage.Locator` interface provides two functions `GetPath()` and `GetRepoPath()` which both retrieve the path of a repository. It isn't exactly easy to tell which one does what though. To shed some light on it: the only difference is that `GetPath()` returns the repository path without verifying that the repository is valid, while `GetRepoPath()` does verify the repository location. To improve upon this confusing interface we have introduced options for `GetRepoPath()` that allow the caller to skip verification in 854b62c45 (storage: Introduce `GetRepoPathConfig`, 2023-03-27). Let's thus perform the migration and use this function exclusively now, dropping the old `GetPath()` function.
2023-06-07Update VERSION filesv16.1.0-rc2GitLab Release Tools Bot
2023-06-07Merge branch 'docs/5411' into 'master'Sami Hiltunen
Add configuration validation docs See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5667 Merged-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Evan Read <eread@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com> Reviewed-by: Will Chandler <wchandler@gitlab.com> Reviewed-by: Sami Hiltunen <shiltunen@gitlab.com> Co-authored-by: Evan Read <eread@gitlab.com> Co-authored-by: Will Chandler <wchandler@gitlab.com> Co-authored-by: Raditya Surya <radityasurya1911@gmail.com>
2023-06-07Add configuration validation docsRaditya Surya
2023-06-07Merge branch 'pks-git-pseudorevision-validation' into 'master'Patrick Steinhardt
git: Validate pseudo-revisions via `git.ValidateRevisions()` See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5878 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com>
2023-06-07Merge branch 'default_branch_head_only' into 'master'Patrick Steinhardt
Update FindDefaultBranchName to add HeadOnly option See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5880 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: James Fargher <jfargher@gitlab.com>
2023-06-07ref service: Move common FindDefaultBranchName test setupJames Fargher
Moves all the common test setup to outside the test loop so that it is only run once.
2023-06-07ref service: Assert entire response from FindDefaultBranchNameJames Fargher
Previously only a single field was checked, but using ProtoEqual allows us to differentiate valid and invalid responses.
2023-06-06Merge branch 'jt-disable-replicate-repository-fsck' into 'master'Will Chandler
repository: Disable `fsck` during replication See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5879 Merged-by: Will Chandler <wchandler@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Co-authored-by: Justin Tobler <jtobler@gitlab.com>
2023-06-06Update changelog for 16.0.3GitLab Release Tools Bot
[ci skip]
2023-06-06Update changelog for 15.11.8GitLab Release Tools Bot
[ci skip]
2023-06-06repository: Disable `fsck` during replicationJustin Tobler
The `ReplicateRepository()` RPC uses `git-fetch(1)` to retrieve objects from preexisting internal repositories. Currently the `fetch` also performs consistency checks on the newly retrieved objects. This is problematic because preexisting objects should alway be able to be replicated regardless of the consistency check. This change sets `fetch.fsckObjects` to `false` for the performed `fetch` to disable `fsck` consistency checks.
2023-06-06Merge branch 'renovate/github.com-stretchr-testify-1.x' into 'master'Toon Claes
go: Update module github.com/stretchr/testify to v1.8.4 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5887 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2023-06-06Merge branch 'kn-smarthttp-docs' into 'master'Quang-Minh Nguyen
proto: Add documentation to `smarthttp.proto` Closes #5120 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5858 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Reviewed-by: Toon Claes <toon@gitlab.com> Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com> Co-authored-by: Karthik Nayak <knayak@gitlab.com>
2023-06-06Merge branch 'renovate/github.com-beevik-ntp-1.x' into 'master'Sami Hiltunen
go: Update module github.com/beevik/ntp to v1 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5865 Merged-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: James Fargher <proglottis@gmail.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2023-06-06Merge branch 'renovate/github.com-urfave-cli-v2-2.x' into 'master'Sami Hiltunen
go: Update module github.com/urfave/cli/v2 to v2.25.5 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5876 Merged-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com> Co-authored-by: GitLab Renovate Bot <gitlab-bot@gitlab.com>
2023-06-06go: Update module github.com/stretchr/testify to v1.8.4GitLab Renovate Bot
2023-06-06Merge branch 'pks-ci-fix-macos-runner' into 'master'Patrick Steinhardt
ci: Update to macOS M1 runners See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5881 Merged-by: Patrick Steinhardt <psteinhardt@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com>
2023-06-06Merge branch 'kn-logrus-update' into 'master'karthik nayak
mod: Update logrus to v1.9.3 Closes #5092 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5877 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com>
2023-06-06Merge branch 'pks-storage-repository' into 'master'Toon Claes
storage: Refactor code to contain knowledge of repo paths in a single package See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5863 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Pavlo Strokov <pstrokov@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
2023-06-06Merge branch 'jt-object-pool-disconnect-refactor' into 'master'Quang-Minh Nguyen
objectpool: Refactor alternates file parsing See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5871 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Justin Tobler <jtobler@gitlab.com> Co-authored-by: Justin Tobler <jtobler@gitlab.com>
2023-06-06Merge branch 'topic/improve-merge-errors' into 'master'James Fargher
Fixed: UserMergeBranch loses error messages from the merge operation See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5777 Merged-by: James Fargher <proglottis@gmail.com> Approved-by: James Fargher <proglottis@gmail.com> Reviewed-by: James Fargher <proglottis@gmail.com> Reviewed-by: OK_MF <oski.kervinen@m-files.com> Co-authored-by: Oski Kervinen <oski.kervinen@m-files.com>
2023-06-06Merge branch ↵karthik nayak
'5036-introduce-structured-error-definitions-for-gettreeentries' into 'master' proto: Add new message `GetTreeEntriesError` See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5827 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: Christian Couder <chriscool@tuxfamily.org> Approved-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: Patrick Steinhardt <psteinhardt@gitlab.com> Reviewed-by: karthik nayak <knayak@gitlab.com>
2023-06-06ci: Update to macOS M1 runnersPatrick Steinhardt
GitLab has recently deprecated the Intel-based macOS runners. As we are still using them as part of our pipeline the consequence is that the pipelines are now broken. Fix this by updating to the new M1 runners.
2023-06-06ci: Explicitly initialize Postgres database on macOSPatrick Steinhardt
With the move to M1-based macOS runners the Postgres database directory is about to be moved. Instead of relying on any hardcoded locations, let's convert the CI job to initialize our own database at a location controlled by us.
2023-06-06mod: Update logrus to v1.9.3Karthik Nayak
The latest release of logrus (v1.9.3) contains a fix for the panic in the Writer. Let us update to the new version.
2023-06-06proto: Add documentation to `smarthttp.proto`Karthik Nayak
The `smarthttp.proto` protobuf is missing documentation. Let's amend the existing documentation and add missing documenatation. Closes https://gitlab.com/gitlab-org/gitaly/-/issues/5120
2023-06-06ref service: Implement HeadOnly option for FindDefaultBranchNameJames Fargher
2023-06-06ref service: Unify FindDefaultBranchName testsJames Fargher
These tests were written in an out-of-date style. This commit updates them to all be table driven.
2023-06-06proto: Update FindDefaultBranchName to add HeadOnlyJames Fargher
We want to progressively migrate gitlab-rails away from the heuristic that this RPC usually uses. There were too many failures to do this using a feature flag. So instead here we introduce a flag to control the behaviour. Updates RPC documentation while in the area. Changelog: added
2023-06-05Merge remote-tracking branch 'dev/master'GitLab Release Tools Bot
2023-06-05go: Update module github.com/urfave/cli/v2 to v2.25.5GitLab Renovate Bot
2023-06-05objectpool: Refactor alternates file parsingJustin Tobler
Currently `Disconnect()` implements its own means to parse a Git alternates file. This change refactors `Disconnect()` to use the already existing `stats.AlternatesInfoForRepository()`, which is much more thorough, to handle the parsing instead.
2023-06-05ref: Convert `GetTagSignatures()` to use `VerifyRevisions()`Patrick Steinhardt
The `GetTagSignatures()` RPC has an open-coded version of revision validation. This validation is both too lenient and too restrictive as it does not reject known-bad patterns while also restricting pseudo-revisions which would be perfectly fine. Refactor the RPC to use `ValidateRevision()` as our new single source of truth for revision validation. Note that we do not allow path-scoped revisions here given that tags cannot ever live at a path anyway.
2023-06-05commit: Convert `ListCommits()` to use `VerifyRevisions()`Patrick Steinhardt
The `ListCommits()` RPC has an open-coded version of revision validation. This validation is both too lenient and too restrictive as it does not reject known-bad patterns while also restricting pseudo-revisions which would be perfectly fine. Refactor the RPC to use `ValidateRevision()` as our new single source of truth for revision validation. Note that we do not allow path-scoped revisions here given that commits cannot ever live at a path anyway.
2023-06-05blob: Convert `ListLFSPointers()` to use `VerifyRevisions()`Patrick Steinhardt
The `ListLFSPointers()` RPC has an open-coded version of revision validation. This validation is both too lenient and too restrictive as it does not reject known-bad patterns while also restricting pseudo-revisions which would be perfectly fine. Refactor the RPC to use `ValidateRevision()` as our new single source of truth for revision validation.
2023-06-05blob: Convert ListBlobs to use `VerifyRevisions()`Patrick Steinhardt
The `ListBlobs()` RPC has an open-coded version of revision validation. This validation is both too lenient and too restrictive as it does not reject known-bad patterns while also restricting pseudo-revisions which would be perfectly fine. Refactor the RPC to use `ValidateRevision()` as our new single source of truth for revision validation.
2023-06-05git: Optionally allow pseudo-revisions in `ValidateRevision()`Patrick Steinhardt
As a safety guard against command-line options injection we disallow passing any revisions that have a dash as leading character. There are valid usecases where a caller may want to pass these though, namely in the form of pseudo-revisions like `--all`, `--not` or `--glob=`. Add a new option `AllowPseudoRevisions()` that puts known pseudo-revisions onto an allowed-list.
2023-06-05git: Optionally allow path-scoped revisions in `ValidateRevision()`Patrick Steinhardt
The `ValidateRevision()` helper function rejects all revisions that contain a colon. This also restricts this function from being used with path-scoped revisions like `HEAD:README.md`, which require the caller to use a colon. Introduce a new option `AllowPathScopedRevision()` that lets callers accept these kinds of revisions.
2023-06-05git: Convert `ValidateRevision()` to accept optionsPatrick Steinhardt
We're about to extend `ValidateRevision()` so that it can optionally handle pseudo-revisions like `--all` and `--not` as well as path-scoped revisions. As not all existing callers will want to make use of these we need to allow callers to opt-in to this new behaviour. Merge `ValidateRevision()` as well as `ValidateRevisionAllowEmpty()` into a single function that can be passed an option. As a first example, we also introduce the `AllowEmptyRevision()` option that gets passed from all callers which were calling `ValidateRevisionAllowEmpty()`.
2023-06-05Automatic merge of gitlab-org/gitaly masterGitLab Bot
2023-06-05Merge branch 'local_restore_backup' into 'master'Toon Claes
Implement restores in backup.Repository See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5844 Merged-by: Toon Claes <toon@gitlab.com> Approved-by: Toon Claes <toon@gitlab.com> Reviewed-by: Will Chandler <wchandler@gitlab.com> Co-authored-by: James Fargher <jfargher@gitlab.com>
2023-06-05Merge branch 'ps-praefect-cli-track-repositories' into 'master'Sami Hiltunen
praefect: Migrate track-repositories sub-command Closes #5001 See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5834 Merged-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Sami Hiltunen <shiltunen@gitlab.com> Approved-by: Will Chandler <wchandler@gitlab.com> Reviewed-by: Will Chandler <wchandler@gitlab.com> Reviewed-by: Sami Hiltunen <shiltunen@gitlab.com> Co-authored-by: Pavlo Strokov <pstrokov@gitlab.com>
2023-06-05go: Update module github.com/beevik/ntp to v1GitLab Renovate Bot