Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2024-03-20 00:11:24 +00:00
parent b529be3951
commit 01489edb5b
24 changed files with 164 additions and 127 deletions

View File

@ -6,6 +6,7 @@ variables:
ALLURE_JOB_NAME: $CI_PROJECT_NAME
COLORIZED_LOGS: "true"
FEATURE_FLAGS: ""
TEST_RUNNER_TAG: e2e
QA_LOG_LEVEL: "info"
QA_TESTS: ""
# run all tests by default when package-and-test is included natively in other projects

View File

@ -167,6 +167,9 @@
.if-ruby-branch: &if-ruby-branch
if: '$CI_COMMIT_BRANCH =~ /^ruby\d+(_\d)*$/ || $CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby\d+(_\d)*/'
.if-renovate-fork: &if-renovate-fork
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-renovate-forks/'
####################
# Changes patterns #
####################
@ -631,7 +634,6 @@
- "scripts/glfm/**/*"
- "scripts/lib/glfm/**/*"
# Certain components require the base e2e GDK image to be rebuilt if they change
.gdk-component-patterns: &gdk-component-patterns
- qa/gdk/**/*
- Gemfile.lock
@ -942,21 +944,14 @@
changes:
- qa/gdk/Dockerfile.gdk
# We use a multi-stage image to:
# - (re)build the first stage in master pipelines (including scheduled pipelines), and
# - build the final stage in code-change pipelines (including MRs), and scheduled pipelines
# This has to match ".qa:rules:e2e:test-on-gdk" otherwise there won't be an image available to run GDK in the test jobs.
# Unfortunately, we can't just include ".qa:rules:e2e:test-on-gdk" because some of the conditions are manual
# Since the smoke test job is not allowed to fail, the `build-gdk-image` job is also not allowed to fail.
# It's better to fail early and avoid wasting resources running test jobs that would just fail anyway.
.build-images:rules:build-gdk-image:
rules:
# Allows to force rebuild base image in case something goes wrong and this had to be disabled
- if: '$QA_RUN_TESTS_ON_GDK !~ /true|yes|1/i'
when: manual
allow_failure: true
variables:
BUILD_GDK_BASE: "true"
- <<: *if-renovate-fork
changes: *gdk-component-patterns
- !reference [".qa:rules:package-and-test-never-run", rules]
- <<: *if-default-branch-schedule-nightly # already executed in the 2-hourly schedule
when: never
@ -1506,6 +1501,8 @@
when: never
- <<: *if-merge-request-labels-pipeline-expedite
when: never
- <<: *if-renovate-fork
changes: *gdk-component-patterns
- <<: *if-merge-request-targeting-stable-branch
changes: *setup-test-env-patterns
allow_failure: true
@ -1720,10 +1717,14 @@
.qa:rules:e2e:test-on-gdk:
rules:
- if: '$QA_RUN_TESTS_ON_GDK !~ /true|yes|1/i'
- if: '$QA_RUN_TESTS_ON_GDK =~ /false|no|0/i'
when: never
- <<: *if-default-branch-schedule-nightly # already executed in the 2-hourly schedule
when: never
- <<: *if-renovate-fork
changes: *gdk-component-patterns
variables:
TEST_RUNNER_TAG: saas-linux-xlarge-amd64
- !reference [".qa:rules:e2e-blocking", rules]
- !reference [".qa:rules:e2e-schedule-blocking", rules]

View File

@ -68,7 +68,7 @@ include:
# Override default command so we don't tail all of the logs to stdout unnecessarily
command: [gdk, tail, rails-web]
tags:
- e2e
- $TEST_RUNNER_TAG
variables:
DOCKER_HOST: tcp://docker:2375
QA_GENERATE_ALLURE_REPORT: "true"

View File

@ -87,7 +87,7 @@ export default {
<div
v-for="userAchievement in userAchievements"
:key="userAchievement.id"
class="gl-display-inline-block gl-vertical-align-top"
class="gl-mr-2 gl-display-inline-block gl-vertical-align-top gl-text-center"
data-testid="user-achievement"
>
<gl-avatar
@ -96,7 +96,7 @@ export default {
:size="32"
tabindex="0"
shape="rect"
class="gl-mr-2 gl-p-1 gl-border-none"
class="gl-p-1 gl-border-none"
/>
<br />
<gl-badge v-if="showCountBadge(userAchievement.count)" variant="info" size="sm">{{

View File

@ -16,6 +16,7 @@ import {
SCOPE_MILESTONES,
SCOPE_WIKI_BLOBS,
SEARCH_TYPE_ADVANCED,
SEARCH_TYPE_ZOEKT,
} from '../constants';
import IssuesFilters from './issues_filters.vue';
import MergeRequestsFilters from './merge_requests_filters.vue';
@ -54,6 +55,17 @@ export default {
computed: {
...mapState(['searchType']),
...mapGetters(['currentScope']),
isBlobScope() {
return this.currentScope === SCOPE_BLOB;
},
isAdvancedSearch() {
return this.searchType === SEARCH_TYPE_ADVANCED;
},
isZoektSearch() {
return (
this.searchType === SEARCH_TYPE_ZOEKT && this.glFeatures.searchAddArchivedFilterToZoekt
);
},
showIssuesFilters() {
return this.currentScope === SCOPE_ISSUES;
},
@ -61,7 +73,7 @@ export default {
return this.currentScope === SCOPE_MERGE_REQUESTS;
},
showBlobFilters() {
return this.currentScope === SCOPE_BLOB && this.searchType === SEARCH_TYPE_ADVANCED;
return this.isBlobScope && (this.isAdvancedSearch || this.isZoektSearch);
},
showProjectsFilters() {
return this.currentScope === SCOPE_PROJECTS;

View File

@ -1,4 +1,7 @@
<script>
// eslint-disable-next-line no-restricted-imports
import { mapState } from 'vuex';
import { SEARCH_TYPE_ADVANCED } from '../constants';
import LanguageFilter from './language_filter/index.vue';
import ArchivedFilter from './archived_filter/index.vue';
import FiltersTemplate from './filters_template.vue';
@ -10,12 +13,18 @@ export default {
FiltersTemplate,
ArchivedFilter,
},
computed: {
...mapState(['searchType']),
showLanguageFilter() {
return this.searchType === SEARCH_TYPE_ADVANCED;
},
},
};
</script>
<template>
<filters-template>
<language-filter class="gl-mb-5" />
<language-filter v-if="showLanguageFilter" class="gl-mb-5" />
<archived-filter class="gl-mb-5" />
</filters-template>
</template>

View File

@ -40,18 +40,11 @@ class RegistrationsController < Devise::RegistrationsController
set_resource_fields
super do |new_user|
record_arkose_data
accept_pending_invitations if new_user.persisted?
persist_accepted_terms_if_required(new_user)
send_custom_confirmation_instructions
track_weak_password_error(new_user, self.class.name, 'create')
if pending_approval?
NotificationService.new.new_instance_access_request(new_user)
if new_user.persisted?
after_successful_create_hook(new_user)
else
track_weak_password_error(new_user, self.class.name, 'create')
end
after_request_hook(new_user)
end
# Devise sets a flash message on both successful & failed signups,
@ -79,7 +72,6 @@ class RegistrationsController < Devise::RegistrationsController
protected
def persist_accepted_terms_if_required(new_user)
return unless new_user.persisted?
return unless Gitlab::CurrentSettings.current_application_settings.enforce_terms?
terms = ApplicationSetting::Term.latest
@ -107,11 +99,17 @@ class RegistrationsController < Devise::RegistrationsController
end
# overridden by EE module
def after_request_hook(user)
return unless user.persisted?
def after_successful_create_hook(user)
accept_pending_invitations
persist_accepted_terms_if_required(user)
notify_new_instance_access_request(user)
track_successful_user_creation(user)
end
track_creation user: user
Gitlab::Tracking.event(self.class.name, 'successfully_submitted_form', user: user)
def notify_new_instance_access_request(user)
return unless pending_approval?
NotificationService.new.new_instance_access_request(user)
end
def after_sign_up_path_for(user)
@ -159,9 +157,11 @@ class RegistrationsController < Devise::RegistrationsController
{}
end
def track_creation(user:)
def track_successful_user_creation(user)
label = user_invited? ? 'invited' : 'signup'
Gitlab::Tracking.event(self.class.name, 'create_user', label: label, user: user)
Gitlab::Tracking.event(self.class.name, 'successfully_submitted_form', user: user)
end
def ensure_destroy_prerequisites_met
@ -216,7 +216,7 @@ class RegistrationsController < Devise::RegistrationsController
def pending_approval?
return false unless Gitlab::CurrentSettings.require_admin_approval_after_user_signup
resource.persisted? && resource.blocked_pending_approval?
resource.blocked_pending_approval?
end
def sign_up_params_attributes
@ -304,10 +304,6 @@ class RegistrationsController < Devise::RegistrationsController
current_user
end
def record_arkose_data
# overridden by EE module
end
def identity_verification_enabled?
# overridden by EE module
false
@ -317,10 +313,6 @@ class RegistrationsController < Devise::RegistrationsController
# overridden by EE module
end
def send_custom_confirmation_instructions
# overridden by EE module
end
def arkose_labs_enabled?
false
end

View File

@ -25,7 +25,7 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated
insufficient_bridge_permissions: 'This job could not be executed because of insufficient permissions to create a downstream pipeline',
bridge_pipeline_is_child_pipeline: 'This job belongs to a child pipeline and cannot create further child pipelines',
downstream_pipeline_creation_failed: 'The downstream pipeline could not be created',
secrets_provider_not_found: 'The secrets provider can not be found',
secrets_provider_not_found: 'The secrets provider can not be found. Check your CI/CD variables and try again.',
reached_max_descendant_pipelines_depth: 'You reached the maximum depth of child pipelines',
reached_max_pipeline_hierarchy_size: 'The downstream pipeline tree is too large',
project_deleted: 'The job belongs to a deleted project',

View File

@ -14,21 +14,14 @@ module Members
end
def execute
if Feature.enabled?(:new_unassignment_service) && !requesting_user
raise ArgumentError, 'requesting_user must be given'
end
raise ArgumentError, 'requesting_user must be given' unless requesting_user
return unless entity && user
project_ids = entity.is_a?(Group) ? entity.all_projects.select(:id) : [entity.id]
if Feature.enabled?(:new_unassignment_service)
unassign_from_issues(project_ids)
unassign_from_merge_requests(project_ids)
else
user.issue_assignees.on_issues(Issue.in_projects(project_ids).select(:id)).delete_all
user.merge_request_assignees.in_projects(project_ids).delete_all
end
unassign_from_issues(project_ids)
unassign_from_merge_requests(project_ids)
user.invalidate_cache_counts
end

View File

@ -62,8 +62,8 @@
- if issuable_sidebar[:supports_time_tracking]
.js-sidebar-time-tracking-root.block
// Fallback while content is loading
.title.hide-collapsed
= _('Time tracking')
.title.hide-collapsed.gl-display-flex.gl-justify-content-space-between.gl-align-items-center{ class: 'gl-mb-0!' }
%span.gl-font-weight-bold= _('Time tracking')
= gl_loading_icon(inline: true)
- if issuable_sidebar.dig(:features_available, :health_status)

View File

@ -4,8 +4,8 @@
.js-sidebar-assignees-root{ data: { field: issuable_type,
max_assignees: dropdown_options[:data][:"max-select"],
directly_invite_members: can_admin_project_member?(@project) } }
.title.hide-collapsed
= s_('Label|Assignee')
.title.hide-collapsed.gl-display-flex.gl-justify-content-space-between.gl-align-items-center{ class: 'gl-mb-0!' }
%span.gl-font-weight-bold= s_('Label|Assignee')
= gl_loading_icon(inline: true)
.js-sidebar-assignee-data.selectbox.hide-collapsed

View File

@ -1,8 +1,8 @@
- issuable_type = issuable_sidebar[:type]
.js-sidebar-reviewers-root{ data: { field: issuable_type, signed_in: signed_in } }
.title.hide-collapsed
= _('Reviewers')
.title.hide-collapsed.gl-display-flex.gl-justify-content-space-between.gl-align-items-center{ class: 'gl-mb-0!' }
%span.gl-font-weight-bold= _('Reviewers')
= gl_loading_icon(inline: true)
.selectbox.hide-collapsed

View File

@ -30,7 +30,7 @@ module MembersDestroyer
return
end
if Feature.enabled?(:new_unassignment_service) && requesting_user_id.nil?
if requesting_user_id.nil?
logger.error(
message: "requesting_user_id is nil.",
entity_type: entity_type,

View File

@ -1,9 +0,0 @@
---
name: new_unassignment_service
feature_issue_url:
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145726
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/443249
milestone: '16.10'
group: group::project management
type: gitlab_com_derisk
default_enabled: false

View File

@ -28,6 +28,20 @@ For more information about our commitment to an open and welcoming environment,
Issues and merge requests should be in English and contain appropriate language
for audiences of all ages.
## GitLab technologies
[GitLab](https://gitlab.com/gitlab-org/gitlab) is a [Ruby on Rails](https://rubyonrails.org/) application.
It uses [Haml](https://haml.info/) and a JavaScript-based frontend with [Vue.js](https://vuejs.org/).
Some satellite projects use [Go](https://go.dev/).
For example:
- [GitLab Runner](https://gitlab.com/gitlab-org/gitlab-runner)
- [Gitaly](https://gitlab.com/gitlab-org/gitaly)
- [GLab](https://gitlab.com/gitlab-org/cli)
We have [development style guides for each technology](style_guides.md) to help you align with our coding standards.
### Choose or create an issue
If you know what you're going to work on, see if an issue exists. If it doesn't,

View File

@ -6,8 +6,6 @@ info: Any user with at least the Maintainer role can merge updates to this conte
# Feature Categorization
> - [Introduced](https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/269) in GitLab 13.2.
Each Sidekiq worker, Batched Background migrations, controller action, [test example](../testing_guide/best_practices.md#feature-category-metadata) or API endpoint
must declare a `feature_category` attribute. This attribute maps each
of these to a [feature category](https://handbook.gitlab.com/handbook/product/categories/). This

View File

@ -39,6 +39,30 @@ The following are possible reasons:
- No buildpack may exist for your application. Try specifying a
[custom buildpack](customize.md#custom-buildpacks).
## Builder sunset error
Because of this [Heroku update](https://github.com/heroku/cnb-builder-images/pull/478), legacy shimmed `heroku/buildpacks:20` and `heroku/builder-classic:22` images now generate errors instead of warnings.
To resolve this issue, you should to migrate to the `heroku/builder:*` builder images. As a temporary workaround, you can also set an environment variable to skip errors.
### Migrating to `heroku/builder:*`
Before you migrate, you should read the release notes for the each [spec release](https://github.com/buildpacks/spec/releases) to determine potential breaking changes.
In this case, the relevant buildpack API versions are 0.6 and 0.7.
These breaking changes are especially relevant to buildpack maintainers.
For more information about the changes, you can also diff the [spec itself](https://github.com/buildpacks/spec/compare/buildpack/v0.5...buildpack/v0.7#files_bucket).
### Skipping errors
As a temporary workaround, you can skip the errors by setting and forwarding the `ALLOW_EOL_SHIMMED_BUILDER` environment variable:
```yaml
variables:
ALLOW_EOL_SHIMMED_BUILDER: "1"
AUTO_DEVOPS_BUILD_IMAGE_FORWARDED_CI_VARIABLES: ALLOW_EOL_SHIMMED_BUILDER
```
## Pipeline that extends Auto DevOps with only / except fails
If your pipeline fails with the following message:

View File

@ -4,10 +4,10 @@ module API
module VsCode
module Settings
class VsCodeSettingsSync < ::API::Base
urgency :low
include ::VsCode::Settings
feature_category :web_ide
urgency :low
helpers do
def find_settings

View File

@ -137,7 +137,7 @@
"deckar01-task_list": "^2.3.1",
"dexie": "^3.2.3",
"diff": "^3.4.0",
"dompurify": "^3.0.9",
"dompurify": "^3.0.10",
"dropzone": "^4.2.0",
"editorconfig": "^0.15.3",
"emoji-regex": "^10.0.0",

View File

@ -1,4 +1,4 @@
ARG GDK_SHA=9e11e49584ed6240e11414b34b74b18a0b1a00d4
ARG GDK_SHA=a7e526ddaa2334255fe3358390ff07ab1e35cd16
# Use tag prefix when running on 'stable' branch to make sure 'protected' image is used which is not deleted by registry cleanup
ARG GDK_BASE_TAG_PREFIX

View File

@ -33,7 +33,7 @@ describe('GlobalSearchSidebar', () => {
currentScope: jest.fn(() => 'issues'),
};
const createComponent = (initialState = {}) => {
const createComponent = (initialState = {}, glFeatures = {}) => {
const store = new Vuex.Store({
state: {
urlQuery: MOCK_QUERY,
@ -44,6 +44,9 @@ describe('GlobalSearchSidebar', () => {
wrapper = shallowMount(GlobalSearchSidebar, {
store,
provide: {
glFeatures,
},
});
};
@ -105,30 +108,34 @@ describe('GlobalSearchSidebar', () => {
});
describe.each`
scope | filter | searchType | isShown
${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_BASIC} | ${false}
${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_ADVANCED} | ${true}
${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_ZOEKT} | ${false}
`('sidebar blobs scope:', ({ scope, filter, searchType, isShown }) => {
beforeEach(() => {
getterSpies.currentScope = jest.fn(() => scope);
createComponent({ urlQuery: { scope }, searchType });
});
scope | filter | searchType | searchAddArchivedFilterToZoekt | isShown
${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_BASIC} | ${true} | ${false}
${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_BASIC} | ${false} | ${false}
${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_ADVANCED} | ${true} | ${true}
${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_ADVANCED} | ${false} | ${true}
${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_ZOEKT} | ${true} | ${true}
${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_ZOEKT} | ${false} | ${false}
`(
'sidebar blobs scope:',
({ scope, filter, searchType, searchAddArchivedFilterToZoekt, isShown }) => {
beforeEach(() => {
getterSpies.currentScope = jest.fn(() => scope);
createComponent(
{
urlQuery: { scope },
searchType,
},
{ searchAddArchivedFilterToZoekt },
);
});
it(`renders correctly filter BlobsFilters when search_type ${searchType}`, () => {
expect(filter().exists()).toBe(isShown);
});
});
describe('filters for blobs will not load if zoekt is enabled', () => {
beforeEach(() => {
createComponent({ urlQuery: { scope: 'blobs' }, searchType: SEARCH_TYPE_ZOEKT });
});
it("doesn't render blobs filters", () => {
expect(findBlobsFilters().exists()).toBe(false);
});
});
it(`does ${
isShown ? '' : 'not '
}render filter BlobsFilters when search_type ${searchType} and searchAddArchivedFilterToZoekt ${searchAddArchivedFilterToZoekt}`, () => {
expect(filter().exists()).toBe(isShown);
});
},
);
describe('with sidebar scope: projects', () => {
beforeEach(() => {

View File

@ -6,7 +6,11 @@ import { MOCK_QUERY } from 'jest/search/mock_data';
import BlobsFilters from '~/search/sidebar/components/blobs_filters.vue';
import LanguageFilter from '~/search/sidebar/components/language_filter/index.vue';
import ArchivedFilter from '~/search/sidebar/components/archived_filter/index.vue';
import { SEARCH_TYPE_ADVANCED } from '~/search/sidebar/constants';
import {
SEARCH_TYPE_ZOEKT,
SEARCH_TYPE_ADVANCED,
SEARCH_TYPE_BASIC,
} from '~/search/sidebar/constants';
Vue.use(Vuex);
@ -17,11 +21,11 @@ describe('GlobalSearch BlobsFilters', () => {
currentScope: () => 'blobs',
};
const createComponent = () => {
const createComponent = (initialState = { searchType: SEARCH_TYPE_ADVANCED }) => {
const store = new Vuex.Store({
state: {
urlQuery: MOCK_QUERY,
searchType: SEARCH_TYPE_ADVANCED,
...initialState,
},
getters: defaultGetters,
});
@ -38,8 +42,19 @@ describe('GlobalSearch BlobsFilters', () => {
createComponent();
});
it('renders LanguageFilter', () => {
expect(findLanguageFilter().exists()).toBe(true);
describe.each`
searchType | isShown
${SEARCH_TYPE_BASIC} | ${false}
${SEARCH_TYPE_ADVANCED} | ${true}
${SEARCH_TYPE_ZOEKT} | ${false}
`('sidebar blobs language filter:', ({ searchType, isShown }) => {
beforeEach(() => {
createComponent({ searchType });
});
it(`does ${isShown ? '' : 'not '}render LanguageFilter when search_type ${searchType}`, () => {
expect(findLanguageFilter().exists()).toBe(isShown);
});
});
it('renders ArchivedFilter', () => {

View File

@ -90,16 +90,6 @@ RSpec.describe Members::UnassignIssuablesService, feature_category: :groups_and_
it_behaves_like 'unassignment events'
it_behaves_like 'missing request_user raises an error'
it_behaves_like 'stale objects are ignored and skipped'
context 'when the FF new_unassignment_service is disabled' do
let_it_be(:requesting_user) { nil }
before do
stub_feature_flags(new_unassignment_service: false)
end
it_behaves_like 'un-assigning issuables', 2, 2, 2, 1
end
end
context 'when a user leaves a group' do
@ -121,16 +111,6 @@ RSpec.describe Members::UnassignIssuablesService, feature_category: :groups_and_
it_behaves_like 'un-assigning issuables', 4, 4, 4, 2
it_behaves_like 'unassignment events'
it_behaves_like 'stale objects are ignored and skipped'
context 'when the FF new_unassignment_service is disabled' do
let_it_be(:requesting_user) { nil }
before do
stub_feature_flags(new_unassignment_service: false)
end
it_behaves_like 'un-assigning issuables', 4, 4, 4, 2
end
end
end
end

View File

@ -5758,10 +5758,10 @@ dommatrix@^1.0.3:
resolved "https://registry.yarnpkg.com/dommatrix/-/dommatrix-1.0.3.tgz#e7c18e8d6f3abdd1fef3dd4aa74c4d2e620a0525"
integrity sha512-l32Xp/TLgWb8ReqbVJAFIvXmY7go4nTxxlWiAFyhoQw9RKEOHBZNnyGvJWqDVSPmq3Y9HlM4npqF/T6VMOXhww==
dompurify@^3.0.5, dompurify@^3.0.9:
version "3.0.9"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.0.9.tgz#b3f362f24b99f53498c75d43ecbd784b0b3ad65e"
integrity sha512-uyb4NDIvQ3hRn6NiC+SIFaP4mJ/MdXlvtunaqK9Bn6dD3RuB/1S/gasEjDHD8eiaqdSael2vBv+hOs7Y+jhYOQ==
dompurify@^3.0.10, dompurify@^3.0.5:
version "3.0.10"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.0.10.tgz#d48b7c5cef8f368fca380c6fbd9aa8d9f3ca0dcb"
integrity sha512-WZDL8ZHTliEVP3Lk4phtvjg8SNQ3YMc5WVstxE8cszKZrFjzI4PF4ZTIk9VGAc9vZADO7uGO2V/ZiStcRSAT4Q==
dropzone@^4.2.0:
version "4.2.0"