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 Aug 2, 2024
1 parent 91c56c2 commit 2f2a542
Show file tree
Hide file tree
Showing 65 changed files with 812 additions and 323 deletions.
1 change: 0 additions & 1 deletion .rubocop_todo/rspec/context_wording.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,6 @@ RSpec/ContextWording:
- 'spec/lib/gitlab/usage/service_ping_report_spec.rb'
- 'spec/lib/gitlab/usage_data/topology_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/ipynb_diff_activity_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/kubernetes_agent_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/quick_action_activity_unique_counter_spec.rb'
- 'spec/lib/gitlab/utils/lazy_attributes_spec.rb'
- 'spec/lib/gitlab/utils/mime_type_spec.rb'
Expand Down
1 change: 0 additions & 1 deletion .rubocop_todo/rspec/expect_change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ RSpec/ExpectChange:
- 'spec/lib/gitlab/legacy_github_import/label_formatter_spec.rb'
- 'spec/lib/gitlab/legacy_github_import/project_creator_spec.rb'
- 'spec/lib/gitlab/query_limiting/transaction_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/kubernetes_agent_counter_spec.rb'
- 'spec/models/ci/build_metadata_spec.rb'
- 'spec/models/ci/build_spec.rb'
- 'spec/models/ci/job_artifact_spec.rb'
Expand Down
1 change: 0 additions & 1 deletion .rubocop_todo/rspec/feature_category.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3290,7 +3290,6 @@ RSpec/FeatureCategory:
- 'spec/lib/gitlab/usage_data_counters/ipynb_diff_activity_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/issue_activity_unique_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/jetbrains_plugin_activity_unique_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/kubernetes_agent_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/merge_request_widget_extension_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/package_event_counter_spec.rb'
Expand Down
1 change: 0 additions & 1 deletion .rubocop_todo/rspec/named_subject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2305,7 +2305,6 @@ RSpec/NamedSubject:
- 'spec/lib/gitlab/usage/metrics/instrumentations/redis_metric_spec.rb'
- 'spec/lib/gitlab/usage_data/topology_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/kubernetes_agent_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters/redis_counter_spec.rb'
- 'spec/lib/gitlab/usage_data_counters_spec.rb'
- 'spec/lib/gitlab/usage_data_metrics_spec.rb'
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/custom_emoji/components/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<script>
import { GlLoadingIcon, GlTableLite, GlTabs, GlTab, GlBadge, GlKeysetPagination } from '@gitlab/ui';
import { __ } from '~/locale';
import { formatDate } from '~/lib/utils/datetime/date_format_utility';
import { localeDateFormat } from '~/lib/utils/datetime/locale_dateformat';
import DeleteItem from './delete_item.vue';
export default {
Expand Down Expand Up @@ -63,7 +63,7 @@ export default {
});
},
formatDate(date) {
return formatDate(date, 'mmmm d, yyyy');
return localeDateFormat.asDate.format(date);
},
},
fields: [
Expand Down
5 changes: 4 additions & 1 deletion app/helpers/emails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def email_default_heading(text)

def closure_reason_text(closed_via, format:, name:)
name = sanitize_name(name)

case closed_via
when MergeRequest
merge_request = MergeRequest.find(closed_via[:id]).present
Expand All @@ -122,8 +123,10 @@ def closure_reason_text(closed_via, format:, name:)

_("Issue was closed by %{name} with %{closed_via}") % { name: name, closed_via: closed_via }
else
type = work_item_type_for(@issue).capitalize

if name
_("Issue was closed by %{name}") % { name: name }
_("%{type} was closed by %{name}") % { name: name, type: type }
else
""
end
Expand Down
14 changes: 5 additions & 9 deletions app/views/admin/gitaly_servers/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
- breadcrumb_title _("Gitaly servers")
- page_title _("Gitaly servers")

= render ::Layouts::PageHeadingComponent.new(_('Gitaly servers'))
= render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card' }, header_options: { class: 'gl-new-card-header' }, body_options: { class: 'gl-new-card-body gl-px-0' }) do |c|
- c.with_header do
.gl-new-card-title-wrapper{ data: { event_tracking_load: 'true', event_tracking: 'view_admin_gitaly_servers_pageload' } }
%h3.gl-new-card-title
= _('Gitaly servers')
.gl-new-card-count
= sprite_icon('earth', css_class: "gl-mr-2 gl-fill-icon-subtle gl-icon")
= @gitaly_servers.size
= render ::Layouts::PageHeadingComponent.new(_('Gitaly servers'), options: { data: { event_tracking_load: 'true', event_tracking: 'view_admin_gitaly_servers_pageload' } })

= render ::Layouts::CrudComponent.new(_('Gitaly servers'),
icon: 'earth',
count: @gitaly_servers.size) do |c|
- c.with_body do
- if @gitaly_servers.any?
%table.table.b-table.gl-table.b-table-stacked-md
Expand Down
2 changes: 1 addition & 1 deletion app/views/notify/closed_issue_email.text.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
= closure_reason_text(@closed_via, format: formats.first, name: @updated_by.name)

Issue ##{@issue.iid}: #{@target_url}
#{work_item_type_for(@issue).capitalize} ##{@issue.iid}: #{@target_url}
14 changes: 14 additions & 0 deletions config/events/created_flux_git_push_notifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Tracks Flux Git Push notification from KAS to agentk
internal_events: true
action: create_flux_git_push_notification
product_group: environments
milestone: '17.3'
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150613
distributions:
- ce
- ee
tiers:
- free
- premium
- ultimate
14 changes: 14 additions & 0 deletions config/events/request_api_proxy_access.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Tracks Kubernetes API proxy request
internal_events: true
action: request_api_proxy_access
product_group: environments
milestone: '17.3'
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150613
distributions:
- ce
- ee
tiers:
- free
- premium
- ultimate
14 changes: 14 additions & 0 deletions config/events/request_api_proxy_access_via_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Tracks Kubernetes API proxy request via CI
internal_events: true
action: request_api_proxy_access_via_ci
product_group: environments
milestone: '17.3'
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150613
distributions:
- ce
- ee
tiers:
- free
- premium
- ultimate
14 changes: 14 additions & 0 deletions config/events/request_api_proxy_access_via_pat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Tracks Kubernetes API proxy request via Personal Access Token
internal_events: true
action: request_api_proxy_access_via_pat
product_group: environments
milestone: '17.3'
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150613
distributions:
- ce
- ee
tiers:
- free
- premium
- ultimate
14 changes: 14 additions & 0 deletions config/events/request_api_proxy_access_via_user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Tracks Kubernetes API proxy request via user
internal_events: true
action: request_api_proxy_access_via_user
product_group: environments
milestone: '17.3'
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150613
distributions:
- ce
- ee
tiers:
- free
- premium
- ultimate
4 changes: 4 additions & 0 deletions config/gitlab_loose_foreign_keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ dast_site_profiles_builds:
- table: p_ci_builds
column: ci_build_id
on_delete: async_delete
dast_site_tokens:
- table: projects
column: project_id
on_delete: async_delete
deployment_clusters:
- table: clusters
column: cluster_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ status: active
milestone: '13.12'
introduced_by_url:
time_frame: all
data_source: redis
instrumentation_class: RedisMetric
options:
prefix: kubernetes_agent
event: k8s_api_proxy_request
data_source: internal_events
events:
- name: request_api_proxy_access
distribution:
- ce
- ee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ status: active
milestone: "16.1"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123782
time_frame: all
data_source: redis
data_source: internal_events
data_category: optional
instrumentation_class: RedisMetric
performance_indicator_type: []
options:
prefix: kubernetes_agent
event: flux_git_push_notifications_total
events:
- name: create_flux_git_push_notification
distribution:
- ce
- ee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ status: active
milestone: "16.2"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124147
time_frame: all
data_source: redis
data_source: internal_events
data_category: optional
instrumentation_class: RedisMetric
performance_indicator_type: []
options:
prefix: kubernetes_agent
event: k8s_api_proxy_requests_via_ci_access
events:
- name: request_api_proxy_access_via_ci
distribution:
- ce
- ee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ status: active
milestone: "16.2"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124147
time_frame: all
data_source: redis
data_source: internal_events
data_category: optional
instrumentation_class: RedisMetric
performance_indicator_type: []
options:
prefix: kubernetes_agent
event: k8s_api_proxy_requests_via_user_access
events:
- name: request_api_proxy_access_via_user
distribution:
- ce
- ee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ status: active
milestone: "16.4"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129463
time_frame: all
data_source: redis
data_source: internal_events
data_category: optional
instrumentation_class: RedisMetric
options:
prefix: kubernetes_agent
event: k8s_api_proxy_requests_via_pat_access
events:
- name: request_api_proxy_access_via_pat
performance_indicator_type: []
distribution:
- ce
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- title: "Group vulnerability report by OWASP top 10 2017 is deprecated"
removal_milestone: "17.3"
removal_milestone: "17.4"
announcement_milestone: "17.0"
breaking_change: false
reporter: abellucci
Expand Down
22 changes: 22 additions & 0 deletions data/deprecations/17-3-codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- title: "CodeClimate-based Code Quality scanning will be removed" # (required) Clearly explain the change, or planned change. For example, "The `confidential` field for a `Note` is deprecated" or "CI/CD job names will be limited to 250 characters."
announcement_milestone: "17.3" # (required) The milestone when this feature was first announced as deprecated.
removal_milestone: "18.0" # (required) The milestone when this feature is planned to be removed
breaking_change: true # (required) Change to false if this is not a breaking change.
reporter: connorgilbert # (required) GitLab username of the person reporting the change
stage: secure # (required) String value of the stage that the feature was created in. e.g., Growth
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/471677 # (required) Link to the deprecation issue in GitLab
body: | # (required) Do not modify this line, instead modify the lines below.
In GitLab 18.0, we will remove CodeClimate-based Code Quality scanning.
However, you'll still be able to import results from quality tools by [providing a report as an artifact](https://docs.gitlab.com/ee/ci/testing/code_quality.html#implement-a-custom-tool), just as you can today.
In addition, you can also see this [epic](https://gitlab.com/groups/gitlab-org/-/epics/8790) for new directions considered for Code Quality.
We expect to implement this change by:
1. Changing the [`Code-Quality.gitlab-ci.yml` CI/CD template](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml) to no longer execute scans. Today, this template runs CodeClimate-based scans. (We plan to change the template rather than delete it to reduce the impact on any pipelines that still `include` the template after 18.0.)
1. No longer running CodeClimate-based scanning as part of Auto DevOps.
Effective immediately, CodeClimate-based scanning will receive only [limited updates](https://docs.gitlab.com/ee/update/terminology.html#deprecation).
After End of Support in GitLab 18.0, we won't provide further updates.
However, we won't delete previously published container images or remove the ability to run them by using custom CI/CD pipeline job definitions.
For more details and required actions, see the [deprecation issue for this change](https://gitlab.com/gitlab-org/gitlab/-/issues/471677#action-required).
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
migration_job_name: BackfillErrorTrackingErrorEventsProjectId
description: Backfills sharding key `error_tracking_error_events.project_id` from `error_tracking_errors`.
feature_category: error_tracking
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161341
milestone: '17.3'
queued_migration_version: 20240731160144
finalize_after: '2024-08-22'
finalized_by: # version of the migration that finalized this BBM
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
migration_job_name: MakeSecurityPolicyBotsPrivate
description: Updates private_profile to true for all security policy bot users.
feature_category: security_policy_management
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161151
milestone: '17.3'
queued_migration_version: 20240729124632
finalize_after: '2024-08-15'
finalized_by: # version of the migration that finalized this BBM
2 changes: 1 addition & 1 deletion db/docs/dast_site_tokens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ feature_categories:
description: Token for the site to be validated
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/41639
milestone: '13.4'
gitlab_schema: gitlab_main_cell
gitlab_schema: gitlab_sec
allow_cross_foreign_keys:
- gitlab_main_clusterwide
sharding_key:
Expand Down
1 change: 1 addition & 0 deletions db/docs/error_tracking_error_events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ desired_sharding_key:
table: error_tracking_errors
sharding_key: project_id
belongs_to: error
desired_sharding_key_migration_job_name: BackfillErrorTrackingErrorEventsProjectId
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

class AddProjectIdToErrorTrackingErrorEvents < Gitlab::Database::Migration[2.2]
milestone '17.3'

def change
add_column :error_tracking_error_events, :project_id, :bigint
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

class RemoveProjectsDastSiteTokensProjectIdFk < Gitlab::Database::Migration[2.2]
milestone '17.3'
disable_ddl_transaction!

FOREIGN_KEY_NAME = "fk_rails_e84f721a8e"

def up
with_lock_retries do
remove_foreign_key_if_exists(:dast_site_tokens, :projects,
name: FOREIGN_KEY_NAME, reverse_lock_order: true)
end
end

def down
add_concurrent_foreign_key(:dast_site_tokens, :projects,
name: FOREIGN_KEY_NAME, column: :project_id,
target_column: :id, on_delete: :cascade)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

class QueueMakeSecurityPolicyBotsPrivate < Gitlab::Database::Migration[2.2]
milestone '17.3'

restrict_gitlab_migration gitlab_schema: :gitlab_main

MIGRATION = "MakeSecurityPolicyBotsPrivate"
DELAY_INTERVAL = 2.minutes
BATCH_SIZE = 1000
SUB_BATCH_SIZE = 100

def up
queue_batched_background_migration(
MIGRATION,
:users,
:id,
job_interval: DELAY_INTERVAL,
batch_size: BATCH_SIZE,
sub_batch_size: SUB_BATCH_SIZE
)
end

def down
delete_batched_background_migration(MIGRATION, :users, :id, [])
end
end
Loading

0 comments on commit 2f2a542

Please sign in to comment.