Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-05-26 12:09:25 +00:00
parent 026a5e9101
commit afd476d5fd
13 changed files with 137 additions and 65 deletions

View file

@ -1089,7 +1089,6 @@ Gitlab/NamespacedClass:
- 'ee/app/workers/project_import_schedule_worker.rb'
- 'ee/app/workers/project_template_export_worker.rb'
- 'ee/app/workers/refresh_license_compliance_checks_worker.rb'
- 'ee/app/workers/repository_push_audit_event_worker.rb'
- 'ee/app/workers/repository_update_mirror_worker.rb'
- 'ee/app/workers/scan_security_report_secrets_worker.rb'
- 'ee/app/workers/set_user_status_based_on_user_cap_setting_worker.rb'

View file

@ -113,7 +113,6 @@ Style/SymbolProc:
- 'ee/app/workers/geo/batch/project_registry_worker.rb'
- 'ee/app/workers/geo/sync_timeout_cron_worker.rb'
- 'ee/app/workers/geo/verification_cron_worker.rb'
- 'ee/app/workers/repository_push_audit_event_worker.rb'
- 'ee/lib/api/entities/pending_member.rb'
- 'ee/lib/api/related_epic_links.rb'
- 'ee/lib/ee/api/entities/audit_event.rb'

View file

@ -140,8 +140,9 @@ export default {
</script>
<template>
<!-- delay so not every mouseover triggers Popover -->
<!-- Delayed so not every mouseover triggers Popover -->
<gl-popover
:css-classes="['gl-max-w-48']"
:show="show"
:target="target"
:delay="$options.USER_POPOVER_DELAY"
@ -149,23 +150,11 @@ export default {
boundary="viewport"
triggers="hover focus manual"
>
<div class="gl-p-3 gl-line-height-normal gl-display-flex" data-testid="user-popover">
<div
class="gl-p-2 flex-shrink-1 gl-display-flex gl-flex-direction-column align-items-center gl-w-70p"
>
<div class="gl-py-3 gl-line-height-normal gl-display-flex" data-testid="user-popover">
<div class="gl-mr-4 gl-flex-shrink-0">
<user-avatar-image :img-src="user.avatarUrl" :size="64" css-classes="gl-m-0!" />
<div v-if="shouldRenderToggleFollowButton" class="gl-mt-3">
<gl-button
:variant="toggleFollowButtonVariant"
:loading="toggleFollowLoading"
size="small"
data-testid="toggle-follow-button"
@click="toggleFollow"
>{{ toggleFollowButtonText }}</gl-button
>
</div>
</div>
<div class="gl-w-full gl-min-w-0 gl-word-break-word">
<div class="gl-w-full gl-word-break-word gl-display-flex gl-align-items-center">
<template v-if="userIsLoading">
<gl-skeleton-loader
:lines="$options.maxSkeletonLines"
@ -175,7 +164,7 @@ export default {
/>
</template>
<template v-else>
<div class="gl-mb-3">
<div>
<h5 class="gl-m-0">
<user-name-with-status
:name="user.name"
@ -184,42 +173,64 @@ export default {
/>
</h5>
<span class="gl-text-gray-500">@{{ user.username }}</span>
</div>
<div class="gl-text-gray-500">
<div v-if="user.bio" class="gl-display-flex gl-mb-2">
<gl-icon name="profile" class="gl-flex-shrink-0" />
<span ref="bio" class="gl-ml-2">{{ user.bio }}</span>
<div v-if="shouldRenderToggleFollowButton" class="gl-mt-3">
<gl-button
:variant="toggleFollowButtonVariant"
:loading="toggleFollowLoading"
size="small"
data-testid="toggle-follow-button"
@click="toggleFollow"
>{{ toggleFollowButtonText }}</gl-button
>
</div>
<div v-if="user.workInformation" class="gl-display-flex gl-mb-2">
<gl-icon name="work" class="gl-flex-shrink-0" />
<span ref="workInformation" class="gl-ml-2">{{ user.workInformation }}</span>
</div>
<div v-if="user.location" class="gl-display-flex gl-mb-2">
<gl-icon name="location" class="gl-flex-shrink-0" />
<span class="gl-ml-2">{{ user.location }}</span>
</div>
<div
v-if="user.localTime && !user.bot"
class="gl-display-flex gl-mb-2"
data-testid="user-popover-local-time"
>
<gl-icon name="clock" class="gl-flex-shrink-0" />
<span class="gl-ml-2">{{ user.localTime }}</span>
</div>
</div>
<div v-if="statusHtml" class="gl-mb-2" data-testid="user-popover-status">
<span v-safe-html:[$options.safeHtmlConfig]="statusHtml"></span>
</div>
<div v-if="user.bot && user.websiteUrl" class="gl-text-blue-500">
<gl-icon name="question" />
<gl-link data-testid="user-popover-bot-docs-link" :href="user.websiteUrl">
<gl-sprintf :message="__('Learn more about %{username}')">
<template #username>{{ user.name }}</template>
</gl-sprintf>
</gl-link>
</div>
</template>
</div>
</div>
<div class="gl-mt-2 gl-w-full gl-word-break-word">
<template v-if="userIsLoading">
<gl-skeleton-loader
:lines="$options.maxSkeletonLines"
preserve-aspect-ratio="none"
equal-width-lines
:height="24"
/>
</template>
<template v-else>
<div class="gl-text-gray-500">
<div v-if="user.bio" class="gl-display-flex gl-mb-2">
<gl-icon name="profile" class="gl-flex-shrink-0" />
<span ref="bio" class="gl-ml-2">{{ user.bio }}</span>
</div>
<div v-if="user.workInformation" class="gl-display-flex gl-mb-2">
<gl-icon name="work" class="gl-flex-shrink-0" />
<span ref="workInformation" class="gl-ml-2">{{ user.workInformation }}</span>
</div>
<div v-if="user.location" class="gl-display-flex gl-mb-2">
<gl-icon name="location" class="gl-flex-shrink-0" />
<span class="gl-ml-2">{{ user.location }}</span>
</div>
<div
v-if="user.localTime && !user.bot"
class="gl-display-flex gl-mb-2"
data-testid="user-popover-local-time"
>
<gl-icon name="clock" class="gl-flex-shrink-0" />
<span class="gl-ml-2">{{ user.localTime }}</span>
</div>
</div>
<div v-if="statusHtml" class="gl-mb-2" data-testid="user-popover-status">
<span v-safe-html:[$options.safeHtmlConfig]="statusHtml"></span>
</div>
<div v-if="user.bot && user.websiteUrl" class="gl-text-blue-500">
<gl-icon name="question" />
<gl-link data-testid="user-popover-bot-docs-link" :href="user.websiteUrl">
<gl-sprintf :message="__('Learn more about %{username}')">
<template #username>{{ user.name }}</template>
</gl-sprintf>
</gl-link>
</div>
</template>
</div>
</gl-popover>
</template>

View file

@ -3,7 +3,7 @@
- can_reopen_merge_request = can?(current_user, :reopen_merge_request, @merge_request)
- are_close_and_open_buttons_hidden = merge_request_button_hidden?(@merge_request, true) && merge_request_button_hidden?(@merge_request, false)
- updated_mr_header_enabled = Feature.enabled?(:updated_mr_header, @project)
- cache_key = [@project, @merge_request, can_update_merge_request, can_reopen_merge_request, are_close_and_open_buttons_hidden, current_user&.preferred_language, "1.1-#{updated_mr_header_enabled}"]
- cache_key = [@project, @merge_request, can_update_merge_request, can_reopen_merge_request, are_close_and_open_buttons_hidden, current_user&.preferred_language, "1.1-#{updated_mr_header_enabled}", moved_mr_sidebar_enabled?]
= cache(cache_key, expires_in: 1.day) do
- if @merge_request.closed_or_merged_without_fork?
@ -13,7 +13,7 @@
= c.body do
= _('The source project of this merge request has been removed.')
.detail-page-header.border-bottom-0.pt-0.pb-0{ class: "#{'gl-display-block gl-md-display-flex!' if updated_mr_header_enabled} #{'is-merge-request' if updated_mr_header_enabled && !fluid_layout}" }
.detail-page-header.border-bottom-0.pt-0.pb-0{ class: "#{'gl-display-block gl-md-display-flex!' if updated_mr_header_enabled} #{'is-merge-request' if moved_mr_sidebar_enabled? && !fluid_layout}" }
.detail-page-header-body
- unless updated_mr_header_enabled
= render "shared/issuable/status_box", issuable: @merge_request

View file

@ -0,0 +1,8 @@
---
name: route_hll_to_snowplow_phase2
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88482
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/363562
milestone: '15.1'
type: development
group: group::product intelligence
default_enabled: false

View file

@ -395,8 +395,6 @@
- 1
- - repository_import
- 1
- - repository_push_audit_event
- 1
- - repository_update_mirror
- 1
- - repository_update_remote_mirror

View file

@ -0,0 +1,13 @@
# frozen_string_literal: true
class PrepareJobArtifactProjectIdIndex < Gitlab::Database::Migration[2.0]
INDEX_NAME = 'index_ci_job_artifacts_on_project_id_and_id'
def up
prepare_async_index :ci_job_artifacts, [:project_id, :id], name: INDEX_NAME
end
def down
unprepare_async_index :notes, [:project_id, :id], name: INDEX_NAME
end
end

View file

@ -0,0 +1 @@
e4b944d4b2107b203593187e8cefc89df276ce01a93e6b0795c0d710e8f81da2

View file

@ -103,21 +103,22 @@ Therefore, document new uploads here by slotting them into the following tables:
| Job traces archive | `carrierwave` | `sidekiq` | `/artifacts/<proj_id_hash>/<date>/<job_id>/<artifact_id>/job.log` |
| Autoscale runner caching | N/A | `gitlab-runner` | `/gitlab-com-[platform-]runners-cache/???` |
| Backups | N/A | `s3cmd`, `awscli`, or `gcs` | `/gitlab-backups/???` |
| Git LFS | `direct upload` | `workhorse` | `/lsf-objects/<lfs_obj_oid[0:2]>/<lfs_obj_oid[2:2]>` |
| Git LFS | `direct upload` | `workhorse` | `/lfs-objects/<lfs_obj_oid[0:2]>/<lfs_obj_oid[2:2]>` |
| Design management files | `disk buffering` | `rails controller` | `/lsf-objects/<lfs_obj_oid[0:2]>/<lfs_obj_oid[2:2]>` |
| Design management thumbnails | `carrierwave` | `sidekiq` | `/uploads/design_management/action/image_v432x230/<model_id>` |
| Design management thumbnails | `carrierwave` | `sidekiq` | `/uploads/design_management/action/image_v432x230/<model_id>/<original_lfs_obj_oid[2:2]` |
| Generic file uploads | `direct upload` | `workhorse` | `/uploads/@hashed/[0:2]/[2:4]/<hash1>/<hash2>/file` |
| Generic file uploads - personal snippets | `direct upload` | `workhorse` | `/uploads/personal_snippet/<snippet_id>/<filename>` |
| Global appearance settings | `disk buffering` | `rails controller` | `/uploads/appearance/...` |
| Topics | `disk buffering` | `rails controller` | `/uploads/projects/topic/...` |
| Avatar images | `direct upload` | `workhorse` | `/uploads/[user,group,project]/avatar/<model_id>` |
| Import/export | `direct upload` | `workhorse` | `/uploads/import_export_upload/???` |
| Import | `direct upload` | `workhorse` | `/uploads/import_export_upload/import_file/<model_id>/<file_name>` |
| Export | `carrierwave` | `sidekiq` | `/uploads/import_export_upload/export_file/<model_id>/<timestamp>_<namespace>-<project_name>_export.tag.gz` |
| GitLab Migration | `carrierwave` | `sidekiq` | `/uploads/bulk_imports/???` |
| MR diffs | `carrierwave` | `sidekiq` | `/external-diffs/merge_request_diffs/mr-<mr_id>/diff-<diff_id>` |
| Package manager archives | `direct upload` | `sidekiq` | `/packages/<proj_id_hash>/packages/<pkg_segment>/files/<pkg_file_id>` |
| Package manager archives | `direct upload` | `sidekiq` | `/packages/<container_id_hash>/debian_*_component_file/<component_file_id>` |
| Package manager archives | `direct upload` | `sidekiq` | `/packages/<container_id_hash>/debian_*_distribution/<distribution_file_id>` |
| Container image cache (?) | `direct upload` | `workhorse` | `/dependency-proxy/<group_id_hash>/dependency_proxy/<group_id>/files/<proxy_id>/<blob_id or manifest_id>` |
| [Package manager assets (except for NPM)](../../user/packages/package_registry/index.md) | `direct upload` | `workhorse` | `/packages/<proj_id_hash>/packages/<package_id>/files/<package_file_id>` |
| [NPM Package manager assets](../../user/packages/npm_registry/index.md) | `carrierwave` | `grape API` | `/packages/<proj_id_hash>/packages/<package_id>/files/<package_file_id>` |
| [Debian Package manager assets](../../user/packages/debian_repository/index.md) | `direct upload` | `workhorse` | `/packages/<group_id or project_id_hash>/debian_*/<group_id or project_id or distribution_file_id>` |
| [Dependency Proxy cache](../../user/packages/dependency_proxy/index.md) | [`send_dependency`](https://gitlab.com/gitlab-org/gitlab/-/blob/6ed73615ff1261e6ed85c8f57181a65f5b4ffada/workhorse/internal/dependencyproxy/dependencyproxy.go) | `workhorse` | `/dependency-proxy/<group_id_hash>/dependency_proxy/<group_id>/files/<blob_id or manifest_id>` |
| Terraform state files | `carrierwave` | `rails controller` | `/terraform/<proj_id_hash>/<terraform_state_id>` |
| Pages content archives | `carrierwave` | `sidekiq` | `/gitlab-gprd-pages/<proj_id_hash>/pages_deployments/<deployment_id>/` |
| Secure Files | `carrierwave` | `sidekiq` | `/ci-secure-files/<proj_id_hash>/secure_files/<secure_file_id>/` |

View file

@ -24,6 +24,11 @@ module API
authorize! :read_terraform_state, user_project
increment_unique_values('p_terraform_state_api_unique_users', current_user.id)
if Feature.enabled?(:route_hll_to_snowplow_phase2, user_project&.namespace)
Gitlab::Tracking.event('API::Terraform::State', 'p_terraform_state_api_unique_users',
namespace: user_project&.namespace, user: current_user)
end
end
params do

View file

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe API::Terraform::State do
RSpec.describe API::Terraform::State, :snowplow do
include HttpBasicAuthHelpers
let_it_be(:project) { create(:project) }
@ -25,11 +25,17 @@ RSpec.describe API::Terraform::State do
context 'without authentication' do
let(:auth_header) { basic_auth_header('bad', 'token') }
it 'does not track unique event' do
it 'does not track unique hll event' do
expect(Gitlab::UsageDataCounters::HLLRedisCounter).not_to receive(:track_event)
request
end
it 'does not track Snowplow event' do
request
expect_no_snowplow_event
end
end
context 'with maintainer permissions' do
@ -39,6 +45,29 @@ RSpec.describe API::Terraform::State do
let(:target_event) { 'p_terraform_state_api_unique_users' }
let(:expected_value) { instance_of(Integer) }
end
it 'tracks Snowplow event' do
request
expect_snowplow_event(
category: described_class.to_s,
action: 'p_terraform_state_api_unique_users',
namespace: project.namespace.reload,
user: current_user
)
end
context 'when route_hll_to_snowplow_phase2 FF is disabled' do
before do
stub_feature_flags(route_hll_to_snowplow_phase2: false)
end
it 'does not track Snowplow event' do
request
expect_no_snowplow_event
end
end
end
end

View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
module CalloutsTestHelper
def callouts_trials_link_path
'/-/trial_registrations/new?glm_content=gold-callout&glm_source=gitlab.com'
end
end
CalloutsTestHelper.prepend_mod

View file

@ -405,7 +405,6 @@ RSpec.describe 'Every Sidekiq worker' do
'RepositoryForkWorker' => 5,
'RepositoryImportWorker' => false,
'RepositoryUpdateMirrorWorker' => false,
'RepositoryPushAuditEventWorker' => 3,
'RepositoryUpdateRemoteMirrorWorker' => 3,
'RequirementsManagement::ImportRequirementsCsvWorker' => 3,
'RequirementsManagement::ProcessRequirementsReportsWorker' => 3,