diff options
-rw-r--r-- | GITALY_SERVER_VERSION | 2 | ||||
-rw-r--r-- | app/assets/javascripts/repository/components/blob_viewers/image_viewer.vue | 2 | ||||
-rw-r--r-- | app/services/repositories/base_service.rb | 2 | ||||
-rw-r--r-- | app/services/repositories/destroy_rollback_service.rb | 8 | ||||
-rw-r--r-- | app/services/repositories/destroy_service.rb | 6 | ||||
-rw-r--r-- | app/views/projects/blob/edit.html.haml | 18 | ||||
-rw-r--r-- | app/views/projects/pipeline_schedules/_form.html.haml | 2 | ||||
-rw-r--r-- | config/feature_flags/development/pipeline_schedules_with_tags.yml | 2 | ||||
-rw-r--r-- | doc/api/groups.md | 9 | ||||
-rw-r--r-- | doc/development/backend/create_source_code_be/index.md | 143 | ||||
-rw-r--r-- | doc/development/index.md | 4 | ||||
-rw-r--r-- | doc/user/profile/account/delete_account.md | 77 | ||||
-rw-r--r-- | locale/gitlab.pot | 9 | ||||
-rw-r--r-- | spec/services/repositories/destroy_rollback_service_spec.rb | 17 | ||||
-rw-r--r-- | spec/services/repositories/destroy_service_spec.rb | 22 |
15 files changed, 247 insertions, 76 deletions
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 4aece4e3baf..6dc73c70b82 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -1ee9d9c2d3981592085407f5f3b05502fd2df105 +ebb18ecc514b369fb0958dab95ba803a20c67cd4 diff --git a/app/assets/javascripts/repository/components/blob_viewers/image_viewer.vue b/app/assets/javascripts/repository/components/blob_viewers/image_viewer.vue index 5027f7877aa..014f1abc121 100644 --- a/app/assets/javascripts/repository/components/blob_viewers/image_viewer.vue +++ b/app/assets/javascripts/repository/components/blob_viewers/image_viewer.vue @@ -16,6 +16,6 @@ export default { </script> <template> <div class="gl-text-center gl-p-7 gl-bg-gray-50"> - <img :src="url" :alt="alt" data-testid="image" /> + <img :src="url" :alt="alt" data-testid="image" class="gl-max-w-full" /> </div> </template> diff --git a/app/services/repositories/base_service.rb b/app/services/repositories/base_service.rb index efb6f6de8db..13ad126f8f0 100644 --- a/app/services/repositories/base_service.rb +++ b/app/services/repositories/base_service.rb @@ -18,8 +18,6 @@ class Repositories::BaseService < BaseService end def mv_repository(from_path, to_path) - return true unless repo_exists?(from_path) - gitlab_shell.mv_repository(repository.shard, from_path, to_path) end diff --git a/app/services/repositories/destroy_rollback_service.rb b/app/services/repositories/destroy_rollback_service.rb index 5ef4e11bf55..a19e305607f 100644 --- a/app/services/repositories/destroy_rollback_service.rb +++ b/app/services/repositories/destroy_rollback_service.rb @@ -12,8 +12,14 @@ class Repositories::DestroyRollbackService < Repositories::BaseService log_info(%Q{Repository "#{removal_path}" moved to "#{disk_path}" for repository "#{full_path}"}) success - else + elsif repo_exists?(removal_path) + # If the repo does not exist, there is no need to return an + # error because there was nothing to do. move_error(removal_path) + else + success end + rescue Gitlab::Git::Repository::NoRepository + success end end diff --git a/app/services/repositories/destroy_service.rb b/app/services/repositories/destroy_service.rb index 1e34dfbe398..c5a0af56066 100644 --- a/app/services/repositories/destroy_service.rb +++ b/app/services/repositories/destroy_service.rb @@ -30,8 +30,12 @@ class Repositories::DestroyService < Repositories::BaseService log_info("Repository \"#{full_path}\" was removed") success - else + elsif repo_exists?(disk_path) move_error(disk_path) + else + success end + rescue Gitlab::Git::Repository::NoRepository + success end end diff --git a/app/views/projects/blob/edit.html.haml b/app/views/projects/blob/edit.html.haml index 8378ce2c7e5..773137ff3f2 100644 --- a/app/views/projects/blob/edit.html.haml +++ b/app/views/projects/blob/edit.html.haml @@ -4,14 +4,16 @@ - webpack_preload_asset_tag('monaco') - if @conflict - .gl-alert.gl-alert-danger.gl-mb-5.gl-mt-5 - .gl-alert-container - = sprite_icon('error', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') - .gl-alert-content - .gl-alert-body - Someone edited the file the same time you did. Please check out - = link_to _('the file'), project_blob_path(@project, tree_join(@branch_name, @file_path)), target: "_blank", rel: 'noopener noreferrer', class: 'gl-link' - and make sure your changes will not unintentionally remove theirs. + = render 'shared/global_alert', + alert_class: 'gl-mb-5 gl-mt-5', + variant: :danger, + dismissible: false do + - blob_url = project_blob_path(@project, @id) + - external_link_icon = content_tag 'span', { aria: { label: _('Opens new window') }} do + - sprite_icon('external-link', css_class: 'gl-icon').html_safe + - blob_link_start = '<a href="%{url}" class="gl-link" target="_blank" rel="noopener noreferrer">'.html_safe % { url: blob_url } + = _('Someone edited the file the same time you did. Please check out %{link_start}the file %{icon}%{link_end} and make sure your changes will not unintentionally remove theirs.').html_safe % { link_start: blob_link_start, link_end: '</a>'.html_safe , icon: external_link_icon } + %h3.page-title.blob-edit-page-title Edit file diff --git a/app/views/projects/pipeline_schedules/_form.html.haml b/app/views/projects/pipeline_schedules/_form.html.haml index 1c828952f6c..0818c3d5cff 100644 --- a/app/views/projects/pipeline_schedules/_form.html.haml +++ b/app/views/projects/pipeline_schedules/_form.html.haml @@ -15,7 +15,7 @@ = f.text_field :cron_timezone, value: @schedule.cron_timezone, id: 'schedule_cron_timezone', class: 'hidden', name: 'schedule[cron_timezone]', required: true .form-group.row .col-md-9 - = f.label :ref, Feature.enabled?(:pipeline_schedules_with_tags) ? _('Target branch or tag') : _('Target branch'), class: 'label-bold' + = f.label :ref, Feature.enabled?(:pipeline_schedules_with_tags, default_enabled: :yaml) ? _('Target branch or tag') : _('Target branch'), class: 'label-bold' %div{ data: { testid: 'schedule-target-ref' } } .js-target-ref-dropdown{ data: { project_id: @project.id, default_branch: @project.default_branch } } = f.text_field :ref, value: @schedule.ref, id: 'schedule_ref', class: 'hidden', name: 'schedule[ref]', required: true diff --git a/config/feature_flags/development/pipeline_schedules_with_tags.yml b/config/feature_flags/development/pipeline_schedules_with_tags.yml index 8d58ff27135..9eb7b60d300 100644 --- a/config/feature_flags/development/pipeline_schedules_with_tags.yml +++ b/config/feature_flags/development/pipeline_schedules_with_tags.yml @@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/354421 milestone: '14.9' type: development group: group::pipeline execution -default_enabled: false +default_enabled: true diff --git a/doc/api/groups.md b/doc/api/groups.md index d4a0b4fed95..120090c18a2 100644 --- a/doc/api/groups.md +++ b/doc/api/groups.md @@ -484,7 +484,9 @@ Example response: ## Details of a group Get all details of a group. This endpoint can be accessed without authentication -if the group is publicly accessible. In case the user that requests is administrator of the group, it returns the `runners_token` for the group too. +if the group is publicly accessible. In case the user that requests is an administrator +if the group is publicly accessible. With authentication, it returns the `runners_token` +for the group too, if the user is an administrator or group owner. ```plaintext GET /groups/:id @@ -506,6 +508,11 @@ To get the details of all projects within a group, use either the [list a group' curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/4" ``` +NOTE: +There is [a known issue](https://gitlab.com/gitlab-org/gitlab/-/issues/345200) that can +prevent `runners_token` from being returned when the call has the `with_projects=false` +parameter. + This endpoint returns: - All projects and shared projects in GitLab 12.5 and earlier. diff --git a/doc/development/backend/create_source_code_be/index.md b/doc/development/backend/create_source_code_be/index.md new file mode 100644 index 00000000000..6421ca3754a --- /dev/null +++ b/doc/development/backend/create_source_code_be/index.md @@ -0,0 +1,143 @@ +--- +stage: Create +group: Source Code +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments +--- + +# Create: Source Code Backend + +The Create:Source Code BE team focuses on the GitLab suite of Source Code Management +(SCM) tools. It is responsible for all backend aspects of the product categories +that fall under the [Source Code group](https://about.gitlab.com/handbook/product/categories/#source-code-group) +of the [Create stage](https://about.gitlab.com/handbook/product/categories/#create-stage) +of the [DevOps lifecycle](https://about.gitlab.com/handbook/product/categories/#devops-stages). + +We interface with the Gitaly and Code Review teams, and work closely with the +[Create:Source Code Frontend team](https://about.gitlab.com/handbook/engineering/development/dev/create-source-code-fe). The features +we work with are listed on the +[Features by Group Page](https://about.gitlab.com/handbook/product/categories/features/#createsource-code-group). + +The team works across three codebases: Workhorse, GitLab Shell and GitLab Rails. + +## Workhorse + +GitLab Workhorse is a smart reverse proxy for GitLab. It handles "large" HTTP +requests such as file downloads, file uploads, `git push`, `git pull` and `git` archive downloads. + +Workhorse itself is not a feature, but there are several features in GitLab +that would not work efficiently without Workhorse. + +Workhorse documentation is available in the [Workhorse repository](https://gitlab.com/gitlab-org/gitlab/tree/master/workhorse). + +## GitLab Shell + +GitLab Shell handles Git SSH sessions for GitLab and modifies the list of authorized keys. +For more information, [refer to the README](https://gitlab.com/gitlab-org/gitlab-shell/-/blob/main/README.md). +for GitLab Shell. + +## GitLab Rails + +### Source code API endpoints + +| Endpoint | Threshold | Source | +| -----------------------------------------------------------------------------------|---------------------------------------|--------------------------------------------------------------------------------------| +| `DELETE /api/:version/projects/:id/protected_branches/:name` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/protected_branches.rb) | +| `GET /api/:version/internal/authorized_keys` | `:high` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/internal/base.rb) | | | +| `GET /api/:version/internal/lfs` | `:high` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/internal/lfs.rb)| +| `GET /api/:version/projects/:id/approval_rules` | `:low` | | +| `GET /api/:version/projects/:id/approval_settings` | default | | +| `GET /api/:version/projects/:id/approvals` | default | | +| `GET /api/:version/projects/:id/forks` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/projects.rb) | +| `GET /api/:version/projects/:id/groups` | default | [source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/projects.rb) | +| `GET /api/:version/projects/:id/languages` | `:medium` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/projects.rb) | +| `GET /api/:version/projects/:id/merge_request_approval_setting` | `:medium` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/api/merge_request_approval_settings.rb) | +| `GET /api/:version/projects/:id/merge_requests/:merge_request_iid/approval_rules` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/api/merge_request_approval_rules.rb) | +| `GET /api/:version/projects/:id/merge_requests/:merge_request_iid/approval_settings` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/api/project_approval_settings.rb) | +| `GET /api/:version/projects/:id/merge_requests/:merge_request_iid/approval_state` | `:low` | [source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/merge_request_approvals.rb) | +| `GET /api/:version/projects/:id/merge_requests/:merge_request_iid/approvals` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/merge_request_approvals.rb) | +| `GET /api/:version/projects/:id/protected_branches` | default |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/protected_branches.rb) | +| `GET /api/:version/projects/:id/protected_branches/:name` | default |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/protected_branches.rb) | +| `GET /api/:version/projects/:id/protected_tags` | default | | +| `GET /api/:version/projects/:id/protected_tags/:name` | default | | +| `GET /api/:version/projects/:id/push_rule` | default | | +| `GET /api/:version/projects/:id/remote_mirrors` | default | | +| `GET /api/:version/projects/:id/repository/archive` | default | | +| `GET /api/:version/projects/:id/repository/blobs/:sha` | default | | +| `GET /api/:version/projects/:id/repository/blobs/:sha/raw` | default | | +| `GET /api/:version/projects/:id/repository/branches` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/branches.rb) | +| `GET /api/:version/projects/:id/repository/branches/:branch` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/branches.rb) | +| `GET /api/:version/projects/:id/repository/commits` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/commits.rb)| +| `GET /api/:version/projects/:id/repository/commits/:sha` | default | [source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/commits.rb) | +| `GET /api/:version/projects/:id/repository/commits/:sha/comments` | default | [source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/commits.rb) | +| `GET /api/:version/projects/:id/repository/commits/:sha/diff` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/commits.rb) | +| `GET /api/:version/projects/:id/repository/commits/:sha/merge_requests` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/commits.rb)| +| `GET /api/:version/projects/:id/repository/commits/:sha/refs` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/commits.rb) | +| `GET /api/:version/projects/:id/repository/compare` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/repositories.rb) | +| `GET /api/:version/projects/:id/repository/contributors` | default | | +| `GET /api/:version/projects/:id/repository/files/:file_path` | default | | +| `GET /api/:version/projects/:id/repository/files/:file_path/raw` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/files.rb) | +| `GET /api/:version/projects/:id/repository/tags` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/tags.rb) | +| `GET /api/:version/projects/:id/repository/tree` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/repositories.rb) | +| `GET /api/:version/projects/:id/statistics` | default | | +| `GraphqlController#execute` | default | | +| `HEAD /api/:version/projects/:id/repository/files/:file_path` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/files.rb) | +| `HEAD /api/:version/projects/:id/repository/files/:file_path/raw` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/files.rb) | +| `POST /api/:version/internal/allowed` | default | [source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/internal/base.rb) | +| `POST /api/:version/internal/lfs_authenticate` | `:high` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/internal/base.rb) | +| `POST /api/:version/internal/post_receive` | default | [source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/internal/base.rb) | +| `POST /api/:version/internal/pre_receive` | `:high` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/internal/base.rb) | +| `POST /api/:version/projects/:id/approvals` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/api/project_approvals.rb) | +| `POST /api/:version/projects/:id/merge_requests/:merge_request_iid/approvals` | `:low` | [source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/merge_request_approvals.rb) | +| `POST /api/:version/projects/:id/merge_requests/:merge_request_iid/approve` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/merge_request_approvals.rb) | +| `POST /api/:version/projects/:id/merge_requests/:merge_request_iid/unapprove` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/merge_request_approvals.rb)| +| `POST /api/:version/projects/:id/protected_branches` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/protected_branches.rb)| +| `POST /api/:version/projects/:id/repository/commits` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/commits.rb)| +| `POST /api/:version/projects/:id/repository/files/:file_path` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/files.rb) | +| `PUT /api/:version/projects/:id/push_rule` | default | | +| `PUT /api/:version/projects/:id/repository/files/:file_path` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/files.rb) | +| `Projects::BlameController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/blame_controller.rb) | +| `Projects::BlobController#create` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/blob_controller.rb) | +| `Projects::BlobController#diff` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/blob_controller.rb) | +| `Projects::BlobController#edit` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/blob_controller.rb) | +| `Projects::BlobController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/blob_controller.rb) | +| `Projects::BlobController#update` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/blob_controller.rb) | +| `Projects::BranchesController#create` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/branches_controller.rb) | +| `Projects::BranchesController#destroy` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/branches_controller.rb) | +| `Projects::BranchesController#diverging_commit_counts` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/branches_controller.rb) | +| `Projects::BranchesController#index` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/branches_controller.rb) | +| `Projects::BranchesController#new` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/branches_controller.rb) | +| `Projects::CommitController#branches` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/commit_controller.rb) | +| `Projects::CommitController#merge_requests` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/commit_controller.rb) | +| `Projects::CommitController#pipelines` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/commit_controller.rb) | +| `Projects::CommitController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/commit_controller.rb) | +| `Projects::CommitsController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/commits_controller.rb)| +| `Projects::CommitsController#signatures` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/commits_controller.rb) | +| `Projects::CompareController#create` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/commits_controller.rb) | +| `Projects::CompareController#index` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/compare_controller.rb) | +| `Projects::CompareController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/compare_controller.rb) | +| `Projects::CompareController#signatures` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/compare_controller.rb) | +| `Projects::FindFileController#list` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/find_file_controller.rb) | +| `Projects::FindFileController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/find_file_controller.rb) | +| `Projects::ForksController#index` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/forks_controller.rb) | +| `Projects::GraphsController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/graphs_controller.rb) | +| `Projects::NetworkController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/network_controller.rb) | +| `Projects::PathLocksController#index` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/controllers/projects/path_locks_controller.rb) | +| `Projects::RawController#show` | default | | +| `Projects::RefsController#logs_tree` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/refs_controller.rb) | +| `Projects::RefsController#switch` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/refs_controller.rb) | +| `Projects::RepositoriesController#archive` | default | | +| `Projects::Settings::RepositoryController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/settings/repository_controller.rb) | +| `Projects::TagsController#index` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/tags_controller.rb) | +| `Projects::TagsController#new` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/tags_controller.rb) | +| `Projects::TagsController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/tags_controller.rb) | +| `Projects::TemplatesController#names` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/templates_controller.rb) | +| `Projects::TreeController#show` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects/tree_controller.rb) | +| `ProjectsController#refs` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/projects_controller.rb) | +| `Repositories::GitHttpController#git_receive_pack` | default | | +| `Repositories::GitHttpController#git_upload_pack` | default | | +| `Repositories::GitHttpController#info_refs` | default | | +| `Repositories::LfsApiController#batch` | `:medium` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/repositories/lfs_api_controller.rb) | +| `Repositories::LfsLocksApiController#verify` | default | | +| `Repositories::LfsStorageController#download` | `:medium` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/repositories/lfs_storage_controller.rb) | +| `Repositories::LfsStorageController#upload_authorize` | `:medium` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/repositories/lfs_storage_controller.rb) | +| `Repositories::LfsStorageController#upload_finalize` | `:low` |[source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/controllers/repositories/lfs_storage_controller.rb) | diff --git a/doc/development/index.md b/doc/development/index.md index 552555ab85c..8f13bd1accb 100644 --- a/doc/development/index.md +++ b/doc/development/index.md @@ -329,6 +329,10 @@ See [database guidelines](database/index.md). - [CI/CD development documentation](cicd/index.md) - [AppSec development documentation](appsec/index.md) +## Technical Reference by Group + +- [Create: Source Code BE](backend/create_source_code_be/index.md) + ## Other Development guides - [Defining relations between files using projections](projections.md) diff --git a/doc/user/profile/account/delete_account.md b/doc/user/profile/account/delete_account.md index c116b1fc00d..5a57f8902ca 100644 --- a/doc/user/profile/account/delete_account.md +++ b/doc/user/profile/account/delete_account.md @@ -5,7 +5,7 @@ group: Authentication and Authorization info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- -# Deleting a User account **(FREE)** +# Deleting a user account **(FREE)** Users can be deleted from a GitLab instance, either by: @@ -15,7 +15,7 @@ Users can be deleted from a GitLab instance, either by: NOTE: Deleting a user deletes all projects in that user namespace. -## As a user +## Delete your own account As a user, to delete your own account: @@ -24,7 +24,7 @@ As a user, to delete your own account: 1. On the left sidebar, select **Account**. 1. Select **Delete account**. -## As an administrator **(FREE SELF)** +## Delete users and user contributions **(FREE SELF)** As an administrator, to delete a user account: @@ -32,55 +32,38 @@ As an administrator, to delete a user account: 1. On the left sidebar, select **Overview > Users**. 1. Select a user. 1. Under the **Account** tab, select: - - **Delete user** to delete only the user but maintain their - [associated records](#associated-records). - - **Delete user and contributions** to delete the user and - their associated records. + - **Delete user** to delete only the user but maintain their [associated records](#associated-records). + - **Delete user and contributions** to delete the user and their associated records. WARNING: -Using the **Delete user and contributions** option may result -in removing more data than intended. Please see [associated records](#associated-records) -below for additional details. +Using the **Delete user and contributions** option may result in removing more data than intended. See +[associated records](#associated-records) for additional details. ### Associated records -> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7393) for issues in GitLab 9.0. -> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/10467) for merge requests, award emoji, notes, and abuse reports in GitLab 9.1. -> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/10273) hard deletion from abuse reports and spam logs in GitLab 9.1. -> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11853) hard deletion from the API in GitLab 9.3. - -There are two options for deleting users: - -- **Delete user** -- **Delete user and contributions** - -When using the **Delete user** option, not all associated records are deleted with the user. -Here's a list of things created by the user that are **not** deleted: - -- Abuse reports -- Award emoji -- Epics -- Issues -- Merge requests -- Notes - -Instead of being deleted, these records are moved to a system-wide -user with the username Ghost User, whose sole purpose is to act as a container -for such records. Any commits made by a deleted user still display the -username of the original user. - -When using the **Delete user and contributions** option, **all** associated records -are removed. This includes all of the items mentioned above including issues, -merge requests, notes/comments, and more. Consider -[blocking a user](../../admin_area/moderate_users.md#block-a-user) -or using the **Delete user** option instead. - -When a user is deleted from an [abuse report](../../admin_area/review_abuse_reports.md) -or spam log, these associated -records are not ghosted and are removed, along with any groups the user -is a sole owner of. Administrators can also request this behavior when -deleting users from the [API](../../../api/users.md#user-deletion) or the -Admin Area. +When deleting users, you can either: + +- Delete just the user. Not all associated records are deleted with the user. Instead of being deleted, these records + are moved to a system-wide user with the username Ghost User. The Ghost User's purpose is to act as a container for + such records. Any commits made by a deleted user still display the username of the original user. +- Delete the user and their contributions, including: + - Abuse reports. + - Award emojis. + - Epics. + - Groups of which the user is the only user with the Owner role. + - Issues. + - Merge requests. + - Notes and comments. + - Personal access tokens. + - Snippets. + +An alternative to deleting is [blocking a user](../../admin_area/moderate_users.md#block-a-user). + +When a user is deleted from an [abuse report](../../admin_area/review_abuse_reports.md) or spam log, these associated +records are always removed. This includes any groups of which the user is the only user with the Owner role. + +The deleting associated records option can be requested in the [API](../../../api/users.md#user-deletion) as well as +the Admin Area. ## Troubleshooting diff --git a/locale/gitlab.pot b/locale/gitlab.pot index b6bf6c85675..5762797d622 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -25716,6 +25716,9 @@ msgstr "" msgid "Opens in a new window" msgstr "" +msgid "Opens new window" +msgstr "" + msgid "Operation failed. Check pod logs for %{pod_name} for more details." msgstr "" @@ -34331,6 +34334,9 @@ msgstr "" msgid "Some common domains are not allowed. %{learn_more_link}." msgstr "" +msgid "Someone edited the file the same time you did. Please check out %{link_start}the file %{icon}%{link_end} and make sure your changes will not unintentionally remove theirs." +msgstr "" + msgid "Someone edited the issue at the same time you did. Please check out %{linkStart}the issue%{linkEnd} and make sure your changes will not unintentionally remove theirs." msgstr "" @@ -44579,9 +44585,6 @@ msgstr "" msgid "the correct format." msgstr "" -msgid "the file" -msgstr "" - msgid "the following epic(s)" msgstr "" diff --git a/spec/services/repositories/destroy_rollback_service_spec.rb b/spec/services/repositories/destroy_rollback_service_spec.rb index 717e52f0e40..a52dff62760 100644 --- a/spec/services/repositories/destroy_rollback_service_spec.rb +++ b/spec/services/repositories/destroy_rollback_service_spec.rb @@ -43,16 +43,19 @@ RSpec.describe Repositories::DestroyRollbackService do expect(repository).to receive(:disk_path).and_return('foo') expect(repository).not_to receive(:before_delete) - result = subject + expect(subject[:status]).to eq :success + end - expect(result[:status]).to eq :success + it 'gracefully handles exception if the repository does not exist on disk' do + expect(repository).to receive(:before_delete).and_raise(Gitlab::Git::Repository::NoRepository) + expect(subject[:status]).to eq :success end context 'when move operation cannot be performed' do let(:service) { described_class.new(repository) } before do - allow(service).to receive(:mv_repository).and_return(false) + expect(service).to receive(:mv_repository).and_return(false) end it 'returns error' do @@ -66,6 +69,14 @@ RSpec.describe Repositories::DestroyRollbackService do service.execute end + + context 'when repository does not exist' do + it 'returns success' do + allow(service).to receive(:repo_exists?).and_return(true, false) + + expect(service.execute[:status]).to eq :success + end + end end def destroy_project(project, user) diff --git a/spec/services/repositories/destroy_service_spec.rb b/spec/services/repositories/destroy_service_spec.rb index 240f837e973..3766467d708 100644 --- a/spec/services/repositories/destroy_service_spec.rb +++ b/spec/services/repositories/destroy_service_spec.rb @@ -69,22 +69,23 @@ RSpec.describe Repositories::DestroyService do expect(repository).to receive(:disk_path).and_return('foo') expect(repository).not_to receive(:before_delete) - result = subject + expect(subject[:status]).to eq :success + end - expect(result[:status]).to eq :success + it 'gracefully handles exception if the repository does not exist on disk' do + expect(repository).to receive(:before_delete).and_raise(Gitlab::Git::Repository::NoRepository) + expect(subject[:status]).to eq :success end context 'when move operation cannot be performed' do let(:service) { described_class.new(repository) } before do - allow(service).to receive(:mv_repository).and_return(false) + expect(service).to receive(:mv_repository).and_return(false) end it 'returns error' do - result = service.execute - - expect(result[:status]).to eq :error + expect(service.execute[:status]).to eq :error end it 'logs the error' do @@ -92,6 +93,15 @@ RSpec.describe Repositories::DestroyService do service.execute end + + context 'when repository does not exist' do + it 'returns success' do + allow(service).to receive(:repo_exists?).and_return(true, false) + + expect(Repositories::ShellDestroyService).not_to receive(:new) + expect(service.execute[:status]).to eq :success + end + end end context 'with a project wiki repository' do |