Skip to content

Commit

Permalink
Add latest changes from gitlab-org/gitlab@master
Browse files Browse the repository at this point in the history
  • Loading branch information
GitLab Bot committed Jun 20, 2023
1 parent a5d7e61 commit 995bcca
Show file tree
Hide file tree
Showing 45 changed files with 586 additions and 874 deletions.
1 change: 0 additions & 1 deletion .haml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ linters:
# These cops should eventually get enabled
- Cop/LineBreakAfterGuardClauses
- Cop/ProjectPathHelper
- Gitlab/FeatureAvailableUsage
- Gitlab/Json
- GitlabSecurity/PublicSend
- Layout/EmptyLineAfterGuardClause
Expand Down
27 changes: 25 additions & 2 deletions .rubocop_todo/gitlab/feature_available_usage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Gitlab/FeatureAvailableUsage:
- 'ee/app/models/approval_state.rb'
- 'ee/app/models/concerns/ee/approvable.rb'
- 'ee/app/models/concerns/ee/project_security_scanners_information.rb'
- 'ee/app/models/concerns/ee/protected_ref_access.rb'
- 'ee/app/models/concerns/insights_feature.rb'
- 'ee/app/models/ee/board.rb'
- 'ee/app/models/ee/ci/build.rb'
Expand Down Expand Up @@ -68,7 +67,6 @@ Gitlab/FeatureAvailableUsage:
- 'ee/app/services/ci/audit_variable_change_service.rb'
- 'ee/app/services/dashboard/projects/create_service.rb'
- 'ee/app/services/dashboard/projects/list_service.rb'
- 'ee/app/services/ee/alert_management/http_integrations/create_service.rb'
- 'ee/app/services/ee/audit_event_service.rb'
- 'ee/app/services/ee/boards/issues/list_service.rb'
- 'ee/app/services/ee/boards/lists/create_service.rb'
Expand All @@ -91,6 +89,31 @@ Gitlab/FeatureAvailableUsage:
- 'ee/app/services/projects/mark_for_deletion_service.rb'
- 'ee/app/services/requirements_management/process_test_reports_service.rb'
- 'ee/app/services/security/store_scans_service.rb'
- 'ee/app/views/compliance_management/compliance_framework/_project_settings.html.haml.rb'
- 'ee/app/views/groups/epics/index.html.haml.rb'
- 'ee/app/views/product_analytics/_project_settings.html.haml.rb'
- 'ee/app/views/projects/_merge_request_settings.html.haml.rb'
- 'ee/app/views/projects/_merge_request_settings_description_text.html.haml.rb'
- 'ee/app/views/projects/_remove.html.haml.rb'
- 'ee/app/views/projects/audit_events/index.html.haml.rb'
- 'ee/app/views/projects/blob/_header_file_locks.html.haml.rb'
- 'ee/app/views/projects/branch_defaults/_branch_names_help.html.haml.rb'
- 'ee/app/views/projects/merge_requests/show.html.haml.rb'
- 'ee/app/views/projects/push_rules/_index.html.haml.rb'
- 'ee/app/views/projects/quality/test_cases/index.html.haml.rb'
- 'ee/app/views/projects/settings/_default_issue_template.html.haml.rb'
- 'ee/app/views/projects/settings/_restore.html.haml.rb'
- 'ee/app/views/projects/settings/ci_cd/_auto_rollback.html.haml.rb'
- 'ee/app/views/projects/settings/ci_cd/_pipeline_subscriptions.html.haml.rb'
- 'ee/app/views/projects/settings/merge_requests/_merge_request_approvals_settings.html.haml.rb'
- 'ee/app/views/projects/settings/operations/_status_page.html.haml.rb'
- 'ee/app/views/projects/settings/repository/_protected_branches.html.haml.rb'
- 'ee/app/views/protected_branches/ee/_code_owner_approval_form.html.haml.rb'
- 'ee/app/views/protected_branches/ee/_code_owner_approval_table.html.haml.rb'
- 'ee/app/views/protected_branches/ee/_code_owner_approval_table_head.html.haml.rb'
- 'ee/app/views/shared/labels/_create_label_help_text.html.haml.rb'
- 'ee/app/views/shared/promotions/_promote_mr_features.html.haml.rb'
- 'ee/app/views/shared/promotions/_promote_repository_features.html.haml.rb'
- 'ee/app/workers/analytics/code_review_metrics_worker.rb'
- 'ee/app/workers/group_saml_group_sync_worker.rb'
- 'ee/lib/ee/api/entities/approval_state.rb'
Expand Down
1 change: 0 additions & 1 deletion .rubocop_todo/layout/empty_line_after_magic_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ Layout/EmptyLineAfterMagicComment:
- 'spec/requests/lfs_http_spec.rb'
- 'spec/rubocop/cop/migration/complex_indexes_require_name_spec.rb'
- 'spec/rubocop/cop/migration/refer_to_index_by_name_spec.rb'
- 'spec/rubocop/formatter/todo_formatter_spec.rb'
- 'spec/scripts/lib/glfm/parse_examples_spec.rb'
- 'spec/scripts/lib/glfm/shared_spec.rb'
- 'spec/scripts/lib/glfm/update_example_snapshots_spec.rb'
Expand Down
2 changes: 0 additions & 2 deletions .rubocop_todo/rspec/missing_feature_category.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5370,9 +5370,7 @@ RSpec/MissingFeatureCategory:
- 'spec/rubocop/cop/usage_data/instrumentation_superclass_spec.rb'
- 'spec/rubocop/cop/usage_data/large_table_spec.rb'
- 'spec/rubocop/cop/user_admin_spec.rb'
- 'spec/rubocop/cop_todo_spec.rb'
- 'spec/rubocop/formatter/graceful_formatter_spec.rb'
- 'spec/rubocop/formatter/todo_formatter_spec.rb'
- 'spec/rubocop/migration_helpers_spec.rb'
- 'spec/rubocop/qa_helpers_spec.rb'
- 'spec/rubocop/todo_dir_spec.rb'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { GlIcon, GlSprintf, GlTooltipDirective } from '@gitlab/ui';
import { sprintf, __ } from '~/locale';
import { sprintf, __, formatNumber } from '~/locale';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue';
Expand Down Expand Up @@ -49,6 +49,12 @@ export default {
managersCount() {
return this.runner.managers?.count || 0;
},
firstIpAddress() {
return this.runner.managers?.nodes?.[0]?.ipAddress || null;
},
additionalIpAddressCount() {
return this.managersCount - 1;
},
jobCount() {
return formatJobCount(this.runner.jobCount);
},
Expand All @@ -63,6 +69,9 @@ export default {
return null;
},
},
methods: {
formatNumber,
},
i18n: {
I18N_NO_DESCRIPTION,
I18N_LOCKED_RUNNER_DESCRIPTION,
Expand Down Expand Up @@ -120,8 +129,11 @@ export default {
</gl-sprintf>
</runner-summary-field>
<runner-summary-field v-if="runner.ipAddress" icon="disk" :tooltip="__('IP Address')">
{{ runner.ipAddress }}
<runner-summary-field v-if="firstIpAddress" icon="disk" :tooltip="__('IP Address')">
{{ firstIpAddress }}
<template v-if="additionalIpAddressCount"
>(+{{ formatNumber(additionalIpAddressCount) }})</template
>
</runner-summary-field>
<runner-summary-field icon="pipeline" data-testid="job-count" :tooltip="__('Jobs')">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ fragment ListItemShared on CiRunner {
runnerType
shortSha
version
ipAddress
paused
locked
jobCount
Expand All @@ -22,8 +21,11 @@ fragment ListItemShared on CiRunner {
updateRunner
deleteRunner
}
managers {
managers(first: 1) {
count
nodes {
ipAddress
}
}
groups(first: 1) {
nodes {
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/mr_more_dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const initMrMoreDropdown = () => {
const {
mergeRequest,
projectPath,
url,
editUrl,
isCurrentUser,
isLoggedIn,
Expand All @@ -20,7 +21,6 @@ export const initMrMoreDropdown = () => {
sourceProjectMissing,
clipboardText,
reportedUserId,
reportedFromUrl,
} = el.dataset;

let mr;
Expand All @@ -41,6 +41,7 @@ export const initMrMoreDropdown = () => {
props: {
mr,
projectPath,
url,
editUrl,
isCurrentUser,
isLoggedIn: Boolean(isLoggedIn),
Expand All @@ -50,7 +51,6 @@ export const initMrMoreDropdown = () => {
sourceProjectMissing,
clipboardText,
reportedUserId: Number(reportedUserId),
reportedFromUrl,
},
}),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export default {
default: '',
required: false,
},
url: {
type: String,
default: '',
required: false,
},
editUrl: {
type: String,
default: '',
Expand Down Expand Up @@ -116,11 +121,6 @@ export default {
default: 0,
required: false,
},
reportedFromUrl: {
type: String,
default: '',
required: false,
},
},
data() {
return {
Expand Down Expand Up @@ -156,7 +156,7 @@ export default {
this.isLoadingDraft = true;
axios
.put(`?merge_request[wip_event]=${this.draftState}`, null, {
.put(`${this.url}?merge_request[wip_event]=${this.draftState}`, null, {
params: { format: 'json' },
})
.then(({ data }) => {
Expand Down Expand Up @@ -353,7 +353,7 @@ export default {
<abuse-category-selector
v-if="!isCurrentUser && isReportAbuseDrawerOpen"
:reported-user-id="reportedUserId"
:reported-from-url="reportedFromUrl"
:reported-from-url="url"
:show-drawer="isReportAbuseDrawerOpen"
@close-drawer="reportAbuseAction(false)"
/>
Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/framework/timeline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
&:not(.note-form).internal-note .timeline-content,
&:not(.note-form).draft-note .timeline-content {
background-color: $orange-50 !important;
border-radius: 3px;
}

.timeline-entry-inner {
Expand Down
12 changes: 12 additions & 0 deletions app/assets/stylesheets/page_bundles/branches.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@
.branches-list .branch-item:not(:last-of-type) {
border-bottom: 1px solid $border-color;
}

.branch-item {
.issuable-reference {
max-width: 92px;
}

.right-block {
@media (min-width: map-get($grid-breakpoints, md)) {
min-width: 200px;
}
}
}
14 changes: 0 additions & 14 deletions app/models/plan_limits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,6 @@ def log_limits_changes(user, new_limits)

update(limits_history: limits_history)
end

def limit_attribute_changes(attribute)
limit_history = limits_history[attribute]
return [] unless limit_history

limit_history.map do |entry|
{
timestamp: entry[:timestamp],
value: entry[:value],
username: entry[:username],
user_id: entry[:user_id]
}
end
end
end

PlanLimits.prepend_mod_with('PlanLimits')
58 changes: 28 additions & 30 deletions app/views/projects/branches/_branch.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

= render_if_exists 'projects/branches/diverged_from_upstream', branch: branch

.block-truncated
.gl-text-truncate
- if commit
= render 'projects/branches/commit', commit: commit, project: @project
- else
Expand All @@ -28,35 +28,33 @@

.pipeline-status.d-none.d-md-block<
- if commit_status
= render 'ci/status/icon', size: 16, status: commit_status, option_css_classes: 'gl-display-inline-flex gl-vertical-align-middle gl-mr-5'
= render 'ci/status/icon', size: 16, status: commit_status, option_css_classes: 'gl-display-inline-flex gl-vertical-align-middle gl-mr-3'
- elsif show_commit_status
.gl-display-inline-flex.gl-vertical-align-middle.gl-mr-5
.gl-display-inline-flex.gl-vertical-align-middle.gl-mr-3
%svg.s16


- if mr_status.present?
.issuable-reference.gl-display-flex.gl-justify-content-end.gl-min-w-10.gl-ml-5.gl-mr-4
= gl_badge_tag issuable_reference(related_merge_request),
{ icon: mr_status[:icon], variant: mr_status[:variant], size: :md, href: merge_request_path(related_merge_request) },
{ class: 'gl-mr-2', title: mr_status[:title], data: { toggle: 'tooltip', container: 'body', qa_selector: 'badge_content' } }

.controls.d-none.d-md-block<
- if mr_status.nil? && create_mr_button?(from: branch.name, source_project: @project)
= render Pajamas::ButtonComponent.new(icon: 'merge-request', href: create_mr_path(from: branch.name, source_project: @project), button_options: { class: 'has-tooltip gl-mr-2!', title: _('New merge request') }) do
= _('New')

= render 'projects/buttons/download', project: @project, ref: branch.name, pipeline: @refs_pipelines[branch.name], css_class: 'gl-mr-1!'

- if !is_default_branch
.js-branch-more-actions{ data: {
branch_name: branch.name,
default_branch_name: @repository.root_ref,
can_delete_branch: user_access(@project).can_delete_branch?(branch.name).to_s,
is_protected_branch: protected_branch?(@project, branch).to_s,
merged: merged.to_s,
compare_path: project_compare_index_path(@project, from: @repository.root_ref, to: branch.name),
delete_path: project_branch_path(@project, branch.name),
} }
- else
.gl-display-inline-flex.gl-w-7
&nbsp;
.right-block.gl-display-flex.gl-align-items-center.gl-justify-content-end
.gl-mr-3
- if mr_status.present?
.issuable-reference.gl-display-flex.gl-justify-content-end.gl-overflow-hidden
= gl_badge_tag issuable_reference(related_merge_request),
{ icon: mr_status[:icon], variant: mr_status[:variant], size: :md, href: merge_request_path(related_merge_request) },
{ class: 'gl-display-block gl-text-truncate', title: mr_status[:title], data: { toggle: 'tooltip', container: 'body', qa_selector: 'badge_content' } }

- elsif mr_status.nil? && create_mr_button?(from: branch.name, source_project: @project)
= render Pajamas::ButtonComponent.new(icon: 'merge-request', href: create_mr_path(from: branch.name, source_project: @project), button_options: { class: 'has-tooltip', title: _('New merge request') }) do
= _('New')

= render 'projects/buttons/download', project: @project, ref: branch.name, pipeline: @refs_pipelines[branch.name], css_class: 'gl-mr-2!'

.gl-w-7
- if !is_default_branch
.js-branch-more-actions{ data: {
branch_name: branch.name,
default_branch_name: @repository.root_ref,
can_delete_branch: user_access(@project).can_delete_branch?(branch.name).to_s,
is_protected_branch: protected_branch?(@project, branch).to_s,
merged: merged.to_s,
compare_path: project_compare_index_path(@project, from: @repository.root_ref, to: branch.name),
delete_path: project_branch_path(@project, branch.name),
} }
4 changes: 2 additions & 2 deletions app/views/projects/branches/_commit.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.branch-commit.gl-font-sm.gl-text-gray-500
.branch-commit.gl-font-sm.gl-text-gray-500.gl-text-truncate
= link_to commit.short_id, project_commit_path(project, commit.id), class: "commit-sha"
&middot;
%span.str-truncated
%span
= link_to_markdown commit.title, project_commit_path(project, commit.id), class: "commit-row-message gl-text-gray-500!"
&middot;
%span.gl-text-secondary= time_ago_with_tooltip(commit.committed_date)
2 changes: 1 addition & 1 deletion app/views/projects/branches/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- if can_push_code
= link_to new_project_branch_path(@project), class: 'gl-button btn btn-confirm' do
= s_('Branches|New branch')
.js-delete-merged-branches{ data: {
.js-delete-merged-branches.gl-w-7{ data: {
default_branch: @project.repository.root_ref,
form_path: project_merged_branches_path(@project) }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.js-mr-more-dropdown{ data: {
merge_request: @merge_request.to_json,
project_path: @project.full_path,
url: merge_request_url(@merge_request),
edit_url: edit_project_merge_request_path(@project, @merge_request),
is_current_user: issuable_author_is_current_user(@merge_request),
is_logged_in: current_user,
Expand All @@ -11,5 +12,4 @@
clipboard_text: @merge_request.to_reference(full: true),
report_abuse_path: add_category_abuse_reports_path,
reported_user_id: @merge_request.author.id,
reported_from_url: merge_request_url(@merge_request),
} }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: phone_verification_for_low_risk_users
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124090
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/415674
milestone: '16.2'
type: experiment
group: group::anti-abuse
default_enabled: false
Loading

0 comments on commit 995bcca

Please sign in to comment.