Commit Graph

668 Commits

Author SHA1 Message Date
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
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