Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/access_tokens/components/new_access_token_app.vue2
-rw-r--r--app/assets/javascripts/diffs/components/diff_code_quality.vue56
-rw-r--r--app/assets/javascripts/diffs/components/diff_row.vue6
-rw-r--r--app/assets/javascripts/diffs/components/diff_view.vue63
-rw-r--r--app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue11
-rw-r--r--app/assets/javascripts/security_configuration/graphql/security_training_vulnerability.query.graphql8
-rw-r--r--app/assets/stylesheets/pages/projects.scss8
-rw-r--r--app/assets/stylesheets/utilities.scss5
-rw-r--r--app/controllers/projects/merge_requests_controller.rb1
-rw-r--r--app/views/projects/protected_branches/shared/_create_protected_branch.html.haml20
-rw-r--r--app/views/projects/protected_branches/shared/_dropdown.html.haml8
-rw-r--r--config/feature_flags/development/refactor_code_quality_inline_findings.yml8
-rw-r--r--doc/user/application_security/configuration/index.md2
-rw-r--r--doc/user/clusters/agent/index.md1
-rw-r--r--doc/user/clusters/agent/vulnerabilities.md40
-rw-r--r--doc/user/clusters/agent/work_with_agent.md16
-rw-r--r--doc/user/project/working_with_projects.md4
-rw-r--r--locale/gitlab.pot5
-rw-r--r--spec/frontend/diffs/components/diff_code_quality_spec.js66
-rw-r--r--spec/frontend/diffs/components/diff_view_spec.js32
-rw-r--r--spec/frontend/diffs/mock_data/diff_code_quality.js62
-rw-r--r--spec/frontend/pages/shared/wikis/components/wiki_form_spec.js21
-rw-r--r--spec/support/shared_examples/features/content_editor_shared_examples.rb2
23 files changed, 106 insertions, 341 deletions
diff --git a/app/assets/javascripts/access_tokens/components/new_access_token_app.vue b/app/assets/javascripts/access_tokens/components/new_access_token_app.vue
index 904052688f3..e111ae91e5c 100644
--- a/app/assets/javascripts/access_tokens/components/new_access_token_app.vue
+++ b/app/assets/javascripts/access_tokens/components/new_access_token_app.vue
@@ -117,7 +117,7 @@ export default {
<template v-if="errors">
<gl-alert :title="alertDangerTitle" variant="danger" @dismiss="errors = null">
- <ul class="m-0">
+ <ul class="gl-m-0">
<li v-for="error in errors" :key="error">
{{ error }}
</li>
diff --git a/app/assets/javascripts/diffs/components/diff_code_quality.vue b/app/assets/javascripts/diffs/components/diff_code_quality.vue
deleted file mode 100644
index f339b108a11..00000000000
--- a/app/assets/javascripts/diffs/components/diff_code_quality.vue
+++ /dev/null
@@ -1,56 +0,0 @@
-<script>
-import { GlButton, GlIcon } from '@gitlab/ui';
-import { SEVERITY_CLASSES, SEVERITY_ICONS } from '~/reports/codequality_report/constants';
-
-export default {
- components: { GlButton, GlIcon },
- props: {
- line: {
- type: Number,
- required: true,
- },
- codeQuality: {
- type: Array,
- required: true,
- },
- },
- methods: {
- severityClass(severity) {
- return SEVERITY_CLASSES[severity] || SEVERITY_CLASSES.unknown;
- },
- severityIcon(severity) {
- return SEVERITY_ICONS[severity] || SEVERITY_ICONS.unknown;
- },
- },
-};
-</script>
-
-<template>
- <div data-testid="diff-codequality" class="gl-relative">
- <ul
- class="gl-list-style-none gl-mb-0 gl-p-0 codequality-findings-list gl-border-top-1 gl-border-bottom-1 gl-bg-gray-10"
- >
- <li
- v-for="finding in codeQuality"
- :key="finding.description"
- class="gl-pt-1 gl-pb-1 gl-pl-3 gl-border-solid gl-border-bottom-0 gl-border-right-0 gl-border-1 gl-border-gray-100"
- >
- <gl-icon
- :size="12"
- :name="severityIcon(finding.severity)"
- :class="severityClass(finding.severity)"
- class="codequality-severity-icon"
- />
- {{ finding.description }}
- </li>
- </ul>
- <gl-button
- data-testid="diff-codequality-close"
- category="tertiary"
- size="small"
- icon="close"
- class="gl-absolute gl-right-2 gl-top-2"
- @click="$emit('hideCodeQualityFindings', line)"
- />
- </div>
-</template>
diff --git a/app/assets/javascripts/diffs/components/diff_row.vue b/app/assets/javascripts/diffs/components/diff_row.vue
index 63c5aedd7ce..1b07b00d725 100644
--- a/app/assets/javascripts/diffs/components/diff_row.vue
+++ b/app/assets/javascripts/diffs/components/diff_row.vue
@@ -274,9 +274,6 @@ export default {
v-if="$options.showCodequalityLeft(props)"
:codequality="props.line.left.codequality"
:file-path="props.filePath"
- @showCodeQualityFindings="
- listeners.toggleCodeQualityFindings(props.line.left.codequality[0].line)
- "
/>
</div>
<div
@@ -398,9 +395,6 @@ export default {
:codequality="props.line.right.codequality"
:file-path="props.filePath"
data-testid="codeQualityIcon"
- @showCodeQualityFindings="
- listeners.toggleCodeQualityFindings(props.line.right.codequality[0].line)
- "
/>
</div>
<div
diff --git a/app/assets/javascripts/diffs/components/diff_view.vue b/app/assets/javascripts/diffs/components/diff_view.vue
index bbb41cef854..d740d5adcb6 100644
--- a/app/assets/javascripts/diffs/components/diff_view.vue
+++ b/app/assets/javascripts/diffs/components/diff_view.vue
@@ -2,14 +2,12 @@
import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import { mapGetters, mapState, mapActions } from 'vuex';
import { IdState } from 'vendor/vue-virtual-scroller';
-import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import DraftNote from '~/batch_comments/components/draft_note.vue';
import draftCommentsMixin from '~/diffs/mixins/draft_comments';
import { getCommentedLines } from '~/notes/components/multiline_comment_utils';
import { hide } from '~/tooltips';
import { pickDirection } from '../utils/diff_line';
import DiffCommentCell from './diff_comment_cell.vue';
-import DiffCodeQuality from './diff_code_quality.vue';
import DiffExpansionCell from './diff_expansion_cell.vue';
import DiffRow from './diff_row.vue';
import { isHighlighted } from './diff_row_utils';
@@ -19,17 +17,12 @@ export default {
DiffExpansionCell,
DiffRow,
DiffCommentCell,
- DiffCodeQuality,
DraftNote,
},
directives: {
SafeHtml,
},
- mixins: [
- draftCommentsMixin,
- IdState({ idProp: (vm) => vm.diffFile.file_hash }),
- glFeatureFlagsMixin(),
- ],
+ mixins: [draftCommentsMixin, IdState({ idProp: (vm) => vm.diffFile.file_hash })],
props: {
diffFile: {
type: Object,
@@ -50,11 +43,6 @@ export default {
default: false,
},
},
- data() {
- return {
- codeQualityExpandedLines: [],
- };
- },
idState() {
return {
dragStart: null,
@@ -96,23 +84,6 @@ export default {
}
this.idState.dragStart = line;
},
- parseCodeQuality(line) {
- return line.left?.codequality ?? line.right.codequality;
- },
-
- hideCodeQualityFindings(line) {
- const index = this.codeQualityExpandedLines.indexOf(line);
- if (index > -1) {
- this.codeQualityExpandedLines.splice(index, 1);
- }
- },
- toggleCodeQualityFindings(line) {
- if (!this.codeQualityExpandedLines.includes(line)) {
- this.codeQualityExpandedLines.push(line);
- } else {
- this.hideCodeQualityFindings(line);
- }
- },
onDragOver(line) {
if (line.chunk !== this.idState.dragStart.chunk) return;
@@ -154,16 +125,15 @@ export default {
},
handleParallelLineMouseDown(e) {
const line = e.target.closest('.diff-td');
- if (line) {
- const table = line.closest('.diff-table');
- table.classList.remove('left-side-selected', 'right-side-selected');
- const [lineClass] = ['left-side', 'right-side'].filter((name) =>
- line.classList.contains(name),
- );
+ const table = line.closest('.diff-table');
+
+ table.classList.remove('left-side-selected', 'right-side-selected');
+ const [lineClass] = ['left-side', 'right-side'].filter((name) =>
+ line.classList.contains(name),
+ );
- if (lineClass) {
- table.classList.add(`${lineClass}-selected`);
- }
+ if (lineClass) {
+ table.classList.add(`${lineClass}-selected`);
}
},
getCountBetweenIndex(index) {
@@ -178,9 +148,6 @@ export default {
Number(this.diffLines[index - 1].left.new_line)
);
},
- getCodeQualityLine(line) {
- return this.parseCodeQuality(line)?.[0]?.line;
- },
},
userColorScheme: window.gon.user_color_scheme,
};
@@ -223,7 +190,6 @@ export default {
:coverage-loaded="coverageLoaded"
@showCommentForm="(code) => singleLineComment(code, line)"
@setHighlightedRow="setHighlightedRow"
- @toggleCodeQualityFindings="toggleCodeQualityFindings"
@toggleLineDiscussions="
({ lineCode, expanded }) =>
toggleLineDiscussions({ lineCode, fileHash: diffFile.file_hash, expanded })
@@ -232,17 +198,6 @@ export default {
@startdragging="onStartDragging"
@stopdragging="onStopDragging"
/>
-
- <diff-code-quality
- v-if="
- glFeatures.refactorCodeQualityInlineFindings &&
- codeQualityExpandedLines.includes(getCodeQualityLine(line))
- "
- :key="line.line_code"
- :line="getCodeQualityLine(line)"
- :code-quality="parseCodeQuality(line)"
- @hideCodeQualityFindings="hideCodeQualityFindings"
- />
<div
v-if="line.renderCommentRow"
:key="`dcr-${line.line_code || index}`"
diff --git a/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue b/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue
index 024b3bc9595..33e5c61f4fc 100644
--- a/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue
+++ b/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue
@@ -1,5 +1,6 @@
<script>
import { GlForm, GlIcon, GlLink, GlButton, GlSprintf, GlAlert } from '@gitlab/ui';
+import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue';
import axios from '~/lib/utils/axios_utils';
import csrf from '~/lib/utils/csrf';
import { setUrlFragment } from '~/lib/utils/url_utility';
@@ -81,6 +82,7 @@ export default {
GlLink,
GlButton,
MarkdownField,
+ LocalStorageSync,
ContentEditor: () =>
import(
/* webpackChunkName: 'content_editor' */ '~/content_editor/components/content_editor.vue'
@@ -186,6 +188,10 @@ export default {
this.useContentEditor = !this.useContentEditor;
},
+ setUseContentEditor(value) {
+ this.useContentEditor = value;
+ },
+
async handleFormSubmit(e) {
e.preventDefault();
@@ -370,6 +376,11 @@ export default {
>{{ toggleEditingModeButtonText }}</gl-button
>
</div>
+ <local-storage-sync
+ storage-key="gl-wiki-content-editor-enabled"
+ :value="useContentEditor"
+ @input="setUseContentEditor"
+ />
<markdown-field
v-if="!isContentEditorActive"
:markdown-preview-path="pageInfo.markdownPreviewPath"
diff --git a/app/assets/javascripts/security_configuration/graphql/security_training_vulnerability.query.graphql b/app/assets/javascripts/security_configuration/graphql/security_training_vulnerability.query.graphql
index 891e0dda312..9fdacb4ee10 100644
--- a/app/assets/javascripts/security_configuration/graphql/security_training_vulnerability.query.graphql
+++ b/app/assets/javascripts/security_configuration/graphql/security_training_vulnerability.query.graphql
@@ -1,7 +1,11 @@
-query getSecurityTrainingUrls($projectFullPath: ID!, $identifierExternalIds: [String!]!) {
+query getSecurityTrainingUrls(
+ $projectFullPath: ID!
+ $identifierExternalIds: [String!]!
+ $filename: String
+) {
project(fullPath: $projectFullPath) {
id
- securityTrainingUrls(identifierExternalIds: $identifierExternalIds) {
+ securityTrainingUrls(identifierExternalIds: $identifierExternalIds, filename: $filename) {
name
status
url
diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss
index 3b76130dd1a..0d45beab983 100644
--- a/app/assets/stylesheets/pages/projects.scss
+++ b/app/assets/stylesheets/pages/projects.scss
@@ -548,14 +548,6 @@ pre.light-well {
}
}
-.new-protected-branch,
-.new-protected-tag {
- label {
- margin-top: 6px;
- font-weight: $gl-font-weight-normal;
- }
-}
-
.protected-branches-list,
.protected-tags-list {
margin-bottom: 30px;
diff --git a/app/assets/stylesheets/utilities.scss b/app/assets/stylesheets/utilities.scss
index 27fcade548f..9bd63919d92 100644
--- a/app/assets/stylesheets/utilities.scss
+++ b/app/assets/stylesheets/utilities.scss
@@ -253,6 +253,11 @@ $gl-line-height-42: px-to-rem(42px);
max-width: 50%;
}
+// Will be moved to @gitlab/ui in https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2894
+.gl-form-lg {
+ max-width: 320px;
+}
+
/**
Note: ::-webkit-scrollbar is a non-standard rule only
supported by webkit browsers.
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 6b564412dbd..b25ff5cffe4 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -43,7 +43,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag(:issue_assignees_widget, @project)
push_frontend_feature_flag(:realtime_labels, project)
push_frontend_feature_flag(:refactor_security_extension, @project)
- push_frontend_feature_flag(:refactor_code_quality_inline_findings, project)
push_frontend_feature_flag(:mr_attention_requests, current_user)
push_frontend_feature_flag(:moved_mr_sidebar, project)
push_frontend_feature_flag(:paginated_mr_discussions, project)
diff --git a/app/views/projects/protected_branches/shared/_create_protected_branch.html.haml b/app/views/projects/protected_branches/shared/_create_protected_branch.html.haml
index e5810930be2..13603c8f946 100644
--- a/app/views/projects/protected_branches/shared/_create_protected_branch.html.haml
+++ b/app/views/projects/protected_branches/shared/_create_protected_branch.html.haml
@@ -1,29 +1,29 @@
= form_for [@project, @protected_branch], html: { class: 'new-protected-branch js-new-protected-branch' } do |f|
%input{ type: 'hidden', name: 'update_section', value: 'js-protected-branches-settings' }
.card
- .card-header
+ .card-header.gl-font-weight-bold
= s_("ProtectedBranch|Protect a branch")
.card-body
= form_errors(@protected_branch)
.form-group.row
- = f.label :name, s_('ProtectedBranch|Branch:'), class: 'col-md-2 text-left text-md-right'
- .col-md-10
- = render partial: "projects/protected_branches/shared/dropdown", locals: { f: f }
+ = f.label :name, s_('ProtectedBranch|Branch:'), class: 'col-sm-12'
+ .col-sm-12
+ = render partial: "projects/protected_branches/shared/dropdown", locals: { f: f, toggle_classes: 'gl-w-full! gl-form-lg' }
.form-text.text-muted
- wildcards_url = help_page_url('user/project/protected_branches', anchor: 'configure-multiple-protected-branches-by-using-a-wildcard')
- wildcards_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: wildcards_url }
= (s_("ProtectedBranch|%{wildcards_link_start}Wildcards%{wildcards_link_end} such as %{code_tag_start}*-stable%{code_tag_end} or %{code_tag_start}production/*%{code_tag_end} are supported.") % { wildcards_link_start: wildcards_link_start, wildcards_link_end: '</a>', code_tag_start: '<code>', code_tag_end: '</code>' }).html_safe
.form-group.row
- = f.label :merge_access_levels_attributes, s_("ProtectedBranch|Allowed to merge:"), class: 'col-md-2 text-left text-md-right'
- .col-md-10
+ = f.label :merge_access_levels_attributes, s_("ProtectedBranch|Allowed to merge:"), class: 'col-sm-12'
+ .col-sm-12
= yield :merge_access_levels
.form-group.row
- = f.label :push_access_levels_attributes, s_("ProtectedBranch|Allowed to push:"), class: 'col-md-2 text-left text-md-right'
- .col-md-10
+ = f.label :push_access_levels_attributes, s_("ProtectedBranch|Allowed to push:"), class: 'col-sm-12'
+ .col-sm-12
= yield :push_access_levels
.form-group.row
- = f.label :allow_force_push, s_("ProtectedBranch|Allowed to force push:"), class: 'col-md-2 gl-text-left text-md-right'
- .col-md-10
+ = f.label :allow_force_push, s_("ProtectedBranch|Allowed to force push:"), class: 'col-sm-12'
+ .col-sm-12
= render Pajamas::ToggleComponent.new(classes: 'js-force-push-toggle',
label: s_("ProtectedBranch|Allowed to force push"),
label_position: :hidden) do
diff --git a/app/views/projects/protected_branches/shared/_dropdown.html.haml b/app/views/projects/protected_branches/shared/_dropdown.html.haml
index 67a6e8efae8..4b09d36e7c3 100644
--- a/app/views/projects/protected_branches/shared/_dropdown.html.haml
+++ b/app/views/projects/protected_branches/shared/_dropdown.html.haml
@@ -1,8 +1,12 @@
+- toggle_classes = local_assigns.fetch(:toggle_classes, '')
+
= f.hidden_field(:name)
= dropdown_tag('Select branch or create wildcard',
- options: { toggle_class: 'js-protected-branch-select js-filter-submit wide monospace qa-protected-branch-select',
- filter: true, dropdown_class: "dropdown-menu-selectable git-revision-dropdown qa-protected-branch-dropdown", placeholder: "Search protected branches",
+ options: { toggle_class: "js-protected-branch-select js-filter-submit wide monospace qa-protected-branch-select #{toggle_classes}",
+ filter: true,
+ dropdown_class: "dropdown-menu-selectable git-revision-dropdown qa-protected-branch-dropdown",
+ placeholder: "Search protected branches",
footer_content: true,
data: { show_no: true, show_any: true, show_upcoming: true,
selected: params[:protected_branch_name],
diff --git a/config/feature_flags/development/refactor_code_quality_inline_findings.yml b/config/feature_flags/development/refactor_code_quality_inline_findings.yml
deleted file mode 100644
index 3f2e35c202d..00000000000
--- a/config/feature_flags/development/refactor_code_quality_inline_findings.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: refactor_code_quality_inline_findings
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88576
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/364198
-milestone: '15.1'
-type: development
-group: group::static analysis
-default_enabled: false
diff --git a/doc/user/application_security/configuration/index.md b/doc/user/application_security/configuration/index.md
index 09292dcb92b..9ca1a6f125f 100644
--- a/doc/user/application_security/configuration/index.md
+++ b/doc/user/application_security/configuration/index.md
@@ -53,7 +53,7 @@ You can configure the following security controls:
enable Container Scanning. For more details, see
[Enable Container Scanning through an automatic merge request](../container_scanning/index.md#enable-container-scanning-through-an-automatic-merge-request).
- [Operational Container Scanning](../../clusters/agent/vulnerabilities.md)
- - Can be configured by adding a configuration block to your agent configuration. For more details, read [Operational Container Scanning](../../clusters/agent/vulnerabilities.md#enable-cluster-vulnerability-scanning).
+ - Can be configured by adding a configuration block to your agent configuration. For more details, read [Operational Container Scanning](../../clusters/agent/vulnerabilities.md#enable-operational-container-scanning).
- [Secret Detection](../secret_detection/index.md)
- Select **Configure with a merge request** to create a merge request with the changes required to
enable Secret Detection. For more details, read [Enable Secret Detection via an automatic merge request](../secret_detection/index.md#enable-secret-detection-via-an-automatic-merge-request).
diff --git a/doc/user/clusters/agent/index.md b/doc/user/clusters/agent/index.md
index 5a69da28632..e714829fa16 100644
--- a/doc/user/clusters/agent/index.md
+++ b/doc/user/clusters/agent/index.md
@@ -43,6 +43,7 @@ This workflow is considered push-based, because GitLab is pushing requests from
GitLab supports the following Kubernetes versions. You can upgrade your
Kubernetes version to a supported version at any time:
+- 1.23 (support ends on October 22, 2023)
- 1.22 (support ends on March 22, 2023)
- 1.21 (support ends on November 22, 2022)
- 1.20 (support ends on July 22, 2022)
diff --git a/doc/user/clusters/agent/vulnerabilities.md b/doc/user/clusters/agent/vulnerabilities.md
index 706ed122f7b..3b80a7a0f81 100644
--- a/doc/user/clusters/agent/vulnerabilities.md
+++ b/doc/user/clusters/agent/vulnerabilities.md
@@ -11,26 +11,9 @@ info: To determine the technical writer assigned to the Stage/Group associated w
To view cluster vulnerabilities, you can view the [vulnerability report](../../application_security/vulnerabilities/index.md).
You can also configure your agent so the vulnerabilities are displayed with other agent information in GitLab.
-## View cluster vulnerabilities
-
-Prerequisite:
-
-- You must have at least the Developer role.
-
-To view vulnerability information in GitLab:
-
-1. On the top bar, select **Menu > Projects** and find the project that contains the agent configuration file.
-1. On the left sidebar, select **Infrastructure > Kubernetes clusters**.
-1. Select the **Agent** tab.
-1. Select the agent you want to see the vulnerabilities for.
-
-![Cluster agent security tab UI](../img/cluster_agent_security_tab_v14_8.png)
-
-This information can also be found under [operational vulnerabilities](../../../user/application_security/vulnerability_report/index.md#operational-vulnerabilities).
-
-## Enable cluster vulnerability scanning **(ULTIMATE)**
+## Enable operational container scanning **(ULTIMATE)**
-You can use [cluster image scanning](../../application_security/cluster_image_scanning/index.md)
+You can use operational container scanning
to scan container images in your cluster for security vulnerabilities.
To begin scanning all resources in your cluster, add a `starboard`
@@ -49,7 +32,7 @@ The `cadence` field is required. GitLab supports the following types of CRON syn
It is possible that other elements of the CRON syntax will work in the cadence field, however, GitLab does not officially test or support them.
-By default, cluster image scanning will attempt to scan the workloads in all
+By default, operational container scanning will attempt to scan the workloads in all
namespaces for vulnerabilities. The `vulnerability_report` block has a `namespaces`
field which can be used to restrict which namespaces are scanned. For example,
if you would like to scan only the `development`, `staging`, and `production`
@@ -64,3 +47,20 @@ starboard:
- staging
- production
```
+
+## View cluster vulnerabilities
+
+Prerequisite:
+
+- You must have at least the Developer role.
+
+To view vulnerability information in GitLab:
+
+1. On the top bar, select **Menu > Projects** and find the project that contains the agent configuration file.
+1. On the left sidebar, select **Infrastructure > Kubernetes clusters**.
+1. Select the **Agent** tab.
+1. Select an agent to view the cluster vulnerabilities.
+
+![Cluster agent security tab UI](../img/cluster_agent_security_tab_v14_8.png)
+
+This information can also be found under [operational vulnerabilities](../../../user/application_security/vulnerability_report/index.md#operational-vulnerabilities).
diff --git a/doc/user/clusters/agent/work_with_agent.md b/doc/user/clusters/agent/work_with_agent.md
index 75c0126b772..058243ec218 100644
--- a/doc/user/clusters/agent/work_with_agent.md
+++ b/doc/user/clusters/agent/work_with_agent.md
@@ -53,24 +53,32 @@ View and provide feedback about the UI in [this epic](https://gitlab.com/groups/
## Debug the agent
+> The `grpc_level` was [introduced](https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/merge_requests/669) in GitLab 15.1.
+
To debug the cluster-side component (`agentk`) of the agent, set the log
level according to the available options:
-- `off`
-- `warning`
- `error`
+- `warning`
- `info`
- `debug`
-The log level defaults to `info`. You can change it by using a top-level `observability`
-section in the [agent configuration file](install/index.md#configure-your-agent), for example setting the level to `debug`:
+The agent has two loggers:
+
+- A general purpose logger, which defaults to `info`.
+- A gRPC logger, which defaults to `error`.
+
+One can change their log levels by using a top-level `observability` section in the [agent configuration file](install/index.md#configure-your-agent), for example setting the levels to `debug` and `warning`:
```yaml
observability:
logging:
level: debug
+ grpc_level: warning
```
+When `grpc_level` is set to `info` or below, there will be a lot of gRPC logs.
+
Commit the configuration changes and inspect the agent service logs:
```shell
diff --git a/doc/user/project/working_with_projects.md b/doc/user/project/working_with_projects.md
index 83cab819f54..13d613a0cf3 100644
--- a/doc/user/project/working_with_projects.md
+++ b/doc/user/project/working_with_projects.md
@@ -391,7 +391,7 @@ To use a project as a Go package, use the `go get` and `godoc.org` discovery req
Prerequisites:
- Your GitLab instance must be accessible with HTTPS.
-- You must have a [personal access token](../profile/personal_access_tokens.md).
+- You must have a [personal access token](../profile/personal_access_tokens.md) with `read_api` scope.
To authenticate Go requests, create a [`.netrc`](https://everything.curl.dev/usingcurl/netrc) file with the following information:
@@ -423,7 +423,7 @@ Configure Git to either:
- Use SSH instead of HTTPS:
```shell
- git config --global url."git@gitlab.example.com".insteadOf "https://gitlab.example.com"
+ git config --global url."git@gitlab.example.com:".insteadOf "https://gitlab.example.com/"
```
### Disable Go module fetching for private projects
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 7933a206091..4a42d766c9e 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -1337,11 +1337,6 @@ msgstr ""
msgid "0 bytes"
msgstr ""
-msgid "1 Code quality finding"
-msgid_plural "%d Code quality findings"
-msgstr[0] ""
-msgstr[1] ""
-
msgid "1 Day"
msgid_plural "%d Days"
msgstr[0] ""
diff --git a/spec/frontend/diffs/components/diff_code_quality_spec.js b/spec/frontend/diffs/components/diff_code_quality_spec.js
deleted file mode 100644
index 81a817c47dc..00000000000
--- a/spec/frontend/diffs/components/diff_code_quality_spec.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import { GlIcon } from '@gitlab/ui';
-import { mountExtended, shallowMountExtended } from 'helpers/vue_test_utils_helper';
-import DiffCodeQuality from '~/diffs/components/diff_code_quality.vue';
-import { SEVERITY_CLASSES, SEVERITY_ICONS } from '~/reports/codequality_report/constants';
-import { multipleFindingsArr } from '../mock_data/diff_code_quality';
-
-let wrapper;
-
-const findIcon = () => wrapper.findComponent(GlIcon);
-
-describe('DiffCodeQuality', () => {
- afterEach(() => {
- wrapper.destroy();
- });
-
- const createWrapper = (codeQuality, mountFunction = mountExtended) => {
- return mountFunction(DiffCodeQuality, {
- propsData: {
- expandedLines: [],
- line: 1,
- codeQuality,
- },
- });
- };
-
- it('hides details and throws hideCodeQualityFindings event on close click', async () => {
- wrapper = createWrapper(multipleFindingsArr);
- expect(wrapper.findByTestId('diff-codequality').exists()).toBe(true);
-
- await wrapper.findByTestId('diff-codequality-close').trigger('click');
-
- expect(wrapper.emitted('hideCodeQualityFindings').length).toBe(1);
- expect(wrapper.emitted().hideCodeQualityFindings[0][0]).toBe(wrapper.props('line'));
- });
-
- it('renders correct amount of list items for codequality array and their description', async () => {
- wrapper = createWrapper(multipleFindingsArr);
- const listItems = wrapper.findAll('li');
-
- expect(wrapper.findAll('li').length).toBe(3);
-
- listItems.wrappers.map((e, i) => {
- return expect(e.text()).toEqual(multipleFindingsArr[i].description);
- });
- });
-
- it.each`
- severity
- ${'info'}
- ${'minor'}
- ${'major'}
- ${'critical'}
- ${'blocker'}
- ${'unknown'}
- `('shows icon for $severity degradation', ({ severity }) => {
- wrapper = createWrapper([{ severity }], shallowMountExtended);
-
- expect(findIcon().exists()).toBe(true);
-
- expect(findIcon().attributes()).toMatchObject({
- class: `codequality-severity-icon ${SEVERITY_CLASSES[severity]}`,
- name: SEVERITY_ICONS[severity],
- size: '12',
- });
- });
-});
diff --git a/spec/frontend/diffs/components/diff_view_spec.js b/spec/frontend/diffs/components/diff_view_spec.js
index 15923a1c6de..dfbe30e460b 100644
--- a/spec/frontend/diffs/components/diff_view_spec.js
+++ b/spec/frontend/diffs/components/diff_view_spec.js
@@ -1,9 +1,7 @@
import { shallowMount } from '@vue/test-utils';
-import Vue, { nextTick } from 'vue';
+import Vue from 'vue';
import Vuex from 'vuex';
import DiffView from '~/diffs/components/diff_view.vue';
-import DiffCodeQuality from '~/diffs/components/diff_code_quality.vue';
-import { diffCodeQuality } from '../mock_data/diff_code_quality';
describe('DiffView', () => {
const DiffExpansionCell = { template: `<div/>` };
@@ -14,7 +12,7 @@ describe('DiffView', () => {
const setSelectedCommentPosition = jest.fn();
const getDiffRow = (wrapper) => wrapper.findComponent(DiffRow).vm;
- const createWrapper = (props, provide = {}) => {
+ const createWrapper = (props) => {
Vue.use(Vuex);
const batchComments = {
@@ -48,33 +46,9 @@ describe('DiffView', () => {
...props,
};
const stubs = { DiffExpansionCell, DiffRow, DiffCommentCell, DraftNote };
- return shallowMount(DiffView, { propsData, store, stubs, provide });
+ return shallowMount(DiffView, { propsData, store, stubs });
};
- it('does not render a codeQuality diff view when there is no finding', () => {
- const wrapper = createWrapper();
- expect(wrapper.findComponent(DiffCodeQuality).exists()).toBe(false);
- });
-
- it('does render a codeQuality diff view with the correct props when there is a finding & refactorCodeQualityInlineFindings flag is true ', async () => {
- const wrapper = createWrapper(diffCodeQuality, {
- glFeatures: { refactorCodeQualityInlineFindings: true },
- });
- wrapper.findComponent(DiffRow).vm.$emit('toggleCodeQualityFindings', 2);
- await nextTick();
- expect(wrapper.findComponent(DiffCodeQuality).exists()).toBe(true);
- expect(wrapper.findComponent(DiffCodeQuality).props().codeQuality.length).not.toBe(0);
- });
-
- it('does not render a codeQuality diff view when there is a finding & refactorCodeQualityInlineFindings flag is false ', async () => {
- const wrapper = createWrapper(diffCodeQuality, {
- glFeatures: { refactorCodeQualityInlineFindings: false },
- });
- wrapper.findComponent(DiffRow).vm.$emit('toggleCodeQualityFindings', 2);
- await nextTick();
- expect(wrapper.findComponent(DiffCodeQuality).exists()).toBe(false);
- });
-
it.each`
type | side | container | sides | total
${'parallel'} | ${'left'} | ${'.old'} | ${{ left: { lineDraft: {}, renderDiscussion: true }, right: { lineDraft: {}, renderDiscussion: true } }} | ${2}
diff --git a/spec/frontend/diffs/mock_data/diff_code_quality.js b/spec/frontend/diffs/mock_data/diff_code_quality.js
deleted file mode 100644
index 2ca421a20b4..00000000000
--- a/spec/frontend/diffs/mock_data/diff_code_quality.js
+++ /dev/null
@@ -1,62 +0,0 @@
-export const multipleFindingsArr = [
- {
- severity: 'minor',
- description: 'Unexpected Debugger Statement.',
- line: 2,
- },
- {
- severity: 'major',
- description:
- 'Function `aVeryLongFunction` has 52 lines of code (exceeds 25 allowed). Consider refactoring.',
- line: 3,
- },
- {
- severity: 'minor',
- description: 'Arrow function has too many statements (52). Maximum allowed is 30.',
- line: 3,
- },
-];
-
-export const multipleFindings = {
- filePath: 'index.js',
- codequality: multipleFindingsArr,
-};
-
-export const singularFinding = {
- filePath: 'index.js',
- codequality: [multipleFindingsArr[0]],
-};
-
-export const diffCodeQuality = {
- diffFile: { file_hash: '123' },
- diffLines: [
- {
- left: {
- type: 'old',
- old_line: 1,
- new_line: null,
- codequality: [],
- lineDraft: {},
- },
- },
- {
- left: {
- type: null,
- old_line: 2,
- new_line: 1,
- codequality: [],
- lineDraft: {},
- },
- },
- {
- left: {
- type: 'new',
- old_line: null,
- new_line: 2,
-
- codequality: [multipleFindingsArr[0]],
- lineDraft: {},
- },
- },
- ],
-};
diff --git a/spec/frontend/pages/shared/wikis/components/wiki_form_spec.js b/spec/frontend/pages/shared/wikis/components/wiki_form_spec.js
index d7f8dc3c98e..fc490bfb774 100644
--- a/spec/frontend/pages/shared/wikis/components/wiki_form_spec.js
+++ b/spec/frontend/pages/shared/wikis/components/wiki_form_spec.js
@@ -4,9 +4,11 @@ import { mount, shallowMount } from '@vue/test-utils';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import { mockTracking } from 'helpers/tracking_helper';
+import { stubComponent } from 'helpers/stub_component';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
import ContentEditor from '~/content_editor/components/content_editor.vue';
+import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue';
import WikiForm from '~/pages/shared/wikis/components/wiki_form.vue';
import {
CONTENT_EDITOR_LOADED_ACTION,
@@ -37,6 +39,7 @@ describe('WikiForm', () => {
const findMarkdownHelpLink = () => wrapper.findByTestId('wiki-markdown-help-link');
const findContentEditor = () => wrapper.findComponent(ContentEditor);
const findClassicEditor = () => wrapper.findComponent(MarkdownField);
+ const findLocalStorageSync = () => wrapper.find(LocalStorageSync);
const setFormat = (value) => {
const format = findFormat();
@@ -103,6 +106,7 @@ describe('WikiForm', () => {
MarkdownField,
GlAlert,
GlButton,
+ LocalStorageSync: stubComponent(LocalStorageSync),
},
}),
);
@@ -330,6 +334,19 @@ describe('WikiForm', () => {
});
});
+ describe('markdown editor type persistance', () => {
+ it('loads content editor by default if it is persisted in local storage', async () => {
+ expect(findClassicEditor().exists()).toBe(true);
+ expect(findContentEditor().exists()).toBe(false);
+
+ // enable content editor
+ await findLocalStorageSync().vm.$emit('input', true);
+
+ expect(findContentEditor().exists()).toBe(true);
+ expect(findClassicEditor().exists()).toBe(false);
+ });
+ });
+
describe('when content editor is active', () => {
let mockContentEditor;
@@ -374,7 +391,7 @@ describe('WikiForm', () => {
});
describe('wiki content editor', () => {
- describe('clicking "use new editor": editor fails to load', () => {
+ describe('clicking "Edit rich text": editor fails to load', () => {
beforeEach(async () => {
createWrapper({ mountFn: mount });
mock.onPost(/preview-markdown/).reply(400);
@@ -401,7 +418,7 @@ describe('WikiForm', () => {
});
});
- describe('clicking "use new editor": editor loads successfully', () => {
+ describe('clicking "Edit rich text": editor loads successfully', () => {
beforeEach(async () => {
createWrapper({ persisted: true, mountFn: mount });
diff --git a/spec/support/shared_examples/features/content_editor_shared_examples.rb b/spec/support/shared_examples/features/content_editor_shared_examples.rb
index 591f7973454..0ea82f37db0 100644
--- a/spec/support/shared_examples/features/content_editor_shared_examples.rb
+++ b/spec/support/shared_examples/features/content_editor_shared_examples.rb
@@ -31,8 +31,6 @@ RSpec.shared_examples 'edits content using the content editor' do
page.go_back
refresh
-
- click_button 'Edit rich text'
end
it 'applies theme classes to code blocks' do