Commit Graph

659 Commits

Author SHA1 Message Date
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
Sean McGivern 9c12cb5375 Merge branch 'gitaly-conflicts-prep' into 'master'
Simplify conflict resolver interface

See merge request gitlab-org/gitlab-ce!15897
2017-12-15 10:59:21 +00:00
Douwe Maan 44f0b2c4be Merge branch '41016-import-gitlab-shell-projects' into 'master'
Import gitlab-shell gitlab_projects.rb as at v5.10.2

Closes #41016

See merge request gitlab-org/gitlab-ce!15853
2017-12-15 09:54:42 +00:00
Lin Jen-Shin 59ac184fcf Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (671 commits)
  Make rubocop happy
  Use guard clause
  Improve language
  Prettify
  Use temp branch
  Pass info about who started the job and which job triggered it
  Docs: add indexes for monitoring and performance monitoring
  clearer-documentation-on-inline-diffs
  Add docs for commit diff discussion in merge requests
  sorting for tags api
  Clear BatchLoader after each spec to prevent holding onto records longer than necessary
  Include project in BatchLoader key to prevent returning blobs for the wrong project
  moved lfs_blob_ids method into ExtractsPath module
  Converted JS modules into exported modules
  spec fixes
  Bump gitlab-shell version to 5.10.3
  Clear caches before updating MR diffs
  Use new Ruby version 2.4 in GitLab QA images
  moved lfs blob fetch from extractspath file
  Update GitLab QA dependencies
  ...
2017-12-15 17:14:26 +08:00
Alejandro Rodríguez 240945f87e Simplify conflict resolver interface
This does two things:
- Pass commit oids instead of `Gitlab::Git::Commit`s. We only need the
former.
- Depend on only the target repository for conflict listing. For
conflict resolution, treat one repository as a remote one so that we can
implement it as such in Gitaly.
2017-12-14 16:02:50 -03:00
Robert Speicher ee9ad1b1f6 Merge branch 'feature/migrate-merge-base-to-gitaly' into 'master'
Migrate Gitlab::Git::Repository#merge_base_commit to Gitaly

Closes gitaly#808

See merge request gitlab-org/gitlab-ce!15770
2017-12-14 18:58:38 +00:00
Nick Thomas 4b785df27b
Import gitlab_projects.rb from gitlab-shell
By importing this Ruby code into gitlab-rails (and gitaly-ruby), we avoid
200ms of startup time for each gitlab_projects subprocess we are eliminating.

By not having a gitlab_projects subprocess between gitlab-rails / sidekiq and
any git subprocesses (e.g. for fork_project, fetch_remote, etc, calls), we can
also manage these git processes more cleanly, and avoid sending SIGKILL to them
2017-12-14 16:00:04 +00:00
Ahmad Sherif 835a5db376 Migrate Gitlab::Git::Repository#merge_base_commit to Gitaly
Closes gitaly#808
2017-12-13 17:40:19 +01:00
Robert Speicher b655a4a790 Merge branch 'repo-write-ref-client-prep' into 'master'
Move Repository#write_ref to Git::Repository#write_ref

Closes gitaly#793

See merge request gitlab-org/gitlab-ce!15712
2017-12-12 16:36:58 +00:00
Kim "BKC" Carlbäcker dad4c0b645 Move Repository#write_ref to Git::Repository#write_ref 2017-12-12 16:05:38 +01:00
Robert Speicher 6930fa3102 Merge branch 'gitaly-mirroring-prep' into 'master'
Gitaly mirroring migration prep

Closes gitaly#816

See merge request gitlab-org/gitlab-ce!15775
2017-12-11 20:50:07 +00:00
Bob Van Landuyt d4d06bded1 Keep track of storage check timings 2017-12-11 13:18:39 +01:00
Bob Van Landuyt f1ae1e39ce Move the circuitbreaker check out in a separate process
Moving the check out of the general requests, makes sure we don't have
any slowdown in the regular requests.

To keep the process performing this checks small, the check is still
performed inside a unicorn. But that is called from a process running
on the same server.

Because the checks are now done outside normal request, we can have a
simpler failure strategy:

The check is now performed in the background every
`circuitbreaker_check_interval`. Failures are logged in redis. The
failures are reset when the check succeeds. Per check we will try
`circuitbreaker_access_retries` times within
`circuitbreaker_storage_timeout` seconds.

When the number of failures exceeds
`circuitbreaker_failure_count_threshold`, we will block access to the
storage.

After `failure_reset_time` of no checks, we will clear the stored
failures. This could happen when the process that performs the checks
is not running.
2017-12-08 09:11:39 +01:00
Kim Carlbäcker 41b0c0e9be Migrate Git::Repository#fsck to Gitaly 2017-12-08 00:27:11 +00:00
Douwe Maan 9dffd0ab6b Merge branch 'dm-commit-diff-discussions-in-mr-context' into 'master'
Allow commenting on individual commits inside an MR

Closes #31847

See merge request gitlab-org/gitlab-ce!12148
2017-12-07 16:49:04 +00:00
Zeger-Jan van de Weg 03ac8d5d0b Remove Rugged::Repository#empty? 2017-12-07 15:33:30 +00:00
micael.bergeron cb6f51ec9b add support for the commit reference filter 2017-12-07 09:01:37 -05:00
Alejandro Rodríguez 95009cefc2 Unify mirror addition operations to prepare for Gitaly migration 2017-12-06 19:08:29 -03:00
Alejandro Rodríguez 885a4da208 Add feature flag to use gitaly-ssh mirroring when cloning internal repos
This also allows us to simplify the naming since we can make some
fetching methods private.
2017-12-06 18:41:45 -03:00
Robert Speicher 4475212a10 Merge branch 'feature/migrate-revert-to-gitaly' into 'master'
Migrate Gitlab::Git::Repository#revert to Gitaly

Closes gitaly#780

See merge request gitlab-org/gitlab-ce!15717
2017-12-05 20:12:03 +00:00
Kim "BKC" Carlbäcker 49dd62ada1 Migrate Gitlab::Git::Commit.shas_with_signatures
- Added tests for Git::Commit.shas_with_signatures
2017-12-05 14:43:46 +01:00
Ahmad Sherif 887a373916 Migrate Gitlab::Git::Repository#revert to Gitaly
Closes gitaly#780
2017-12-05 14:09:15 +01:00
Sean McGivern 9f75b7a47f Merge branch 'gitaly-conflict-file' into 'master'
Small Gitlab::Git fixes for Gitaly

See merge request gitlab-org/gitlab-ce!15675
2017-12-05 12:13:39 +00:00
Sean McGivern 515c619c18 Merge branch 'ce-gitaly-worktree-refactor' into 'master'
[CE] Move git operations for squash and rebase into Gitlab::Git

See merge request gitlab-org/gitlab-ce!15673
2017-12-05 11:46:17 +00:00
Robert Speicher f3a3bd50ea Merge branch 'feature/migrate-cherry-pick-to-gitaly' into 'master'
Migrate Gitlab::Git::Repository#cherry_pick to Gitaly

Closes gitaly#737

See merge request gitlab-org/gitlab-ce!15517
2017-12-04 19:20:01 +00:00
Alejandro Rodríguez 359b65beac Use `String#end_with?` instead of `String#ends_with?`
The former is in Ruby's core lib, so is more flexible.
2017-12-04 16:11:54 -03:00
Alejandro Rodríguez 2286681e1c Add missing attr_accessor to Gitlab::Git::Conflict::File 2017-12-04 16:11:54 -03:00
Alejandro Rodríguez f91c5c5bbe Backport Squash/Rebase refactor from EE 2017-12-04 16:04:53 -03:00
Ahmad Sherif 8be9567c64 Migrate Gitlab::Git::Repository#cherry_pick to Gitaly
Closes gitaly#737
2017-12-04 19:21:07 +01:00
Douwe Maan a1cd9be429 Merge branch 'git-fsck-worker-client-prep' into 'master'
Move SingleRepositoryWorker#fsck into Gitlab::Git::Repository

Closes gitaly#802

See merge request gitlab-org/gitlab-ce!15710
2017-12-04 15:58:53 +00:00
Kim "BKC" Carlbäcker 12f61e0d2c Move SingleRepositoryWorker#fsck into Gitlab::Git::Repository 2017-12-04 15:57:20 +01:00
Bob Van Landuyt b72d243872 Keep track of all storage keys in a set
That way we don't need the to scan the entire keyspace to get all
known keys
2017-12-01 17:50:43 +01:00
Rémy Coutable 3e78b5ae8f Merge branch 'sh-fix-root-ref-repository' into 'master'
Gracefully handle case when repository's root ref does not exist

Closes #40615

See merge request gitlab-org/gitlab-ce!15678
2017-12-01 11:02:32 +00:00
Stan Hu 66127221fe Gracefully handle case when repository's root ref does not exist
This was failing regularly with an Error 500 when the API branches endpoint
was used.

Closes #40615
2017-11-30 23:21:44 -08:00
Zeger-Jan van de Weg 60056d67a0
Add link to gitaly converation
This endpoint still has to be migrated, and this comment makes sure
everyone knows we are aware of this one.

[ci skip]
2017-11-30 17:05:55 +01:00
Lin Jen-Shin 4925ec5087 We could simply count the commits 2017-11-30 16:03:28 +08:00
Lin Jen-Shin 85be6d83be Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (170 commits)
  support ordering of project notes in notes api
  Redirect to an already forked project if it exists
  Reschedule the migration to populate fork networks
  Create fork networks for forks for which the source was deleted.
  Fix item name and namespace text overflow in Projects dropdown
  Minor backport from EE
  fix link that was linking to `html` instead of `md`
  Backport epic tasklist
  Add timeouts for Gitaly calls
  SSHUploadPack over Gitaly is now OptOut
  fix icon colors in commit list
  Fix star icon color/stroke
  Backport border inline edit
  Add checkboxes to automatically run AutoDevops pipeline
  BE for automatic pipeline when enabling Auto DevOps
  I am certainly weary of debugging sidekiq but I don't think that's what was meant
  Ensure MRs always use branch refs for comparison
  Fix issue comment submit button disabled on GFM paste
  Lock seed-fu at the correct version in Gemfile.lock
  Improve indexes on merge_request_diffs
  ...
2017-11-30 15:20:00 +08:00
Sean McGivern 3c6a4d6363 Ensure MRs always use branch refs for comparison
If a merge request was created with a branch name that also matched a tag name,
we'd generate a comparison to or from the tag respectively, rather than the
branch. Merging would still use the branch, of course.

To avoid this, ensure that when we get the branch heads, we prepend the
reference prefix for branches, which will ensure that we generate the correct
comparison.
2017-11-28 17:01:38 +00:00
Sean McGivern dd11f0e053 Merge branch 'dm-cleanup-fetch-and-mirror-methods' into 'master'
Clean up repository fetch and mirror methods

See merge request gitlab-org/gitlab-ce!15424
2017-11-23 17:01:47 +00:00
Douwe Maan 7a1e93d35b Rename fetch_refs to refmap 2017-11-23 16:59:58 +01:00
Douwe Maan 0e6beaf50c Clean up repository fetch and mirror methods 2017-11-23 16:59:50 +01:00
Douwe Maan dbf97574dc Merge branch '39887-move-identical-check-to-merged-branches' into 'master'
Move identical merged branch check to merged_branch_names

Closes #39887

See merge request gitlab-org/gitlab-ce!15464
2017-11-23 15:16:37 +00:00
Jacob Vosmaer (GitLab) 4cfcc97544 Fix encoding bugs in Gitlab::Git::User 2017-11-23 10:48:57 +00:00
Lin Jen-Shin 7df1cb528e Move identical merged branch check to merged_branch_names 2017-11-23 18:26:41 +08:00
Jacob Vosmaer (GitLab) 571f1dda17 Add FetchSourceBranch Gitaly call 2017-11-22 10:19:42 +00:00
Lin Jen-Shin 663593e87e Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (126 commits)
  Update VERSION to 10.3.0-pre
  Update CHANGELOG.md for 10.2.0
  default fill color for SVGs
  ignore hashed repos (for now) when using `rake gitlab:cleanup:repos`
  Use Redis cache for branch existence checks
  Update CONTRIBUTING.md: Link definition of done to criteria
  Use `make install` for Gitaly setups in non-test environments
  FileUploader should check for hashed_storage?(:attachments) to use disk_path
  Set the default gitlab-shell timeout to 3 hours
  Update composite pipelines index to include "id"
  Use arrays in Pipeline#latest_builds_with_artifacts
  Fix blank states using old css
  Skip confirmation user api
  Custom issue tracker
  Revert "check for `read_only?` first before seeing if request is disallowed"
  add `#with_metadata` scope to remove a N+1 from the notes' API
  Fix promoting milestone updating all issuables without milestone
  Batchload blobs for diff generation
  check for `read_only?` first before seeing if request is disallowed
  use `Gitlab::Routing.url_helpers` instead of `Rails.application.routes.url_helpers`
  ...
2017-11-22 17:07:01 +08:00
Zeger-Jan van de Weg f9565e3039
Batchload blobs for diff generation
After installing a new gem, batch-loader, a construct can be used to
queue data to be fetched in bulk. The gem was also introduced in both
gitlab-org/gitlab-ce!14680 and gitlab-org/gitlab-ce!14846, but those mrs
are not merged yet.

For the generation of diffs, both the old blob and the new blob need to
be loaded. This for every file in the diff, too. Now we collect all
these so we do 1 fetch. Three `.allow_n_plus_1_calls` have been removed,
which I expect to be valid, but this needs to be confirmed by a full CI
run.

Possibly closes:
- https://gitlab.com/gitlab-org/gitlab-ce/issues/37445
- https://gitlab.com/gitlab-org/gitlab-ce/issues/37599
- https://gitlab.com/gitlab-org/gitlab-ce/issues/37431
2017-11-21 13:53:26 +01:00
Douwe Maan 4b78f70fc4 Merge branch 'gitaly-delete-refs' into 'master'
Incorporate Gitaly's RefService.DeleteRefs RPC

Closes gitaly#740

See merge request gitlab-org/gitlab-ce!15460
2017-11-20 15:20:40 +00:00
Douwe Maan 202ab62874 Merge branch 'fix-conflict-highlighting' into 'master'
Fix conflict highlighting

See merge request gitlab-org/gitlab-ce!15463
2017-11-20 10:17:43 +00:00
Rémy Coutable 4f09d099e9 Merge branch '18040-rubocop-line-break-after-guard-clause' into 'master'
Adds Rubocop rule for line break after guard clause

Closes #18040

See merge request gitlab-org/gitlab-ce!15188
2017-11-20 09:22:14 +00:00
Alejandro Rodríguez 3f0c9e9708 Fix Gitlab::Git::Repository#remote_tags using unexisting variable 2017-11-20 09:08:09 +00:00
Alejandro Rodríguez 38730a2d07 Incorporate Gitaly's RefService.DeleteRefs RPC 2017-11-17 18:08:50 -03:00
Sean McGivern 64a9e53bd1 Fix conflict highlighting
Conflicts used to take a `Repository` and pass that to
`Gitlab::Highlight.highlight`, which would call `#gitattribute` on the
repository. Now they use a `Gitlab::Git::Repository`, which didn't have that
method defined - but defining it on `Gitlab::Git::Repository` does make it
available on `Repository` through `method_missing`, so we can do that and both
cases will work.
2017-11-17 17:57:48 +00:00
Francisco Javier López ff26ea818c Resolve "Performance issues when loading large number of wiki pages" 2017-11-17 11:48:32 +00:00
Lin Jen-Shin 0af35d7e30 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (507 commits)
  Add dropdowns documentation
  Convert migration to populate latest merge request ID into a background migration
  Set 0.69.0 instead of latest for codeclimate image
  De-duplicate background migration matchers defined in spec/support/migrations_helpers.rb
  Update database_debugging.md
  Update database_debugging.md
  Move installation of apps higher
  Change to Google Kubernetes Cluster and add internal links
  Add Ingress description from official docs
  Add info on creating your own k8s cluster from the cluster page
  Add info about the installed apps in the Cluster docs
  Resolve "lock/confidential issuable sidebar custom svg icons iteration"
  Update HA README.md to clarify GitLab support does not troubleshoot DRBD.
  Update license_finder to 3.1.1
  Make sure NotesActions#noteable returns a Noteable in the update action
  Cache the number of user SSH keys
  Adjust openid_connect_spec to use `raise_error`
  Resolve "Clicking on GPG verification badge jumps to top of the page"
  Add changelog for container repository path update
  Update container repository path reference
  ...
2017-11-17 19:19:06 +08:00
Jacopo 181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Rémy Coutable 701577f0f2 Merge branch 'gitaly-wiki-get-all-pages' into 'master'
Incorporate Gitaly's WikiService.WikiGetAllPages RPC

Closes gitaly#722

See merge request gitlab-org/gitlab-ce!15307
2017-11-14 08:02:49 +00:00
Alejandro Rodríguez 282e7f8eab Incorporate Gitaly's WikiService.WikiGetAllPages RPC 2017-11-13 16:54:50 -03:00
Sean McGivern 3eff7b6773 Merge branch 'zj-move-repo-exists-opt-out' into 'master'
Repository Exists check is OPT_OUT for Gitaly

See merge request gitlab-org/gitlab-ce!15287
2017-11-13 10:28:12 +00:00
Jacob Vosmaer (GitLab) de301d13bb Prepare Repository#fetch_source_branch for migration 2017-11-10 14:45:23 +00:00
Zeger-Jan van de Weg 90d74ce2df
Repository Exists check is OPT_OUT for Gitaly
Moving more git operations to be executed by Gitaly, now the check if a
repository exists is an opt out endpoint.

Can be disabled, for the time being, by performing in the rails console:
> Feature.get('gitaly_repository_exists').disable
=> true

Part of gitlab-org/gitaly#314
2017-11-09 09:32:21 +01:00
Douwe Maan ce06415cb6 Merge branch 'gitaly-700-wiki-update-page' into 'master'
Migrate GitLab::Git::Wiki.update_page to Gitaly

Closes gitaly#700

See merge request gitlab-org/gitlab-ce!15268
2017-11-08 17:07:55 +00:00
Kim "BKC" Carlbäcker 00ce8756ad Migrate GitLab::Git::Wiki.update_page to Gitaly 2017-11-08 16:11:10 +01:00
Yorick Peterse 4dfe26cd8b
Rewrite the GitHub importer from scratch
Prior to this MR there were two GitHub related importers:

* Github::Import: the main importer used for GitHub projects
* Gitlab::GithubImport: importer that's somewhat confusingly used for
  importing Gitea projects (apparently they have a compatible API)

This MR renames the Gitea importer to Gitlab::LegacyGithubImport and
introduces a new GitHub importer in the Gitlab::GithubImport namespace.
This new GitHub importer uses Sidekiq for importing multiple resources
in parallel, though it also has the ability to import data sequentially
should this be necessary.

The new code is spread across the following directories:

* lib/gitlab/github_import: this directory contains most of the importer
  code such as the classes used for importing resources.
* app/workers/gitlab/github_import: this directory contains the Sidekiq
  workers, most of which simply use the code from the directory above.
* app/workers/concerns/gitlab/github_import: this directory provides a
  few modules that are included in every GitHub importer worker.

== Stages

The import work is divided into separate stages, with each stage
importing a specific set of data. Stages will schedule the work that
needs to be performed, followed by scheduling a job for the
"AdvanceStageWorker" worker. This worker will periodically check if all
work is completed and schedule the next stage if this is the case. If
work is not yet completed this worker will reschedule itself.

Using this approach we don't have to block threads by calling `sleep()`,
as doing so for large projects could block the thread from doing any
work for many hours.

== Retrying Work

Workers will reschedule themselves whenever necessary. For example,
hitting the GitHub API's rate limit will result in jobs rescheduling
themselves. These jobs are not processed until the rate limit has been
reset.

== User Lookups

Part of the importing process involves looking up user details in the
GitHub API so we can map them to GitLab users. The old importer used
an in-memory cache, but this obviously doesn't work when the work is
spread across different threads.

The new importer uses a Redis cache and makes sure we only perform
API/database calls if absolutely necessary.  Frequently used keys are
refreshed, and lookup misses are also cached; removing the need for
performing API/database calls if we know we don't have the data we're
looking for.

== Performance & Models

The new importer in various places uses raw INSERT statements (as
generated by `Gitlab::Database.bulk_insert`) instead of using Rails
models. This allows us to bypass any validations and callbacks,
drastically reducing the number of SQL queries and Gitaly RPC calls
necessary to import projects.

To ensure the code produces valid data the corresponding tests check if
the produced rows are valid according to the model validation rules.
2017-11-07 23:24:59 +01:00
Sean McGivern 045795d0d9 Merge branch 'remove-ensure-ref-fetched-from-controllers' into 'master'
removed the #ensure_ref_fetched from all controllers

Closes #36061

See merge request gitlab-org/gitlab-ce!15129
2017-11-06 17:10:18 +00:00
Lin Jen-Shin fc6aad0b44 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (1723 commits)
  Resolve "Editor icons"
  Refactor issuable destroy action
  Ignore routes matching legacy_*_redirect in route specs
  Gitlab::Git::RevList and LfsChanges use lazy popen
  Gitlab::Git::Popen can lazily hand output to a block
  Merge branch 'master-i18n' into 'master'
  Remove unique validation from external_url in Environment
  Expose `duration` in Job API entity
  Add TimeCop freeze for DST and Regular time
  Harcode project visibility
  update a changelog
  Put a condition to old migration that adds fast_forward column to MRs
  Expose project visibility as CI variable
  fix flaky tests by removing unneeded clicks and focus actions
  fix flaky test in gfm_autocomplete_spec.rb
  Use Gitlab::Git operations for repository mirroring
  Encapsulate git operations for mirroring in Gitlab::Git
  Create a Wiki Repository's raw_repository properly
  Add `Gitlab::Git::Repository#fetch` command
  Fix Gitlab::Metrics::System#real_time and #monotonic_time doc
  ...
2017-11-06 21:44:57 +08:00
Douwe Maan a2cd9ad251 Merge branch 'jej/fix-lfs-changes-laziness' into 'master'
Implement lazy popen so LfsChanges doesn't have to wait for rev-list to complete

See merge request gitlab-org/gitlab-ce!15180
2017-11-06 11:34:10 +00:00
James Edwards-Jones ca049902dc Gitlab::Git::RevList and LfsChanges use lazy popen 2017-11-06 10:20:14 +00:00
James Edwards-Jones 95640413e6 Gitlab::Git::Popen can lazily hand output to a block
This allows input to start processing immediately without waiting for the process to complete.
This also allows long or infinite inputs to be partially processed,
which will termiate the process when reading stops with SIGPIPE.
2017-11-06 10:20:13 +00:00
Alejandro Rodríguez dea6d054cd Encapsulate git operations for mirroring in Gitlab::Git 2017-11-03 14:33:24 -03:00
micael.bergeron cd88fa8f80 removed the #ensure_ref_fetched from all controllers
also, I refactored the MergeRequest#fetch_ref method to express
the side-effect that this method has.

  MergeRequest#fetch_ref -> MergeRequest#fetch_ref!
  Repository#fetch_source_branch -> Repository#fetch_source_branch!
2017-11-03 08:13:11 -04:00
Rémy Coutable 6a5e8f1046 Merge branch 'gitaly-ff-merge' into 'master'
Incorporate Gitaly's OperationService.UserFFBranch RPC

Closes gitaly#693

See merge request gitlab-org/gitlab-ce!15040
2017-11-02 16:11:53 +00:00
Douwe Maan e65bbc0ca4 Merge branch 'jej/lfs-change-detection' into 'master'
Detect changes to LFS pointers for pruning and integrity check

See merge request gitlab-org/gitlab-ce!14785
2017-11-01 17:33:41 +00:00
James Edwards-Jones fb3f9c6e50 Detect changes to LFS pointers for pruning and integrity check
Gitlab::Git::Blob.batch_lfs_metadata can be used to check for LFS pointers. It uses a lazy enumorator and filters by blob size
2017-11-01 16:41:05 +00:00
Alejandro Rodríguez 37cc50f843 Incorporate Gitaly's OperationService.UserFFBranch RPC 2017-10-31 16:28:09 -03:00
Ahmad Sherif 56e53556c5 Migrate Gitlab::Git::Wiki#file to Gitaly
Closes gitaly#689
2017-10-31 20:49:41 +02:00
Ahmad Sherif 964cbb67da Migrate Gitlab::Git::Wiki#page to Gitaly
Closes gitaly#677
2017-10-31 18:28:54 +02:00
Ahmad Sherif b3a0166203 Migrate Gitlab::Git::Wiki#delete_page to Gitaly
Closes gitaly#673
2017-10-31 13:47:34 +02:00
Lin Jen-Shin (godfat) 57d7ed05d9 Fetch the merged branches at once 2017-10-27 15:55:08 +00:00
Sean McGivern 15e3d33761 Merge branch 'zj-commit-cache' into 'master'
Cache commits on the repository model

See merge request gitlab-org/gitlab-ce!14863
2017-10-27 13:31:05 +00:00
Ahmad Sherif 43f0bca648 Avoid using Rugged in Gitlab::Git::Wiki#preview_slug 2017-10-27 13:59:25 +02:00
Zeger-Jan van de Weg 3411fef1df
Cache commits on the repository model
Now, when requesting a commit from the Repository model, the results are
not cached. This means we're fetching the same commit by oid multiple times
during the same request. To prevent us from doing this, we now cache
results. Caching is done only based on object id (aka SHA).

Given we cache on the Repository model, results are scoped to the
associated project, eventhough the change of two repositories having the
same oids for different commits is small.
2017-10-27 12:49:11 +02:00
Douwe Maan b0c419f9cd Merge branch 'an/local_branches_opt_out' into 'master'
Make local_branches OPT_OUT

See merge request gitlab-org/gitlab-ce!15045
2017-10-26 12:08:29 +00:00
Sean McGivern 98c57e9a9f Merge branch 'fix/add-path-attr-to-wiki-file' into 'master'
Add path attribute to WikiFile class

Closes #39420

See merge request gitlab-org/gitlab-ce!15019
2017-10-26 11:41:04 +00:00
Ahmad Sherif 76becfb5b4 Add path attribute to WikiFile class
Fixes #39420
2017-10-26 13:04:33 +02:00
Andrew Newdigate efdf51d838 Make local_branches OPT_OUT 2017-10-26 09:52:52 +00:00
Alejandro Rodríguez 42a45392a9 Fix the incorrect value being used to set GL_USERNAME on hooks 2017-10-25 14:01:57 -03:00
Rémy Coutable 53ab16f6ff Merge branch 'gitaly-ff-merge-preparation' into 'master'
Move all rugged operation for ff_merge inside Gitlab::Git

Closes gitaly#683

See merge request gitlab-org/gitlab-ce!15011
2017-10-25 12:42:25 +00:00
Alejandro Rodríguez a64601b929 Move all rugged operation for ff_merge inside Gitlab::Git
We also delete some unused code related to the aforementioned feature.
2017-10-24 14:31:52 -03:00
Douwe Maan 30a8d2def3 Merge branch 'gitaly-gl-username' into 'master'
Support `Gitaly::User`'s gl_username field

See merge request gitlab-org/gitlab-ce!15016
2017-10-24 13:59:44 +00:00
Alejandro Rodríguez 4969f486f2 Support `Gitaly::User`'s gl_username field
We also unify conversions from and to `Gitaly::User`s in the
`Gitlab::Git::User` class.
2017-10-23 17:31:48 -03:00
Bob Van Landuyt 705c15d7af Allow enabling the circuitbreaker using an env variable
That way we can enable the circuitbreaker for just one host at a time.
2017-10-23 13:53:49 +03:00
Bob Van Landuyt 591ee4e361 Perform the stat check multiple times when checking a storage
Instead of only checking once within a timeout, check multiple times
within a timeout.

That means with a timeout of 30 seconds and 3 retries. Each try would
be allowed 20 seconds.
2017-10-23 13:53:49 +03:00
Bob Van Landuyt 430e767139 Implement backoff for the circuitbreaker
The circuitbreaker now has 2 failure modes:

- Backing off: This will raise the `Gitlab::Git::Storage::Failing`
  exception. Access to the shard is blocked temporarily.
- Circuit broken: This will raise the
  `Gitlab::Git::Storage::CircuitBroken` exception. Access to the shard
  will be blocked until the failures are reset.
2017-10-23 12:02:23 +03:00
Sean McGivern ed194a6d4a Merge branch 'feature/migrate-wiki-write-page-to-gitaly' into 'master'
Migrate Gitlab::Git::Wiki#write_page to Gitaly

Closes gitaly#638

See merge request gitlab-org/gitlab-ce!14870
2017-10-18 11:13:50 +00:00
Rémy Coutable 89f5ede2a3 Merge branch 'bvl-do-not-use-redis-keys' into 'master'
Avoid using `Redis#keys`

See merge request gitlab-org/gitlab-ce!14889
2017-10-17 16:15:44 +00:00
Bob Van Landuyt c365dea887 Don't use `Redis#keys` in the circuitbreaker 2017-10-17 12:47:20 +02:00
Douwe Maan 4bbdab764d Merge branch 'bvl-circuitbreaker-improvements' into 'master'
Make the circuitbreaker configurable at runtime

See merge request gitlab-org/gitlab-ce!14842
2017-10-17 10:43:05 +00:00
Bob Van Landuyt 619021fd7a Read circuitbreaker settings from `Gitlab::CurrentSettings`
Instead of from the configuration file
2017-10-17 11:50:32 +02:00
Ahmad Sherif fa5eeaecfb Migrate Gitlab::Git::Wiki#write_page to Gitaly
Closes gitaly#638
2017-10-16 15:53:48 +02:00
Sean McGivern 980423f6da Merge branch 'git-env-handle-arrays' into 'master'
Add Gitlab::Git::Env.to_env_hash

See merge request gitlab-org/gitlab-ce!14841
2017-10-16 12:37:02 +00:00
Jacob Vosmaer e73af42239 Add Gitlab::Git::Env.to_env_hash 2017-10-16 13:19:44 +02:00
Sean McGivern b2553840e8 Merge branch 'conflict-resolution-refactor' into 'master'
Conflict resolution refactor

See merge request gitlab-org/gitlab-ce!14747
2017-10-16 10:36:06 +00:00
Andrew Newdigate f530261773 Popen with a timeout 2017-10-16 09:11:31 +00:00
Jacob Vosmaer 0aff29f96b Merge Merge Requests via Gitaly 2017-10-13 14:07:31 +02:00
Alejandro Rodríguez 9fdde3693b Move line code generation into Gitlab::Git
Having a distinct class just for that was a bit overkill
2017-10-12 22:13:05 -03:00
Alejandro Rodríguez faa9bd402d Create a Gitlab::Git submodule for conlict-related files
Rename classes to (hopefully) clearer names while we're doing that.
2017-10-12 22:03:15 -03:00
Alejandro Rodríguez 3fcab51ebb Refactor conflict resolution to contain git ops within Gitlab::Git
This prepares the codebase for a Gitaly migration. See
https://gitlab.com/gitlab-org/gitaly/issues/553
2017-10-12 22:03:14 -03:00
Alejandro Rodríguez 9cc15172de Clean hierarchy of calls between models and Gitalb::Git for blob search 2017-10-12 22:03:09 -03:00
Alejandro Rodríguez f72598b659 Move Gitlab::Diff::LineCode to module Gitlab::Git 2017-10-12 21:45:16 -03:00
Douwe Maan 05f46b820e Merge branch 'fix/rugged-alternate-paths' into 'master'
Fix the format of rugged alternate directory list

Closes #39046

See merge request gitlab-org/gitlab-ce!14840
2017-10-12 15:37:14 +00:00
Dmitriy Zaporozhets 400557f0ba Merge branch 'gitaly-fetch-remote' into 'master'
Add `Gitlab::Git::Repository#fetch` command

Closes gitaly#586

See merge request gitlab-org/gitlab-ce!14772
2017-10-12 14:53:32 +00:00
Ahmad Sherif a24abf39bf Fix the format of rugged alternate directory list
Fixes #39046
2017-10-12 14:20:04 +02:00
Ahmad Sherif 4378f56c7b Pass git object dir attributes as relative paths to Gitaly
Fixes gitaly#629
2017-10-11 15:46:55 +02:00
Alejandro Rodríguez 06e7eeb1c2 Use Gitaly's RepositoryService.HasLocalBranches RPC 2017-10-10 14:26:32 -03:00
Alejandro Rodríguez 1731934398 Add `Gitlab::Git::Repository#fetch` command 2017-10-09 18:25:24 -03:00
Zeger-Jan van de Weg 4656283c5c
Gitaly namespace service enabled for GitLab 2017-10-05 14:11:32 +02:00
Lin Jen-Shin e25abf5be6 Use simple path for tmp ref, avoiding extra dir
So that we don't have to worry about cleaning empty
directories later. This was brought up at:

https://gitlab.com/gitlab-org/gitlab-ce/issues/38689#note_42242988
2017-10-05 17:30:44 +08:00
Sean McGivern 4a0f720a50 Merge branch 'capture-rev-list-errors' into 'master'
Include RevList error messages in exceptions

See merge request gitlab-org/gitlab-ce!14658
2017-10-04 12:07:23 +00:00
Sean McGivern 27e18f182f Merge branch 'gitaly-fetch-ref' into 'master'
Let fetch_ref pull from Gitaly instead of from disk

Closes gitaly#585

See merge request gitlab-org/gitlab-ce!14588
2017-10-04 12:07:17 +00:00
Jacob Vosmaer 147e2b21be Let fetch_ref pull from Gitaly instead of from disk 2017-10-04 12:57:41 +02:00
Jacob Vosmaer 45c5311a8b Add missing exception variable 2017-10-04 12:29:06 +02:00
Douwe Maan c6e5a77e51 Merge branch 'gitaly-delete-branch' into 'master'
Implement OperationService.UserDeleteBranch Gitaly RPC

See merge request gitlab-org/gitlab-ce!14603
2017-10-04 07:34:33 +00:00
Alejandro Rodríguez 79719cf003 Add OperationService.UserDeleteBranch Gitaly RPC 2017-10-03 21:06:34 -03:00
Jacob Vosmaer (GitLab) 5dd26d4e5a Hide Gollum inside Gitlab::Git::Wiki 2017-10-03 16:58:33 +00:00
Jacob Vosmaer (GitLab) bfd53aa6d0 Restore User.from_gitaly 2017-10-03 16:53:11 +00:00
Jacob Vosmaer f6966d8922 Include RevList error messages in exceptions 2017-10-03 16:33:32 +02:00
Sean McGivern 1440342fcf Merge branch 'log-update-ref-errors' into 'master'
Log update-ref errors in OperationService

See merge request gitlab-org/gitlab-ce!14627
2017-10-02 15:32:59 +00:00
Douwe Maan 4716e81f9d Merge branch 'revert-configurable-size-limits' into 'master'
Revert "Increase diff limits to 100 KB for collapse and 200 KB overall"

See merge request gitlab-org/gitlab-ce!14628
2017-10-02 14:39:55 +00:00
Sean McGivern a5d47bb063 Revert "Increase diff limits to 100 KB for collapse and 200 KB overall"
This reverts commit 1d3c33b57e.
2017-10-02 13:54:40 +01:00
Jacob Vosmaer 581272f6d4 Log update-ref errors in OperationService 2017-10-02 14:39:09 +02:00
Sean McGivern 0a69abdb28 Merge branch 'gitaly-add-branch' into 'master'
Implement OperationService.UserAddBranch Gitaly RPC

Closes gitaly#544

See merge request gitlab-org/gitlab-ce!14522
2017-10-02 09:27:23 +00:00
Alejandro Rodríguez fa5f0164eb Implement OperationService.UserAddBranch Gitaly RPC 2017-09-30 00:58:56 -03:00
Alejandro Rodríguez 16f850033f Populate `Gitlay::Repository`'s `gl_repository` field 2017-09-30 00:58:56 -03:00
David Turner 01ce58bde4 add username to authorized result, so that gitlab-shell can pass it to hooks 2017-09-29 18:16:55 -04:00
David Turner dbcf48af8b Add username as GL_USERNAME in hooks (http)
When calling pre-receive, post-receive, and update hooks, add the GitLab
username as the GL_USERNAME environment variable.

This patch only handles cases where pushes are over http, or via
the web interface.  Later, we will address the ssh case.
2017-09-29 18:12:03 -04:00
David Turner 999b7e553b remove unused from_gitaly method 2017-09-29 18:12:02 -04:00
Jacob Vosmaer e5fecc3a37 Create repositories via Gitaly 2017-09-29 18:27:06 +02:00
Jacob Vosmaer (GitLab) 403712f06e Make Repository#has_visible_content more efficient 2017-09-29 13:08:44 +00:00
Ahmad Sherif 4f5be9ec7b Migrate Gitlab::Git::Repository#add_tag to Gitaly
Closes gitaly#601
2017-09-29 00:53:49 +02:00
Robert Speicher 07c3112ef5 Merge branch 'feature/migrate-repository-rm-tag-to-gitaly' into 'master'
Migrate Git::Repository#rm_tag to Gitaly

Closes gitaly#562

See merge request gitlab-org/gitlab-ce!14388
2017-09-28 22:43:37 +00:00
Ahmad Sherif 3944e16b4b Migrate Git::Repository#rm_tag to Gitaly
Closes gitaly#562
2017-09-28 23:36:40 +02:00
Sean McGivern b63e8d64c1 Handle error when fetching ref for MR with deleted source branch
If the ref doesn't exist, and the source branch is deleted, we can't get it back
easily. Previously, we ignored this error by shelling out, so replicate that
behaviour.
2017-09-28 11:11:10 +01:00
Zeger-Jan van de Weg a02881dfda RepositoryExists is always called with #gitaly_migration 2017-09-26 19:40:49 -03:00
Kim "BKC" Carlbäcker 9c16958c30 Migrate Gitlab::Git::Repository#log to Gitaly 2017-09-25 11:34:10 +02:00
Lin Jen-Shin 239332eed3 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (168 commits)
  Update CHANGELOG.md for 10.0.1
  Remove Grit settings from default settings
  Fix duplicate key errors in PostDeployMigrateUserExternalMailData migration
  Workaround for #38259
  Workaround for n+1 in Projects::TreeController#show
  Removed old icons from project page
  Make branches page translatable
  fix typo in icons section
  Don't show it if there's no project.
  Update CHANGELOG.md for 10.0.0
  Inform user that current shared projects will remain shared
  Allow the git circuit breaker to correctly handle missing repository storages
  Reserve refs/replace cos `git-replace` is using it
  Resolve "Better SVG Usage in the Frontend"
  Replace the 'project/service.feature' spinach test with an rspec analog
  Replace the 'project/shortcuts.feature' spinach test with an rspec analog
  Removed two legacy config options
  Fix rendering double note issue.
  IssueNotes: Switch back to Write pane when note cancel or submit.
  Upgrade Nokogiri because of CVE-2017-9050
  ...
2017-09-25 15:42:34 +08:00
Douwe Maan 7cf8e0981a Merge branch '36549-circuit-breaker-handles-missing-storages' into 'master'
Allow the git circuit breaker to correctly handle missing repository storages

Closes #36549

See merge request gitlab-org/gitlab-ce!14417
2017-09-22 20:24:22 +00:00
Douwe Maan 604f176bf8 Merge branch 'feature/migrate-repository-diff' into 'master'
Migrate Gitlab::Git::Repository#diff to Gitaly

Closes gitaly#524

See merge request gitlab-org/gitlab-ce!14251
2017-09-22 11:43:11 +00:00
Douwe Maan 408c595292 Merge branch 'sh-blob-raw-check' into 'master'
Ensure that Blob.raw returns always returns a valid blob object

See merge request gitlab-org/gitlab-ce!14412
2017-09-22 10:40:27 +00:00
Nick Thomas ba0ebbb510 Allow the git circuit breaker to correctly handle missing repository storages 2017-09-22 10:05:28 +01:00
Stan Hu 794b4c5579 Ensure that Blob.raw returns always returns a valid blob object
In gitlab-org/gitlab-ee!2976, we saw that a given OID could point
to a commit, which would cause the delta size check to fail.
Gitaly already returns nil if the OID isn't a blob, so this change
makes the Rugged implementation consistent.
2017-09-21 14:49:51 -04:00
Robin Bobbitt fbe205f92f Display full pre-receive and post-receive hook output in GitLab UI 2017-09-21 09:13:00 -04:00
Ahmad Sherif eb36fa17a6 Migrate Gitlab::Git::Repository#diff to Gitaly
Closes gitaly#524
2017-09-21 11:05:06 +02:00
Alejandro Rodríguez 34eeac6108 Use Gitlab::Git's Popen on that module's code
This allows the current Gitaly migration to depend on less code outside
of the Gitlab::Git module
2017-09-20 13:21:54 +02:00
Jacob Vosmaer (GitLab) 75509fac17 Prepare cherry-pick and revert for migration to Gitaly 2017-09-19 17:09:10 +00:00
Andrew Newdigate 64d7ec0a9e Detect n+1 issues involving Gitaly 2017-09-19 10:55:37 +00:00
Lin Jen-Shin 9ae92b8caa Add cop to make sure we don't use ivar in a module 2017-09-18 21:23:45 +08:00
Jacob Vosmaer 902b5347dc Prepare Repository#merge for migration to Gitaly 2017-09-15 16:39:20 +02:00
Jacob Vosmaer 9e40baba1e Rename Gitlab::Git::Committer to User 2017-09-14 17:42:02 +02:00
Kim "BKC" Carlbäcker 25c34608b9 Migrate Git::CommitStats to Gitaly 2017-09-11 21:00:58 +02:00
Alejandro Rodríguez c2e99b40f7 Implement fix for n+1 issue on `flatten_tree` helper 2017-09-06 17:47:25 -03:00
Robert Speicher 86cbf60cbb Merge branch 'feature/migrate-branch-operations-to-gitaly' into 'master'
Migrate creating/deleting a branch to Gitaly

See merge request !13864
2017-09-06 17:26:05 +00:00
Ahmad Sherif 41ef94e777 Migrate creating/deleting a branch to Gitaly 2017-09-06 17:25:17 +02:00
micael.bergeron a6af5522d7 renames ambiguous methods and add spec 2017-09-06 09:01:53 -04:00
micael.bergeron dbaed90c8d fix refactoring error with Blob.binary?
remove some lint
2017-09-06 09:01:53 -04:00
micael.bergeron c9aa793215 revert to using a simple representation 2017-09-06 09:01:53 -04:00
micael.bergeron bca72f5906 wip: fake its a binary diff 2017-09-06 09:01:53 -04:00
Ahmad Sherif e10437de40 Migrate Gitlab::Git::Repository#find_branch to Gitaly 2017-09-05 17:29:45 +00:00
Jacob Vosmaer 9d88ad45d2 Add Gitaly migration points for branch/tag create/delete 2017-09-05 12:00:13 +02:00
Sean McGivern 4efdb451b5 Merge branch 'move-git-operation-service' into 'master'
Move GitOperationService to Gitlab::Git

See merge request !13984
2017-09-04 11:06:12 +00:00
Sean McGivern dabce2c571 Merge branch 'git-operation-service-to-git' into 'master'
Prepare GitOperationService for moving to Gitlab::Git

See merge request !13773
2017-09-04 10:56:26 +00:00
Jacob Vosmaer 6cdaa27a53 Move GitOperationService to Gitlab::Git 2017-09-01 14:37:56 +02:00
Jacob Vosmaer (GitLab) 0187018e48 Simplify Git interactions in AfterImportService 2017-09-01 12:01:50 +00:00
Jacob Vosmaer 254f5ab62b Add Gitlab::Git::Repository#== 2017-09-01 11:40:07 +02:00
Jacob Vosmaer 8ad690b0d4 Prepare GitOperationService for move to Gitlab::Git 2017-08-31 15:35:59 +02:00
Sean McGivern 91a55ed6a1 Merge branch 'gitaly-440-shell-fetch-remote' into 'master'
Migrate Repository.FetchRemote to Gitaly

See merge request !13625
2017-08-31 11:08:45 +00:00
Kim "BKC" Carlbäcker b77176d11a Migrate Repository.FetchRemote to Gitaly
- `Gitlab::Shell.fetch_remote` now takes a `Gitlab::Git::Repository` instead
2017-08-30 20:51:56 +02:00
Lin Jen-Shin c5553ce772 Use `git update-ref --stdin -z` to delete refs 2017-08-30 22:01:23 +08:00
Lin Jen-Shin 86149a8216 Merge remote-tracking branch 'upstream/master' into 36807-gc-unwanted-refs-after-import
* upstream/master: (225 commits)
  Add changelog entry
  Backports EE 2756 logic to CE.
  Make rubocop happy
  Make profile settings dropdown consistent
  Add filter by my reaction
  Update spec initialization with it being a shared component
  Update identicon path and selector
  Renamed to `identicon` and make shared component
  Merge branch 'master-i18n' into 'master'
  Fix broken Frontend JS guide
  Replace 'project/star.feature' spinach test with an rspec analog
  Adds position fixed to right sidebar
  Fixes the margin of the top buttons of the pipeline page
  Remove commented out code
  Better align fallback image emojis
  Decrease Metrics/CyclomaticComplexity threshold to 15
  Add changelog
  Respect the default visibility level when creating a group
  Further break with_repo_branch_commit into parts
  Make sure inspect doesn't generate crazy string
  ...
2017-08-30 21:13:19 +08:00
Lin Jen-Shin 9954dafda5 Just use a block 2017-08-29 16:23:12 +08:00
Maxim Rydkin 10ae0d8316 replace `is_ancestor` with `ancestor?` 2017-08-29 11:14:42 +03:00
Maxim Rydkin 87467127b6 replace `is_ancestor?` with `ancestor?` 2017-08-29 11:14:41 +03:00
Lin Jen-Shin d1054bd3dd Resolve feedback on the MR:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13766

* Rename AfterImportService
* Use constants
* Move Git operations to Gitlab::Git::Repository
* Use Regexp.union
2017-08-25 22:38:07 +08:00
Sean McGivern e46a3d2fda Merge branch 'git-operation-user' into 'master'
Move GitHooksService into Gitlab::Git

See merge request !13739
2017-08-24 14:32:17 +00:00
Andrew Newdigate fb49c94e49 Delegate Repository::branch_exists? and ref_exists? to Gitlab::Git 2017-08-24 09:20:04 +00:00
Douwe Maan 93ad83443a Merge branch 'sh-fix-branch-count' into 'master'
Fix inconsistent number of branches when remote branches are present

Closes #36934

See merge request !13784
2017-08-24 07:42:30 +00:00
Stan Hu 37904108b9 Fix inconsistent number of branches when remote branches are present
Users of project mirrors would see that the number of branches did not
match the number in the branch dropdown because remote branches were
counted when Rugged was in use. With Gitaly, only local branches
are counted.

Closes #36934
2017-08-23 22:07:32 -07:00
Sean McGivern d546f7d36e Merge branch 'gitaly-commit-patch' into 'master'
Incorporate DiffService.CommitPatch Gitaly RPC

Closes gitaly#463

See merge request !13441
2017-08-23 10:39:01 +00:00
Jacob Vosmaer da769135fe Rubocop whitespace 2017-08-23 10:45:20 +02:00
Jacob Vosmaer dc7c6bede2 Move GitHooksService to Gitlab::Git 2017-08-23 10:45:20 +02:00
Jacob Vosmaer 65f83941c3 Make gl_repository a G::G::Repository attribute 2017-08-23 10:45:20 +02:00
Jacob Vosmaer 9b93093292 Decouple GitOperationService from User 2017-08-23 10:45:20 +02:00
Alejandro Rodríguez 258d5a50e6 Incorporate DiffService.CommitPatch Gitaly RPC 2017-08-22 16:31:59 -03:00
Jacob Vosmaer 3049dfaf48 Simplify return values 2017-08-18 16:03:27 +02:00
Jacob Vosmaer df7f2b135a Simplify method arguments 2017-08-18 15:59:17 +02:00
Jacob Vosmaer a902166475 More annotations 2017-08-18 15:55:30 +02:00
Jacob Vosmaer faaed0aa1f Delete unused Gitlab::Git methods 2017-08-18 14:12:17 +02:00
Jacob Vosmaer 66afd1ee1c Add Gitaly annotation 2017-08-18 14:07:51 +02:00
Andrew Newdigate aaa887feba Client Implementation: RefService::RefExists 2017-08-18 09:43:58 +01:00
Alejandro Rodríguez c463a83405 Incorporate RepositoryService.ApplyGitattributes Gitaly RPC 2017-08-17 14:44:30 -03:00
Robert Speicher ec34b2d051 Merge branch 'dm-gpg-signature-performance' into 'master'
Only create commit GPG signature when necessary

See merge request !13561
2017-08-16 18:34:55 +00:00
Douwe Maan ba7251fefd Only create commit GPG signature when necessary 2017-08-16 18:57:50 +02:00
Rémy Coutable fcce6c3168 Merge branch 'rs-more-public-send-whitelists' into 'master'
Whitelist or fix additional `Gitlab/PublicSend` cop violations

See merge request !13467
2017-08-16 11:25:26 +00:00
Rémy Coutable 7b68bdce15 Merge branch 'rs-trailingwhitespace-cop' into 'master'
Enable Layout/TrailingWhitespace cop and auto-correct offenses

See merge request !13573
2017-08-16 10:27:46 +00:00
Robert Speicher 4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Nick Thomas 5fc871381a Speed up project creation by inlining repository creation 2017-08-15 18:33:07 +01:00
Douwe Maan 0da644072f Merge branch 'malformed-submodule' into 'master'
Handle missing .gitmodules when getting submodule urls

See merge request !13509
2017-08-15 09:00:44 +00:00
Robert Speicher 260c8da060 Whitelist or fix additional `Gitlab/PublicSend` cop violations
An upcoming update to rubocop-gitlab-security added additional
violations.
2017-08-14 12:14:11 -04:00
Douwe Maan a64760d6d0 Merge branch 'gitaly-404-commit-list-files' into 'master'
Migrate `Git::Repository.ls_files` to Gitaly

Closes gitaly#404

See merge request !13302
2017-08-14 15:44:36 +00:00
Jacob Vosmaer d9b6fd4fba Handle missing .gitmodules when getting submodule urls 2017-08-14 10:53:02 +02:00
Kim "BKC" Carlbäcker 7b10885046 Migrate Git::Repository.ls_files to Gitaly 2017-08-10 16:10:47 +02:00
Jacob Vosmaer b21539cc57 Expose the raw_log method 2017-08-09 15:37:05 +02:00
Brian Neel 9770c57fab Re-enable SqlInjection and CommandInjection 2017-08-08 10:50:54 -04:00
Dmitriy Zaporozhets 1439115183 Merge branch 'gitaly-find-commit' into 'master'
Incorporate Gitaly's CommitService.FindCommit RPC

Closes gitaly#402

See merge request !13094
2017-08-08 14:27:22 +00:00
Alejandro Rodríguez 3ce6f03f14 Incorporate Gitaly's CommitService.FindCommit RPC 2017-08-07 23:33:43 -04:00
Alejandro Rodríguez e363fbf71a Move `deltas` and `diff_from_parents` logic to Gitlab::Git::Commit
This helps keep the abstraction layers simpler, and also keep the
interface of those methods consistent, in case of implementation
changes.
2017-08-07 23:33:40 -04:00
Alejandro Rodríguez c21ae07e33 Refactor Gitlab::Git::Commit to include a repository 2017-08-07 22:34:34 -04:00
Robert Speicher 6085ce1352 Merge branch 'feature/migrate-repository-size-to-gitaly' into 'master'
Migrate Gitlab::Git::Repository#size to Gitaly

Closes gitaly#437

See merge request !13259
2017-08-07 21:29:32 +00:00
Douwe Maan 942bd5b411 Merge branch 'blob-batch-methods' into 'master'
Add Gitlab::Git::Blob.batch method

See merge request !13225
2017-08-07 19:57:25 +00:00
Ahmad Sherif c4f55ce32d Migrate Gitlab::Git::Repository#size to Gitaly
Closes gitaly#437
2017-08-07 18:53:32 +02:00