From ab936dd90a65777cd911d506e98be3ee6b1997e3 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 1 Oct 2021 00:10:18 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../merge_requests/_mr_title.html.haml | 10 +-- .../merge_requests/_nav_btns.html.haml | 6 +- doc/ci/jobs/index.md | 9 +- lib/api/internal/kubernetes.rb | 19 ---- locale/gitlab.pot | 3 + spec/requests/api/internal/kubernetes_spec.rb | 90 ------------------- 6 files changed, 12 insertions(+), 125 deletions(-) diff --git a/app/views/projects/merge_requests/_mr_title.html.haml b/app/views/projects/merge_requests/_mr_title.html.haml index 5a983fb5565..0e8de3c2bb8 100644 --- a/app/views/projects/merge_requests/_mr_title.html.haml +++ b/app/views/projects/merge_requests/_mr_title.html.haml @@ -32,20 +32,20 @@ .dropdown-menu.dropdown-menu-right %ul - if can_update_merge_request - %li= link_to 'Edit', edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) + %li= link_to _('Edit'), edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) - if @merge_request.opened? %li = link_to @merge_request.work_in_progress? ? _('Mark as ready') : _('Mark as draft'), toggle_draft_merge_request_path(@merge_request), method: :put, class: "js-draft-toggle-button" %li{ class: [merge_request_button_visibility(@merge_request, true), 'js-close-item'] } - = link_to 'Close', merge_request_path(@merge_request, merge_request: { state_event: :close }), method: :put, title: 'Close merge request' + = link_to _('Close'), merge_request_path(@merge_request, merge_request: { state_event: :close }), method: :put, title: 'Close merge request' - if can_reopen_merge_request %li{ class: merge_request_button_visibility(@merge_request, false) } - = link_to 'Reopen', merge_request_path(@merge_request, merge_request: { state_event: :reopen }), method: :put, title: 'Reopen merge request' + = link_to _('Reopen'), merge_request_path(@merge_request, merge_request: { state_event: :reopen }), method: :put, title: 'Reopen merge request' - unless @merge_request.merged? || current_user == @merge_request.author - %li= link_to 'Report abuse', new_abuse_report_path(user_id: @merge_request.author.id, ref_url: merge_request_url(@merge_request)) + %li= link_to _('Report abuse'), new_abuse_report_path(user_id: @merge_request.author.id, ref_url: merge_request_url(@merge_request)) - if can_update_merge_request - = link_to 'Edit', edit_project_merge_request_path(@project, @merge_request), class: "d-none d-md-block btn gl-button btn-default btn-grouped js-issuable-edit", data: { qa_selector: "edit_button" } + = link_to _('Edit'), edit_project_merge_request_path(@project, @merge_request), class: "d-none d-md-block btn gl-button btn-default btn-grouped js-issuable-edit", data: { qa_selector: "edit_button" } - if can_update_merge_request && !are_close_and_open_buttons_hidden = render 'projects/merge_requests/close_reopen_draft_report_toggle' diff --git a/app/views/projects/merge_requests/_nav_btns.html.haml b/app/views/projects/merge_requests/_nav_btns.html.haml index b34cf23634c..00d12423eb9 100644 --- a/app/views/projects/merge_requests/_nav_btns.html.haml +++ b/app/views/projects/merge_requests/_nav_btns.html.haml @@ -5,7 +5,7 @@ .js-csv-import-export-buttons{ data: { show_export_button: "true", issuable_type: issuable_type, issuable_count: issuables_count_for_state(issuable_type.to_sym, params[:state]), email: notification_email, export_csv_path: export_csv_project_merge_requests_path(@project, request.query_parameters), container_class: 'gl-mr-3' } } - if @can_bulk_update - = button_tag "Edit merge requests", class: "gl-button btn btn-default gl-mr-3 js-bulk-update-toggle" + = button_tag _("Edit merge requests"), class: "gl-button btn btn-default gl-mr-3 js-bulk-update-toggle" - if merge_project - = link_to new_merge_request_path, class: "gl-button btn btn-confirm", title: "New merge request" do - New merge request + = link_to new_merge_request_path, class: "gl-button btn btn-confirm", title: _("New merge request") do + = _('New merge request') diff --git a/doc/ci/jobs/index.md b/doc/ci/jobs/index.md index 54704d5574b..cb3b11ebf99 100644 --- a/doc/ci/jobs/index.md +++ b/doc/ci/jobs/index.md @@ -45,8 +45,6 @@ Clicking an individual job shows you its job log, and allows you to: ## See why a job failed -> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17782) in GitLab 10.7. - When a pipeline fails or is allowed to fail, there are several places where you can find the reason: @@ -58,8 +56,7 @@ In each place, if you hover over the failed job you can see the reason it failed ![Pipeline detail](img/job_failure_reason.png) -In [GitLab 10.8 and later](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17814), -you can also see the reason it failed on the Job detail page. +You can also see the reason it failed on the Job detail page. ## The order of jobs in a pipeline @@ -87,8 +84,6 @@ For example: ## Group jobs in a pipeline -> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/6242) in GitLab 8.12. - If you have many similar jobs, your [pipeline graph](../pipelines/index.md#visualize-pipelines) becomes long and hard to read. @@ -164,8 +159,6 @@ for a single run of the manual job. ## Delay a job -> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/21767) in GitLab 11.4. - When you do not want to run a job immediately, you can use the [`when:delayed`](../jobs/job_control.md#run-a-job-after-a-delay) keyword to delay a job's execution for a certain period. diff --git a/lib/api/internal/kubernetes.rb b/lib/api/internal/kubernetes.rb index d1ad3c1feb1..f3974236fe3 100644 --- a/lib/api/internal/kubernetes.rb +++ b/lib/api/internal/kubernetes.rb @@ -79,25 +79,6 @@ module API gitaly_repository: gitaly_repository(project) } end - - desc 'Gets project info' do - detail 'Retrieves project info (if authorized)' - end - route_setting :authentication, cluster_agent_token_allowed: true - get '/project_info' do - project = find_project(params[:id]) - - unless Guest.can?(:download_code, project) || agent.has_access_to?(project) - not_found! - end - - status 200 - { - project_id: project.id, - gitaly_info: gitaly_info(project), - gitaly_repository: gitaly_repository(project) - } - end end namespace 'kubernetes/agent_configuration' do diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 108ea19d8d4..730326e8be1 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -12337,6 +12337,9 @@ msgstr "" msgid "Edit issues" msgstr "" +msgid "Edit merge requests" +msgstr "" + msgid "Edit public deploy key" msgstr "" diff --git a/spec/requests/api/internal/kubernetes_spec.rb b/spec/requests/api/internal/kubernetes_spec.rb index 24422f7b0dd..245e4e6ba15 100644 --- a/spec/requests/api/internal/kubernetes_spec.rb +++ b/spec/requests/api/internal/kubernetes_spec.rb @@ -177,94 +177,4 @@ RSpec.describe API::Internal::Kubernetes do end end end - - describe 'GET /internal/kubernetes/project_info' do - def send_request(headers: {}, params: {}) - get api('/internal/kubernetes/project_info'), params: params, headers: headers.reverse_merge(jwt_auth_headers) - end - - include_examples 'authorization' - include_examples 'agent authentication' - - context 'an agent is found' do - let_it_be(:agent_token) { create(:cluster_agent_token) } - - shared_examples 'agent token tracking' - - context 'project is public' do - let(:project) { create(:project, :public) } - - it 'returns expected data', :aggregate_failures do - send_request(params: { id: project.id }, headers: { 'Authorization' => "Bearer #{agent_token.token}" }) - - expect(response).to have_gitlab_http_status(:success) - - expect(json_response).to match( - a_hash_including( - 'project_id' => project.id, - 'gitaly_info' => a_hash_including( - 'address' => match(/\.socket$/), - 'token' => 'secret', - 'features' => {} - ), - 'gitaly_repository' => a_hash_including( - 'storage_name' => project.repository_storage, - 'relative_path' => project.disk_path + '.git', - 'gl_repository' => "project-#{project.id}", - 'gl_project_path' => project.full_path - ) - ) - ) - end - - context 'repository is for project members only' do - let(:project) { create(:project, :public, :repository_private) } - - it 'returns 404' do - send_request(params: { id: project.id }, headers: { 'Authorization' => "Bearer #{agent_token.token}" }) - - expect(response).to have_gitlab_http_status(:not_found) - end - end - end - - context 'project is private' do - let(:project) { create(:project, :private) } - - it 'returns 404' do - send_request(params: { id: project.id }, headers: { 'Authorization' => "Bearer #{agent_token.token}" }) - - expect(response).to have_gitlab_http_status(:not_found) - end - - context 'and agent belongs to project' do - let(:agent_token) { create(:cluster_agent_token, agent: create(:cluster_agent, project: project)) } - - it 'returns 200' do - send_request(params: { id: project.id }, headers: { 'Authorization' => "Bearer #{agent_token.token}" }) - - expect(response).to have_gitlab_http_status(:success) - end - end - end - - context 'project is internal' do - let(:project) { create(:project, :internal) } - - it 'returns 404' do - send_request(params: { id: project.id }, headers: { 'Authorization' => "Bearer #{agent_token.token}" }) - - expect(response).to have_gitlab_http_status(:not_found) - end - end - - context 'project does not exist' do - it 'returns 404' do - send_request(params: { id: non_existing_record_id }, headers: { 'Authorization' => "Bearer #{agent_token.token}" }) - - expect(response).to have_gitlab_http_status(:not_found) - end - end - end - end end