Commit Graph

978 Commits

Author SHA1 Message Date
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
Douwe Maan 81b5ce1152 Only set cwd on the newly spawned process, instead of the current one 2018-02-06 12:19:48 -06:00
Douwe Maan 7095c2bf40 Merge branch '42730-close-rugged-repository' into 'master'
Resolve "ProjectCacheWorker leaks file descriptors"

Closes #42730

See merge request gitlab-org/gitlab-ce!16930
2018-02-06 17:49:00 +00:00
Douwe Maan a480ee184b Merge branch 'zj/gitlab-ce-zj-wiki-page-versions' 2018-02-06 11:41:09 -06:00
Robert Speicher 245d937514 Merge branch 'gitaly-lfs-client-prep' into 'master'
Refactor Gitlab::Git code related to LFS changes for Gitaly migration

Closes gitaly#980

See merge request gitlab-org/gitlab-ce!16835
2018-02-06 17:35:08 +00:00
Bastian Blank 285d5d526b Close low level rugged repository in project cache worker
Signed-off-by: Bastian Blank <waldi@debian.org>
2018-02-06 16:36:35 +00:00
Sean McGivern f81306e76f Merge branch 'jej/upload-file-tracks-lfs' into 'master'
File upload UI obeys LFS filter

Closes #29876

See merge request gitlab-org/gitlab-ce!16412
2018-02-06 16:24:54 +00:00
Douwe Maan 5db5a9cbd1 Merge branch 'master' into 'zj-wiki-page-versions'
# Conflicts:
#   Gemfile
#   Gemfile.lock
2018-02-06 16:08:06 +00:00
James Edwards-Jones d2a77094ae File upload UI obeys LFS filters
Uses Lfs::FileModificationHandler to coordinate LFS detection, creation of LfsObject, etc

Caveats:
 1. This isn't used by the multi-file editor / Web IDE
 2. This isn't used on rename. We'd need to be able to download LFS files
    and add them to the commit if they no longer match so not as simple.
 3. We only check the root .gitattributes file, so this should be improved
    to correctly check for nested .gitattributes files in subfolders.
2018-02-06 15:26:25 +00:00
Francisco Javier López 27c08a1689 Allow moving wiki pages from the UI 2018-02-05 17:17:21 +00:00
Rémy Coutable f5990e444a Merge branch 'gitaly-user-squash' into 'master'
Incorporate OperationService.UserSquash Gitaly RPC

Closes gitaly#991

See merge request gitlab-org/gitlab-ce!16899
2018-02-05 10:32:20 +00:00
Douwe Maan 295ff65d62 Merge branch 'zj-ref-contains' into 'master'
Client changes for Tag,BranchNamesContainingCommit

See merge request gitlab-org/gitlab-ce!16789
2018-02-04 11:31:49 +00:00
Alejandro Rodríguez e60bf2f256 Incorporate OperationService.UserSquash Gitaly RPC 2018-02-02 19:02:40 -03:00
Alejandro Rodríguez 98affa75ed Refactor Gitlab::Git code related to LFS changes for Gitaly migration
We stop relying on Gitlab::Git::Env for the RevList class, and use
Gitlab::Git::Repository#run_git methods inteaad. The refactor also fixes
another issue, since we now top using "path_to_repo" (which is a
Repository model method).
2018-02-02 16:27:01 -03:00
Douwe Maan 26debb120e Merge branch 'master' into 'zj-ref-contains'
# Conflicts:
#   lib/gitlab/git/repository.rb
2018-02-01 20:22:04 +00:00
Alejandro Rodríguez 658749ddd3 Fix an issue where sparse checkout wasn't configured correctly
This was affecting the performance of `Gitlab::Git::Repository#squash`.
2018-02-01 17:07:40 -03:00
Robert Speicher 2793e3e1cc Merge branch 'gitaly-970-repo-write-config' into 'master'
Migrate Gitlab::Git::Repository#write_config to Gitaly

Closes gitaly#970

See merge request gitlab-org/gitlab-ce!16730
2018-02-01 19:46:32 +00:00
Zeger-Jan van de Weg fd46d6ceb8
Remove intermediate methods on Branch and Tag classes 2018-02-01 13:00:38 +01:00
Zeger-Jan van de Weg 0a47d1924d
Client changes for Tag,BranchNamesContainingCommit
As part of gitlab-org/gitaly#884, this commit contains the client
implementation for both TagNamesContaintingCommit and
BranchNamesContainingCommit. The interface in the Repository model stays
the same, but the implementation on the serverside, e.g. Gitaly, uses
`for-each-ref`, as opposed to `branch` or `tag` which both aren't
plumbing command. The result stays the same.

On the serverside, we have the opportunity to limit the number of names
to return. However, this is not supported on the front end yet. My
proposal to use this ability: gitlab-org/gitlab-ce#42581. For now, this
ability is not used as that would change more behaviours on a feature
flag which might lead to unexpected changes on page refresh for example.
2018-02-01 13:00:33 +01:00
Rémy Coutable 76b9f1a4c5 Merge branch '42497-rubocop-style-regexpliteral' into 'master'
Enable Style/RegexpLiteral cop

Closes #42497

See merge request gitlab-org/gitlab-ce!16752
2018-02-01 09:11:09 +00:00
Douwe Maan 283c0a9d28 Merge branch 'repository-log-disable-walk' into 'master'
Remove Rugged::Walk implementation of #log

See merge request gitlab-org/gitlab-ce!16798
2018-01-31 21:54:02 +00:00
Takuya Noguchi 2b6307f6ad Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
Kim "BKC" Carlbäcker 28bbb4cb47 Migrate Gitlab::Git::Repository#write_config to Gitaly
- Add tests for Repository#write_config
2018-01-31 15:02:31 +01:00
Sean McGivern a0fc0fcc53 Merge branch 'rugged-reference-cache-rescue' into 'master'
Stop rescuing Rugged::Reference in Repository cache

See merge request gitlab-org/gitlab-ce!16770
2018-01-31 14:00:37 +00:00
Grzegorz Bizon dacd9dbef4 Merge branch 'fix/move-can-be-merged-to-lib-git' into 'master'
Move Repository#can_be_merged? to Gitlab::Git::Repository

Closes #42544

See merge request gitlab-org/gitlab-ce!16771
2018-01-31 11:02:09 +00:00
Jacob Vosmaer afe665d9c0 Remove Rugged::Walk implementation of #log 2018-01-31 11:56:36 +01:00
Ahmad Sherif 1ebb781f6a Migrate Git::Repository#delete_refs to Gitaly
Closes gitaly#967
2018-01-30 23:48:51 +01:00
Robert Speicher 95b4f7ea37 Merge branch 'feature/migrate-wiki-page-formatted-data-to-gitaly' into 'master'
Migrate fetching wiki page formatted content to Gitaly

Closes gitaly#958

See merge request gitlab-org/gitlab-ce!16716
2018-01-30 20:47:23 +00:00
Douwe Maan 40e128730f Merge branch 'gitaly-784-repo-write-ref' into 'master'
Migrate Git::Repository#write_ref to Gitaly

Closes gitaly#784

See merge request gitlab-org/gitlab-ce!16513
2018-01-30 18:48:56 +00:00
Ahmad Sherif 11191f938c Move Repository#can_be_merged? to Gitlab::Git::Repository
Fixes #42544
2018-01-30 19:05:34 +01:00
Jacob Vosmaer a6dbb85e97 Remove Rugged exception in cache rescue 2018-01-30 17:51:56 +01:00
Jacob Vosmaer (GitLab) 5c2fe2d3d7 Decouple more of Repository from Rugged 2018-01-30 16:21:55 +00:00
Ahmad Sherif fa9d47f221 Migrate fetching wiki page formatted content to Gitaly
Closes gitaly#958
2018-01-30 17:19:39 +01:00
Kim "BKC" Carlbäcker 10fb904d63 Migrate Git::Repository#write_ref to Gitaly 2018-01-30 12:22:31 +01:00
Jacob Vosmaer (GitLab) e407c2d18f Don't allow Repository#log with limit zero 2018-01-29 15:27:46 +00:00
Jacob Vosmaer (GitLab) 3f79376c76 Set alternate object directories in run_git 2018-01-29 08:51:25 +00:00
Robert Speicher af95ba2fb4 Merge branch 'feature/migrate-repo-restorer-to-gitaly' into 'master'
Migrate restoring repo from bundle to Gitaly

Closes gitaly#946

See merge request gitlab-org/gitlab-ce!16623
2018-01-25 19:03:51 +00:00
Rémy Coutable 26c4dea7ad Merge branch 'lint-rugged' into 'master'
Add a lint check to restrict use of Rugged

See merge request gitlab-org/gitlab-ce!16656
2018-01-25 17:52:01 +00:00
Rémy Coutable 5c68c839c0 Merge branch 'contrain-run-git' into 'master'
Make Gitlab::Git::Repository#run_git private

See merge request gitlab-org/gitlab-ce!16622
2018-01-25 16:17:02 +00:00
Grzegorz Bizon 9df130ff22 Merge branch 'fix/batch-lfs-pointers-accepting-lazy-enum' into 'master'
Fix .batch_lfs_pointers accepting a lazy enumerator

See merge request gitlab-org/gitlab-ce!16701
2018-01-25 14:28:48 +00:00
Jacob Vosmaer (GitLab) 9e6ce87727 Make Gitaly RepositoryExists opt-out 2018-01-25 13:59:35 +00:00
Ahmad Sherif 07b0beb004 Fix .batch_lfs_pointers accepting a lazy enumerator 2018-01-25 14:11:27 +01:00
Jacob Vosmaer 6d6f7536bd Look for rugged with static analysis 2018-01-25 14:05:11 +01:00
Douwe Maan eab9ffeff6 Merge branch 'revert-430b3f0e' into 'master'
Revert "Merge branch 'remove-rugged-walk' into 'master'"

See merge request gitlab-org/gitlab-ce!16676
2018-01-25 11:15:07 +00:00
Rémy Coutable d2bf53942f Merge branch 'jej/gitattributes-check-at-ref' into 'master'
Can parse root .gitattributes file for a ref

See merge request gitlab-org/gitlab-ce!16418
2018-01-25 11:01:36 +00:00
Jacob Vosmaer (GitLab) 7363aa0b9d Revert "Merge branch 'remove-rugged-walk' into 'master'"
This reverts merge request !16525
2018-01-25 11:03:29 +01:00
Jacob Vosmaer 49e9347e73 Make Gitlab::Git::Repository#run_git private 2018-01-25 11:00:15 +01:00
Robert Speicher caf84a0306 Merge branch 'fix/add-formatted-data-to-wiki-page' into 'master'
Add formatted_data attribute to Git::WikiPage

Closes #39805

See merge request gitlab-org/gitlab-ce!16682
2018-01-24 20:56:53 +00:00
Ahmad Sherif 5735747050 Add formatted_data attribute to Git::WikiPage
Related to #39805
2018-01-24 21:14:11 +01:00
Ahmad Sherif 29fa930baf Migrate .batch_lfs_pointers to Gitaly
Closes gitaly#921
2018-01-24 19:02:51 +01:00
Ahmad Sherif 6a28967c14 Migrate restoring repo from bundle to Gitaly
Closes gitaly#946
2018-01-24 19:02:32 +01:00
Ahmad Sherif 24625323a8 Migrate repository bundling to Gitaly
Closes gitaly#929
2018-01-24 12:10:31 +01:00
James Edwards-Jones 0683d31ab1 Can parse root .gitattributes file for a ref 2018-01-24 05:15:37 +00:00
Rémy Coutable ae1358e483 Merge branch 'gitaly-update-remote-mirror' into 'master'
Incorporate Gitaly's RemoteService.UpdateRemoteMirror RPC

Closes gitaly#936

See merge request gitlab-org/gitlab-ce!16536
2018-01-23 09:35:29 +00:00
Douwe Maan 09fc32173f Merge branch 'gitaly-user-commit-files' into 'master'
Incorporate Gitaly's OperationService.UserCommitFiles RPC

Closes gitaly#890

See merge request gitlab-org/gitlab-ce!16307
2018-01-23 09:34:59 +00:00
Robert Speicher 00aaf50326 Merge branch 'sh-fix-error-500-no-avatars' into 'master'
Fix Error 500 when repository has no avatar

Closes #42249

See merge request gitlab-org/gitlab-ce!16601
2018-01-22 17:46:39 +00:00
Alejandro Rodríguez d86751d842 Incorporate Gitaly's RemoteService.UpdateRemoteMirror RPC 2018-01-22 13:51:02 -03:00
Alejandro Rodríguez 2e0951e93f Incorporate Gitaly's OperationService.UserCommitFiles RPC 2018-01-22 13:34:51 -03:00
Robert Speicher f344f7cecc Merge branch 'gitaly-write-ref-error-handling' into 'master'
Wrap Rugged-exceptions in Gitlab::Git::Repository#write_ref

See merge request gitlab-org/gitlab-ce!16570
2018-01-22 16:09:45 +00:00
Kim "BKC" Carlbäcker 728d7e0cf7 Move error-handling to lib/gitlab/git 2018-01-22 15:40:38 +01:00
Zeger-Jan van de Weg a29f0c28fd
Allow pagination for WikiVersions on Gitaly request 2018-01-22 14:56:28 +01:00
Zeger-Jan van de Weg 1c0437d95e
Client implementation for WikiPageVerion
Part of gitlab-org/gitaly#639
2018-01-22 10:08:46 +01:00
Douwe Maan 6a1da56731 Merge branch 'gitaly-write-repo-config-prep' into 'master'
Move rugged-call from Project#write_repository_config to Git::Repository#write_config

See merge request gitlab-org/gitlab-ce!16572
2018-01-22 08:46:37 +00:00
Stan Hu b9c537487f Fix Error 500 when repository has no avatar
Closes #42249
2018-01-20 21:00:39 -08:00
Kim "BKC" Carlbäcker 31268b1b1a _never_ unset gitlab.full_path 2018-01-19 18:08:07 +01:00
Kim "BKC" Carlbäcker e1925f6d68 Move rugged-call from Project#write_repository_config to Git::Repository#write_config 2018-01-19 11:45:06 +01:00
Douwe Maan 774e751264 Merge branch 'fix-derefenced-target' into 'master'
Fix dereferenced_target naming in Gitlab::Git::Ref initialize

See merge request gitlab-org/gitlab-ce!16504
2018-01-19 09:22:17 +00:00
Kim "BKC" Carlbäcker 58aa32bcea Wrap Rugged-exceptions in Gitlab::Git::Repository#write_ref 2018-01-18 21:31:40 +01:00
Sean McGivern d7c7061a9c Merge branch 'gitaly-commit-signature' into 'master'
Retrieve commit signatures with Gitaly

Closes gitaly#923

See merge request gitlab-org/gitlab-ce!16467
2018-01-18 14:12:41 +00:00
Jacob Vosmaer (GitLab) 4d87f3bb37 Retrieve commit signatures with Gitaly 2018-01-18 14:10:17 +00:00
Jacob Vosmaer (GitLab) fa52038731 Remove Rugged::Walker from Repository#log 2018-01-18 14:05:14 +00:00
Jacob Vosmaer (GitLab) f4de7309ab Remove unused methods from Gitlab::Git 2018-01-17 09:54:27 +00:00
Serdar Dogruyol 5750ddf6dc Fix dereferenced_target naming in Gitlab::Git::Ref initialize 2018-01-17 00:01:07 +03:00
Stan Hu 3228ac06a0 Merge branch 'jej/lfs-rev-list-handles-non-utf-paths-41627' into 'master'
Prevent RevList failing on non utf8 paths

Closes #41627

See merge request gitlab-org/gitlab-ce!16440
2018-01-16 20:47:17 +00:00
James Edwards-Jones c4dd7b8296 Prevent RevList failing on non utf8 paths 2018-01-16 13:27:59 +00:00
Sean McGivern b94b8aae29 Merge branch 'feature/migrate-commit-uri-to-gitaly' into 'master'
Migrate Commit#uri_type to Gitaly

Closes gitaly#915

See merge request gitlab-org/gitlab-ce!16453
2018-01-16 11:03:51 +00:00
Ahmad Sherif f32f04a50f Migrate Commit#uri_type to Gitaly
Closes gitaly#915
2018-01-15 14:16:22 +01:00
Ahmad Sherif 49d6ed9ded Migrate importing repository to Gitaly
Closes gitaly#907
2018-01-15 14:15:54 +01:00
Grzegorz Bizon 6277ef8e28 Merge branch 'feature/migrate-can-be-merged-to-gitaly' into 'master'
Migrate Repository#can_be_merged? to Gitaly

Closes gitaly#893

See merge request gitlab-org/gitlab-ce!16316
2018-01-15 08:10:30 +00:00
Robert Speicher 16e895801e Merge branch 'feature/migrate-is-rebase-in-progress-to-gitaly' into 'master'
Migrate rebase_in_progress? to Gitaly

Closes gitaly#866

See merge request gitlab-org/gitlab-ce!16286
2018-01-11 22:27:16 +00:00
Robert Speicher 587242656f Merge branch 'feature/migrate-rebase-to-gitaly' into 'master'
Migrate Gitlab::Git::Repository#rebase to Gitaly

Closes gitaly#863

See merge request gitlab-org/gitlab-ce!16259
2018-01-11 22:24:50 +00:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Ahmad Sherif b4b267b739 Migrate Repository#can_be_merged? to Gitaly 2018-01-11 16:40:13 +01:00
Rémy Coutable ccb3fe1f42 Merge branch 'feature/migrate-merged-branch-names-to-gitaly' into 'master'
Migrate merged_branch_names to Gitaly

Closes gitaly#851

See merge request gitlab-org/gitlab-ce!16157
2018-01-11 15:22:49 +00:00
Ahmad Sherif 831019412f Migrate merged_branch_names to Gitaly
Closes gitaly#851
2018-01-11 14:52:15 +01:00
Robert Speicher 4fc0a09017 Merge branch 'git-write-ref-prep' into 'master'
Gitlab::Git::Repository#write_ref client-prep take 2

Closes gitaly#793

See merge request gitlab-org/gitlab-ce!16287
2018-01-10 19:13:50 +00:00
Ahmad Sherif 42265d445f Migrate Gitlab::Git::Repository#rebase to Gitaly
Closes gitaly#863
2018-01-10 13:28:10 +01:00
Ahmad Sherif 92d62ff69d Migrate rebase_in_progress? to Gitaly
Closes gitaly#866
2018-01-10 13:24:29 +01:00
Zeger-Jan van de Weg 58e17bf3b0
Migrate GitlabProject (re)move project endpoints
Migration is done through a small refactoring, which makes us call
endpoins which are performing the same actions for namespaces.
Tests are added to ensure only the project is removed that should be
removed.

Closes gitlab-org/gitaly#873
2018-01-09 19:23:18 +01:00
Kim "BKC" Carlbäcker 657065b73e Client-prep Gitlab::Git::Repository#write_ref 2018-01-09 15:20:44 +01:00
Sean McGivern 3013951c73 Merge branch 'remove-commit-tree' into 'master'
Remove the Commit#tree method

See merge request gitlab-org/gitlab-ce!16236
2018-01-08 11:31:10 +00:00
Sean McGivern d42c0ecc02 Merge branch 'gitaly-fetch-internal-remote' into 'master'
Incorporate RemoteService.FetchInternalRemote Gitaly RPC

Closes gitaly#857

See merge request gitlab-org/gitlab-ce!16140
2018-01-08 10:42:35 +00:00
Stan Hu c2b7147c2f Fix error 500 when viewing commit and merge request diffs
Due to the refactoring in !16082, `Blob#batch` no longer falls back
to a default `blob_size_limit`. Since `Repository#batch_blobs` was using
a default `nil` value, this would cause issues in the `Blob#find_by_rugged`
method.

This fix here is to be consistent and use a non-nil default value in
`Repository#batch_blobs`.

The problem was masked in development and tests because Gitaly is always
enabled by default for all features.

Closes #41735
2018-01-07 04:49:07 -08:00
Alejandro Rodríguez 9ff44c2986 Incorporate RemoteService.FetchInternalRemote Gitaly RPC 2018-01-05 15:45:24 -03:00
Alejandro Rodríguez 0b07be594e Move git operations for multi_action into Gitlab::Git 2018-01-05 15:17:53 -03:00
Lin Jen-Shin (godfat) 33c5630b02 Use --left-right and --max-count for counting diverging commits 2018-01-05 16:52:06 +00:00
Douwe Maan 3bb68efb7a Merge branch 'zj-blob-batch' into 'master'
Reroute batch blobs to single blob RPC

See merge request gitlab-org/gitlab-ce!16082
2018-01-05 10:47:28 +00:00
Sean McGivern 4dd0c55f05 Merge branch 'fix/prepare-rebase-to-be-migrated-to-gitaly' into 'master'
Prepare Gitlab::Git::Repository#rebase for Gitaly migration

See merge request gitlab-org/gitlab-ce!16192
2018-01-05 10:44:24 +00:00
Zeger-Jan van de Weg 6b15784ce7 Fix typos in a code comment 2018-01-05 09:41:05 +00:00
Jacob Vosmaer ac2cb65ab3 Remove the Commit#tree method 2018-01-04 18:00:28 +01:00
Dmitriy Zaporozhets 58a705aaac Merge branch 'ce-gitaly-remote-mirror-prep' into 'master'
[CE] Move git operations for UpdateRemoteMirrorService into Gitlab::Git

See merge request gitlab-org/gitlab-ce!16023
2018-01-04 16:02:22 +00:00
Ahmad Sherif 0ba0f9de08 Prepare Gitlab::Git::Repository#rebase for Gitaly migration 2018-01-04 12:39:45 +01:00
Rémy Coutable 062ea80e64 Merge branch 'feature/add-max-count-to-count-commits-rpc' into 'master'
Add support for max_count option to Git::Repository#count_commits

See merge request gitlab-org/gitlab-ce!16145
2018-01-04 10:58:47 +00:00
Alejandro Rodríguez 996becdcbb Move git operations for UpdateRemoteMirrorService into Gitlab::Git 2018-01-03 23:09:04 -03:00
Alejandro Rodríguez 1c458d17d7 Move delete_remote_branches from Gitlab::Shell to Gitlab::Git::Repository 2018-01-03 23:07:38 -03:00
Alejandro Rodríguez 43308bd826 Move push_remote_branches from Gitlab::Shell to Gitlab::Git::Repository 2018-01-03 23:06:34 -03:00
Robert Speicher 946a3634bc Merge branch 'sh-optimize-commit-stats' into 'master'
Speed up generation of commit stats by using Rugged native methods

See merge request gitlab-org/gitlab-ce!16186
2018-01-03 17:39:24 +00:00
Robert Speicher f7cb21930a Merge branch 'migrate-fork-repo-to-gitaly' into 'master'
Migrate repo forking to Gitaly

Closes gitaly#825

See merge request gitlab-org/gitlab-ce!16018
2018-01-03 17:35:32 +00:00
Grzegorz Bizon 57906a5322 Merge branch 'gitaly-conflict-resolver' into 'master'
Gitaly conflict resolver

Closes gitaly#813

See merge request gitlab-org/gitlab-ce!15755
2018-01-03 08:39:16 +00:00
Stan Hu 25a868753b Speed up generation of commit stats by using Rugged native methods
The previous implementation iterated across the entire patch set
to determine the number of lines added, deleted, and changed. Rugged
has a native method `Rugged::Diff#stat` that does this already,
which appears to be a little faster and require less RAM than doing
this ourselves.

Improves performance in #41524
2018-01-02 23:48:19 -08:00
Alejandro Rodríguez 65e3a1e9e9 Simplify conflict resolution interface and code
- Add a Gitlab::Git::Conflict::Resolution class to encapsulate
resolution data
- Simplify conflict file collection assembly
2018-01-02 16:22:02 -03:00
Ahmad Sherif 4b5b43383a Migrate repo forking to Gitaly
Closes gitaly#825
2018-01-02 17:20:01 +01:00
Zeger-Jan van de Weg 59e50e33b3
Reroute batch blobs to single blob RPC
Given the priorities shifted for the Gitaly team, this endpoint does not
get a dedicated endpoint yet. To make it work in a cloud native
environment the request needs to go to Gitaly, not rugged. This is
achieved by rerouting to the generic TreeEntry endpoint.
2018-01-02 10:00:24 +01:00
Stan Hu 0ea75205df Merge branch 'gitaly-opt-out' into 'master'
Unmark Gitaly features as OPT_OUT until the gRPC proxy issue is fixed

Closes #38333

See merge request gitlab-org/gitlab-ce!16155
2017-12-28 16:37:55 +00:00
Alejandro Rodríguez 7ed28b9069 Unmark Gitaly features as OPT_OUT until the gRPC proxy issue is fixed 2017-12-28 12:09:34 -03:00
Alejandro Rodríguez 04b987563a Fix feature flags for Gitaly's RemoteService RPCs 2017-12-27 20:14:36 +00:00
Alejandro Rodríguez 0aa87bbe13 Incorporate ConflictsService.ResolveConflicts Gitaly RPC 2017-12-27 15:14:25 -03:00
Alejandro Rodríguez 351f205c05 Incorporate ConflictsService.ListConflictFiles Gitaly RPC 2017-12-27 15:12:30 -03:00
Ahmad Sherif 13932b0b12 Add support for max_count option to Git::Repository#count_commits 2017-12-27 14:16:24 +01:00
Dmitriy Zaporozhets 87bae6d42f Merge branch 'gitaly-remotes' into 'master'
Incorporate Gitaly's RemoteService RPCs

Closes gitaly#852

See merge request gitlab-org/gitlab-ce!16060
2017-12-25 10:43:04 +00:00
Alejandro Rodríguez 2694355bb6 Incorporate Gitaly's RemoteService RPCs 2017-12-22 20:30:08 -03:00
Alejandro Rodríguez 7354c9f75d Remove unused method `remote_exists?` 2017-12-22 20:30:07 -03:00
Rémy Coutable a2d39b8010 Use gitlab-styles
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-12-22 08:34:44 -06:00
Kim Carlbäcker 28fba5ed99 Revert "Merge branch 'repo-write-ref-client-prep' into 'master'"
This reverts merge request !15712
2017-12-20 18:29:52 +00:00
Zeger-Jan van de Weg c6edae3887
Load commit in batches for pipelines#index
Uses `list_commits_by_oid` on the CommitService, to request the needed
commits for pipelines. These commits are needed to display the user that
created the commit and the commit title.

This includes fixes for tests failing that depended on the commit
being `nil`. However, now these are batch loaded, this doesn't happen
anymore and the commits are an instance of BatchLoader.
2017-12-19 10:05:40 +01:00
Robert Speicher b540b98764 Merge branch 'no-ivar-in-modules' into 'master'
Add cop to make sure we don't use ivar in a module

See merge request gitlab-org/gitlab-ce!12800
2017-12-15 19:56:15 +00:00