Commit 11f086f9 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents d0126f0e f17d1cc4
<script>
import { GlAlert, GlButton } from '@gitlab/ui';
import { CENTERED_LIMITED_CONTAINER_CLASSES } from '../constants';
import { CENTERED_LIMITED_CONTAINER_CLASSES, EVT_EXPAND_ALL_FILES } from '../constants';
import eventHub from '../event_hub';
export default {
......@@ -40,7 +40,7 @@ export default {
this.$emit('dismiss');
},
expand() {
eventHub.$emit('mr:diffs:expandAllFiles');
eventHub.$emit(EVT_EXPAND_ALL_FILES);
this.dismiss();
},
},
......
......@@ -6,7 +6,7 @@ import { polyfillSticky } from '~/lib/utils/sticky';
import CompareDropdownLayout from './compare_dropdown_layout.vue';
import SettingsDropdown from './settings_dropdown.vue';
import DiffStats from './diff_stats.vue';
import { CENTERED_LIMITED_CONTAINER_CLASSES } from '../constants';
import { CENTERED_LIMITED_CONTAINER_CLASSES, EVT_EXPAND_ALL_FILES } from '../constants';
import eventHub from '../event_hub';
export default {
......@@ -71,7 +71,7 @@ export default {
'toggleShowTreeList',
]),
expandAllFiles() {
eventHub.$emit('mr:diffs:expandAllFiles');
eventHub.$emit(EVT_EXPAND_ALL_FILES);
},
},
};
......
......@@ -11,7 +11,11 @@ import DiffFileHeader from './diff_file_header.vue';
import DiffContent from './diff_content.vue';
import { diffViewerErrors } from '~/ide/constants';
import { collapsedType, isCollapsed } from '../diff_file';
import { DIFF_FILE_AUTOMATIC_COLLAPSE, DIFF_FILE_MANUAL_COLLAPSE } from '../constants';
import {
DIFF_FILE_AUTOMATIC_COLLAPSE,
DIFF_FILE_MANUAL_COLLAPSE,
EVT_EXPAND_ALL_FILES,
} from '../constants';
import { DIFF_FILE, GENERIC_ERROR } from '../i18n';
import eventHub from '../event_hub';
......@@ -154,10 +158,10 @@ export default {
},
created() {
notesEventHub.$on(`loadCollapsedDiff/${this.file.file_hash}`, this.requestDiff);
eventHub.$on('mr:diffs:expandAllFiles', this.expandAllListener);
eventHub.$on(EVT_EXPAND_ALL_FILES, this.expandAllListener);
},
beforeDestroy() {
eventHub.$off('mr:diffs:expandAllFiles', this.expandAllListener);
eventHub.$off(EVT_EXPAND_ALL_FILES, this.expandAllListener);
},
methods: {
...mapActions('diffs', [
......
......@@ -95,3 +95,6 @@ export const RENAMED_DIFF_TRANSITIONS = {
[`${STATE_ERRORED}:${TRANSITION_LOAD_START}`]: STATE_LOADING,
[`${STATE_ERRORED}:${TRANSITION_ACKNOWLEDGE_ERROR}`]: STATE_IDLING,
};
// MR Diffs known events
export const EVT_EXPAND_ALL_FILES = 'mr:diffs:expandAllFiles';
......@@ -6,7 +6,7 @@ module Mutations
graphql_name 'MergeRequestSetLabels'
argument :label_ids,
[GraphQL::ID_TYPE],
[::Types::GlobalIDType[Label]],
required: true,
description: <<~DESC
The Label IDs to set. Replaces existing labels by default.
......@@ -23,10 +23,11 @@ module Mutations
merge_request = authorized_find!(project_path: project_path, iid: iid)
project = merge_request.project
label_ids = label_ids
.map { |gid| GlobalID.parse(gid) }
.select(&method(:label_descendant?))
.map(&:model_id) # MergeRequests::UpdateService expects integers
# TODO: remove this line when the compatibility layer is removed:
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
label_ids = label_ids.map { |id| ::Types::GlobalIDType[::Label].coerce_isolated_input(id) }
# MergeRequests::UpdateService expects integers
label_ids = label_ids.compact.map(&:model_id)
attribute_name = case operation_mode
when Types::MutationOperationModeEnum.enum[:append]
......@@ -45,10 +46,6 @@ module Mutations
errors: errors_on_object(merge_request)
}
end
def label_descendant?(gid)
gid&.model_class&.ancestors&.include?(Label)
end
end
end
end
# frozen_string_literal: true
module ResolvesProject
# Accepts EITHER one of
# - full_path: String (see Project#full_path)
# - project_id: GlobalID. Arguments should be typed as: `::Types::GlobalIDType[Project]`
def resolve_project(full_path: nil, project_id: nil)
unless full_path.present? ^ project_id.present?
raise ::Gitlab::Graphql::Errors::ArgumentError, 'Incompatible arguments: projectId, projectPath.'
......
......@@ -8,7 +8,7 @@ module Resolvers
required: false,
description: 'The full-path of the project the authored merge requests should be in. Incompatible with projectId.'
argument :project_id, GraphQL::ID_TYPE,
argument :project_id, ::Types::GlobalIDType[::Project],
required: false,
description: 'The global ID of the project the authored merge requests should be in. Incompatible with projectPath.'
......@@ -50,8 +50,10 @@ module Resolvers
end
def load_project(project_path, project_id)
@project = resolve_project(full_path: project_path, project_id: project_id)
@project = @project.sync if @project.respond_to?(:sync)
# TODO: remove this line when the compatibility layer is removed
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
project_id &&= ::Types::GlobalIDType[::Project].coerce_isolated_input(project_id)
@project = ::Gitlab::Graphql::Lazy.force(resolve_project(full_path: project_path, project_id: project_id))
end
def no_results_possible?(args)
......
---
name: include_lfs_blobs_in_archive
introduced_by_url: '44116'
rollout_issue_url:
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44116
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/268409
type: development
group: group::source code
default_enabled: false
default_enabled: true
......@@ -12258,7 +12258,7 @@ input MergeRequestSetLabelsInput {
"""
The Label IDs to set. Replaces existing labels by default.
"""
labelIds: [ID!]!
labelIds: [LabelID!]!
"""
Changes the operation mode. Defaults to REPLACE.
......@@ -21464,7 +21464,7 @@ type User {
"""
The global ID of the project the authored merge requests should be in. Incompatible with projectPath.
"""
projectId: ID
projectId: ProjectID
"""
The full-path of the project the authored merge requests should be in. Incompatible with projectId.
......@@ -21549,7 +21549,7 @@ type User {
"""
The global ID of the project the authored merge requests should be in. Incompatible with projectPath.
"""
projectId: ID
projectId: ProjectID
"""
The full-path of the project the authored merge requests should be in. Incompatible with projectId.
......
......@@ -33685,7 +33685,7 @@
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"name": "LabelID",
"ofType": null
}
}
......@@ -62248,7 +62248,7 @@
"description": "The global ID of the project the authored merge requests should be in. Incompatible with projectPath.",
"type": {
"kind": "SCALAR",
"name": "ID",
"name": "ProjectID",
"ofType": null
},
"defaultValue": null
......@@ -62453,7 +62453,7 @@
"description": "The global ID of the project the authored merge requests should be in. Incompatible with projectPath.",
"type": {
"kind": "SCALAR",
"name": "ID",
"name": "ProjectID",
"ofType": null
},
"defaultValue": null
---
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Documentation process
The process for creating and maintaining GitLab product documentation allows
......
---
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Go standards and style guidelines
This document describes various guidelines and best practices for GitLab
......
---
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Shell scripting standards and style guidelines
GitLab consists of many various services and sub-projects. The majority of
......
---
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type: reference
---
......
---
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Customizing Auto DevOps
While [Auto DevOps](index.md) provides great defaults to get you started, you can customize
......
......@@ -22,6 +22,8 @@ Using the GitLab project Kubernetes integration, you can:
- Use [Web terminals](#web-terminals).
- Use [Deploy Boards](#deploy-boards). **(PREMIUM)**
- Use [Canary Deployments](#canary-deployments). **(PREMIUM)**
- Use [deployment variables](#deployment-variables).
- Use [role-based or attribute-based access controls](add_remove_clusters.md#access-controls).
- View [Logs](#viewing-pod-logs).
- Run serverless workloads on [Kubernetes with Knative](serverless/index.md).
......@@ -242,9 +244,18 @@ A Kubernetes cluster can be the destination for a deployment job. If
### Deployment variables
Deployment variables require a valid [Deploy Token](../deploy_tokens/index.md) named
[`gitlab-deploy-token`](../deploy_tokens/index.md#gitlab-deploy-token), and the
following command in your deployment job script, for Kubernetes to access the registry:
```plaintext
kubectl create secret docker-registry gitlab-registry --docker-server="$CI_REGISTRY" --docker-username="$CI_DEPLOY_USER" --docker-password="$CI_DEPLOY_PASSWORD" --docker-email="$GITLAB_USER_EMAIL" -o yaml --dry-run | kubectl apply -f -
```
The Kubernetes cluster integration exposes the following
[deployment variables](../../../ci/variables/README.md#deployment-environment-variables) in the
GitLab CI/CD build environment.
GitLab CI/CD build environment to deployment jobs, which are jobs that have
[defined a target environment](../../../ci/environments/index.md#defining-environments).
| Variable | Description |
| -------- | ----------- |
......
......@@ -302,7 +302,7 @@ module Gitlab
private :archive_file_path
def archive_version_path
return '' unless Feature.enabled?(:include_lfs_blobs_in_archive)
return '' unless Feature.enabled?(:include_lfs_blobs_in_archive, default_enabled: true)
'@v2'
end
......
......@@ -270,7 +270,7 @@ module Gitlab
prefix: metadata['ArchivePrefix'],
format: format,
path: path.presence || "",
include_lfs_blobs: Feature.enabled?(:include_lfs_blobs_in_archive)
include_lfs_blobs: Feature.enabled?(:include_lfs_blobs_in_archive, default_enabled: true)
).to_proto
)
}
......
......@@ -2,7 +2,7 @@ import Vuex from 'vuex';
import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
import createStore from '~/diffs/store/modules';
import CollapsedFilesWarning from '~/diffs/components/collapsed_files_warning.vue';
import { CENTERED_LIMITED_CONTAINER_CLASSES } from '~/diffs/constants';
import { CENTERED_LIMITED_CONTAINER_CLASSES, EVT_EXPAND_ALL_FILES } from '~/diffs/constants';
import eventHub from '~/diffs/event_hub';
const propsData = {
......@@ -77,13 +77,13 @@ describe('CollapsedFilesWarning', () => {
expect(wrapper.find('[data-testid="root"]').exists()).toBe(false);
});
it('emits the `mr:diffs:expandAllFiles` event when the alert action button is clicked', () => {
it(`emits the \`${EVT_EXPAND_ALL_FILES}\` event when the alert action button is clicked`, () => {
createComponent({}, { full: true });
jest.spyOn(eventHub, '$emit');
getAlertActionButton().vm.$emit('click');
expect(eventHub.$emit).toHaveBeenCalledWith('mr:diffs:expandAllFiles');
expect(eventHub.$emit).toHaveBeenCalledWith(EVT_EXPAND_ALL_FILES);
});
});
......@@ -12,6 +12,7 @@ import DiffContentComponent from '~/diffs/components/diff_content.vue';
import eventHub from '~/diffs/event_hub';
import { diffViewerModes, diffViewerErrors } from '~/ide/constants';
import { EVT_EXPAND_ALL_FILES } from '~/diffs/constants';
function changeViewer(store, index, { automaticallyCollapsed, manuallyCollapsed, name }) {
const file = store.state.diffs.diffFiles[index];
......@@ -140,7 +141,7 @@ describe('DiffFile', () => {
});
describe('collapsing', () => {
describe('`mr:diffs:expandAllFiles` event', () => {
describe(`\`${EVT_EXPAND_ALL_FILES}\` event`, () => {
beforeEach(() => {
jest.spyOn(wrapper.vm, 'handleToggle').mockImplementation(() => {});
});
......@@ -150,13 +151,13 @@ describe('DiffFile', () => {
await wrapper.vm.$nextTick();
eventHub.$emit('mr:diffs:expandAllFiles');
eventHub.$emit(EVT_EXPAND_ALL_FILES);
expect(wrapper.vm.handleToggle).toHaveBeenCalledTimes(1);
});
it('does nothing when the file is not collapsed', async () => {
eventHub.$emit('mr:diffs:expandAllFiles');
eventHub.$emit(EVT_EXPAND_ALL_FILES);
await wrapper.vm.$nextTick();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment