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
2021-01-26CI: retry to work around flaky testsavar/retry-ci-on-failureÆvar Arnfjörð Bjarmason
We have flaky tests[1] that keep causing false alarms in the CI, so people have to waste time looking at the same issue and click "retry" manually. Let's do that retry automatically. We'll waste less time just having it retry so you'll potentially wait a bit more for a real failure, v.s. the false alarms. This is an interim solution for[1]. We should also fix those tests, a smarter way to do this would be to quickly annotate known failed tests, or to have "make test" et al smartly retry just the failing tests, but just doing this is simpler and better than the status quo. 1. https://gitlab.com/gitlab-org/gitaly/-/issues?label_name[]=failure%3A%3Aflaky-test
2021-01-26Merge branch 'avar/nuke-ruby-user-create-tag-and-branch' into 'master'Ævar Arnfjörð Bjarmason
Remove on-by-default go_user_delete_{branch,tag} feature flags See merge request gitlab-org/gitaly!3033
2021-01-26Remove on-by-default go_user_delete_{branch,tag} feature flagsÆvar Arnfjörð Bjarmason
Remove calls to the Ruby code for the go_user_delete_{branch,tag} flags on by default since a96949aef (Enable feature flag by default, 2021-01-12), and on in production since 2021-01-14: - https://gitlab.com/gitlab-org/gitaly/-/issues/3412#note_485304117 - https://gitlab.com/gitlab-org/gitaly/-/issues/3413#note_485303898 I'm removing less code than I did in fbc9f83ab (Remove Ruby code for 100% on user_delete_{branch,tag} in Go feature, 2021-01-15) per a comment from Patrick[1]: We can't remove feature flag and Ruby code at the same time due to there being a race condition. That race even exists if the feature flag is default-enabled as customers may have disabled the flag. See [2] for past discussion and conflicting information on the issue. I'll open a MR to the feature flag docs to clear this up. This brings the runtime of: time go test -v ./internal/gitaly/service/operations/ -run 'Tag|Branch' -count=1 From ~25 seconds to ~15 second. 1. https://gitlab.com/gitlab-org/gitaly/-/merge_requests/3033#note_492850106 2. https://gitlab.com/gitlab-org/gitaly/-/merge_requests/3010#note_488175228
2021-01-26Merge branch 'ps-git-factory-objectpool' into 'master'Pavlo Strokov
Git command factory injected in to objectpool See merge request gitlab-org/gitaly!3047
2021-01-26Merge branch 'smh-user-commit-files-autocrlf' into 'master'Sami Hiltunen
Improve test coverage of line ending normalization See merge request gitlab-org/gitaly!3026
2021-01-26Merge branch 'pks-fetch-remote-fix-pruning' into 'master'Patrick Steinhardt
repository: Fix regressions in FetchRemote See merge request gitlab-org/gitaly!3043
2021-01-26Merge branch 'avar/user-branch-tag-merge-lint-fixes' into 'master'Ævar Arnfjörð Bjarmason
User(Branch|Tag|Merge) tests: fix lint issues See merge request gitlab-org/gitaly!3046
2021-01-26Git command factory injected in to objectpoolPavlo Strokov
In continuation of the removing dependency on the global config.Config we now replace usages of the git.NewCommand func with injected factory method designed for the same purpose. As the calls are deeply nested we are required to make a lot of changes in other components as well in order to pass the dependency throw all the layers. Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/2699
2021-01-26changelogs: Add changelog entryPatrick Steinhardt
2021-01-26repository: Stop pruning if NoPrune was passed to FetchRemotePatrick Steinhardt
The FetchRemote RPC accepts a NoPrune parameter, which if set should cause us to not prune remote references. We fail to pay attention to that parameter though and always invoke git-fetch(1) with the "--prune" parameter and inject "remote.$REMOTE.prune=true". Let's fix this bug by passing the NoPrune parameter to git-fetch(1). We can also get rid of the injected config entry as it's essentially duplicating the "--prune" parameter.
2021-01-26repository: Fix default refspec for FetchRemotePatrick Steinhardt
in case a RemoteParam as passed to FetchRemote, we intend do use its MirrorRefmaps to determine how references should be mirrored, as there is no configured remote which could have a refspec. In case no map is provided, we should fall back to just doing a mirror-fetch, if one goes by what the Ruby RPC did back when it still existed. But in fact we don't set up a refspec at all in that case, which instead causes us to simply fetch the remote's HEAD reference. Fix this issue by using "refs/*:refs/*" in case no refspec is given.
2021-01-26repository: Always inject "http.followRedirects" in FetchRemotePatrick Steinhardt
We're currently only injecting the "http.followRedirects" option in case the FetchRemote RPC was invoked with RemoteParams, but not in case remote name was passed. This is different to the original Ruby behaviour and opens us up for unwanted redirects. Fix this issue by unconditionally passing `http.followRedirects=false`.
2021-01-26repository: Drop remote.$REMOTE.mirror when fetching remotesPatrick Steinhardt
When calling FetchRemote with RemoteParams set, we create an ad-hoc remote and configure it as requested by the RPC's parameters. One of the config entries we inject at runtime only is "remote.$REMOTE.mirror", which shouldn't have any effect at all considering it's only used when pushing to a remote. Let's drop this useless entry, it's only confusing.
2021-01-26proto: Add missing documentation for FetchRemoteRequestPatrick Steinhardt
The FetchRemoteRequest RPC doesn't have any docmuentation right now. Let's fix it by documenting both the RPC itself as well as its parameters.
2021-01-26improve test coverage of line ending normalizationSami Hiltunen
Gitaly normalizes line endings by setting `core.autocrlf=input` globally for every git invocation. This commit improves test coverage around this in WriteBlob and UserCommitFiles.
2021-01-26Merge branch 'pks-git-inject-global-config' into 'master'Ævar Arnfjörð Bjarmason
git: Add support for options which always get injected See merge request gitlab-org/gitaly!3028
2021-01-26User(Branch|Tag|Merge) tests: fix lint issuesÆvar Arnfjörð Bjarmason
Fix a few lint issues added to the exclusions list in 6e7eea01e (Lint: turn "errcheck" on by default, 2021-01-19).
2021-01-26Update CHANGELOG.md for 13.8.1GitLab Release Tools Bot
[ci skip]
2021-01-26Merge branch 'pks-go-user-merge-to-ref-allow-conflicts' into 'master'Patrick Steinhardt
operations: Wire up AllowConflicts handling for Go See merge request gitlab-org/gitaly!2997
2021-01-26Merge branch 'pks-localrepo-split' into 'master'Pavlo Strokov
git: Split out LocalRepository implementation See merge request gitlab-org/gitaly!3048
2021-01-26operations: Wire up AllowConflicts handling for GoPatrick Steinhardt
Originally, handling of the "AllowConflicts" parameter for the UserMergeToRef RPC was only implemented in Ruby and not in Go because efforts to port to Go and to implement this new flag crossed. This has changed with the previous commit so that we can now switch over to fully use the Go port instead of the Ruby code in all cases. Note that this directly removes the Ruby codepath without any kind of feature flag. This is done because first, the UserMergeToRef RPC has been tested already and rolled out by default. And second, all callers in GitLab Rails which make use of "AllowConflicts" are already hidden behind the "display_merge_conflicts_in_diff" feature flag which is currently disabled by default. Introducing another feature flag for this parameter thus doesn't seem necessary.
2021-01-26git2go: Implement handling of AllowConflicts for UserMergeToRefPatrick Steinhardt
While we ported the UserMergeToRef RPC to Go, a new flag "allow_conflicts" was added to its request. What it does is that instead of raising an error when there's any conflict, the RPC will now commit the conflicting file together with its conflict markers. Given that both efforts kind of crossed, the parameter isn't supported by the Go implementation nowadays. This commit lays the groundwork to support it.
2021-01-26conflicts: Expose helper to merge a conflicting index entryPatrick Steinhardt
In order to compute the list of conflicts, we have a function which takes an `IndexConflict` as input and computes a merged file which contains the conflicts as part of its merged contents, including conflict markers. While this function is currently only used in a single location, we're about to extend the UserMergeToRef RPC to also optionally commit conflict markers, where this function will be useful. Let's expose it up front in order to make it available outside of its current module.
2021-01-26git: Rename FormatTag testPatrick Steinhardt
The tests for `FormatTag()` is currently called `TestLocalRepository_FormatTag()`, even though it's not a receiver function of the `LocalRepository` structure. Let's rename it to `TestFormatTag()` instead according to our test name policy.
2021-01-26git: Add missing comment for HasBranches functionPatrick Steinhardt
The `LocalRepository.HasBranches()` function is missing a comment. Let's add it to silence the linter.
2021-01-26git: Move RepositoryConfig type into localrepo filesPatrick Steinhardt
The RepositoryConfig type is only implemented for the LocalRepository type, and it can only ever be used for local repositories in the first place. Let's make it obvious that this is the case by moving the RepositoryConfig implementation into a "localrepo" file and renaming it to LocalRepositoryConfig.
2021-01-26git: Move RepositoryRemote type into localrepo filesPatrick Steinhardt
The RepositoryRemote type is only implemented for the LocalRepository type, and it can only ever be used for local repositories in the first place. Let's make it obvious that this is the case by moving the RepositoryRemote implementation into a "localrepo" file and renaming it to LocalRepositoryRemote.
2021-01-26git: Single out LocalRepository implementationPatrick Steinhardt
The LocalRepository implementation has grown quite a lot recently, but is still mostly contained in a single file only. This makes it really hard to understand, refactor and extend its implementation. This commit thus moves the abstraction into its own set of files to fix this issue.
2021-01-26Merge branch 'sh-restore-gitaly-json-logs' into 'master'James Fargher
Make gitaly_ruby_json.log work again See merge request gitlab-org/gitaly!3052
2021-01-26Make gitaly_ruby_json.log work againStan Hu
https://gitlab.com/gitlab-org/gitaly/-/merge_requests/2900 dropped `GITALY_LOG_DIR` from the environment, causing gitaly-ruby to log everything to /dev/null. Relates to https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/822
2021-01-26Merge branch 'pks-go-fetch-source-branch-remove-ff' into 'master'James Fargher
featureflag: Remove GoFetchSourceBranch feature flag See merge request gitlab-org/gitaly!3050
2021-01-26Merge branch 'smh-remove-server-scope' into 'master'James Fargher
Remove server scope from Praefect Closes #3122 See merge request gitlab-org/gitaly!3015
2021-01-25Merge branch 'pks-hooks-payload-drop-fallback' into 'master'Christian Couder
hooks: Drop payload fallback code See merge request gitlab-org/gitaly!2988
2021-01-25hooks: Fix name of hooks payload envvar name variablePatrick Steinhardt
The name of the hooks payload environment variable names' variable is somehow got named `ErrHooksPayloadNotFound`. It's been called like that ever since I originally implemented it in 807efa204 (git: Implement a new hooks payload structure, 2020-12-02), but my mind really must have been clouded to call it such. Let's rename it to `EnvHooksPayload` to make it less confusing.
2021-01-25featureflag: Remove GoFetchSourceBranch feature flagPatrick Steinhardt
The GoFetchSourceBranch feature flag has been default-enabled in commit 8443b3333 (featureflag: Enable Go implementation of FetchSourceBranch by default, 2021-01-13), which was released with v13.8.0. We can thus remove this feature flag altogether now.
2021-01-25testhelper: Use different feature flag to test feature setsPatrick Steinhardt
We're using a set of "real" feature flags to test the feature set implementation. This has the obvious downside that as each feature flag is eventually being removed, the test cases need to be adjusted to use a different feature flag instead. Let's convert this to instead use a set of dummy feature flags.
2021-01-25Merge branch 'pks-go-user-merge-branch-remove-ff' into 'master'Sami Hiltunen
featureflags: Remove GoUserMergeBranch feature flag See merge request gitlab-org/gitaly!3049
2021-01-25metadata: Drop code to serialize and deserialize from envvarsPatrick Steinhardt
Back when we were still using standalone environment variables to pass down both transaction and Praefect server information to gitaly-hooks, we had to serialize and deserialize both structures into and from environment variables. We've since converted the code to use a single serialized `HooksPayload` struct, so in fact we don't need this legacy code anymore. Remove `PraefectFromEnv()`, `TransactionFromEnv()` and their `Env()` functions.
2021-01-25hooks: Drop payload fallback codePatrick Steinhardt
In release 13.7, we have migrated hooks away from using multiple environment variables to instead use a single serialized `HooksPayload` structure. In order to allow zero-downtime upgrades, we had to keep some fallback code though to still work with the old environment variables such that an old server continues to work with a new gitaly-hooks binary. Now that 13.7 is out, let's drop the fallback code. We only allow for zero-downtime upgrades between consecutive releases, so this is safe to do.
2021-01-25git: Add support for options which always get injectedPatrick Steinhardt
Traditionally, the gitconfig is not managed by the Gitaly project but by the various projects which deploy Gitaly or by the administrator himself if he chooses to do a source-based installation. Admins may have to potentially update the gitconfig on each upgrade of Gitaly while we as the Gitaly team need to ensure that all projects which deploy Gitaly (Docker, CNG, Omnibus and the likes) have the same gitconfig. Going by Murphy's law, this means that the git configuration for ways of installing Gitaly is going to diverge or has already diverged. Running in an environment where we don't know that a set of config entries is set can be dangerous and may lead to incorrect results, failures or even data loss in the case of "core.fsyncObjectFiles" and "gc.auto". This commit thus moves the global configuration into the Gitaly project to avoid any inconsistent environments. This allows us to ensure that required options are set while being quicker to iterate in case we need to change the configuration. The injection is done via the `git.ConfigPair{}` mechanism, which will put all config entries on the command line via `git -c <key>=<value>` pairs. While it has the downside of being verbose, the current set of entries we inject is quite limited and contains only five different options, so we shouldn't be near any command line limits. Furthermore, we're currently in the process of upstreaming a new way of injecting config entries via the environment, which we can migrate to as soon as this git version has been released. The list of injected configuration entries is taken from our source installation instructions.
2021-01-25featureflags: Remove GoUserMergeBranch feature flagPatrick Steinhardt
The GoUserMergeBranch feature flag has been default-enabled in eeab751f2 (featureflags: Enable Go implementation of UserMergeBranch by default, 2021-01-06), which has been released with v13.8.0. We can thus remove the feature flag completely now.
2021-01-25Update CHANGELOG.md for 13.7.5GitLab Release Tools Bot
[ci skip]
2021-01-25Merge branch 'avar/remove-more-ruby-ref-service' into 'master'Zeger-Jan van de Weg
Remove unused Ruby code not used in almost a year See merge request gitlab-org/gitaly!3045
2021-01-25Merge branch 'pks-deterministic-rpcs' into 'master'Patrick Steinhardt
transactions: Optionally use timestamps for deterministic results See merge request gitlab-org/gitaly!3036
2021-01-25conflicts: Allow ResolveConflicts to get an optional timestampPatrick Steinhardt
The ResolveConflicts RPC is currently not deterministic with regards to the created commits because they contain a timestamp, which is by default the creation time. This breaks transactions, as when multiple Gitalies now try to process the same request in parallel, the likelihood is very high that they'll end up with different commit IDs. Fix the issue by introducing a new optional "timestamp" field to the request. If set, it will be used instead of the current system time. This is only the first half of the fix, the second one will require us to inject a single timestamp in Rails.
2021-01-25operations: Allow UserUpdateSubmodule to get an optional timestampPatrick Steinhardt
The UserUpdateSubmodule RPC is currently not deterministic with regards to the created commits because they contain a timestamp, which is by default the creation time. This breaks transactions, as when multiple Gitalies now try to process the same request in parallel, the likelihood is very high that they'll end up with different commit IDs. Fix the issue by introducing a new optional "timestamp" field to the request. If set, it will be used instead of the current system time. This is only the first half of the fix, the second one will require us to inject a single timestamp in Rails.
2021-01-25operations: Allow UserApplyPatch to get an optional timestampPatrick Steinhardt
The UserApplyPatch RPC is currently not deterministic with regards to the created commits because they contain a timestamp, which is by default the creation time. This breaks transactions, as when multiple Gitalies now try to process the same request in parallel, the likelihood is very high that they'll end up with different commit IDs. Fix the issue by introducing a new optional "timestamp" field to the request. If set, it will be used instead of the current system time. This is only the first half of the fix, the second one will require us to inject a single timestamp in Rails.
2021-01-25operations: Allow UserSquash to get an optional timestampPatrick Steinhardt
The UserSquash RPC is currently not deterministic with regards to the created commits because they contain a timestamp, which is by default the creation time. This breaks transactions, as when multiple Gitalies now try to process the same request in parallel, the likelihood is very high that they'll end up with different commit IDs. Fix the issue by introducing a new optional "timestamp" field to the request. If set, it will be used instead of the current system time. This is only the first half of the fix, the second one will require us to inject a single timestamp in Rails.
2021-01-25operations: Allow UserRevert to get an optional timestampPatrick Steinhardt
The UserRevert RPC is currently not deterministic with regards to the created commits because they contain a timestamp, which is by default the creation time. This breaks transactions, as when multiple Gitalies now try to process the same request in parallel, the likelihood is very high that they'll end up with different commit IDs. Fix the issue by introducing a new optional "timestamp" field to the request. If set, it will be used instead of the current system time. This is only the first half of the fix, the second one will require us to inject a single timestamp in Rails.
2021-01-25operations: Allow UserCommitFiles to get an optional timestampPatrick Steinhardt
The UserCommitFiles RPC is currently not deterministic with regards to the created commits because they contain a timestamp, which is by default the creation time. This breaks transactions, as when multiple Gitalies now try to process the same request in parallel, the likelihood is very high that they'll end up with different commit IDs. Fix the issue by introducing a new optional "timestamp" field to the request. If set, it will be used instead of the current system time. This is only the first half of the fix, the second one will require us to inject a single timestamp in Rails.