Commit Graph

65 Commits

Author SHA1 Message Date
GitLab Bot 44696847f6 Add latest changes from gitlab-org/gitlab@master 2023-10-13 03:10:36 +00:00
GitLab Bot fdb5a6d73c Add latest changes from gitlab-org/gitlab@master 2023-10-05 03:08:14 +00:00
GitLab Bot 49d36ce6e3 Add latest changes from gitlab-org/gitlab@master 2023-10-04 12:17:55 +00:00
GitLab Bot 2f08c2b7d2 Add latest changes from gitlab-org/gitlab@master 2023-10-03 15:10:59 +00:00
GitLab Bot 1690313142 Add latest changes from gitlab-org/gitlab@master 2022-12-08 21:09:17 +00:00
GitLab Bot 5b72415235 Add latest changes from gitlab-org/gitlab@master 2022-09-02 00:11:46 +00:00
GitLab Bot be8b477154 Add latest changes from gitlab-org/gitlab@master 2021-06-29 03:07:32 +00:00
GitLab Bot c59765a50a Add latest changes from gitlab-org/gitlab@master 2020-06-24 18:09:03 +00:00
GitLab Bot c6b3ec3f56 Add latest changes from gitlab-org/gitlab@master 2020-04-07 15:09:30 +00:00
GitLab Bot 154b9bae14 Add latest changes from gitlab-org/gitlab@master 2020-03-17 21:09:16 +00:00
GitLab Bot cbfe03ae04 Add latest changes from gitlab-org/gitlab@master 2020-03-16 12:09:12 +00:00
GitLab Bot cd52759ee3 Add latest changes from gitlab-org/gitlab@master 2020-03-12 12:09:17 +00:00
GitLab Bot df2eda3f14 Add latest changes from gitlab-org/gitlab@master 2020-02-20 18:08:51 +00:00
GitLab Bot 0ab47b994c Add latest changes from gitlab-org/gitlab@master 2020-02-13 15:08:52 +00:00
GitLab Bot 143f196f8b Add latest changes from gitlab-org/gitlab@master 2019-11-18 18:06:53 +00:00
GitLab Bot b3e4ec8e8a Add latest changes from gitlab-org/gitlab@master 2019-10-23 09:06:03 +00:00
GitLab Bot 25989ab7ef Add latest changes from gitlab-org/gitlab@master 2019-10-18 11:11:44 +00:00
GitLab Bot 3744bcc0d1 Add latest changes from gitlab-org/gitlab@master 2019-10-09 09:06:19 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
Patrick Bajao c08191e0d5 Remove the fallback path from gitlab-ce 2019-08-29 16:33:04 +08:00
Thong Kuah 8c42a0eac0 Add frozen_string_literal to lib part 2
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-08-23 00:15:24 +12:00
Zeger-Jan van de Weg 951afba624
Remove hook directory requirement from Shell
It used to be the case that GitLab created symlinks for each repository
to one copy of the Git hooks, so these ran when required. This changed
to set the hooks dynamically on Gitaly when invoking Git.

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

Related: https://gitlab.com/gitlab-org/gitaly/issues/1392#note_175619926
2019-05-30 20:04:08 +02:00
Patrick Bajao 26dadbc9c4 Integrate Gitlab::Keys with Gitlab::Shell
In this commit, some methods that aren't being used
are removed from `Gitlab::Shell`. They are the ff:
- `#remove_keys_not_found_in_db`
- `#batch_read_key_ids`
- `#list_key_ids`

The corresponding methods in `Gitlab::Keys` have been
removed as well.
2019-03-19 11:16:21 +00:00
Jacob Vosmaer 078f11a6b9 Prepare test suite for switch to Gitaly-embedded Git hooks 2019-02-27 10:58:21 +00:00
Stan Hu 6bac612dc4 Clean up Shell.fork_repository
Use project models instead of a list of parameters.
2019-02-05 21:33:09 -08:00
Stan Hu 82b6e5378a Send project name with Gitaly repository requests
When hashed storage is in use, it's helpful to have the project
name associated with the request.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1394
2019-02-05 21:33:09 -08:00
Nick Thomas 668e5d63fa
Stop Repository#fetch_remote from using Gitlab::Shell
This indirection doesn't provide any value, so remove it
2018-11-06 12:42:00 +00:00
Alejandro Rodríguez d3c5b07962 Remove Rugged and shell code from Gitlab::Git 2018-09-12 12:32:32 -03:00
Jacob Vosmaer a4e75e7a83 Use Gitaly for fetches and creating bundles 2018-07-09 12:50:17 +02:00
Zeger-Jan van de Weg 1dc0332726
Move forking to Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/817

Closes https://gitlab.com/gitlab-org/gitaly/issues/1236
2018-06-19 13:30:54 +02:00
Jacob Vosmaer f376347f24 Find and mark more Git disk access locations, part 2 2018-06-12 14:33:37 +02:00
Jacob Vosmaer (GitLab) a0808df0b6 Find and mark more Git disk access locations 2018-06-05 15:51:14 +00:00
Zeger-Jan van de Weg ec4423665c
Gitlab::Shell works on shard name, not path
Direct disk access is done through Gitaly now, so the legacy path was
deprecated. This path was used in Gitlab::Shell however. This required
the refactoring in this commit.

Added is the removal of direct path access on the project model, as that
lookup wasn't needed anymore is most cases.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1111
2018-04-25 13:36:22 +02:00
🙈 jacopo beschi 🙉 c6b1043e9d Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00: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
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
Jacob Vosmaer 008a6a6ce6 Route path lookups through legacy_disk_path 2018-03-21 18:18:32 +01:00
Zeger-Jan van de Weg 77f0906e4c
Change Gitlab::Shell#add_namespace to #create_namespace
Prior to this change, this method was called add_namespace, which broke
the CRUD convention and made it harder to grep for what I was looking
for. Given the change was a find and replace kind of fix, this was
changed without opening an issue and on another feature branch.

If more dynamic calls are made to add_namespace, these could've been
missed which might lead to incorrect bahaviour. However, going through
the commit log it seems thats not the case.
2018-03-14 09:56:22 +01: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
Nick Thomas 6b0c6e69e1
Use hashed storage in the specs 2018-02-07 13:40:46 +00:00
Douwe Maan ed2c9797e1 Merge branch 'zj-migrate-gitlab-project-rm-mv' into 'master'
Migrate GitlabProject (re)move project endpoints

Closes gitaly#873

See merge request gitlab-org/gitlab-ce!16249
2018-01-10 10:09:57 +00: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
Douwe Maan 2e4a1b3b78 Merge branch 'jej/backport-authorized-keys-to-ce' into 'master'
Backport authorized_keys

Closes gitlab-ee#3953

See merge request gitlab-org/gitlab-ce!16014
2018-01-09 11:21:23 +00:00
James Edwards-Jones bd9ead683c Fix spec in shell_spec.rb
The spec for "#add_key does nothing" would always have passed,
since the expectation was on both the wrong object and message.
2018-01-08 20:34:38 +00:00
Valery Sizov d9557e43e4 Backport spec fixes in spec/lib/gitlab/shell_spec.rb 2018-01-08 20:34:37 +00:00
Michael Kozono 797fe0a6e6 Backport authorized_keys_enabled defaults to true'
Originally from branch 'fix-authorized-keys-enabled-default-2738' via merge request https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2240

Removed background migrations which were intended to fix state after using Gitlab
without a default having been set

Squashed commits:
Locally, if Spring was not restarted, `current_application_settings` was still cached, which prevented the migration from editing the file. This will also ensure that any app server somehow hitting old cache data will properly default this setting regardless.
Retroactively fix migration
  This allows us to identify customers who ran the broken migration. Their `authorized_keys_enabled` column does not have a default at this point.
  We will fix the column after we fix the `authorized_keys` file.
Fix authorized_keys file if needed
Add default to authorized_keys_enabled setting
  Reminder: The original migration was fixed retroactively a few commits ago, so people who did not ever run GitLab 9.3.0 already have a column that defaults to true and disallows nulls. I have tested on PostgreSQL and MySQL that it is safe to run this migration regardless.
  Affected customers who did run 9.3.0 are the ones who need this migration to fix the authorized_keys_enabled column.
  The reason for the retroactive fix plus this migration is that it allows us to run a migration in between to fix the authorized_keys file only for those who ran 9.3.0.
Tweaks to address feedback
Extract work into background migration
Move batch-add-logic to background migration
  Do the work synchronously to avoid multiple workers attempting to add batches of keys at the same time.
  Also, make the delete portion wait until after adding is done.
Do read and delete work in background migration
Fix Rubocop offenses
Add changelog entry
Inform the user of actions taken or not taken
Prevent unnecessary `select`s and `remove_key`s
Add logs for action taken
Fix optimization
Reuse `Gitlab::ShellAdapter`
Guarantee the earliest key
Fix migration spec for MySQL
2018-01-08 20:34:20 +00:00
Michael Kozono 255a0f85e3 Backport option to disable writing to `authorized_keys` file
Originally branch 'mk-toggle-writing-to-auth-keys-1631'

See merge request !2004

Squashed commits:
Add authorized_keys_enabled to Application Settings
Ensure default settings are exposed in UI
Without this change, `authorized_keys_enabled` is unchecked when it is nil, even if it should be checked by default.
Add “Speed up SSH operations” documentation
Clarify the reasons for disabling writes
Add "How to go back" section
Tweak copy
Update Application Setting screenshot
2018-01-08 20:34:19 +00:00
Alejandro Rodríguez 15ddfa2b5b Pass timeout to RepositoryService.FetchRemote Gitaly RPC calls 2018-01-05 18:27:00 -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