Commit Graph

1303 Commits

Author SHA1 Message Date
Douglas Barbosa Alexandre 090ca4f7e3 Merge branch 'sh-add-rugged-logs' into 'master'
Add Rugged calls and duration to API and Rails logs

Closes #64676

See merge request gitlab-org/gitlab-ce!30871
2019-07-18 15:43:37 +00:00
Stan Hu 1136c0c8e9 Add Rugged calls and duration to API and Rails logs
This adds `rugged_duration_ms` and `rugged_calls` fields to
`api_json.log` and `production_json.log`. This will make it easier to
identify performance issues caused by excessive I/O.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64676
2019-07-18 06:53:39 -07:00
Nick Thomas 3069cb2545 Merge branch 'webide-commit-use-correct-parent' into 'master'
Use correct parent when committing in WebIDE

See merge request gitlab-org/gitlab-ce!29598
2019-07-18 10:47:35 +00:00
Markus Koller f8cecafb07
Add start_sha to commits API
When passing start_branch on committing from the WebIDE, it's possible
that the branch has changed since editing started, which results in the
change being applied on top of the latest commit in the branch and
overwriting the new changes.

By passing the start_sha instead we can make sure that the change is
applied on top of the commit which the user started editing from.
2019-07-18 09:19:18 +02: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
Mayra Cabrera 0ab89d8e36 Add a rubocop for Rails.logger
Suggests to use a JSON structured log instead

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
2019-07-10 19:26:47 +00: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
Paul Okstad 7e2188a18e Change GetRawChanges RPC to use bytes 2019-06-27 13:35:13 +00: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
Luke Duncalfe dcf811ba14 CE backport for changes in EE MR 14017
This backports to CE changes to allow the EE model
DesignManagement::Repository to override the #attributes_at method to
provide its own git attributes.

The #attributes_at method was freely available, as it's never called by
anything in the app. It looks like the code that called it got
refactored out of existence in ca66a04f. It was still being called in a
spec
85b29c1c2f/spec/services/files/create_service_spec.rb (L40)
which I've left because with the change in Lfs::FileTransformer in fact
is now again the perfect test!

See EE MR
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14017

And these comment threads
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894#note_178002089
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894#note_178049984
2019-06-19 17:51:57 +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
John Cai f86797b5a9 Omit max-count for diverging_commit_counts behind feature flag
We want to optimize the query for the CountDivergingCommits rpc by
removing the --max-count argument now that we have commit graphs
enabled for all repositories during housekeeping. However, we want to
test this first behind a feature flag.
2019-05-14 12:13:19 -05: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
Stan Hu 02ca1577ea Merge branch 'jc-disconnect-git-alternates-client' into 'master'
Add client methods for DisconnectGitAlternates rpc

See merge request gitlab-org/gitlab-ce!27938
2019-05-06 10:54:16 +00:00
Nick Thomas 8973f32d42
Remove cleaned up OIDs from database and cache 2019-05-06 11:35:03 +01:00
Stan Hu f93b2e02a5 Run rubocop -a on CE files 2019-05-05 03:24:28 -07: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
Luke Duncalfe 49cb4b3dfc Add support for two-step Gitaly Rebase RPC
The new two-step Gitaly `Rebase` RPC yields the rebase commit SHA to the
client before proceeding with the rebase.

This avoids an issue where the rebase commit SHA was returned when the
RPC had fully completed, and in some cases this would be after the Rails
`post_receive` worker services had already run. In these situations,
the merge request did not yet have its rebase_commit_sha attribute set
introducing the possibility for bugs (such as previous approvals being
reset).

https://gitlab.com/gitlab-org/gitlab-ee/issues/5966
2019-05-02 17:30:07 +00: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
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 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
Igor 866b58a54e Allow to sort wiki pages by date and title
- Add controls for sorting by title and date
- Execute Gitaly call which now accepts sorting params for wikis
2019-04-04 16:28:56 +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
Jacob Vosmaer 35b9274f12 Stop calling UnlinkRepositoryFromObjectPool RPC
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/59777.

In earlier iterations of our implementation of Git object deduplication
we thought we would be making extensive use of Git remotes in pool
repositories in the future, and that we should manage these remotes
carefully from the start. We now expect we only care about one remote,
namely the source project. The other remotes are there only for forensic
purposes.

Before this MR we tried to also remove pool remotes when member projects
got deleted, with the UnlinkRepositoryFromObjectPool RPC. This is
fragile when there are race conditions (see
https://gitlab.com/gitlab-org/gitaly/issues/1568#note_153955926). We
have spent some time making this RPC less fragile in
https://gitlab.com/gitlab-org/gitaly/merge_requests/1151 but looking at
this problem again, I think we should just stop calling it.
2019-04-02 13:20:26 +00: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
Sean McGivern 2ce68fd3a5 Merge branch '58805-allow-incomplete-commit-data-to-be-fetched-from-collection' into 'master'
Enrich commits with full data in CommitCollection

Closes #58805

See merge request gitlab-org/gitlab-ce!26445
2019-03-26 09:22:14 +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
Sean McGivern a97ec84f05 Revert "Merge branch '58805-allow-incomplete-commit-data-to-be-fetched-from-collection' into 'master'"
This reverts merge request !26144
2019-03-21 10:33:29 +00:00
Sean McGivern 1efa960444 Merge branch '58805-allow-incomplete-commit-data-to-be-fetched-from-collection' into 'master'
Enrich commits with full data in CommitCollection

Closes #58805

See merge request gitlab-org/gitlab-ce!26144
2019-03-21 08:42:33 +00:00
Nick Thomas 9266901e50 Merge branch 'ce-avoid_es_loading_commits' into 'master'
Backport of avoid_es_loading_commits

See merge request gitlab-org/gitlab-ce!26301
2019-03-20 13:10:41 +00:00
Mario de la Ossa e886151669
Backport of avoid_es_loading_commits 2019-03-19 13:24:23 -06:00
Luke Duncalfe 8ef0a9d5ca 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-18 13:03:23 +13:00
Yorick Peterse 31fb547f6c
Backport Gitaly dynamic timeouts from EE
EE added the ability to set timeouts when handling blobs. Since there's
no particular reason for this to be EE specific we can just backport
this to CE.
2019-03-12 11:10:40 +01:00
Stan Hu 4ee08fd1f7 Add back Rugged support for retrieving a commit tree entry
This brings back some of the changes in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20176/diffs.

We discovered another N+1 that hits Gitaly `TreeEntry` via the
`RelativeLinkFilter`:
https://gitlab.com/gitlab-org/gitlab-ce/issues/58657. When a blob is
loaded with many relative links, `TreeEntry` is called for each link to
scan the URI type.

There are multiple paths that hit Gitaly `TreeEntry`, and
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25706 did not
cover all cases. This commit covers another common use case.

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_commit_tree_entry` to
activate the Rugged method.
2019-03-08 16:01:59 -08:00
Sean McGivern b63efb09a5 Merge branch 'sh-rugged-get-tree-entry' into 'master'
Bring back Rugged implementation of TreeEntry

See merge request gitlab-org/gitlab-ce!25706
2019-03-07 15:57:06 +00:00
Stan Hu 46c8cc35a0 Remove unnecessary return statements in tree.rb 2019-03-07 06:33:55 -08:00
Stan Hu 8a68f91229 Fix return nil Rubocop offenses 2019-03-07 05:13:41 -08: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 28883d8e44 Remove old code in TreeHelper#flatten_tree 2019-03-07 04:29: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
Douwe Maan d655ed379f Merge branch 'sh-rugged-commit-is-ancestor' into 'master'
Bring back Rugged implementation of CommitIsAncestor

See merge request gitlab-org/gitlab-ce!25702
2019-03-07 11:36:12 +00:00
Andrew Newdigate 3288e1a874 Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
2019-03-06 17:51:56 +02:00
Patrick Bajao de5aef3bbd Accept force option on commit via API
When `force` is set to `true` and `start_branch` is set, the
branch will be ovewritten with the new commit based on the
`HEAD` of the `start_branch`.

This commit includes changes to update the `gitaly-proto` gem.
2019-03-06 10:44:59 +00:00
Stan Hu 9d294467bd Bring back Rugged implementation of CommitIsAncestor
This brings back some of the changes in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20095.

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_commit_is_ancestor` to activate the Rugged
path.

Part of four Rugged changes identified in
https://gitlab.com/gitlab-org/gitlab-ce/issues/57317.
2019-03-04 12:21:31 -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
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
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
Stan Hu f929411c6d Rename gl_project_name -> gl_project_path
Upgrade gitaly-proto to 1.10.0 to have this field.
2019-02-05 21:33:10 -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
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
Kamil Trzciński f9fd9b1def Merge branch 'zj-pool-destruction' into 'master'
Leave object pools when destroying projects

Closes gitaly#1415

See merge request gitlab-org/gitlab-ce!23869
2018-12-19 13:03:54 +00:00
Zeger-Jan van de Weg 752e9c18a1
Leave object pools when destroying projects
This action doesn't lean on reduplication, so a short call can me made
to the Gitaly server to have the object pool remove its remote to the
project pending deletion.
https://gitlab.com/gitlab-org/gitaly/blob/f6cd55357/internal/git/objectpool/link.go#L58

When an object pool doesn't have members, this would invalidate the need
for a pool. So when a project leaves the pool, the pool will be
destroyed on the background.

Fixes: https://gitlab.com/gitlab-org/gitaly/issues/1415
2018-12-19 13:21:56 +01: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
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 4b7e9eaacd
Treat Repository instances with the same disk path as the same hash key 2018-11-26 11:15:18 +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
Nick Thomas f1bc7b6eb5
SSH public-key authentication for push mirroring 2018-11-19 11:46:39 +00:00
Zeger-Jan van de Weg 35239a6aec
Show what RPC is called in the performance bar
Now only the data was shown of the service, which is not valueable at
times given some of those expose a lot of RPCs.
2018-11-16 12:16:25 +01:00
Stan Hu 6494467a19 Merge branch 'frozen-string-lib-gitlab-even-more' into 'master'
Enable even more frozen string in lib/gitlab

See merge request gitlab-org/gitlab-ce!22959
2018-11-15 19:50:53 +00:00
Oswaldo Ferreira 039df0267e Avoid Gitaly RPC errors when fetching diff stats 2018-11-14 17:33:30 -02:00
gfyoung ebf98f27c4 Enable even more frozen string in lib/gitlab
Enables frozen string for the following:

* lib/gitlab/fogbugz_import/**/*.rb
* lib/gitlab/gfm/**/*.rb
* lib/gitlab/git/**/*.rb
* lib/gitlab/gitaly_client/**/*.rb
* lib/gitlab/gitlab_import/**/*.rb
* lib/gitlab/google_code_import/**/*.rb
* lib/gitlab/gpg/**/*.rb
* lib/gitlab/grape_logging/**/*.rb
* lib/gitlab/graphql/**/*.rb
* lib/gitlab/graphs/**/*.rb
* lib/gitlab/hashed_storage/**/*.rb
* lib/gitlab/health_checks/**/*.rb

Partially address gitlab-org/gitlab-ce#47424.
2018-11-13 11:42:15 -08:00
Bob Van Landuyt 6fbdc5ed52 Apply patches when creating MR via email
This allows users to add patches as attachments to merge request
created via email.

When an email to create a merge request is sent, all the attachments
ending in `.patch` will be applied to the branch specified in the
subject of the email. If the branch did not exist, it will be created
from the HEAD of the repository.

When the patches could not be applied, the error message will be
replied to the user.

The patches can have a maximum combined size of 2MB for now.
2018-11-07 16:27:55 +01:00
Francisco Javier López 28cbb2acfe
Add submodule update API endpoint
This new endpoint allow users to update a submodule's reference.

The MR involves adding a new operation RPC operation in gitaly-proto
(see gitlab-org/gitaly-proto!233) and change Gitaly to use this
new version (see gitlab-org/gitaly!936).

See gitlab-org/gitlab-ce!20949
2018-11-07 14:03:30 +01:00
Nick Thomas 668e5d63fa
Stop Repository#fetch_remote from using Gitlab::Shell
This indirection doesn't provide any value, so remove it
2018-11-06 12:42:00 +00:00
Bob Van Landuyt 81f5955eb6 Move Repository#wrapped_gitaly_errors into concern
Having this in a concern allows us to reuse it for different single
purpose classes that call out to git without going through the
repository every time.
2018-10-30 15:53:46 +01:00
Tiago Botelho 084a8b6101
Adds tracing messages for slow git pushes
Whenever a git push takes more than 50 seconds the user
will receive a trace from each check performed along with
their timings
2018-10-25 10:10:45 +01:00
Alejandro Rodríguez c8ffd8b035 [ci skip] Fix documentation of Gitlab::Git::Diff#filter_diff_options flags 2018-10-17 17:39:16 -03:00
Nick Thomas c5bff77ea4
Remove a dependency on gitlab-gollum-lib
Inlining this code allows us to remove a dependency on gitlab_grit in
gitlab-ce. We can't stop maintaining gitlab_grit yet, since gitaly-ruby
still depends on this gem, but it moves us a step closer.
2018-10-16 12:53:30 +01:00
Nick Thomas c7be9f5cac
Remove a dependency on gitlab-gollum-lib
Removing this dependency also allows us to remove a transitive
dependency on gitlab_grit - which is the whole point of this exercise.

I don't think we can EOL gitlab_grit until it's removed as a dependency
from gitaly-ruby, but this at least gets it out of gitlab-ce.
2018-10-16 12:53:30 +01:00
Douwe Maan 3c15a20ba3 Merge branch 'bvl-merge-base-multiple-revisions' into 'master'
Allow getting the merge base of multiple revisions

Closes #52573

See merge request gitlab-org/gitlab-ce!22295
2018-10-15 16:18:21 +00:00
Zeger-Jan van de Weg 399056ed78 Remove dependencies on Linguist
This saves about 128 MB of baseline RAM usage per Unicorn and
Sidekiq process (!).

Linguist wasn't detecting languages anymore from CE/EE since
9ae8b57467. However, Linguist::BlobHelper
was still being depended on by BlobLike and others.

This removes the Linguist gem, given it isn't required anymore.
EscapeUtils were pulled in as dependency, but given Banzai depends on
it, it is now added explicitly.

Previously, Linguist was used to detect the best ACE mode. Instead,
we rely on ACE to guess the best mode based on the file extension.
2018-10-12 17:17:30 -07:00
Bob Van Landuyt 71d71afb3a Allow getting the merge base of multiple revisions
As we now support getting the merge base for multiple revisions in
gitaly, we can provide this functionality in our API
2018-10-12 11:41:22 +02:00
Zeger-Jan van de Weg 30b4ce940d
Remove Git circuit breaker
Was introduced in the time that GitLab still used NFS, which is not
required anymore in most cases. By removing this, the API it calls will
return empty responses. This interface has to be removed in the next
major release, expected to be 12.0.
2018-10-10 09:08:18 +02:00
Kamil Trzciński 9f9cac67ab Fix CE to EE merge (backport) 2018-10-05 17:39:42 +02:00
Kamil Trzciński 84c4e920cd Merge branch 'master' into 'feature/gb/pipeline-only-except-with-modified-paths'
# Conflicts:
#   app/models/ci/pipeline.rb
2018-10-04 16:52:48 +00:00
Douwe Maan a5cfacc281 Merge branch 'remove-rugged' into 'master'
Remove Gitlab::Git::Repository#rugged

See merge request gitlab-org/gitlab-ce!22039
2018-10-03 09:06:32 +00:00
Alejandro Rodríguez a99bf447a2 Remove Gitlab::Git::Repository#rugged and Gollum code
Cleanup code, and refactor tests that still use Rugged. After this, there should
be no Rugged code that access the instance's repositories on non-test
environments. There is still some rugged code for other tasks like the
repository import task, but since it doesn't access any repository storage path
it can stay.
2018-10-02 16:34:28 -03:00
Douwe Maan 57dc233325 Merge branch 'osw-configurable-single-diff-file-limit' into 'master'
Make single diff patch limit configurable

Closes #48027

See merge request gitlab-org/gitlab-ce!21886
2018-10-02 13:53:32 +00:00
Grzegorz Bizon 1c4187e38e Treat nil git push revisons as a blank Git SHA value 2018-10-02 13:01:55 +02:00
Oswaldo Ferreira 4fbca2a346 Make single diff patch limit configurable
- Creates a new column to hold the single patch limit value on
application_settings
- Allows updating this value through the application_settings API
- Calculates single diff patch collapsing limit based on
diff_max_patch_bytes column
- Updates diff limit documentation
- Adds documentation (with warning) as of how one can update this limit
2018-10-01 11:58:21 -03:00
Tiago Botelho a583f137dd Removes N+1 gitaly rpc call to fetch the last commit for path
Implements list_last_commits_for_tree to communicate with the
ListLastCommitsForTree Gitaly RPC

Bumps the Gitaly server version

Bumps the Gitaly-Proto gem version
2018-10-01 13:29:47 +01:00
Grzegorz Bizon 419d8cc7a2 Calculate modified paths of a git push operation 2018-09-28 15:13:04 +02:00
Grzegorz Bizon 4abba28944 Add specs for extracted git push class 2018-09-28 14:46:22 +02:00
Grzegorz Bizon 76d9e29a65 Extract git push from merge request refresh service 2018-09-28 12:20:51 +02:00
Grzegorz Bizon 3c2d6b4870 Add a class that represents a git push operation 2018-09-28 11:09:55 +02:00
Michael Kozono a54a5d9f39 Use `Gitlab::SafeRequestStore` in more places
Even if it doesn’t save lines of code, since people will tend to use
code they’ve seen. And `SafeRequestStore` is safer since you
don’t have to remember to check `RequestStore.active?`.
2018-09-24 12:11:27 -07:00
Michael Kozono f107bc69e3 Simplify by using Gitlab::SafeRequestStore
These are clear wins.
2018-09-24 12:11:26 -07:00
Oswaldo Ferreira 5dce096cf8 Use standalone diff stats RPC on every comparison view 2018-09-19 12:26:28 +00:00
Douwe Maan a2a00a5e6d Merge branch '51564-fix-commit-email-usage' into 'master'
Respect the user commit email in more places

Closes #51564

See merge request gitlab-org/gitlab-ce!21773
2018-09-18 12:07:52 +00:00
Douwe Maan bff85a4b1c Merge branch 'osw-gitaly-diff-stats-client' into 'master'
Add Gitaly diff stats RPC client

See merge request gitlab-org/gitlab-ce!21732
2018-09-17 16:29:42 +00:00
Oswaldo Ferreira c9d6c02f15 Add Gitaly diff stats RPC client
This adds a basic interface to fetch diff statistics given two SHAs.
It's a requirement for #49399 #20282 and #19232.
2018-09-17 12:27:01 -03:00
Nick Thomas f54cada7b7
Remove Gitlab::Git::Repository#user_to_committer 2018-09-17 14:44:24 +01:00
Nick Thomas fc0194b589 Resolve "Add functionality to change what email address online actions commit using" 2018-09-14 09:52:09 +00:00
Robert Speicher c7d1eef671 Merge branch 'rubocop-code-reuse' into 'master'
Add RuboCop cops to enforce code reusing rules

See merge request gitlab-org/gitlab-ce!21391
2018-09-13 14:53:05 +00:00
Alejandro Rodríguez d3c5b07962 Remove Rugged and shell code from Gitlab::Git 2018-09-12 12:32:32 -03:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Douwe Maan 7f2b287f66 Merge branch 'osw-send-max-patch-bytes-to-gitaly' into 'master'
Send max_patch_bytes to Gitaly via Gitaly::CommitDiffRequest

Closes #50635

See merge request gitlab-org/gitlab-ce!21575
2018-09-07 14:02:17 +00:00
Oswaldo Ferreira 965ff14b6f Send max_patch_bytes to Gitaly via Gitaly::CommitDiffRequest
We used to apply this limitation on GitLab when using Rugged. Now that
we've shifted to Gitaly, this parameter needs to be sent via a RPC
request. Currently this value is hardcoded on Gitaly.
2018-09-06 19:18:27 -03:00
Douglas Barbosa Alexandre 460badd8cc
Add Gitlab::Git::Repository#find_remote_root_ref 2018-09-06 16:01:48 -03:00
Alejandro Rodríguez 4b87d80499 Fix merge requests not showing any diff files for big patches 2018-08-17 13:22:38 -03:00
Douwe Maan 5bf9f5b67b Merge branch 'zj-user-update-branch' into 'master'
Remove feature flags for UserUpdateBranch

Closes gitaly#1246 and gitaly#1310

See merge request gitlab-org/gitlab-ce!21238
2018-08-17 09:00:43 +00:00
Zeger-Jan van de Weg 295e582142
Remove feature flags for UserUpdateBranch
This has been tested on .com. So far no errors have been seen.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1310
Closes https://gitlab.com/gitlab-org/gitaly/issues/1246
2018-08-16 10:24:26 +02:00
Zeger-Jan van de Weg 31749779da
Remove feature flag for FindAllRemoteBranches
Acceptance testing done through:
https://gitlab.com/gitlab-org/gitaly/issues/1312

Relatively short AT period, but given its not a hard RPC, nor anything
funky is going on, I felt that this was decent enough to remove the
feature flag.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1243
2018-08-16 09:42:31 +02:00
Douwe Maan bbbcb9142e Merge branch 'zj-remove-feature-gate-list-commits' into 'master'
Remove feature gate for ListNewCommits

Closes gitaly#1286 and gitaly#1233

See merge request gitlab-org/gitlab-ce!21184
2018-08-14 09:14:23 +00:00
Zeger-Jan van de Weg 5ddc9ad0b9
Remove feature gate for ListNewCommits
Introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20087,
this has been tested on .com now, and is stable.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1286
Closes https://gitlab.com/gitlab-org/gitaly/issues/1233
2018-08-14 10:34:15 +02:00
Bob Van Landuyt 7466df872c Get the `merge-base` of 2 refs trough the API
This adds an endpoint to get the common ancestor of 2 refs from the API.
2018-08-13 11:58:54 +02:00
Rubén Dávila 6688a719c4 Backport of gitlab-org/gitlab-ee!6848 2018-08-08 16:18:37 -05:00
Rubén Dávila 5c748a0bd9 Backport some changes from gitlab-org/gitlab-ee!6767 2018-08-07 06:13:48 -05:00
Alejandro Rodríguez 01de2b5df8 Refactor gitlab:import:repos task to remove direct disk access 2018-07-31 16:28:44 -04:00
Jacob Vosmaer (GitLab) 3f0e6d9205 More Gitaly cleanup: fetch_ref, allow disk access blocks 2018-07-27 08:43:19 +00:00
Stan Hu c8ff6b7c73 Use limit parameter to retrieve Wikis from Gitaly
Without this parameter, every load of a Wiki page will load all the Wiki pages
in the repository for the sidebar. This is a significant performance penalty
that can significant slow the display of all Wiki pages.

Relates to #40101
2018-07-24 15:36:31 -07:00
Zeger-Jan van de Weg ad73953772
Make repository cleanup mandatory 2018-07-24 13:25:27 +02:00
Jacob Vosmaer (GitLab) 4147a2dbbd Annotate Gitlab::Git::Repository#fetch_ref 2018-07-24 06:33:55 +00:00
Alejandro Rodríguez d4c3a9ab41 Remove unused rugged code that is currently on Gitaly 2018-07-20 14:47:50 -04:00
Sean McGivern 256e7a6396 Merge branch 'zj-gitaly-migrate-old-migrations' into 'master'
Gitaly migrate old DB migrations

Closes gitaly#1106

See merge request gitlab-org/gitlab-ce!20708
2018-07-20 10:21:05 +00:00
Alejandro Rodríguez fa1ea656f7 Migrate add_remote, remove_remote, fetch_internal_remote to gitaly 2018-07-19 15:07:37 -04:00
Jacob Vosmaer (GitLab) 805de7fb8d Add missing Gitaly branch_update nil checks 2018-07-19 17:48:58 +00:00
Zeger-Jan van de Weg cfbb256b8b
MigrateProcessCommitWorkerJobs to use Gitaly
This old migration used Rugged to find a commit, while Gitaly is the
prefered way now. By migrating this to Gitaly, Gitaly is now a required
running component for this migration.

Part of https://gitlab.com/gitlab-org/gitaly/issues/1106
2018-07-19 13:34:10 +02:00
Alejandro Rodríguez 68b1e5a97c Incorporate Gitaly's RefService.FindAllRemoteBranches RPC 2018-07-18 16:48:47 -04:00
Zeger-Jan van de Weg 9348efc6ba
Client implementation for Repository#new_commits
After trying to remove the whole method in
8f69014af2902d8d53fe931268bec60f6858f160, this is a more gentle
approach to the method. :)

Prior to this change, new commit detection wasn't implemented in Gitaly,
this was done through: https://gitlab.com/gitlab-org/gitaly/merge_requests/779

As the new implemented got moved around a bit, the whole RevList class
got removed.

Part of https://gitlab.com/gitlab-org/gitaly/issues/1233
2018-07-18 14:46:27 +02:00
Jacob Vosmaer (GitLab) 5c651daa97 Remove unreachable Git code 2018-07-18 11:12:57 +00:00
Jacob Vosmaer (GitLab) 830940f422 Migrate merge base, merged branches, write ref 2018-07-17 09:00:32 +00:00
Jacob Vosmaer (GitLab) 37eca76583 Remove Repository#lookup and unreachable rugged code 2018-07-16 10:34:31 +00:00
Yorick Peterse 9451c80ac9 Merge branch 'sh-fix-stderr-pipe-consumption' into 'master'
Avoid process deadlock in popen by consuming input pipes

Closes gitlab-ee#6895

See merge request gitlab-org/gitlab-ce!20600
2018-07-13 13:14:34 +00:00
Stan Hu fd392cd725 Avoid process deadlock in popen by consuming input pipes
A process that spews a lot of output to stderr or stdout could stall out
due to the pipe buffer being full. As described in https://bugs.ruby-lang.org/issues/9082,
we can use the trick used in Ruby's capture3 function to read the pipes in separate
threads.

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/6895
2018-07-12 16:21:30 -07:00
Jacob Vosmaer 9d93a61a70 Fix find_branch call sites 2018-07-12 18:06:31 +02:00
Jacob Vosmaer d1d7144b96 Make more ref RPC's mandatory 2018-07-12 15:12:00 +02:00
Jacob Vosmaer (GitLab) 62ffad0802 Remove Repository#path memoization 2018-07-12 09:49:25 +00:00
Jacob Vosmaer 723f74d49d Remove last flags from Blob and Workhorse 2018-07-11 12:59:15 +02:00
Rémy Coutable 7358211ece Merge branch '49057-fix-repository-typo' into 'master'
Fix a typo in Gitlab::Git::Repository

See merge request gitlab-org/gitlab-ce!20520
2018-07-10 13:32:20 +00:00
Douwe Maan 937d916b5f Merge branch 'gitaly-mandatory-20180709-jv' into 'master'
Use Gitaly for fetches and creating bundles

Closes gitaly#387, gitaly#874, gitaly#750, and gitaly#665

See merge request gitlab-org/gitlab-ce!20490
2018-07-10 10:22:05 +00:00
Lin Jen-Shin 1f28f4567b Fix a typo? gitaly_operation{-s-}_client 2018-07-10 16:52:34 +08:00
Sean McGivern 2a4039cf66 Merge branch 'update-rubocop' 2018-07-09 17:23:30 +01:00
Robert Speicher 2cedb243ee Merge branch 'gitaly-update-branch' into 'master'
Use Gitaly's OperationService.UserUpdateBranch RPC

Closes gitaly#1252

See merge request gitlab-org/gitlab-ce!20231
2018-07-09 16:12:18 +00:00
Lin Jen-Shin 9286f5b934 Use stable gitlab-styles and eliminate offenses 2018-07-09 21:13:08 +08:00
Lin Jen-Shin 4ee08b77bc Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
Jacob Vosmaer a4e75e7a83 Use Gitaly for fetches and creating bundles 2018-07-09 12:50:17 +02:00
Jacob Vosmaer (GitLab) 3082b7d1c2 Make blob and other RPC's mandatory 2018-07-09 10:02:02 +00:00
Douwe Maan 090f4d9e9f Merge branch 'gitaly-mandatory-20180706-jv' into 'master'
Remove gitaly_list_commits_by_oid, gitaly_commit_deltas, gitaly_create_repository flags

Closes gitaly#593, gitaly#566, and gitaly#670

See merge request gitlab-org/gitlab-ce!20432
2018-07-09 09:59:51 +00:00
Grzegorz Bizon 1a78483b49 Merge branch 'gitaly-diff-mandatory' into 'master'
Make all Gitaly diff flags mandatory

Closes gitaly#528 and gitaly#222

See merge request gitlab-org/gitlab-ce!20424
2018-07-09 09:42:30 +00:00
Alejandro Rodríguez 4a4338fcc6 Use Gitaly's OperationService.UserUpdateBranch RPC 2018-07-08 23:27:20 -04:00
Nick Thomas 7a17f8d85d Merge branch 'gitaly-set-delete-config' into 'master'
Add Repository#set_config and #delete_config

See merge request gitlab-org/gitlab-ce!20372
2018-07-06 15:55:10 +00:00
Jacob Vosmaer c770d2f96e Make more things mandatory 2018-07-06 14:44:54 +02:00
Jacob Vosmaer ff112ce641 Add Repository#set_config and #delete_config 2018-07-06 12:06:54 +02:00
Jacob Vosmaer b012abee8b Make all Gitaly diff flags mandatory 2018-07-06 12:01:15 +02:00
Jacob Vosmaer 9f8326995c Partially rever "Revert "Merge branch 'gitaly-mandatory-20180703-jv' into 'master'""
This partially reverts commit 64dfe2cba1.
2018-07-06 11:43:01 +02:00
Jacob Vosmaer (GitLab) 64dfe2cba1 Revert "Merge branch 'gitaly-mandatory-20180703-jv' into 'master'"
This reverts merge request !20339
2018-07-05 10:22:04 +00:00
Sean McGivern 7a355f6856 Merge branch 'gitaly-mandatory-20180703-jv-2' into 'master'
Remove more Gitaly feature flags

Closes gitaly#329, gitaly#320, gitaly#323, and gitaly#328

See merge request gitlab-org/gitlab-ce!20343
2018-07-04 10:39:59 +00:00
Jacob Vosmaer (GitLab) 78708b1932 Make more Gitaly features mandatory 2018-07-04 07:39:59 +00:00
Jacob Vosmaer 201802f723 Remove more feature flags 2018-07-03 17:39:08 +02:00
Jacob Vosmaer (GitLab) 15aadc665f Make OperationService RPC's mandatory 2018-07-03 09:12:03 +00:00
Douwe Maan e28896ce0d Merge branch 'zj-find-all-commits' into 'master'
FindAllCommits mandatory

Closes gitaly#326

See merge request gitlab-org/gitlab-ce!20242
2018-06-28 13:11:00 +00:00
Douwe Maan 37b1922237 Merge branch 'zj-commits-between-mandatory' into 'master'
Commits between in Gitaly only

Closes gitaly#315

See merge request gitlab-org/gitlab-ce!20239
2018-06-28 13:10:07 +00:00
Zeger-Jan van de Weg ec78d29a6e
FindAllCommits mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/326
2018-06-28 13:42:10 +02:00
Zeger-Jan van de Weg f369da063f
Commits between in Gitaly only
Prior to this change, most the commits counted were done through Gitaly.
This removes the last point where this wasn't the case.

This makes the `rugged_count_commits` method obsolete, with its tests.

Closes https://gitlab.com/gitlab-org/gitaly/issues/315
2018-06-28 12:09:20 +02:00
Douwe Maan e38db19659 Merge branch 'gitaly-mandatory-20180627-jv-2' into 'master'
Make Gitaly signature RPC's mandatory

Closes gitaly#745, gitaly#1044, and gitaly#876

See merge request gitlab-org/gitlab-ce!20212
2018-06-28 07:45:31 +00:00
Jacob Vosmaer f4d6834786 Make Gitaly signature RPC's mandatory 2018-06-27 14:32:09 +02:00
Jacob Vosmaer be5e6d586f Make search and message RPC's mandatory 2018-06-27 13:46:51 +02:00
Sean McGivern 2452f1a73e Merge branch 'gitaly-tree-entry-dot-dot' into 'master'
Client-side fix for Gitaly TreeEntry bug

See merge request gitlab-org/gitlab-ce!20176
2018-06-27 09:04:34 +00:00
Jacob Vosmaer 33c950f293 Client-side fix for Gitaly TreeEntry bug 2018-06-26 14:12:08 +02:00
Alejandro Rodríguez c6ff7bfaec Move git calls for `Repository#update_branch` inside Gitlab::Git
This prepares this code for migration to Gitaly.
2018-06-25 19:49:55 -04:00
Douwe Maan 77fe416681 Merge branch 'zj-create-from-bundle-mandatory' into 'master'
Moves CreateFromBundle RPC to mandatory

Closes gitaly#944

See merge request gitlab-org/gitlab-ce!20144
2018-06-25 15:29:57 +00:00
Douwe Maan fe03ff90c2 Merge branch 'zj-is-anchestor' into 'master'
Ancestor check is Gitaly only now

Closes gitaly#789 and gitaly#308

See merge request gitlab-org/gitlab-ce!20095
2018-06-25 15:28:19 +00:00
Douwe Maan 246ce5b5f9 Merge branch 'zj-write-config' into 'master'
Write Config is mandatory

Closes gitaly#879

See merge request gitlab-org/gitlab-ce!20146
2018-06-25 15:27:41 +00:00
Douwe Maan 51f047aaad Merge branch 'zj-missing-part-linguist' into 'master'
Remove Languages feature gate

See merge request gitlab-org/gitlab-ce!20128
2018-06-25 15:23:25 +00:00
Zeger-Jan van de Weg 29b4d657be
Moves another RPC to mandatory
This specific one isn't used on most machines, therefor low risk.

Closes https://gitlab.com/gitlab-org/gitaly/issues/944
2018-06-25 15:55:22 +02:00
Zeger-Jan van de Weg 8354ae3cef
Update remote happens through Gitaly only
This change makes closes another migration! And remotes tests around it,
mostly due to stubbing this was needed. Also, these are tested on the
Gitaly side too:
- https://gitlab.com/gitlab-org/gitaly/issues/791
-
6dd74543f6/internal/service/repository/fetch_remote_test.go

Closes https://gitlab.com/gitlab-org/gitaly/issues/789
2018-06-25 15:47:42 +02:00
Zeger-Jan van de Weg 0855478726
Write Config is mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/879
2018-06-25 15:08:20 +02:00
Zeger-Jan van de Weg af20d7816e
Remove feature gate 2018-06-25 13:51:06 +02:00
Zeger-Jan van de Weg e91b2b5dff
Gitaly tree entry is mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/310
2018-06-25 13:48:28 +02:00
Zeger-Jan van de Weg 9d438edb34
Anchestor check is Gitaly only now
Closes https://gitlab.com/gitlab-org/gitaly/issues/308
2018-06-25 09:25:15 +02:00
Douwe Maan 70bc866563 Merge branch 'zj-commit-raw-diffs' into 'master'
Raw diffs are served from Gitaly

Closes gitaly#222

See merge request gitlab-org/gitlab-ce!20091
2018-06-22 16:00:02 +00:00
Robert Speicher 254e589de9 Merge branch 'rs-lib-gitlab-git-gitlab_projects-parity' into 'master'
CE-EE parity for lib/gitlab/git/gitlab_projects.rb

See merge request gitlab-org/gitlab-ce!20047
2018-06-22 15:25:36 +00:00
Douwe Maan 510e45fd1e Merge branch 'zj-find-ref-name' into 'master'
FindRefName RPC now mandatory

Closes gitaly#221

See merge request gitlab-org/gitlab-ce!20090
2018-06-22 13:35:49 +00:00
Zeger-Jan van de Weg 417a21a123
Raw diffs are served from Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/222
2018-06-22 13:40:38 +02:00
Zeger-Jan van de Weg 4e9491f7bb
Repository size is Gitaly only
Closes https://gitlab.com/gitlab-org/gitaly/issues/393
2018-06-22 11:53:18 +02:00
Zeger-Jan van de Weg 21c4ffe36f
FindRefName RPC now mandatory
Has never been in OPT_OUT, dispite being ages old. The time where
feature flags are still set by env vars.

Closes https://gitlab.com/gitlab-org/gitaly/issues/221
2018-06-22 11:41:07 +02:00
Zeger-Jan van de Weg 3247f47c8d
Git ls files is Gitaly only now
Moved to the front on the line through: https://gitlab.com/gitlab-org/gitlab-ce/issues/47893

Closes: https://gitlab.com/gitlab-org/gitlab-ce/issues/47893
Closes: https://gitlab.com/gitlab-org/gitaly/issues/327
2018-06-22 11:14:34 +02:00
Zeger-Jan van de Weg 2ac672280b
Raw changes calculation is Gitaly only now
Closes https://gitlab.com/gitlab-org/gitaly/issues/1138
2018-06-21 10:12:51 +02:00
Robert Speicher f87e702ece
CE-EE parity for lib/gitlab/git/gitlab_projects.rb 2018-06-20 15:08:11 -05:00
Mark Chao 937bd9e386 Fix possiblilty of branch not found
This now can happen because can_be_merged? is called
during MR merge_status transition to cannot_be_merged.
It is possible branch_name is invalid.
2018-06-20 23:38:13 +08:00
Douwe Maan a5245fd8b8 Merge branch 'zj-can-be-merged' into 'master'
Move mergablility check to Gitaly

Closes gitaly#889

See merge request gitlab-org/gitlab-ce!20019
2018-06-20 14:15:28 +00:00
Sean McGivern b60415c2b7 Merge branch '48105-git-version-detection-using-gitaly' into 'master'
Move git version detection to gitaly for usage ping data

Closes #48105 and charts/gitlab#530

See merge request gitlab-org/gitlab-ce!19993
2018-06-20 09:00:32 +00:00
Douwe Maan c67d8c2478 Merge branch 'zj-lfs-pointers' into 'master'
LFS changes are detected by Gitaly

Closes gitaly#935

See merge request gitlab-org/gitlab-ce!19995
2018-06-20 08:29:47 +00:00
Zeger-Jan van de Weg 46b56b18f5
Move mergablility check to Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/889
2018-06-20 09:11:55 +02:00
Douwe Maan c0f0ccf222 Merge branch 'zj-force-push-opt-out' into 'master'
Force push is handled by Gitaly now

Closes gitaly#348

See merge request gitlab-org/gitlab-ce!19992
2018-06-19 14:19:18 +00:00
Zeger-Jan van de Weg 64cda7746c
LFS changes are detected by Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/935
2018-06-19 15:59:27 +02:00
Zeger-Jan van de Weg c2cdefd441
Force push is handled by Gitaly now
Closes gitlab-org/gitaly#348
2018-06-19 15:35:17 +02:00
Balasankar "Balu" C 5607c57c41 Use gitaly to figure out git version for usage ping 2018-06-19 18:39:47 +05:30
Douwe Maan b0fadeee83 Merge branch 'zj-counting-commits' into 'master'
Counting commits is done by Gitaly

Closes gitaly#382

See merge request gitlab-org/gitlab-ce!19983
2018-06-19 12:45:49 +00:00
Douwe Maan 51334904f5 Merge branch 'zj-gitaly-squash' into 'master'
Rebase and Squash in progress are Gitaly only

Closes gitaly#865 and gitaly#1018

See merge request gitlab-org/gitlab-ce!19987
2018-06-19 09:56:33 +00:00
Douwe Maan 14dda26b25 Merge branch 'zj-info-attributes' into 'master'
Move info attributes to mandatory

Closes gitaly#1082

See merge request gitlab-org/gitlab-ce!19988
2018-06-19 09:55:48 +00:00
Douwe Maan 9e82c32b31 Merge branch 'zj-commit-count' into 'master'
Move count commit to mandatory

Closes gitaly#330

See merge request gitlab-org/gitlab-ce!19984
2018-06-19 09:55:38 +00:00
Zeger-Jan van de Weg c24e39ab88
Counting commits is done by Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/382
2018-06-19 10:37:51 +02:00
Zeger-Jan van de Weg 012948b849
Move info attributes to mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/1082
2018-06-19 10:02:12 +02:00
Zeger-Jan van de Weg 5053dc84b0
Rebase and Squash in progress are Gitaly only
Closes https://gitlab.com/gitlab-org/gitaly/issues/865
Closes https://gitlab.com/gitlab-org/gitaly/issues/1018
2018-06-19 09:41:09 +02:00
Zeger-Jan van de Weg da8419a1ba
License detection happens soley through Gitaly now
Migration: https://gitlab.com/gitlab-org/gitaly/issues/1026

Conflicts:
	lib/gitlab/git/repository.rb
2018-06-19 09:35:15 +02:00
Zeger-Jan van de Weg 6e25935f73
Move count commit to mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/330
2018-06-19 09:24:46 +02:00
Jacob Vosmaer (GitLab) 14000a561b Make Gitaly wiki RPC's mandatory 2018-06-18 08:19:11 +00:00
Zeger-Jan van de Weg 15f0cef1d0
Local branches go through Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/217
2018-06-14 10:44:33 +02:00
Zeger-Jan van de Weg 3ed4a1b3aa
HasLocalBranches check is done by Gitaly only
Closes https://gitlab.com/gitlab-org/gitaly/issues/217
2018-06-14 10:31:24 +02:00
Zeger-Jan van de Weg 89ab32c6b2
Branches are fully migrated to Gitaly
Closes: https://gitlab.com/gitlab-org/gitaly/issues/389
2018-06-14 10:25:28 +02:00
Zeger-Jan van de Weg 143a632ebe
Tags are migrated to Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/390
2018-06-14 10:18:45 +02:00
Zeger-Jan van de Weg 36d75be393
Move TagNames to mandatory through Gitaly
Closes: https://gitlab.com/gitlab-org/gitaly/issues/220
2018-06-14 10:13:15 +02:00
Zeger-Jan van de Weg 89095530bc
Tag names returned through Gitaly
Migration: https://gitlab.com/gitlab-org/gitaly/issues/220
2018-06-14 10:00:47 +02:00
Zeger-Jan van de Weg 4fc4600747
Default branch detection happens through Gitaly
Migration: https://gitlab.com/gitlab-org/gitaly/issues/220
2018-06-14 09:56:16 +02:00
Zeger-Jan van de Weg f195a7436d
RawBlame only called through Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/376
2018-06-13 16:44:59 +02:00
Sean McGivern 4666ef683c Merge branch 'zj-compare-source-branch' into 'master'
Migrate compare_source_branch to use only Gitaly

Closes gitaly#771

See merge request gitlab-org/gitlab-ce!19700
2018-06-13 08:26:00 +00:00
Douwe Maan 8b0d2283d7 Merge branch 'gitaly-disk-access-3' into 'master'
Find and mark more Git disk access locations, part 2

See merge request gitlab-org/gitlab-ce!19437
2018-06-12 13:32:46 +00:00
Jacob Vosmaer f376347f24 Find and mark more Git disk access locations, part 2 2018-06-12 14:33:37 +02:00
Zeger-Jan van de Weg d65db552af
Migrate compare_source_branch to use only Gitaly
Initially expected this to be a full blown migration, but that wasn't
the case as we could fetch to a reference that would be deleted after
the instanciation of the Diff object.

This is a racy RPC, as #delete_refs is called and garbage collections
runs right than, the commit can't be found later.

Closes https://gitlab.com/gitlab-org/gitaly/issues/771
2018-06-12 12:48:09 +02:00
Jacob Vosmaer (GitLab) 8749641838 Move Gitaly branch/tag/ref RPC's to opt-out 2018-06-12 09:24:05 +00:00
Jacob Vosmaer (GitLab) ea8dc10772 Don't use Gitlab::Utils.nlbr in Gitlab::Git 2018-06-11 10:42:09 +00:00
Jacob Vosmaer (GitLab) ab40c7e3c8 Move gitaly_blame, gitaly_count_commits, gitaly_commit_count to opt-out 2018-06-11 10:39:23 +00:00
Jacob Vosmaer 2120391441 Remove Gitlab::Popen dependency from lib/gitlab/git 2018-06-08 11:16:21 +02:00
Rubén Dávila c5d4f10b80 Pass the --in-commit-order arg to `git-rev-list`
@jamedjo has found a good improvement in the performance of the LFS
integrity check by passing this arg
2018-06-07 12:09:45 -05:00
Francisco Javier López ea2bd9cb4f Add git filter flag only if it is supported 2018-06-07 15:49:01 +00:00
Francisco Javier López 86d39016a2
Moving rev-list lfs options to Lfschanges 2018-06-06 21:55:32 +02:00
Francisco Javier López e8f49b4bee Support LFS objects when creating a project by import 2018-06-06 16:42:18 +00:00
Jacob Vosmaer e7ef91339e Simplify server feature flags 2018-06-06 11:20:41 +02:00
Zeger-Jan van de Weg f131757fc8 Set Gitaly Server feature flags from Rails
Gitaly itself hold very little state, other than the data on disk. This
limits the interfaces to set feature flags. Gitaly now has the ability
to interpret the request metadata to check for feature flags.
https://gitlab.com/gitlab-org/gitaly/merge_requests/704
This allows clients control on the Gitaly server, and given that Rails
has an internal chatops interface to set these values this was chosen as
solution.

Known limitation right now, is that this package doesn't support the opt
out that other Gitaly features do.
2018-06-06 11:20:41 +02:00
Nick Thomas 65dbead796
Fix repository archive generation when hashed storage is enabled 2018-06-05 20:44:07 +01:00
Jacob Vosmaer (GitLab) a0808df0b6 Find and mark more Git disk access locations 2018-06-05 15:51:14 +00:00
Jacob Vosmaer (GitLab) 3a4ecfd0c9 Prevent Gitaly WriteConfig log noise 2018-06-05 12:55:41 +00:00
Jacob Vosmaer (GitLab) edb9db37ed Add "deny disk access" Gitaly feature (tripswitch) 2018-06-01 11:56:29 +00:00
Douwe Maan d6d7abb1d0 Merge branch 'gitaly-repo-squash-in-progress-opt-out' into 'master'
Make Repo#squash_in_progress Opt-Out

See merge request gitlab-org/gitlab-ce!19088
2018-05-23 09:52:11 +00:00
Douwe Maan 91f3930cc1 Merge branch 'gitaly-wiki-get-formatted-data-opt-out' into 'master'
Move Wiki::GetFormattedData to OptOut

See merge request gitlab-org/gitlab-ce!19091
2018-05-23 09:51:37 +00:00
Douwe Maan 68b5cd71e0 Merge branch 'gitaly-import-project-opt-out' into 'master'
Move ImportProject to OptOut in Gitaly

See merge request gitlab-org/gitlab-ce!19090
2018-05-23 09:50:54 +00:00
Kim Carlbäcker f0ef31a114 Move Repository#info_attributes to OptOut in gitaly 2018-05-22 16:05:02 +00:00
Kim Carlbäcker cb2a541027 Move Wiki::GetFormattedData to OptOut 2018-05-22 15:58:36 +00:00
Kim Carlbäcker 2a781f7f5b Move ImportProject to OptOut in Gitaly 2018-05-22 15:52:54 +00:00
Kim Carlbäcker 536b32c8fa Make Repo#squash_in_progress Opt-Out 2018-05-22 15:44:42 +00:00
Grzegorz Bizon b113330fab Merge branch 'zj-workhorse-archive-mandatory' into 'master'
Move git archives downloading to Gitaly

See merge request gitlab-org/gitlab-ce!18990
2018-05-21 07:08:58 +00:00
Grzegorz Bizon ad9e00917f Merge branch 'xeodon/gitlab-ce-fix/45743-master-fix-gitaly-delete-refs' into 'master'
Fix error when deleting an empty list of refs

Closes #45743

See merge request gitlab-org/gitlab-ce!19053
2018-05-19 05:42:16 +00:00
Sergey Sinev 100c687cbc Fix error when deleting an empty list of refs
Closes #45743
2018-05-18 20:47:46 -07:00
Stan Hu 95dacabe4b Merge branch '46498-do-not-modify-strings' into 'master'
Resolve "Blob#batch can't handle frozen string paths"

Closes #46498

See merge request gitlab-org/gitlab-ce!19039
2018-05-19 00:03:49 +00:00
Robert Speicher 076ab2e8e0 Merge branch 'fix/handle-large-commit-tag-message' into 'master'
Add handling for commit/tags with big messages

See merge request gitlab-org/gitlab-ce!17892
2018-05-18 19:28:25 +00:00
Ahmad Sherif 019f5e2469 Add handling for commit/tags with big messages 2018-05-18 20:51:10 +02:00
Robert Speicher ee59fdf566 Merge branch 'gitaly-1182-search-by-content-name' into 'master'
Migrate Repo#search_by_{content,name}  to Gitaly

See merge request gitlab-org/gitlab-ce!18750
2018-05-18 18:28:32 +00:00
Nick Thomas 8bacfbd1cc Merge branch 'zj-calculate-checksum-mandator' into 'master'
Calculating repository checksums executed by Gitaly

Closes gitaly#1105 and #46293

See merge request gitlab-org/gitlab-ce!18907
2018-05-18 15:53:35 +00:00
Nick Thomas 73903ae884
Fix a RuntimeError: cannot modify frozen string 2018-05-18 15:19:58 +01:00
Zeger-Jan van de Weg 18a8eb96b3
Calculating repository checksums executed by Gitaly
OPT_OUT status has been removed, and alternative implementation removed.
Also checks if the repository exists before executing the checksum RPC
to guard against NotFound errors.

Closes gitlab-org/gitaly#1105
2018-05-18 16:07:29 +02:00
Kim "BKC" Carlbäcker 61a5994db6 Migrate RepositoryService#SearchFilesBy{Content,Name} 2018-05-18 12:51:28 +02:00
Grzegorz Bizon 48877dfc7e Merge branch 'zj-workhorse-commit-patch-diff' into 'master'
Workhorse to send raw diff and patch for commits

Closes gitaly#1196

See merge request gitlab-org/gitlab-ce!18974
2018-05-17 08:12:33 +00:00
Zeger-Jan van de Weg 94b209b32c
Move git archives downloading to Gitaly 2018-05-17 09:31:50 +02:00
Douwe Maan f05ff2d93d Merge branch 'zj-add-branch-mandatory' into 'master'
Move Gitlab::Git::Repository#add_branch to mandatory

Closes gitaly#540

See merge request gitlab-org/gitlab-ce!18939
2018-05-16 11:15:15 +00:00
Zeger-Jan van de Weg dfdd881510
Workhorse to send raw diff and patch for commits
Prior to this change, this was done through unicorn. In theory this
could time out. Workhorse has been sending these raw patches and diffs
for a long time and is stable in doing so.

Added bonus is the fact that `Commit#to_patch` can be removed.

`Commit#to_diff` too, which closes
https://gitlab.com/gitlab-org/gitaly/issues/324

Closes https://gitlab.com/gitlab-org/gitaly/issues/1196
2018-05-16 11:52:43 +02:00
Zeger-Jan van de Weg 7fc185ab25
Ref contains oid check done by Gitaly
These two endpoints are in opt-out, and no one noticed. Has been running
on .com for 4 months now and considered stable.

Closes https://gitlab.com/gitlab-org/gitaly/issues/884
2018-05-14 15:55:27 +02:00
Zeger-Jan van de Weg e012485a99
Move Gitlab::Git::Repository#add_branch to mandatory
Prior to this change, a feature flag could be used to disable this
feature. Now all requests go through Gitaly's OperationService.

Closes https://gitlab.com/gitlab-org/gitaly/issues/540

When vendoring `Gitlab::Git` again in Gitaly, this implemenation will be
gone, but this is readded there through:
https://gitlab.com/gitlab-org/gitaly/merge_requests/717
2018-05-14 12:18:23 +02:00
Robert Speicher 40683268b2 Merge branch 'rd-remove-duplicate-method' into 'master'
Remove duplicate method

See merge request gitlab-org/gitlab-ce!18886
2018-05-11 18:15:44 +00:00
Zeger-Jan van de Weg 4cf3a6094a
Wiki Find Page to opt_out
Closes https://gitlab.com/gitlab-org/gitaly/issues/894
2018-05-11 09:30:08 +02:00
Rubén Dávila 0a0d4912f5 Remove duplicate method 2018-05-10 15:25:17 -05:00
Douwe Maan 05a6e2b866 Merge branch 'backport-rd-5566-improve-performance-of-repository-size-limit-check' into 'master'
Backport some changes from gitlab-ee!5476

See merge request gitlab-org/gitlab-ce!18760
2018-05-10 09:29:55 +00:00
Rubén Dávila 5b584a0fd2 Backport some changes from gitlab-ee!5476
The lib/gitlab/git/repository.rb needs to have the same content between
gitlab-ce and gitlab-ee in order to have Gitaly working fine.
2018-05-09 13:20:28 -05:00
Robert Speicher ce793073d7 Merge branch 'zj-remove-rugged-call' into 'master'
Remove rugged call in blame controller

See merge request gitlab-org/gitlab-ce!18817
2018-05-09 16:07:21 +00:00
Zeger-Jan van de Weg 4f15460d2c
Remove rugged call in blame controller
Fetching commits through #lookup uses rugged, and this is phased out.

Also adds a short circuit in the `feature_enabled?` Gitaly method to
allow Gitaly to be used when objects are set up with `let` before an
example is run.
2018-05-08 17:18:31 +02:00
Douglas Barbosa Alexandre 17258b37c8
Raise InvalidRepository error for non-valid git repositories 2018-05-07 14:22:16 -03:00
Zeger-Jan van de Weg 713c7fa9a5
Client implementation GetRawChanges
Part of https://gitlab.com/gitlab-org/gitaly/issues/1138
2018-05-07 15:37:49 +02:00
Kim Carlbäcker 8cbabe43be Update repository.rb 2018-05-04 11:27:08 +00:00
Kim Carlbäcker 3fe555a751 Add note about rebase/squash duplication in Gitaly 2018-05-04 10:45:20 +00:00
Douwe Maan 639cf5617f Merge branch 'zj-fork-opt-out' into 'master'
Forking repositories is handled by Gitaly by default

See merge request gitlab-org/gitlab-ce!18679
2018-05-03 08:12:04 +00:00
Robert Speicher 6b93fafb56 Merge branch 'zj-repo-checksum-opt-out' into 'master'
Compute repository checksum by default

Closes gitaly#1146

See merge request gitlab-org/gitlab-ce!18648
2018-05-02 18:45:29 +00:00
Zeger-Jan van de Weg 2bbfa4cc66
Forking repositories is handled by Gitaly by default
Initial Rails implementation was introduced in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16018, and
acceptance testing was done in
https://gitlab.com/gitlab-org/gitaly/issues/881

Part of https://gitlab.com/gitlab-org/gitaly/issues/817
2018-05-02 18:29:39 +02:00
Douwe Maan 3fcb9c115d Merge branch 'zj-fix-index-rails' into 'master'
Use Ruby methods, not Rails' String#first

See merge request gitlab-org/gitlab-ce!18669
2018-05-01 10:16:18 +00:00
Zeger-Jan van de Weg 5e75d37705
Use Ruby methods, not Rails' String#first
Gitaly-Ruby is not a Rails application, which made the method not exist
after the vendor. This patch uses direct indexing, which has the same
properties that `#first` has.

Found while working on: https://gitlab.com/gitlab-org/gitaly/merge_requests/699
2018-05-01 10:49:58 +02:00
Douwe Maan 9cf4e47341 Merge branch 'security-45689-fix-archive-cache-bug' into 'security-10-7'
Serve archive requests with the correct file in all cases (10.7)

See merge request gitlab/gitlabhq!2376
2018-04-30 15:00:14 -05:00
Douwe Maan 660a902891 Merge branch 'zj-remove-repo-path-remote-repository' into 'master'
Remove legacy storage path call

See merge request gitlab-org/gitlab-ce!18598
2018-04-30 10:17:09 +00:00
Zeger-Jan van de Weg 27d2f407fb
Compute repository checksum by default
Acceptance testing was done in:
https://gitlab.com/gitlab-org/gitaly/issues/1146. Errors were limited to
NotFound errors, as the repository really doesn't exists.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1146

Optimistically moved https://gitlab.com/gitlab-org/gitaly/issues/1105 to
opt out on the Gitaly migration board.
2018-04-30 09:16:00 +02:00
Zeger-Jan van de Weg 7d23a2bfdf
Remove legacy storage path call
Storage shards should only be used, the exact paths are the
responsibilty of Gitaly. This will create deprecation warning, and in
this instance the path is initialized, but never used so it could be
removed.
2018-04-30 09:02:23 +02:00
Zeger-Jan van de Weg 5cd57cf250
Repository#exists? can only be queried with Gitaly
Has been in opt out for 5 months, and within GitLab been in production
for longer than that.

No code needs to be migrated as this is implemented in GoLang over at
Gitaly.

Closes https://gitlab.com/gitlab-org/gitaly/issues/314
2018-04-25 14:51:04 +02:00
Francisco Javier López c921e686b8 Moved committer and spec. Added some extra code to run hooks or not depending on the options 2018-04-23 10:56:46 +00:00
Nick Thomas 672733aa66
Add an API endpoint to download git repository snapshots 2018-04-19 17:25:01 +01:00
Francisco Javier López e8a27a67fa Fix Custom hooks are not triggered by UI wiki edit 2018-04-18 17:50:56 +00:00
🙈 jacopo beschi 🙉 c6b1043e9d Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
Douwe Maan 019e881d44 Merge branch 'zj-uri-type-empty' into 'master'
Return nil on empty path

Closes gitaly#1115

See merge request gitlab-org/gitlab-ce!18430
2018-04-18 08:20:21 +00:00
Nick Thomas b3ed751c0e Merge branch 'zj-ref-exists-opt-out' into 'master'
Move Gitaly RefExists check to OPT_OUT

Closes gitaly#401

See merge request gitlab-org/gitlab-ce!18333
2018-04-17 17:37:08 +00:00
Zeger-Jan van de Weg e02f1271f5
Return nil on empty path
The execution path wasn't clear from the error, but either way this is a
fix.

Closes gitlab-org/gitaly#1115
2018-04-17 16:30:18 +02:00
Stan Hu cf955af157 Move uncached_has_local_branches? to a private method 2018-04-14 15:38:53 -07:00
Stan Hu 74e5ec198c Fix failing ./spec/lib/backup/repository_spec.rb by clearing the memoized value 2018-04-14 15:36:36 -07:00
Stan Hu b1f15dfa42 Memoize Git::Repository#has_visible_content?
This is called repeatedly when viewing a merge request, and this should
improve performance significantly by avoiding shelling out to git every time.

This should help https://gitlab.com/gitlab-com/infrastructure/issues/4027.
2018-04-14 14:37:28 -07:00
Jacob Vosmaer (GitLab) 0c357db3a4 Remove bogus '|' symbol 2018-04-13 13:16:07 +00:00
Douwe Maan ac149be040 Merge branch 'zj-storage-path-deprecation' into 'master'
Deprecate legacy disk paths

See merge request gitlab-org/gitlab-ce!18332
2018-04-13 08:16:39 +00:00
Zeger-Jan van de Weg a752c56ca8
Deprecate legacy disk paths
Direct disk access is impossible on environments where components run in
their own container. There for constructing the path should not be done
except for exceptional cases.

One of the considerations, instead of logging, was to use Sentry. For
now I've chosen not to use this as the impact of this change is hard to
determine. Getting this in now will allow us to checkout the impact on
dev.gitlab.org and staging.
2018-04-12 15:23:36 +02:00
Douwe Maan db6854b2cd Merge branch 'backport-of-rd-3429-enabling-maximum-file-size-limit-in-repository-causes-pushes-to-fail' into 'master'
Backport of EE !4989

See merge request gitlab-org/gitlab-ce!18238
2018-04-12 08:46:36 +00:00
Zeger-Jan van de Weg 5173bc8a4c
Move Gitaly RefExists check to OPT_OUT
Part of the Gitaly migration as tracked in: https://gitlab.com/gitlab-org/gitaly/issues/401

Acceptance testing was done in: https://gitlab.com/gitlab-org/gitaly/issues/1014
2018-04-12 10:22:04 +02:00
Rubén Dávila d28b1dfc46 Backport of EE !4989 2018-04-11 22:05:07 -05:00
Douwe Maan b2f57a561f Merge branch 'zj-info-attributes' into 'master'
Client implementation for InfoAttributes

See merge request gitlab-org/gitlab-ce!18261
2018-04-11 12:58:52 +00:00
Zeger-Jan van de Weg c830b8e3b7
Client implementation for InfoAttributes
Clients can now request the attributes from `$GIT_DIR/info/attributes`
through Gitaly. The Gitaly migration is described in gitlab-org/gitaly#1082.

The parser algorithm was implemented in a way it could handle both file
contents or a File handle, and both were already tested.

Other than that, using the boy scout rule, I've removed a class,
InfoAttributes, as it was delegating everything to the parser and
therefor wasn't really needed in my opinion.
2018-04-11 14:21:27 +02:00
Rémy Coutable 2a7d011afd Merge branch 'zj-branch-containing-sha-opt-out' into 'master'
Branch with a commit detection defaults to Gitaly

See merge request gitlab-org/gitlab-ce!18304
2018-04-11 09:53:38 +00:00
Zeger-Jan van de Weg bbbe40eae5
Tag with a commit detection defaults to Gitaly
By default this was an OPT_IN RPC, and now graduates to OPT_OUT as the
acceptance testing was successful in:
gitaly#1009

This follows the conventions of our [migration
process](https://gitlab.com/gitlab-org/gitaly/blob/master/doc/MIGRATION_PROCESS.md)
2018-04-11 09:31:11 +02:00
Zeger-Jan van de Weg 4d3f0998e0
Branch with a commit detection defaults to Gitaly
By default this was an OPT_IN RPC, and now graduates to OPT_OUT as the
acceptance testing was successful in:
https://gitlab.com/gitlab-org/gitaly/issues/1008

This follows the conventions of our [migration
process](https://gitlab.com/gitlab-org/gitaly/blob/master/doc/MIGRATION_PROCESS.md)
2018-04-11 09:13:02 +02:00
Grzegorz Bizon a2a6a5cab6 Merge branch 'zj-find-license-opt-out' into 'master'
Move FindLicense RPC to OPT OUT status

See merge request gitlab-org/gitlab-ce!18228
2018-04-09 09:32:58 +00:00
Stan Hu 151d87e4a0 Merge branch 'da-gitaly-calculate-repository-checksum' into 'master'
Repository checksum calculation is handled by Gitaly when feature is enabled

See merge request gitlab-org/gitlab-ce!18210
2018-04-06 21:32:42 +00:00
Rémy Coutable 9e8f3058af Merge branch 'fix-500-error-when-mr-ref-is-not-yet-fetched' into 'master'
Fix 500 error when MR from fork has conflicts but worker has not run

See merge request gitlab-org/gitlab-ce!18226
2018-04-06 16:38:41 +00:00
Douglas Barbosa Alexandre 76cd2d7881
Move checksum calculation to Gitlab::Git::Repository 2018-04-06 13:25:07 -03:00
Douglas Barbosa Alexandre 13992ac92e
Checksum calculation is handled by Gitaly when feature is enabled 2018-04-06 13:23:23 -03:00
Stan Hu a18eea8c32 Automatically cleanup stale worktrees and lock files upon a push
git 2.16 will fail badly if there are stale worktrees.

Closes #44115
2018-04-06 08:17:07 -07:00
Douwe Maan 44f4a674e2 Merge branch 'jramsay-38830-tarball' into 'master'
Add alternative archive route

Closes #38830

See merge request gitlab-org/gitlab-ce!17225
2018-04-06 14:14:39 +00:00
Zeger-Jan van de Weg 4ca00b52cd
Move FindLicense RPC to OPT OUT status
Acceptance testing was successful in
https://gitlab.com/gitlab-org/gitaly/issues/1058. So this is moved to
OPT OUT.

Part of https://gitlab.com/gitlab-org/gitaly/issues/1026
2018-04-06 16:13:01 +02:00
James Ramsay 07f517d441 Add new repository archive route
Repository archives are always named `<project>-<ref>-<sha>` even if
the ref is a commit. A consequence of always including the sha even
for tags is that packaging a release is more difficult because both
the ref and sha must be known by the packager.

- add `<project>/-/archive/<ref>/<filename>.<format>` route using the
`-` separator to prevent namespace collisions. If the filename is
`<project>-<ref>` or the ref is a sha, the sha will be omitted,
otherwise the default filename will be used.
- deprecate previous archive route `repository/<ref>/archive`
2018-04-06 08:45:17 -04:00
Sean McGivern 30bca22d08 Fix 500 error when MR from fork has conflicts but worker has not run
If the ref hasn't been fetched into the target repository yet, this will fail
with a Rugged::ReferencError (assuming we're not using Gitaly). We should handle
this in the same way as a missing ref.
2018-04-06 12:16:51 +01:00
Sean McGivern dda326f1d3 Merge branch 'ce-4474-custom-additional-text-in-confirmation-email' into 'master'
Add custom additional text to emails -- CE backport

Closes gitlab-ee#4474

See merge request gitlab-org/gitlab-ce!18183
2018-04-05 10:20:15 +00:00
Sean McGivern 4ef3e835cf Merge branch 'zj-opt-out-list-commits-by-oid' into 'master'
Move ListCommitsByOid to OPT_OUT

See merge request gitlab-org/gitlab-ce!18175
2018-04-05 08:48:06 +00:00
James Ramsay 0b1b9c409d Add option to suppress archive commit sha
Repository archives are always named `<project>-<ref>-<sha>` even if
the ref is a commit. A consequence of always including the sha even
for tags is that packaging a release is more difficult because both
the ref and sha must be known by the packager.

- add append_sha option (defaults true) to provide a method for
toggling this feature.

Support added to GitLab Workhorse by gitlab-org/gitlab-workhorse!232
2018-04-04 16:56:18 -04:00
Eric Eastwood a6c7d8050e Add custom additonal email text to all emails
Fix https://gitlab.com/gitlab-org/gitlab-ee/issues/4474

Conflicts:
	db/schema.rb
	ee/app/controllers/ee/admin/application_settings_controller.rb
	ee/app/helpers/ee/application_settings_helper.rb
	ee/app/models/ee/application_setting.rb
	ee/app/models/license.rb
	ee/app/views/layouts/service_desk.html.haml
	ee/app/views/notify/approved_merge_request_email.html.haml
	ee/app/views/notify/service_desk_new_note_email.text.erb
	ee/app/views/notify/service_desk_thank_you_email.text.erb
	ee/app/views/notify/unapproved_merge_request_email.html.haml
	ee/lib/ee/api/entities.rb
	ee/spec/controllers/admin/application_settings_controller_spec.rb
	ee/spec/models/application_setting_spec.rb
	ee/spec/requests/api/settings_spec.rb
	lib/api/settings.rb
	spec/mailers/previews/notify_preview.rb
2018-04-04 12:29:03 -05:00
Zeger-Jan van de Weg 39cc4a9202
Bulk deleting refs is handled by Gitaly by default
Has been stable for a while in production, so this endpoint grew out if
OPT_IN, the default state.

Part of https://gitlab.com/gitlab-org/gitaly/issues/526
2018-04-04 18:03:24 +02:00
Zeger-Jan van de Weg 2ba0118505
Move ListCommitsByOid to OPT_OUT
Acceptence testing was successfull in
[#844](https://gitlab.com/gitlab-org/gitaly/issues/844)

Part of gitlab-org/gitaly#670
2018-04-04 16:41:43 +02:00
Sean McGivern c353426650 Merge branch 'fix/use-shard-name-in-gitlab-projects-instead-of-shard-path' into 'master'
Use shard name in Git::GitlabProjects instead of shard path

Closes gitaly#1110

See merge request gitlab-org/gitlab-ce!18015
2018-04-04 09:20:19 +00:00
Douglas Barbosa Alexandre 563d38e81e
Backport Gitlab::Git::Checksum to CE 2018-04-03 15:36:43 -03:00
Ahmad Sherif ddfc661f79 Use shard name in Git::GitlabProjects instead of shard path
Closes gitaly#1110
2018-04-03 16:22:13 +02:00
Stan Hu 6fd1d07cfc Handle CR-LFs properly in .gitmodules file
Any submodule lines that had a CR-LF ending would be ignored by the parser.

Closes gitlab-org/gitlab-ce#2262
2018-03-30 15:23:44 -07:00
Jacob Vosmaer (GitLab) b942462788 Remove support for absolute dirs from Git::Env 2018-03-30 09:19:46 +00:00
Sean McGivern c113b70057 Merge branch 'dm-refs-contains-sha-encoding' into 'master'
Fix listing commit branch/tags that contain special characters

Closes #43212

See merge request gitlab-org/gitlab-ce!18023
2018-03-28 09:02:09 +00:00
Douwe Maan 39c911eaaa Fix listing commit branch/tags that contain special characters 2018-03-27 18:20:08 +02:00
Sean McGivern 70af1e2e03 Fix 500 error when trying to resolve non-ASCII conflicts in editor
When we added caching, this meant that calling `can_be_resolved_in_ui?` didn't
always call `lines`, which meant that we didn't get the benefit of the
side-effect from that, where it forced the conflict data itself to UTF-8.

To fix that, make this explicit by separating the `raw_content` (any encoding)
from the `content` (which is either UTF-8, or an exception is raised).
2018-03-23 18:33:14 +00:00
Sean McGivern bb9d360c0a Merge branch 'mark-legacy-git-access' into 'master'
Route path lookups through legacy_disk_path

See merge request gitlab-org/gitlab-ce!17743
2018-03-23 10:20:45 +00:00
Kamil Trzciński be0ce05c5d Merge branch 'ci-pipeline-commit-lookup' into 'master'
Use porcelain commit lookup method on CI::CreatePipelineService

Closes charts/helm.gitlab.io#291

See merge request gitlab-org/gitlab-ce!17911
2018-03-22 21:09:19 +00:00
Alejandro Rodríguez 04b8e00feb Use porcelain commit lookup method on CI::CreatePipelineService
Before we were using a "plumbing" Gitlab::Git method that does not go
through Gitaly migration checking.
2018-03-22 11:39:20 -03:00
Jacob Vosmaer 008a6a6ce6 Route path lookups through legacy_disk_path 2018-03-21 18:18:32 +01:00
Ahmad Sherif d0a1da526e Remove calls to clear_cache from Git::Wiki
They were probably added to compensate for tests shortcomings, but now
they don't complain.

Closes gitaly#1095
2018-03-21 18:08:09 +01:00
Sean McGivern 8ccf7f328d Merge branch '44280-fix-code-search' into 'master'
Resolve "Search code blob sometimes shows filename and branch"

Closes #44280

See merge request gitlab-org/gitlab-ce!17777
2018-03-20 08:47:45 +00:00
Jasper Maes d17d3ec7f7 Split repository search result on \n instead of $ to prevent the items of the array to start with a newline. Remove the strip from parsing the search result to keep result endlines. 2018-03-19 19:09:31 +01:00
James Edwards-Jones c1e3942122 Extract constant for LfsPointerFile::VERSION_LINE 2018-03-16 13:35:03 +00:00
James Edwards-Jones 9d32fccfa7 Avoid printing data for LfsPointerFile#inspect 2018-03-15 21:49:02 +00:00
James Edwards-Jones ca66a04ffe Lfs::FileTranformer caches .gitattributes parser
Prevents `.gitattributes` blob lookup being repeated for every file checked at a given ref
2018-03-15 21:49:01 +00:00
Nick Thomas 91ff0eaa13
Respect the configured git path for imported gitlab-shell operations 2018-03-12 16:03:00 +00:00
Douwe Maan 47b9854dac Merge branch 'gitaly-fsck-mandatory' into 'master'
Make 'git fsck' mandatory

See merge request gitlab-org/gitlab-ce!17648
2018-03-08 22:21:04 +00:00
Kim "BKC" Carlbäcker 3ddde75a1b Make 'git fsck' mandatory 2018-03-08 16:27:31 +01:00
Jacob Vosmaer f45c66e5b0 Remove duplicate method definitions 2018-03-08 12:50:42 +01:00
Robert Speicher 3da9cb6929 Merge branch 'fix/reduce-number-of-find-commit-for-log-tree' into 'master'
Reduce number of FindCommit calls from RefsController#logs_tree

Closes gitaly#1057

See merge request gitlab-org/gitlab-ce!17566
2018-03-07 17:53:16 +00:00
Zeger-Jan van de Weg 0136bbbb89
Move OperationService#UserRemoveBranch
Part of: gitlab-org/gitaly#476
2018-03-07 14:52:57 +01:00
Zeger-Jan van de Weg 790d5147e3
Move OperationService#UserCreateBranch
Part of: gitlab-org/gitaly#476
2018-03-07 14:52:57 +01:00
Zeger-Jan van de Weg 113d9d6475
Move CommitService#Languages to OPT_OUT
Part of: gitlab-org/gitlab-ce!17561
2018-03-07 14:52:57 +01:00
Zeger-Jan van de Weg e0931b3af1
Move RefService#CreateBranch to OPT_OUT
Part of: gitlab-org/gitaly#540
2018-03-07 14:52:57 +01:00
Zeger-Jan van de Weg 4604e2c6db
Move RefService#DeleteBranch to OPT_OUT
Part of: gitlab-org/gitaly#546
2018-03-07 14:52:57 +01:00
Zeger-Jan van de Weg 1985300134
Move OperationService#UserRevert to OPT_OUT
Part of: gitlab-org/gitaly#779
2018-03-07 14:52:56 +01:00
Zeger-Jan van de Weg 718011748a
Move OperationService#UserAddTag to OPT_OUT
Part of: gitlab-org/gitaly#541
2018-03-07 14:52:56 +01:00
Zeger-Jan van de Weg 635d5bf2a2
Move CommitService::CommitPatch to OPT_OUT
Part of gitlab-org/gitaly#324
2018-03-07 14:52:56 +01:00
Zeger-Jan van de Weg 2cdbfef109
Move Repository#HasLocalBranches to OPT_OUT
Part of gitlab-org/gitaly#616
2018-03-07 08:47:53 +01:00
Nick Thomas 0649a1f835 Merge branch 'sh-make-prune-optional-in-git-fetch' into 'master'
Make --prune a configurable parameter in fetching a git remote

See merge request gitlab-org/gitlab-ce!17346
2018-03-07 02:02:24 +00:00
Ahmad Sherif 37162a5fa6 Reduce number of FindCommit calls from RefsController#logs_tree
Fixes gitaly#1057

The old code was calling LastCommitForPath to extract a commit ID _then_
call FindCommit to get a commit it already had in the first place!
2018-03-06 15:27:03 +01:00
Rémy Coutable af84ccbd82 Merge branch '40187-project-branch-dashboard-with-active-stale-branches' into 'master'
Add overview of branches and filtered views for active/stale branches

Closes #40187 et #17293

See merge request gitlab-org/gitlab-ce!15402
2018-03-06 13:14:10 +00:00
Takuya Noguchi 580d895363 Add overview of branches and a filter for active/stale branches 2018-03-06 21:28:14 +09:00
Stan Hu e9fad3e501 Make --prune a configurable parameter in fetching a git remote
By default, --prune is added to the command-line of a `git fetch` operation,
but for repositories with many references this can take a long time to run. We
shouldn't need to run --prune the first time we fetch a new repository.
2018-03-06 00:10:04 -08:00
Douwe Maan 0736197f63 Merge branch 'gitaly-lfs-changes' into 'master'
Incorporate Gitaly's RPCs for Gitlab::Git::LfsChanges

Closes gitaly#1048

See merge request gitlab-org/gitlab-ce!16973
2018-03-05 15:43:26 +00:00
Douwe Maan 899967fbd8 Merge branch 'feature/add-support-for-all-option-in-count-find-commits' into 'master'
Add support for :all option to {count,find}_commits

See merge request gitlab-org/gitlab-ce!17464
2018-03-05 15:41:49 +00:00
Alejandro Rodríguez 0a4ee10eda Fix n+1 issue by not reloading fully loaded blobs 2018-03-05 11:14:43 -03:00
Alejandro Rodríguez a0a7b551ae Incorporate Gitaly's RPCs for Gitlab::Git::LfsChanges 2018-03-02 17:12:08 -03:00
Ahmad Sherif cd770946c4 Add support for :all option to {count,find}_commits 2018-03-02 14:55:20 +01:00
Sean McGivern 40c61acb6a Merge branch 'feature/fetch-commit-signs-from-gitaly-in-batch' into 'master'
Fetch commit signatures from Gitaly in batches

Closes gitaly#1046

See merge request gitlab-org/gitlab-ce!17456
2018-03-02 11:16:20 +00:00
Ahmad Sherif 03f3350f3f Fetch commit signatures from Gitaly in batches
Closes gitaly#1046
2018-03-01 18:31:31 +01:00
Sean McGivern 52e133d176 Merge branch 'zj-licensee-key' into 'master'
Client implementation for Licensee#key

See merge request gitlab-org/gitlab-ce!17449
2018-03-01 17:10:39 +00:00
Douwe Maan de454de9b1 Merge branch '42434-allow-commits-endpoint-to-work-over-all-commits' into 'master'
Resolve "Allow API method /projects/:id/repository/commits  to work over all commits"

Closes #42434

See merge request gitlab-org/gitlab-ce!17182
2018-03-01 15:54:43 +00:00
Zeger-Jan van de Weg 34fbade4ae
Client implementation for Licensee#key
Part of the migration as tracked in: gitlab-org/gitaly#1026
2018-03-01 16:41:08 +01:00
Tiago Botelho cd9daf644e Add specs 2018-03-01 14:38:35 +00:00
Kim Carlbäcker 17b91050ba Re-enable the remaning Wiki Gitaly-Endpoints 2018-02-28 13:23:26 +00:00
Robert Speicher e0195f3369 Merge branch 'feature/migrate-recursive-tree-entries-fetching' into 'master'
Migrate recursive tree entries fetching to Gitaly

See merge request gitlab-org/gitlab-ce!17191
2018-02-26 16:26:28 +00:00
Ahmad Sherif c370f53cb6 Migrate recursive tree entries fetching to Gitaly 2018-02-26 16:59:29 +01:00
Sean McGivern e351f67874 Suppress whitespace warnings in squash error messages
These are obscuring the real error, which is confusing for everyone.
2018-02-26 09:08:17 +00:00
Tiago Botelho 442a6e8800 API method /projects/:id/repository/commits now works over every commit 2018-02-23 10:09:46 +00:00
Grzegorz Bizon eb421c88ee Merge branch 'fix-squash-with-renamed-files' into 'master'
Fix squash with renamed files

Closes gitlab-ee#4975

See merge request gitlab-org/gitlab-ce!17216
2018-02-22 11:35:34 +00:00
Douwe Maan e503efa320 Merge branch 'zj-branch-contains-git-message' into 'master'
Allow branchnames to be named the same as the commit it points to

See merge request gitlab-org/gitlab-ce!17231
2018-02-22 11:34:03 +00:00
Grzegorz Bizon 15196f9269 Merge branch 'ce-gitaly-squash-in-progress' into 'master'
[CE] Incorporate Gitaly's RepositoryService.IsSquashInProgress RPC

See merge request gitlab-org/gitlab-ce!17002
2018-02-22 08:03:15 +00:00
Alejandro Rodríguez acc0e25de7 Incorporate Gitaly's RepositoryService.IsSquashInProgress RPC 2018-02-21 17:35:31 -03:00
Zeger-Jan van de Weg e70fe78281
Handle branch and tag names which are commit ids
Adds a test where a branch name is also a valid commit id. Git, the
binary should create an error message which is difficult to parse and
leading to errors later, as seen in: gitlab-org/gitlab-ce#43222

To catch these cases in the future,
gitlab-test@1942eed5cc108b19c7405106e81fa96125d0be22 was created. Which
a branch name matching the commit
2018-02-21 19:08:26 +01:00
Sean McGivern 01f5035bfe Fix squash with renamed files
We need to ignore the names for renamed files when configuring with sparse
checkout.
2018-02-19 15:11:10 +00:00
Sean McGivern 0b032daa11 Merge branch '32564-fix-double-system-closing-notes' into 'master'
Resolve "Double closing system  notes when closing issue with Merge Request"

Closes #32546 and #32564

See merge request gitlab-org/gitlab-ce!17035
2018-02-19 11:50:28 +00:00
Sean McGivern 23dd313d76 Convert Gitaly commit parent IDs to array as early as possible
The tracking issue if this causes problems is
https://gitlab.com/gitlab-org/gitaly/issues/1028
2018-02-19 11:21:23 +00:00
Stan Hu 8d32dfef9b Fix squash rebase not working when diff contained encoded data
When the applied diff contains UTF-8 or some other encoded data, the diff
returned back from the git process may be in ASCII-8BIT format. Writing this
data to stdin may fail if the data because stdin expects this data to be in
UTF-8. By switching the output to binmode, we ensure that the diff will
always be written as-is.

Closes gitlab-org/gitlab-ee#4960
2018-02-18 21:48:49 -08:00
Micaël Bergeron af5cd10e00 applying feedback
#	modified:   lib/gitlab/git/commit.rb
2018-02-16 13:51:19 -05:00
Micaël Bergeron f949255461 fix specs 2018-02-16 13:51:19 -05:00
Ahmad Sherif 8cdb3477b0 Remove allow_n_plus_1 from Git::Repository#branches_filter 2018-02-08 19:20:46 +01:00
Ahmad Sherif dabc703a29 Migrate Git::Blob.batch to Gitaly
Closes gitaly#985
2018-02-08 00:26:45 +01:00
Francisco Javier López d40912bb49 Removing gitaly flags 2018-02-07 16:33:12 +00:00
Sean McGivern 683984f2e3 Merge branch 'zj-refs-hash' into 'master'
Don't use rugged in Repository#refs_hash

Closes gitaly#880

See merge request gitlab-org/gitlab-ce!16827
2018-02-07 15:42:55 +00:00
Zeger-Jan van de Weg 73e78c4e15
Don't use rugged in Repository#refs_hash
The refs hash is used to determine what branches and tags have a commit
as head in the network graph. The previous implementation depended on
Rugged#references. The problem with this implementation was that it
depended on rugged, but also that it iterated over all references and
thus loading more data than needed if for example the project uses CI/CD
environments, Pipelines, or Merge Requests.

Given only refs are checked the network cares about the GraphHelper#refs
method has no need to reject those, simplifying the method.

Closes gitlab-org/gitaly#880
2018-02-07 15:07:03 +01:00
Stan Hu bc59a5d0a5 Merge branch 'dm-git-hook-popen' into 'master'
Only set cwd on the newly spawned process, instead of the current one

See merge request gitlab-org/gitlab-ce!16958
2018-02-06 19:17:22 +00:00