Commit Graph

717 Commits

Author SHA1 Message Date
GitLab Bot 6ef0d7a8fe Add latest changes from gitlab-org/gitlab@master 2021-05-24 18:10:28 +00:00
GitLab Bot 4a882000a9 Add latest changes from gitlab-org/gitlab@master 2021-05-12 15:10:25 +00:00
GitLab Bot 25db9c1230 Add latest changes from gitlab-org/gitlab@master 2021-05-06 12:10:38 +00:00
GitLab Bot be4b3134a2 Add latest changes from gitlab-org/gitlab@master 2021-05-04 15:10:36 +00:00
GitLab Bot 70cfa5e3e7 Add latest changes from gitlab-org/gitlab@master 2021-04-26 21:10:25 +00:00
GitLab Bot 9c6578ed4e Add latest changes from gitlab-org/gitlab@master 2021-04-21 15:09:35 +00:00
GitLab Bot 430aebe8af Add latest changes from gitlab-org/gitlab@master 2021-04-21 06:09:28 +00:00
GitLab Bot a3dfd311f4 Add latest changes from gitlab-org/gitlab@master 2021-04-14 15:09:04 +00:00
GitLab Bot 1769b59b9f Add latest changes from gitlab-org/gitlab@master 2021-04-01 18:13:56 +00:00
GitLab Bot cb840235d7 Add latest changes from gitlab-org/gitlab@master 2021-03-17 15:09:03 +00:00
GitLab Bot 7ff2de7c12 Add latest changes from gitlab-org/gitlab@master 2021-03-05 00:09:24 +00:00
GitLab Bot b0a5a92e83 Add latest changes from gitlab-org/gitlab@master 2021-03-04 09:10:52 +00:00
GitLab Bot 7f5e08060f Add latest changes from gitlab-org/gitlab@master 2021-02-12 09:08:48 +00:00
GitLab Bot 89f3fa0b96 Add latest changes from gitlab-org/gitlab@master 2021-02-04 00:09:18 +00:00
GitLab Bot fba5aaeec6 Add latest changes from gitlab-org/gitlab@master 2021-01-25 21:09:03 +00:00
GitLab Bot ef8c47e97e Add latest changes from gitlab-org/gitlab@master 2021-01-20 15:10:29 +00:00
GitLab Bot b8f4476569 Add latest changes from gitlab-org/gitlab@master 2021-01-19 06:10:50 +00:00
GitLab Bot 8106ac487c Add latest changes from gitlab-org/gitlab@master 2021-01-14 15:10:46 +00:00
GitLab Bot 716896e8ca Add latest changes from gitlab-org/gitlab@master 2021-01-13 18:10:55 +00:00
GitLab Bot 2c2b5aeac0 Add latest changes from gitlab-org/gitlab@master 2021-01-05 15:10:02 +00:00
GitLab Bot 9b09561f47 Add latest changes from gitlab-org/gitlab@master 2020-12-09 18:09:48 +00:00
GitLab Bot a2f16969fa Add latest changes from gitlab-org/gitlab@master 2020-12-04 06:09:34 +00:00
GitLab Bot f4182abcb6 Add latest changes from gitlab-org/gitlab@master 2020-11-12 18:09:26 +00:00
GitLab Bot 3775eba7c1 Add latest changes from gitlab-org/gitlab@master 2020-10-16 12:09:33 +00:00
GitLab Bot c311ce331f Add latest changes from gitlab-org/gitlab@master 2020-10-16 03:08:29 +00:00
GitLab Bot c083f926c5 Add latest changes from gitlab-org/gitlab@master 2020-10-15 21:09:12 +00:00
GitLab Bot 16515bdfcb Add latest changes from gitlab-org/gitlab@master 2020-10-13 15:08:53 +00:00
GitLab Bot a87ae2e97e Add latest changes from gitlab-org/gitlab@master 2020-10-07 21:08:21 +00:00
GitLab Bot 62f486eb35 Add latest changes from gitlab-org/gitlab@master 2020-10-02 15:08:13 +00:00
GitLab Bot 6092dcc437 Add latest changes from gitlab-org/gitlab@master 2020-10-02 12:09:03 +00:00
GitLab Bot e0b023e388 Add latest changes from gitlab-org/gitlab@master 2020-09-23 15:10:14 +00:00
GitLab Bot b85aae44f9 Add latest changes from gitlab-org/gitlab@master 2020-09-21 15:09:44 +00:00
GitLab Bot 7985071975 Add latest changes from gitlab-org/gitlab@master 2020-09-21 12:09:34 +00:00
GitLab Bot a961982252 Add latest changes from gitlab-org/gitlab@master 2020-09-02 21:10:43 +00:00
GitLab Bot 8e35232810 Add latest changes from gitlab-org/gitlab@master 2020-09-02 15:10:54 +00:00
GitLab Bot bdca097916 Add latest changes from gitlab-org/gitlab@master 2020-08-11 03:11:00 +00:00
GitLab Bot 2ecc6e22e3 Add latest changes from gitlab-org/gitlab@master 2020-08-04 18:09:49 +00:00
GitLab Bot 8bb9ee8769 Add latest changes from gitlab-org/gitlab@master 2020-07-31 21:10:12 +00:00
GitLab Bot 1e254d9f5a Add latest changes from gitlab-org/gitlab@master 2020-06-30 12:08:57 +00:00
GitLab Bot 757d2fda7e Add latest changes from gitlab-org/gitlab@master 2020-06-26 21:08:51 +00:00
GitLab Bot c59765a50a Add latest changes from gitlab-org/gitlab@master 2020-06-24 18:09:03 +00:00
GitLab Bot 4c5468b408 Add latest changes from gitlab-org/gitlab@master 2020-06-24 15:08:50 +00:00
GitLab Bot 810bd2a662 Add latest changes from gitlab-org/gitlab@master 2020-06-02 12:08:33 +00:00
GitLab Bot b64a8161c9 Add latest changes from gitlab-org/gitlab@master 2020-05-29 18:08:26 +00:00
GitLab Bot 100a5e4bea Add latest changes from gitlab-org/gitlab@master 2020-05-25 21:08:00 +00:00
GitLab Bot 735e7717e7 Add latest changes from gitlab-org/gitlab@master 2020-05-24 12:08:20 +00:00
GitLab Bot 927df95cc4 Add latest changes from gitlab-org/gitlab@master 2020-05-15 12:08:28 +00:00
GitLab Bot c7ba7b9976 Add latest changes from gitlab-org/gitlab@master 2020-05-11 09:09:45 +00:00
GitLab Bot 5f0e3773e9 Add latest changes from gitlab-org/gitlab@master 2020-05-06 21:10:00 +00:00
GitLab Bot bd5d5791c5 Add latest changes from gitlab-org/gitlab@master 2020-04-23 09:09:46 +00:00
GitLab Bot 209bd8cf1f Add latest changes from gitlab-org/gitlab@master 2020-04-09 15:09:29 +00:00
GitLab Bot 53b1f4eaa2 Add latest changes from gitlab-org/gitlab@master 2020-04-02 15:08:01 +00:00
GitLab Bot 684d65316a Add latest changes from gitlab-org/gitlab@master 2020-04-02 12:08:18 +00:00
GitLab Bot 0d0cddc9ce Add latest changes from gitlab-org/gitlab@master 2020-03-31 12:08:09 +00:00
GitLab Bot 95ad46159e Add latest changes from gitlab-org/gitlab@master 2020-03-30 21:08:01 +00:00
GitLab Bot 154b9bae14 Add latest changes from gitlab-org/gitlab@master 2020-03-17 21:09:16 +00:00
GitLab Bot c36152ff8c Add latest changes from gitlab-org/gitlab@master 2020-03-13 15:09:21 +00:00
GitLab Bot 3cd08f4bf9 Add latest changes from gitlab-org/gitlab@master 2020-03-13 00:09:34 +00:00
GitLab Bot dc889678d1 Add latest changes from gitlab-org/gitlab@master 2020-03-12 15:09:39 +00:00
GitLab Bot 951616a26a Add latest changes from gitlab-org/gitlab@master 2020-02-25 18:09:02 +00:00
GitLab Bot a8c82a6395 Add latest changes from gitlab-org/gitlab@master 2020-02-25 03:08:49 +00:00
GitLab Bot df2eda3f14 Add latest changes from gitlab-org/gitlab@master 2020-02-20 18:08:51 +00:00
GitLab Bot 8c4198cbe6 Add latest changes from gitlab-org/gitlab@master 2020-02-20 12:08:51 +00:00
GitLab Bot cd3e2c7b93 Add latest changes from gitlab-org/gitlab@master 2020-02-19 12:09:13 +00:00
GitLab Bot 93d7441cc9 Add latest changes from gitlab-org/gitlab@master 2020-02-18 21:09:11 +00:00
GitLab Bot 4720b569f0 Add latest changes from gitlab-org/gitlab@master 2020-02-18 09:09:24 +00:00
GitLab Bot 0c6bc5443a Add latest changes from gitlab-org/gitlab@master 2020-02-07 21:08:39 +00:00
GitLab Bot a89cb5cbdd Add latest changes from gitlab-org/gitlab@master 2020-02-06 21:08:48 +00:00
GitLab Bot 0d6fa03312 Add latest changes from gitlab-org/gitlab@master 2020-02-06 18:08:54 +00:00
GitLab Bot 27a18afc7d Add latest changes from gitlab-org/gitlab@master 2020-02-04 00:09:04 +00:00
GitLab Bot c8f773a859 Add latest changes from gitlab-org/gitlab@master 2020-01-30 21:08:47 +00:00
GitLab Bot 390582e118 Add latest changes from gitlab-org/gitlab@master 2020-01-27 18:09:04 +00:00
GitLab Bot c158fa8d69 Add latest changes from gitlab-org/gitlab@master 2020-01-16 12:08:32 +00:00
GitLab Bot 8b1228b0d4 Add latest changes from gitlab-org/gitlab@master 2020-01-10 15:07:47 +00:00
GitLab Bot c6373a2cec Add latest changes from gitlab-org/gitlab@master 2019-12-24 12:08:01 +00:00
GitLab Bot 784fae4b9d Add latest changes from gitlab-org/gitlab@master 2019-12-12 12:07:33 +00:00
GitLab Bot 4e375367b7 Add latest changes from gitlab-org/gitlab@master 2019-12-07 00:07:51 +00:00
GitLab Bot ab7cf450ba Add latest changes from gitlab-org/gitlab@master 2019-12-03 18:06:49 +00:00
GitLab Bot a048261403 Add latest changes from gitlab-org/gitlab@master 2019-11-21 09:06:16 +00:00
GitLab Bot 6791eefead Add latest changes from gitlab-org/gitlab@master 2019-10-21 09:06:22 +00:00
GitLab Bot 25989ab7ef Add latest changes from gitlab-org/gitlab@master 2019-10-18 11:11:44 +00:00
GitLab Bot 7b8ec6e718 Add latest changes from gitlab-org/gitlab@master 2019-10-15 18:06:01 +00:00
GitLab Bot 4b28d5ae77 Add latest changes from gitlab-org/gitlab@master 2019-10-09 21:06:24 +00:00
GitLab Bot 9a1c545674 Add latest changes from gitlab-org/gitlab@master 2019-10-03 15:07:07 +00:00
GitLab Bot 4f4dcd3c5d Add latest changes from gitlab-org/gitlab@master 2019-10-02 15:06:12 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
GitLab Bot bd860c22f6 Add latest changes from gitlab-org/gitlab@master 2019-09-17 12:06:48 +00:00
Pavel Shutsin f089a23015 Backport EE changes for productivity analytics
Improve diff lines count efficiency
2019-09-04 13:01:55 +03:00
Sean McGivern f9c456bd0c Make performance bar enabled checks consistent
Previously, we called the `peek_enabled?` method like so:

    prepend_before_action :set_peek_request_id, if: :peek_enabled?

Now we don't have a `set_peek_request_id` method, so we don't need that
line. However, the `peek_enabled?` part had a side-effect: it would also
populate the request store cache for whether the performance bar was
enabled for the current request or not.

This commit makes that side-effect explicit, and replaces all uses of
`peek_enabled?` with the more explicit
`Gitlab::PerformanceBar.enabled_for_request?`. There is one spec that
still sets `SafeRequestStore[:peek_enabled]` directly, because it is
contrasting behaviour with and without a request store enabled.

The upshot is:

1. We still set the value in one place. We make it more explicit that
   that's what we're doing.
2. Reading that value uses a consistent method so it's easier to find in
   future.
2019-08-28 17:25:02 +01:00
Stan Hu 291df05e43 Add Rugged calls to performance bar
This will help diagnose the source of excessive I/O from Rugged
calls. To implement this, we need to obtain the full list of arguments
sent to each request method.
2019-07-23 21:38:05 -07:00
Stan Hu ddf2dcf7fd Merge branch 'jc-wrap-rugged-calls-with-disk-access' into 'master'
Wrap rugged calls with access disk block

See merge request gitlab-org/gitlab-ce!30592
2019-07-17 22:23:20 +00:00
Igor 0f46886880 Added submodule links to Submodule type in GraphQL API
This is part of migration of Folder View to Vue
2019-07-17 13:06:19 +00:00
John Cai 8765d53737 Wrap rugged calls with access disk block
Whenever we use the rugged implementation, we are going straight to disk
so we want to bypass the disk access check.
2019-07-16 13:54:01 -07:00
John Cai 5305d5267d Disabling can_use_disk? temporarily 2019-07-09 11:14:57 -07:00
John Cai 8152e1aa4a Use Rugged if we detect storage is NFS and we can access the disk
Add a module we use as a singleton to determine whether or not rails is
able to access the disk
2019-07-05 10:31:47 -07:00
Shinya Maeda 48307fac1e Extend MergeToRefService for creating merge ref from the other ref
Currently, MergeToRefService is specifically designed for
createing merge commits from source branch and target branch of
merge reqeusts. We extend this behavior to source branch and any
target ref paths.
2019-07-05 17:15:10 +07:00
GitalyBot e7b54b9cb8 Fix broken worktree test
The setup was wrong, and due to Gitaly being a bit more strict it had to
match up. The test is now accurate and passing again.
2019-06-25 14:45:51 +00:00
Patrick Bajao 40fd0b9e40 Add client code to call GetObjectDirectorySize RPC
CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13460
2019-06-05 20:58:46 +08:00
Zeger-Jan van de Weg 951afba624
Remove hook directory requirement from Shell
It used to be the case that GitLab created symlinks for each repository
to one copy of the Git hooks, so these ran when required. This changed
to set the hooks dynamically on Gitaly when invoking Git.

The side effect is that we didn't need all these symlinks anymore, which
Gitaly doesn't create anymore either. Now that means that the tests in
GitLab-Rails should test for it either.

Related: https://gitlab.com/gitlab-org/gitaly/issues/1392#note_175619926
2019-05-30 20:04:08 +02:00
Stan Hu c1827f1c50 API: Fix recursive flag not working with Rugged get_tree_entries flag
Attempting to use the API endpoint
/projects/:id/repository/tree?recursive=true would only return a subset
of the results since the full recursive list wasn't actually being
returned.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/61979
2019-05-20 12:19:15 -07:00
Douwe Maan 908860087f Merge branch '30093-apply-bfg-object-map-to-database' into 'master'
Remove cleaned up OIDs from database and cache

Closes #30093

See merge request gitlab-org/gitlab-ce!26555
2019-05-06 11:33:11 +00:00
Nick Thomas 8973f32d42
Remove cleaned up OIDs from database and cache 2019-05-06 11:35:03 +01:00
John Cai 0e033b3124 Add client methods for DisconnectGitAlternates rpc
DisconnectGitAlternates is a Gitaly RPC that will delete a repository's
objects/info/alternates file. This commit adds client support for that
RPC.
2019-05-03 15:59:28 -07:00
John Cai 5ee7876534 Add client methods for FetchIntoObjectPool RPC
Gitaly's FetchIntoObjectPool RPC will idempotently fetch objects into an
object pool. If the pool doesn't exist, it will create an empty pool
before attempting the fetch. This change adds client code as well as
specs to cover this behavior.
2019-04-30 08:28:56 -07:00
Bob Van Landuyt 33cf8edae1 Port changes for design management to CE
This ports the changes from
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10462/
to CE
2019-04-29 08:28:43 +02:00
Winnie Hellmann 79f17ee779 Fix typo in blob_spec.rb 2019-04-25 07:39:27 +00:00
Francisco Javier López dde69bfb2a Added list_pages method to avoid loading all wiki pages content
Inside a wiki, when we show the sidebar or browse to the `pages`,
all page contents are retrieved from Gitaly and that is a waste
of resources, since no content from that pages are going to be
showed.

This MR introduces the method `ProjectWiki#list_pages`,
which uses new wiki_list_pages RPC call to retrieve
pages without content

Also in the `WikisController` we're using the method to show
pages in the sidebar and also on the `pages` page.
2019-04-25 04:19:07 +00:00
Oswaldo Ferreira 976d373ac1 Make use of local ref if it is reachable 2019-04-19 16:01:49 -03:00
Stan Hu 5d74c95c98 Check that source and target branch exist
This ensures the return value is consistent if the source and/or
branch do not exist.
2019-04-18 22:01:51 -03:00
Stan Hu 54d64ec9f6 Remove source_branch_name commit check
This should already be done in Gitlab::Git:Compare.
2019-04-18 22:01:51 -03:00
Stan Hu 26653eb035 Don't create a temp reference for branch comparisons within project
A temp reference is only needed to fetch a branch from another project,
as in the case for forked repositories. For branch comparisons within
the same project, we can just use the existing branch names to do the
comparison.

Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/38689#note_126107862
2019-04-18 22:01:51 -03:00
Douwe Maan 6a72ab22c8 Merge branch 'sh-backport-list-commits-by-oid-rugged' into 'master'
Bring back Rugged implementation of ListCommitsByOid

See merge request gitlab-org/gitlab-ce!27441
2019-04-17 13:16:51 +00:00
Stan Hu 2fc4de6ab6 Bring back Rugged implementation of ListCommitsByOid
This brings back changes in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20432.

For users using Gitaly on top of NFS, accessing the Git data directly
via Rugged may be faster than going through than Gitaly. This merge
request introduces the feature flag `rugged_list_commits_by_oid` to
activate the Rugged method.

For one customer, we saw that ListCommitsByOid was the second highest
used endpoint that may be causing increased load.
2019-04-17 05:09:18 -07:00
Nick Thomas 2845e8d973
Revert "Revert "Merge branch '24704-download-repository-path' into 'master'""
This reverts commit 171818df0a.
2019-04-16 15:16:23 +01:00
Rémy Coutable 51119395e6 Merge branch 'revert-24704-download-repository-path' into 'master'
Revert "Merge branch '24704-download-repository-path' into 'master'"

See merge request gitlab-org/gitlab-ce!27249
2019-04-11 10:01:52 +00:00
Patrick Bajao 171818df0a Revert "Merge branch '24704-download-repository-path' into 'master'"
This reverts commit 6c75bd015c, reversing
changes made to 1be7f5aaa3.
2019-04-11 15:49:53 +08:00
John Cai 674b926ef4 Guard against nil dereferenced_target 2019-04-10 11:39:36 -07:00
Thong Kuah 4ec16912b8 Autocorrect with RSpec/ExampleWording cop
- rewords examples starting with 'should'
- rewords examples starting with 'it'

Note: I had to manually fixup "onlies" to "only"
2019-04-05 08:43:27 +00:00
Patrick Bajao 6766a0a144 Download a folder from repository
Add `GetArchiveRequest` to git-archive params.

Modifies `Git::Repository#archive_metadata` to append `path`
to `ArchivePrefix` so it'll not hit the cache of repository archive
when it already exists.
2019-04-02 22:07:16 +08:00
Stan Hu 8686e01250 Avoid excessive recursive calls with Rugged TreeEntries
The Rugged implementation was recursively scanning the repository to
create `flat_path` because the post-process step was being called from
with a loop. For large repositories, this was significantly slowing
things down. Break the call to `rugged_populate_flat_path` out of this
loop to make this work efficiently.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59759
2019-03-31 22:14:19 -07:00
Dmitriy Zaporozhets 535bd5743f Merge branch '48132-display-output-from-pre-receive-scripts' into 'master'
Allow custom hooks errors to appear in GitLab UI

Closes #48132

See merge request gitlab-org/gitlab-ce!25625
2019-03-26 22:33:25 +00:00
Luke Duncalfe f82380b9df Allow custom hooks errors to appear in GitLab UI
Error messages from custom pre-receive hooks now appear in the GitLab
UI.

This is re-enabling a feature that had been disabled in merge request
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18646

The feature had been disabled due to security concerns that information
which was not intended to be public (like stack traces) would leak into
public view.

PreReceiveErrors (from pre-receive, post-receive and update custom
hooks) are now filtered for messages that have been prefixed in a
particular way.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/48132
2019-03-26 13:05:40 +13:00
Luke Duncalfe 38bf176c3c Enrich commits with full data in CommitCollection
Allow incomplete commit records to load their full data from gitaly.

Commits can be based on a Hash of data retrieved from PostgreSQL, and
this data can be intentionally incomplete in order to save space.

A new method #gitaly? has been added to Gitlab::Git::Commit, which
returns true if the underlying data source of the Commit is a
Gitaly::GitCommit.

CommitCollection now has a method #enrich which replaces non-gitaly
commits in place with commits from gitaly.

CommitCollection#without_merge_commits has been updated to call this
method, as in order to determine a merge commit we need to have parent
data.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/58805
2019-03-22 10:26:15 +13:00
Stan Hu 30caec327f Bump Rugged to 0.28.0
This version bump makes things consistent between Gitaly and
fixes a significant number of bugs:
https://github.com/libgit2/libgit2/releases

This also decreases disk space of Omnibus builds by ~30 MB.

There is also a workaround for
https://github.com/libgit2/rugged/issues/785. If Gitaly or another
process changes .gitconfig while Rugged has the file loaded,
Rugged::Repository#each_key will report stale values unless a lookup is
done first.

This bug only manifests in a spec because we are using both Gitaly and
Rugged at the same time there, and we normally don't use Rugged in the
CE/EE code in this way.
2019-03-19 00:16:00 -07:00
Nick Thomas 9f05e97aad
Run rubocop -a 2019-03-13 13:42:43 +00:00
Stan Hu 9d3e413aa7 Bring back Rugged implementation of TreeEntry
This brings back some of the changes in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20099/diffs

For users using Gitaly on top of NFS, accessing the Git data directly
via Rugged is more performant than Gitaly. This merge request introduces
the feature flag `rugged_tree_entry` to activate the Rugged method.

Part of four Rugged changes identified in
https://gitlab.com/gitlab-org/gitlab-ce/issues/57317.
2019-03-07 04:33:57 -08:00
Stan Hu 2c4cb7a6a8 Bring back Rugged implementation of GetTreeEntries
This brings back some of the changes in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20343.

For users using Gitaly on top of NFS, accessing the Git data directly
via Rugged is more performant than Gitaly. This merge request introduces
the feature flag `rugged_tree_entries` to activate the Rugged method.

Part of four Rugged changes identified in
https://gitlab.com/gitlab-org/gitlab-ce/issues/57317.
2019-03-07 04:29:51 -08:00
Sean McGivern fd50ba4240 Merge branch 'sh-rugged-find-commit' into 'master'
Bring back Rugged implementation of find_commit

See merge request gitlab-org/gitlab-ce!25477
2019-03-04 09:22:44 +00:00
John Cai 87adc799eb Removing old code path for search_files_by_content
In 11.8, we added a fix for the SearchFilesByContent RPC in gitaly to
send back the response in chunks. However, we kept in the old code path
for backwards compatibility. Now that the change is fully deployed, we
can remove that old codepath.
2019-03-01 15:25:30 -08:00
Stan Hu fb6a4e21d4 Bring back Rugged implementation of find_commit
This brings back some of the changes in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20339.

For users using Gitaly on top of NFS, accessing the Git data directly
via Rugged is more performant than Gitaly. This merge request introduces
the feature flag `rugged_find_commit` to activate Rugged paths.

There are also Rake tasks `gitlab:features:enable_rugged` and
`gitlab:features:disable_rugged` to enable/disable these feature
flags altogether.

Part of four Rugged changes identified in
https://gitlab.com/gitlab-org/gitlab-ce/issues/57317.
2019-03-01 08:45:51 -08:00
Jacob Vosmaer 078f11a6b9 Prepare test suite for switch to Gitaly-embedded Git hooks 2019-02-27 10:58:21 +00:00
Oswaldo Ferreira 1ad699677f Support merge to ref for merge-commit and squash
Adds the ground work for writing into
the merge ref refs/merge-requests/:iid/merge the
merge result between source and target branches of
a MR, without further side-effects such as
mailing, MR updates and target branch changes.
2019-02-25 10:40:58 -03:00
Lin Jen-Shin b502d90a9f Adapt that diverging commits could be just one bar
refactors the ui for diverging commits so that it's only a single
bar instead of two separate bars
2019-02-11 10:44:06 -08:00
John Cai 1f2f38f59a Add client support for count diverging commits
Adds the client call for the gitaly rpc CountDivergingCommits

fixing signature

simplifying commit logic

adding test for max-count

refactoring tests
2019-02-06 22:25:37 -08:00
John Cai 04b9de85a8 Modifying gitaly search files client to add chunking support
updates gitaly proto to 1.7.0, modifies the search files gitaly client
call to use the new chunked_response flag in the rpc request, and stitch
the responses together.

maintains backwards compatibility with older gitaly servers.
2019-02-06 20:32:53 -08:00
Stan Hu 82b6e5378a Send project name with Gitaly repository requests
When hashed storage is in use, it's helpful to have the project
name associated with the request.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1394
2019-02-05 21:33:09 -08:00
Rémy Coutable 3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +01:00
Nick Thomas 067dc6540c
Validate bundle files before unpacking them 2019-01-10 21:33:36 +00:00
Francisco Javier López 5a3e6fdff9
Fixing image lfs bug and also displaying text lfs
This commit, introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23812,
fixes a problem creating a displaying image diff notes when the image
is stored in LFS. The main problem was that `Gitlab::Diff::File` was
returning an invalid valid in `text?` for this kind of files.

It also fixes a rendering problem with other LFS files, like text
ones. They LFS pointer shouldn't be shown when LFS is enabled
for the project, but they were.
2018-12-27 16:51:07 +01:00
Douwe Maan aa7c927e1e Merge branch 'zj-upgrade-gitaly-version' into 'master'
Upgrade Gitaly to 1.9.0

See merge request gitlab-org/gitlab-ce!23865
2018-12-18 13:50:24 +00:00
Zeger-Jan van de Weg 50ce459118
Upgrade Gitaly to 1.9.0
This upgrade moves logic from gitlab-rails to Gitaly, which allowed code
removal too.
2018-12-17 09:26:09 +01:00
Nick Thomas 0b74b86367
Fix repository cleanup with object storage on
When the BFG object map file is in object storage (i.e., uploads in
general are placed into object storage), we get an instance of the
Gitlab::HttpIO class. This doesn't behave as expected when you try to
read past EOF, so we need to explicitly check for this condition to
avoid ending up in a tight loop around io.read
2018-12-15 13:50:59 +00:00
Zeger-Jan van de Weg 896c0bdbfb
Allow public forks to be deduplicated
When a project is forked, the new repository used to be a deep copy of everything
stored on disk by leveraging `git clone`. This works well, and makes isolation
between repository easy. However, the clone is at the start 100% the same as the
origin repository. And in the case of the objects in the object directory, this
is almost always going to be a lot of duplication.

Object Pools are a way to create a third repository that essentially only exists
for its 'objects' subdirectory. This third repository's object directory will be
set as alternate location for objects. This means that in the case an object is
missing in the local repository, git will look in another location. This other
location is the object pool repository.

When Git performs garbage collection, it's smart enough to check the
alternate location. When objects are duplicated, it will allow git to
throw one copy away. This copy is on the local repository, where to pool
remains as is.

These pools have an origin location, which for now will always be a
repository that itself is not a fork. When the root of a fork network is
forked by a user, the fork still clones the full repository. Async, the
pool repository will be created.

Either one of these processes can be done earlier than the other. To
handle this race condition, the Join ObjectPool operation is
idempotent. Given its idempotent, we can schedule it twice, with the
same effect.

To accommodate the holding of state two migrations have been added.
1. Added a state column to the pool_repositories column. This column is
managed by the state machine, allowing for hooks on transitions.
2. pool_repositories now has a source_project_id. This column in
convenient to have for multiple reasons: it has a unique index allowing
the database to handle race conditions when creating a new record. Also,
it's nice to know who the host is. As that's a short link to the fork
networks root.

Object pools are only available for public project, which use hashed
storage and when forking from the root of the fork network. (That is,
the project being forked from itself isn't a fork)

In this commit message I use both ObjectPool and Pool repositories,
which are alike, but different from each other. ObjectPool refers to
whatever is on the disk stored and managed by Gitaly. PoolRepository is
the record in the database.
2018-12-07 19:18:37 +01:00
Nick Thomas 9395d198f9
Use BFG object maps to clean projects 2018-12-06 18:58:00 +00:00
Bob Van Landuyt 67f2faa72d Don't specify `shell` for Gitaly write-ref
Use shelling out to git to write refs instead of rugged, hoping to
avoid creating invalid refs.

To update HEAD we switched to using `git symbolic-ref`.
2018-11-26 16:44:26 +01:00
Douwe Maan 5f0e4040ce
Batch load only data from same repository when lazy object is accessed
By specifying `key`, we get a different lazy batch loader for each
repository, which means that accessing a lazy object from one repository
will only result in that repository's objects being fetched, not those
of other repositories, saving us some unnecessary Gitaly lookups.
2018-11-26 11:15:18 +01:00
Sean McGivern 2bc4a17dec Merge branch 'revert-fd6e3781' into 'master'
Revert "Merge branch 'revert-e2aa2177' into 'master'"

Closes #54267

See merge request gitlab-org/gitlab-ce!23237
2018-11-22 09:50:34 +00:00
Takuya Noguchi e902f462c2 Eliminate duplicated words
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2018-11-22 01:01:23 +09:00
Zeger-Jan van de Weg 16346eb5b9 Revert "Merge branch 'revert-e2aa2177' into 'master'"
This reverts merge request !23229
2018-11-20 12:29:56 +00:00
Sean McGivern 2742b871fe Revert "Merge branch 'zj-improve-gitaly-pb' into 'master'"
This reverts merge request !23140
2018-11-20 10:36:52 +00:00