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

Automatic merge of gitlab-org/gitlab master

parents d0126f0e f17d1cc4
<script> <script>
import { GlAlert, GlButton } from '@gitlab/ui'; 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'; import eventHub from '../event_hub';
export default { export default {
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
this.$emit('dismiss'); this.$emit('dismiss');
}, },
expand() { expand() {
eventHub.$emit('mr:diffs:expandAllFiles'); eventHub.$emit(EVT_EXPAND_ALL_FILES);
this.dismiss(); this.dismiss();
}, },
}, },
......
...@@ -6,7 +6,7 @@ import { polyfillSticky } from '~/lib/utils/sticky'; ...@@ -6,7 +6,7 @@ import { polyfillSticky } from '~/lib/utils/sticky';
import CompareDropdownLayout from './compare_dropdown_layout.vue'; import CompareDropdownLayout from './compare_dropdown_layout.vue';
import SettingsDropdown from './settings_dropdown.vue'; import SettingsDropdown from './settings_dropdown.vue';
import DiffStats from './diff_stats.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'; import eventHub from '../event_hub';
export default { export default {
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
'toggleShowTreeList', 'toggleShowTreeList',
]), ]),
expandAllFiles() { expandAllFiles() {
eventHub.$emit('mr:diffs:expandAllFiles'); eventHub.$emit(EVT_EXPAND_ALL_FILES);
}, },
}, },
}; };
......
...@@ -11,7 +11,11 @@ import DiffFileHeader from './diff_file_header.vue'; ...@@ -11,7 +11,11 @@ import DiffFileHeader from './diff_file_header.vue';
import DiffContent from './diff_content.vue'; import DiffContent from './diff_content.vue';
import { diffViewerErrors } from '~/ide/constants'; import { diffViewerErrors } from '~/ide/constants';
import { collapsedType, isCollapsed } from '../diff_file'; 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 { DIFF_FILE, GENERIC_ERROR } from '../i18n';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
...@@ -154,10 +158,10 @@ export default { ...@@ -154,10 +158,10 @@ export default {
}, },
created() { created() {
notesEventHub.$on(`loadCollapsedDiff/${this.file.file_hash}`, this.requestDiff); 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() { beforeDestroy() {
eventHub.$off('mr:diffs:expandAllFiles', this.expandAllListener); eventHub.$off(EVT_EXPAND_ALL_FILES, this.expandAllListener);
}, },
methods: { methods: {
...mapActions('diffs', [ ...mapActions('diffs', [
......
...@@ -95,3 +95,6 @@ export const RENAMED_DIFF_TRANSITIONS = { ...@@ -95,3 +95,6 @@ export const RENAMED_DIFF_TRANSITIONS = {
[`${STATE_ERRORED}:${TRANSITION_LOAD_START}`]: STATE_LOADING, [`${STATE_ERRORED}:${TRANSITION_LOAD_START}`]: STATE_LOADING,
[`${STATE_ERRORED}:${TRANSITION_ACKNOWLEDGE_ERROR}`]: STATE_IDLING, [`${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 ...@@ -6,7 +6,7 @@ module Mutations
graphql_name 'MergeRequestSetLabels' graphql_name 'MergeRequestSetLabels'
argument :label_ids, argument :label_ids,
[GraphQL::ID_TYPE], [::Types::GlobalIDType[Label]],
required: true, required: true,
description: <<~DESC description: <<~DESC
The Label IDs to set. Replaces existing labels by default. The Label IDs to set. Replaces existing labels by default.
...@@ -23,10 +23,11 @@ module Mutations ...@@ -23,10 +23,11 @@ module Mutations
merge_request = authorized_find!(project_path: project_path, iid: iid) merge_request = authorized_find!(project_path: project_path, iid: iid)
project = merge_request.project project = merge_request.project
label_ids = label_ids # TODO: remove this line when the compatibility layer is removed:
.map { |gid| GlobalID.parse(gid) } # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
.select(&method(:label_descendant?)) label_ids = label_ids.map { |id| ::Types::GlobalIDType[::Label].coerce_isolated_input(id) }
.map(&:model_id) # MergeRequests::UpdateService expects integers # MergeRequests::UpdateService expects integers
label_ids = label_ids.compact.map(&:model_id)
attribute_name = case operation_mode attribute_name = case operation_mode
when Types::MutationOperationModeEnum.enum[:append] when Types::MutationOperationModeEnum.enum[:append]
...@@ -45,10 +46,6 @@ module Mutations ...@@ -45,10 +46,6 @@ module Mutations
errors: errors_on_object(merge_request) errors: errors_on_object(merge_request)
} }
end end
def label_descendant?(gid)
gid&.model_class&.ancestors&.include?(Label)
end
end end
end end
end end
# frozen_string_literal: true # frozen_string_literal: true
module ResolvesProject 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) def resolve_project(full_path: nil, project_id: nil)
unless full_path.present? ^ project_id.present? unless full_path.present? ^ project_id.present?
raise ::Gitlab::Graphql::Errors::ArgumentError, 'Incompatible arguments: projectId, projectPath.' raise ::Gitlab::Graphql::Errors::ArgumentError, 'Incompatible arguments: projectId, projectPath.'
......
...@@ -8,7 +8,7 @@ module Resolvers ...@@ -8,7 +8,7 @@ module Resolvers
required: false, required: false,
description: 'The full-path of the project the authored merge requests should be in. Incompatible with projectId.' 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, required: false,
description: 'The global ID of the project the authored merge requests should be in. Incompatible with projectPath.' description: 'The global ID of the project the authored merge requests should be in. Incompatible with projectPath.'
...@@ -50,8 +50,10 @@ module Resolvers ...@@ -50,8 +50,10 @@ module Resolvers
end end
def load_project(project_path, project_id) def load_project(project_path, project_id)
@project = resolve_project(full_path: project_path, project_id: project_id) # TODO: remove this line when the compatibility layer is removed
@project = @project.sync if @project.respond_to?(:sync) # 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 end
def no_results_possible?(args) def no_results_possible?(args)
......
--- ---
name: include_lfs_blobs_in_archive name: include_lfs_blobs_in_archive
introduced_by_url: '44116' introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44116
rollout_issue_url: rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/268409
type: development type: development
group: group::source code group: group::source code
default_enabled: false default_enabled: true
...@@ -12258,7 +12258,7 @@ input MergeRequestSetLabelsInput { ...@@ -12258,7 +12258,7 @@ input MergeRequestSetLabelsInput {
""" """
The Label IDs to set. Replaces existing labels by default. The Label IDs to set. Replaces existing labels by default.
""" """
labelIds: [ID!]! labelIds: [LabelID!]!
""" """
Changes the operation mode. Defaults to REPLACE. Changes the operation mode. Defaults to REPLACE.
...@@ -21464,7 +21464,7 @@ type User { ...@@ -21464,7 +21464,7 @@ type User {
""" """
The global ID of the project the authored merge requests should be in. Incompatible with projectPath. 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. The full-path of the project the authored merge requests should be in. Incompatible with projectId.
...@@ -21549,7 +21549,7 @@ type User { ...@@ -21549,7 +21549,7 @@ type User {
""" """
The global ID of the project the authored merge requests should be in. Incompatible with projectPath. 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. The full-path of the project the authored merge requests should be in. Incompatible with projectId.
......
...@@ -33685,7 +33685,7 @@ ...@@ -33685,7 +33685,7 @@
"name": null, "name": null,
"ofType": { "ofType": {
"kind": "SCALAR", "kind": "SCALAR",
"name": "ID", "name": "LabelID",
"ofType": null "ofType": null
} }
} }
...@@ -62248,7 +62248,7 @@ ...@@ -62248,7 +62248,7 @@
"description": "The global ID of the project the authored merge requests should be in. Incompatible with projectPath.", "description": "The global ID of the project the authored merge requests should be in. Incompatible with projectPath.",
"type": { "type": {
"kind": "SCALAR", "kind": "SCALAR",
"name": "ID", "name": "ProjectID",
"ofType": null "ofType": null
}, },
"defaultValue": null "defaultValue": null
...@@ -62453,7 +62453,7 @@ ...@@ -62453,7 +62453,7 @@
"description": "The global ID of the project the authored merge requests should be in. Incompatible with projectPath.", "description": "The global ID of the project the authored merge requests should be in. Incompatible with projectPath.",
"type": { "type": {
"kind": "SCALAR", "kind": "SCALAR",
"name": "ID", "name": "ProjectID",
"ofType": null "ofType": null
}, },
"defaultValue": 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 # Documentation process
The process for creating and maintaining GitLab product documentation allows 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 # Go standards and style guidelines
This document describes various guidelines and best practices for GitLab 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 # Shell scripting standards and style guidelines
GitLab consists of many various services and sub-projects. The majority of 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 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 # Customizing Auto DevOps
While [Auto DevOps](index.md) provides great defaults to get you started, you can customize 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: ...@@ -22,6 +22,8 @@ Using the GitLab project Kubernetes integration, you can:
- Use [Web terminals](#web-terminals). - Use [Web terminals](#web-terminals).
- Use [Deploy Boards](#deploy-boards). **(PREMIUM)** - Use [Deploy Boards](#deploy-boards). **(PREMIUM)**
- Use [Canary Deployments](#canary-deployments). **(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). - View [Logs](#viewing-pod-logs).
- Run serverless workloads on [Kubernetes with Knative](serverless/index.md). - 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 ...@@ -242,9 +244,18 @@ A Kubernetes cluster can be the destination for a deployment job. If
### Deployment variables ### 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 The Kubernetes cluster integration exposes the following
[deployment variables](../../../ci/variables/README.md#deployment-environment-variables) in the [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 | | Variable | Description |
| -------- | ----------- | | -------- | ----------- |
......
...@@ -302,7 +302,7 @@ module Gitlab ...@@ -302,7 +302,7 @@ module Gitlab
private :archive_file_path private :archive_file_path
def archive_version_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' '@v2'
end end
......
...@@ -270,7 +270,7 @@ module Gitlab ...@@ -270,7 +270,7 @@ module Gitlab
prefix: metadata['ArchivePrefix'], prefix: metadata['ArchivePrefix'],
format: format, format: format,
path: path.presence || "", 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 ).to_proto
) )
} }
......
...@@ -2,7 +2,7 @@ import Vuex from 'vuex'; ...@@ -2,7 +2,7 @@ import Vuex from 'vuex';
import { shallowMount, mount, createLocalVue } from '@vue/test-utils'; import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
import createStore from '~/diffs/store/modules'; import createStore from '~/diffs/store/modules';
import CollapsedFilesWarning from '~/diffs/components/collapsed_files_warning.vue'; 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'; import eventHub from '~/diffs/event_hub';
const propsData = { const propsData = {
...@@ -77,13 +77,13 @@ describe('CollapsedFilesWarning', () => { ...@@ -77,13 +77,13 @@ describe('CollapsedFilesWarning', () => {
expect(wrapper.find('[data-testid="root"]').exists()).toBe(false); 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 }); createComponent({}, { full: true });
jest.spyOn(eventHub, '$emit'); jest.spyOn(eventHub, '$emit');
getAlertActionButton().vm.$emit('click'); 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'; ...@@ -12,6 +12,7 @@ import DiffContentComponent from '~/diffs/components/diff_content.vue';
import eventHub from '~/diffs/event_hub'; import eventHub from '~/diffs/event_hub';
import { diffViewerModes, diffViewerErrors } from '~/ide/constants'; import { diffViewerModes, diffViewerErrors } from '~/ide/constants';
import { EVT_EXPAND_ALL_FILES } from '~/diffs/constants';
function changeViewer(store, index, { automaticallyCollapsed, manuallyCollapsed, name }) { function changeViewer(store, index, { automaticallyCollapsed, manuallyCollapsed, name }) {
const file = store.state.diffs.diffFiles[index]; const file = store.state.diffs.diffFiles[index];
...@@ -140,7 +141,7 @@ describe('DiffFile', () => { ...@@ -140,7 +141,7 @@ describe('DiffFile', () => {
}); });
describe('collapsing', () => { describe('collapsing', () => {
describe('`mr:diffs:expandAllFiles` event', () => { describe(`\`${EVT_EXPAND_ALL_FILES}\` event`, () => {
beforeEach(() => { beforeEach(() => {
jest.spyOn(wrapper.vm, 'handleToggle').mockImplementation(() => {}); jest.spyOn(wrapper.vm, 'handleToggle').mockImplementation(() => {});
}); });
...@@ -150,13 +151,13 @@ describe('DiffFile', () => { ...@@ -150,13 +151,13 @@ describe('DiffFile', () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
eventHub.$emit('mr:diffs:expandAllFiles'); eventHub.$emit(EVT_EXPAND_ALL_FILES);
expect(wrapper.vm.handleToggle).toHaveBeenCalledTimes(1); expect(wrapper.vm.handleToggle).toHaveBeenCalledTimes(1);
}); });
it('does nothing when the file is not collapsed', async () => { 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(); 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