Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-01-06 00:09:52 +00:00
parent fa138c9c24
commit 6742cc8951
9 changed files with 70 additions and 49 deletions

View File

@ -1,11 +1,10 @@
<script>
import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { GlCollapsibleListbox } from '@gitlab/ui';
import { getDisplayName } from '../utils';
export default {
components: {
GlDropdown,
GlDropdownItem,
GlCollapsibleListbox,
},
props: {
dropdownLabel: {
@ -42,8 +41,21 @@ export default {
required: true,
},
},
computed: {
listboxItems() {
return this.projects.map((project) => {
return {
text: getDisplayName(project),
value: project.id,
};
});
},
},
methods: {
getDisplayName,
selectProject(id) {
const project = this.projects.find((p) => p.id === id);
this.$emit('select-project', project);
},
},
};
</script>
@ -52,22 +64,15 @@ export default {
<div :class="{ 'gl-show-field-errors': isProjectInvalid }">
<label class="label-bold" for="project-dropdown">{{ __('Project') }}</label>
<div class="row">
<gl-dropdown
<gl-collapsible-listbox
id="project-dropdown"
class="col-8 col-md-9 gl-pr-0"
class="gl-pl-5"
:disabled="!hasProjects"
menu-class="w-100 mw-100"
toggle-class="dropdown-menu-toggle gl-field-error-outline"
:text="dropdownLabel"
>
<gl-dropdown-item
v-for="project in projects"
:key="`${project.organizationSlug}.${project.slug}`"
class="w-100"
@click="$emit('select-project', project)"
>{{ getDisplayName(project) }}</gl-dropdown-item
>
</gl-dropdown>
:items="listboxItems"
:selected="selectedProject && selectedProject.id"
:toggle-text="dropdownLabel"
@select="selectProject"
/>
</div>
<p v-if="isProjectInvalid" class="js-project-dropdown-error gl-field-error">
{{ invalidProjectLabel }}

View File

@ -37,7 +37,7 @@ module Ci
private
def search!
if @project && Feature.enabled?(:on_demand_scans_runner_tags, @project)
if @project
project_runners
elsif @group
group_runners

View File

@ -0,0 +1,13 @@
- title: "Owner permissions are required to update Package settings" # (required) Actionable title. e.g., The `confidential` field for a `Note` is deprecated. Use `internal` instead.
announcement_milestone: "15.8" # (required) The milestone when this feature was first announced as deprecated.
announcement_date: "2023-01-22" # (required) The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post.
removal_milestone: "16.0" # (required) The milestone when this feature is planned to be removed
removal_date: "2023-05-22" # (required) The date of the milestone release when this feature is planned to be removed. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post.
breaking_change: true # (required) If this deprecation is a breaking change, set this value to true
reporter: trizzi # (required) GitLab username of the person reporting the deprecation
stage: Package # (required) String value of the stage that the feature was created in. e.g., Growth
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/370471 # (required) Link to the deprecation issue in GitLab
body: | # (required) Do not modify this line, instead modify the lines below.
You must have Owner permissions to use the GitLab UI to update the `Packages and registries` settings for your groups. This includes [allowing or preventing duplicate package uploads](https://docs.gitlab.com/ee/user/packages/maven_repository/#do-not-allow-duplicate-maven-packages), [package request forwarding](https://docs.gitlab.com/ee/user/packages/maven_repository/#request-forwarding-to-maven-central), and [enabling lifecycle rules for the Dependency Proxy](https://docs.gitlab.com/ee/user/packages/dependency_proxy/reduce_dependency_proxy_storage.html). Currently, you can use the GraphQL API with Owner or Maintainer permissions to update these settings.
In GitLab 16.0 and later, you must have Owner permissions to use the GraphQL API to change the `Packages and registries` settings.

View File

@ -100,6 +100,22 @@ The Container Registry pull-through cache is deprecated in GitLab 15.8 and will
<div class="deprecation removal-160 breaking-change">
### Owner permissions are required to update Package settings
Planned removal: GitLab <span class="removal-milestone">16.0</span> (2023-05-22)
WARNING:
This is a [breaking change](https://docs.gitlab.com/ee/development/deprecation_guidelines/).
Review the details carefully before upgrading.
You must have Owner permissions to use the GitLab UI to update the `Packages and registries` settings for your groups. This includes [allowing or preventing duplicate package uploads](https://docs.gitlab.com/ee/user/packages/maven_repository/#do-not-allow-duplicate-maven-packages), [package request forwarding](https://docs.gitlab.com/ee/user/packages/maven_repository/#request-forwarding-to-maven-central), and [enabling lifecycle rules for the Dependency Proxy](https://docs.gitlab.com/ee/user/packages/dependency_proxy/reduce_dependency_proxy_storage.html). Currently, you can use the GraphQL API with Owner or Maintainer permissions to update these settings.
In GitLab 16.0 and later, you must have Owner permissions to use the GraphQL API to change the `Packages and registries` settings.
</div>
<div class="deprecation removal-160 breaking-change">
### Support for third party registries
Planned removal: GitLab <span class="removal-milestone">16.0</span> (2023-05-22)

View File

@ -113,7 +113,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js, feature_catego
within('div#project-dropdown') do
click_button('Select project')
click_button('Sentry | internal')
find('li', text: 'Sentry | internal').click
end
click_button('Save changes')

View File

@ -630,16 +630,6 @@ RSpec.describe Ci::RunnersFinder, feature_category: :runner_fleet do
expect(subject).to be_empty
end
end
context 'when on_demand_scans_runner_tags feature flag is disabled' do
before do
stub_feature_flags(on_demand_scans_runner_tags: false)
end
it 'returns no runners' do
expect(subject).to be_empty
end
end
end
end
end

View File

@ -1,4 +1,4 @@
import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { GlCollapsibleListbox } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
import { pick, clone } from 'lodash';
@ -42,7 +42,7 @@ describe('error tracking settings project dropdown', () => {
describe('empty project list', () => {
it('renders the dropdown', () => {
expect(wrapper.find('#project-dropdown').exists()).toBe(true);
expect(wrapper.findComponent(GlDropdown).exists()).toBe(true);
expect(wrapper.findComponent(GlCollapsibleListbox).exists()).toBe(true);
});
it('shows helper text', () => {
@ -57,8 +57,10 @@ describe('error tracking settings project dropdown', () => {
});
it('does not contain any dropdown items', () => {
expect(wrapper.findComponent(GlDropdownItem).exists()).toBe(false);
expect(wrapper.findComponent(GlDropdown).props('text')).toBe('No projects available');
expect(wrapper.findComponent(GlCollapsibleListbox).props('items')).toEqual([]);
expect(wrapper.findComponent(GlCollapsibleListbox).props('toggleText')).toBe(
'No projects available',
);
});
});
@ -71,12 +73,12 @@ describe('error tracking settings project dropdown', () => {
it('renders the dropdown', () => {
expect(wrapper.find('#project-dropdown').exists()).toBe(true);
expect(wrapper.findComponent(GlDropdown).exists()).toBe(true);
expect(wrapper.findComponent(GlCollapsibleListbox).exists()).toBe(true);
});
it('contains a number of dropdown items', () => {
expect(wrapper.findComponent(GlDropdownItem).exists()).toBe(true);
expect(wrapper.findAllComponents(GlDropdownItem).length).toBe(2);
expect(wrapper.findComponent(GlCollapsibleListbox).exists()).toBe(true);
expect(wrapper.findComponent(GlCollapsibleListbox).props('items').length).toBe(2);
});
});

View File

@ -5,12 +5,14 @@ const defaultStore = createStore();
export const projectList = [
{
id: '1',
name: 'name',
slug: 'slug',
organizationName: 'organizationName',
organizationSlug: 'organizationSlug',
},
{
id: '2',
name: 'name2',
slug: 'slug2',
organizationName: 'organizationName2',
@ -19,6 +21,7 @@ export const projectList = [
];
export const staleProject = {
id: '3',
name: 'staleName',
slug: 'staleSlug',
organizationName: 'staleOrganizationName',
@ -26,6 +29,7 @@ export const staleProject = {
};
export const normalizedProject = {
id: '5',
name: 'name',
slug: 'slug',
organizationName: 'organization_name',
@ -33,6 +37,7 @@ export const normalizedProject = {
};
export const sampleBackendProject = {
id: '5',
name: normalizedProject.name,
slug: normalizedProject.slug,
organization_name: normalizedProject.organizationName,
@ -45,6 +50,7 @@ export const sampleFrontendSettings = {
integrated: false,
token: 'token',
selectedProject: {
id: '5',
slug: normalizedProject.slug,
name: normalizedProject.name,
organizationName: normalizedProject.organizationName,
@ -58,6 +64,7 @@ export const transformedSettings = {
integrated: false,
token: 'token',
project: {
sentry_project_id: '5',
slug: normalizedProject.slug,
name: normalizedProject.name,
organization_name: normalizedProject.organizationName,

View File

@ -53,16 +53,4 @@ RSpec.describe 'Project.runners', feature_category: :runner do
expect(graphql_data_at(:project, :runners, :nodes)).to be_empty
end
end
context 'when on_demand_scans_runner_tags feature flag is disabled' do
before do
stub_feature_flags(on_demand_scans_runner_tags: false)
end
it 'returns no runners' do
post_graphql(query, current_user: user)
expect(graphql_data_at(:project, :runners, :nodes)).to be_empty
end
end
end