Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-03-02 18:12:20 +00:00
parent b2c21b99c7
commit 3c4d101de0
165 changed files with 2516 additions and 1315 deletions

View File

@ -146,7 +146,7 @@ variables:
GET_SOURCES_ATTEMPTS: "3"
DEBIAN_VERSION: "bullseye"
CHROME_VERSION: "109"
DOCKER_VERSION: "20.10.14"
DOCKER_VERSION: "23.0.1"
RUBY_VERSION: "2.7"
GO_VERSION: "1.18"
RUST_VERSION: "1.65"

View File

@ -353,7 +353,7 @@
.use-buildx:
extends: .use-docker-in-docker
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-slim:docker-${DOCKER_VERSION}-buildx-0.8
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-slim:docker-${DOCKER_VERSION}
variables:
QEMU_IMAGE: tonistiigi/binfmt:qemu-v7.0.0
before_script:

View File

@ -95,7 +95,7 @@ review-build-cng:
variables:
HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}"
DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}"
GITLAB_HELM_CHART_REF: "afcef7854ac72c5ff958035ef210ba6c68ec800b" # 6.8.0: https://gitlab.com/gitlab-org/charts/gitlab/-/commit/afcef7854ac72c5ff958035ef210ba6c68ec800b
GITLAB_HELM_CHART_REF: "febc4ad69acb7bba0eeb4a62daa577d0b7c3ee71" # 6.9.1: https://gitlab.com/gitlab-org/charts/gitlab/-/commit/febc4ad69acb7bba0eeb4a62daa577d0b7c3ee71
environment:
name: review/${CI_COMMIT_REF_SLUG}${SCHEDULE_TYPE} # No separator for SCHEDULE_TYPE so it's compatible as before and looks nice without it
url: https://gitlab-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}

View File

@ -1359,6 +1359,8 @@
- !reference [".rails:rules:ee-and-foss-default-rules", rules]
- <<: *if-default-refs
changes: *backend-patterns
- <<: *if-default-refs
changes: *backstage-patterns
.rails:rules:ee-and-foss-unit:predictive:
rules:
@ -1368,6 +1370,8 @@
- !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
- <<: *if-merge-request
changes: *backend-patterns
- <<: *if-merge-request
changes: *backstage-patterns
.rails:rules:ee-and-foss-integration:
rules:

View File

@ -2,6 +2,23 @@
documentation](doc/development/changelog.md) for instructions on adding your own
entry.
## 15.9.2 (2023-03-02)
### Security (12 changes)
- [Using builds metadata to determine debug_mode](gitlab-org/security/gitlab@e19fcea675071d005eb72c7e100ff0b357f43508) ([merge request](gitlab-org/security/gitlab!3022))
- [Fix pagination limits for Commits API](gitlab-org/security/gitlab@f71e2650b44e306c8291a8fa5f8557ff4ae4f5d7) ([merge request](gitlab-org/security/gitlab!3071))
- [Mask Google IAP account details in Prometheus integration](gitlab-org/security/gitlab@8cad41d16614f7eb6a0f1693046ae1981ff413d5) ([merge request](gitlab-org/security/gitlab!3081))
- [Stop Group Transfer Service if SAML Provider or SCIM token is present](gitlab-org/security/gitlab@e7ebbc1d37372c147392a3854186f4bb7fd15db5) ([merge request](gitlab-org/security/gitlab!3095))
- [Protect Datadog API key by changing Datadog site](gitlab-org/security/gitlab@abe3343d6cd0397a6b1b491878a9e8dfc5774a2f) ([merge request](gitlab-org/security/gitlab!3093))
- [Protect integrations' sensitive information exposed via API](gitlab-org/security/gitlab@0036ee57dd9f37858ca09746be20fa254347a7ef) ([merge request](gitlab-org/security/gitlab!3087))
- [Disallow maintainer to create an owner access token](gitlab-org/security/gitlab@820d02055d2a958462da3be5587d460a905d157f) ([merge request](gitlab-org/security/gitlab!3090))
- [Paste only text content in work items title](gitlab-org/security/gitlab@5ef125158ceaf0220260423d67cf6a0e1c973e63) ([merge request](gitlab-org/security/gitlab!3074))
- [Jira DVCS OAuth Open Redirect Vulnerability](gitlab-org/security/gitlab@d6295e117531bc9cde690ba49a456be6883fcd21) ([merge request](gitlab-org/security/gitlab!3077))
- [Block private personal snippet from unauthorized users](gitlab-org/security/gitlab@1471002b48fba676367397bdffa63a1b50c375bd) ([merge request](gitlab-org/security/gitlab!3079))
- [Verify Kroki diagram type](gitlab-org/security/gitlab@c76ccc6be3115ded496bbd1bde7da6e4a7dd19ba) ([merge request](gitlab-org/security/gitlab!3056))
- [Check read_release permission before showing releases in Tags API](gitlab-org/security/gitlab@e176a4eb4d266cf774a06ff021c3789a2cb830d9) ([merge request](gitlab-org/security/gitlab!3060))
## 15.9.1 (2023-02-23)
### Fixed (2 changes)
@ -732,6 +749,23 @@ entry.
- [Remove Gitlab::Redis::DuplicateJobs](gitlab-org/gitlab@73d863b0a49175cce7649c0936b2e16157f61665) ([merge request](gitlab-org/gitlab!109122))
- [Clean-up feature flag `hash_based_cache_for_protected_branches`](gitlab-org/gitlab@96e8a07564bac07a100556e00ce4af3f21dca293) ([merge request](gitlab-org/gitlab!108724))
## 15.8.4 (2023-03-02)
### Security (12 changes)
- [Using builds metadata to determine debug_mode](gitlab-org/security/gitlab@169fdb3222a9701b5818ef7c00f8f292dc60495d) ([merge request](gitlab-org/security/gitlab!3035))
- [Fix pagination limits for Commits API](gitlab-org/security/gitlab@3d58c0fef6429d1030d1dfce1ca523ef33a0054b) ([merge request](gitlab-org/security/gitlab!3072))
- [Mask Google IAP account details in Prometheus integration](gitlab-org/security/gitlab@96426e4c799e9bf5e90e5e57b2e54235831819a3) ([merge request](gitlab-org/security/gitlab!3082))
- [Stop Group Transfer Service if SAML Provider or SCIM token is present](gitlab-org/security/gitlab@9496a2ed22f73bf83e56b1ff502fefcfe777ad07) ([merge request](gitlab-org/security/gitlab!3097))
- [Protect Datadog API key by changing Datadog site](gitlab-org/security/gitlab@c6804e50cb60fc4747ea573306eec17eb0dd25f9) ([merge request](gitlab-org/security/gitlab!3094))
- [Protect integrations' sensitive information exposed via API](gitlab-org/security/gitlab@a408475163272b926e65b1cf56c9efde09eac8dd) ([merge request](gitlab-org/security/gitlab!3088))
- [Disallow maintainer to create an owner access token](gitlab-org/security/gitlab@d184909f6ab9123a6131c5c37452ace5c4bc8d3d) ([merge request](gitlab-org/security/gitlab!3091))
- [Paste only text content in work items title](gitlab-org/security/gitlab@d8c48ade46fd75ab62731fced05cdfa2451bcdfa) ([merge request](gitlab-org/security/gitlab!3075))
- [Jira DVCS OAuth Open Redirect Vulnerability](gitlab-org/security/gitlab@91ee37eeaaae8cc6d923f6b4b28ce0d7914342dd) ([merge request](gitlab-org/security/gitlab!3063))
- [Block private personal snippet from unauthorized users](gitlab-org/security/gitlab@d687866d69cbdf25a3ca7185974c02402345015d) ([merge request](gitlab-org/security/gitlab!3030))
- [Verify Kroki diagram type](gitlab-org/security/gitlab@4ec26a4479e73233d0f77bc5a5e764d506c29faf) ([merge request](gitlab-org/security/gitlab!3055))
- [Check read_release permission before showing releases in Tags API](gitlab-org/security/gitlab@32bf21efc32fcb6a3803993959b50d8a9cd07d25) ([merge request](gitlab-org/security/gitlab!3057))
## 15.8.3 (2023-02-15)
### Fixed (3 changes)
@ -1226,6 +1260,23 @@ No changes.
- [Do not use _test when not necessary](gitlab-org/gitlab@1bde73aba2bd1d7f9e833c7325cffa0c90d1c106) ([merge request](gitlab-org/gitlab!107373))
- [Add config/redis.yml unified config file](gitlab-org/gitlab@ace8301236eecc07a511975b57f80e21ec7be3c2) ([merge request](gitlab-org/gitlab!106854))
## 15.7.8 (2023-03-02)
### Security (12 changes)
- [Using builds metadata to determine debug_mode](gitlab-org/security/gitlab@12be0c159940a35899851f2867fde1237dae254b) ([merge request](gitlab-org/security/gitlab!3036))
- [Fix pagination limits for Commits API](gitlab-org/security/gitlab@d507c5d906aff98a8bff943181299cbec5cc43db) ([merge request](gitlab-org/security/gitlab!3073))
- [Mask Google IAP account details in Prometheus integration](gitlab-org/security/gitlab@54420f92a366e2a7648c10baaaf67492d6676746) ([merge request](gitlab-org/security/gitlab!3083))
- [Stop Group Transfer Service if SAML Provider or SCIM token is present](gitlab-org/security/gitlab@52400160cd607fb30411dec04b516a1314e44996) ([merge request](gitlab-org/security/gitlab!3098))
- [Protect Datadog API key by changing Datadog site](gitlab-org/security/gitlab@9aa3ba9f719a786238ae59914d5456666363940e) ([merge request](gitlab-org/security/gitlab!3096))
- [Protect integrations' sensitive information exposed via API](gitlab-org/security/gitlab@60c22681f52c2aadcb55e1b9e92d358076e3c92c) ([merge request](gitlab-org/security/gitlab!3089))
- [Disallow maintainer to create an owner access token](gitlab-org/security/gitlab@2adeb7fafb119a43c0bfe162fbc66d2740cb4168) ([merge request](gitlab-org/security/gitlab!3092))
- [Paste only text content in work items title](gitlab-org/security/gitlab@5fa8a9bf683427af6f25e043b3f0a332719bc970) ([merge request](gitlab-org/security/gitlab!3076))
- [Jira DVCS OAuth Open Redirect Vulnerability](gitlab-org/security/gitlab@3598b2558de92b0a775f09beb739c6e2f90ff7ab) ([merge request](gitlab-org/security/gitlab!3064))
- [Block private personal snippet from unauthorized users](gitlab-org/security/gitlab@a106541570423480c9c510f512a2dc61acc5c01f) ([merge request](gitlab-org/security/gitlab!2994))
- [Verify Kroki diagram type](gitlab-org/security/gitlab@eafe89b8be423e4828fe92769353b7f17ffe895e) ([merge request](gitlab-org/security/gitlab!3054))
- [Check read_release permission before showing releases in Tags API](gitlab-org/security/gitlab@d56500c47754c7d5eb11f3c84bedbe60366eff0e) ([merge request](gitlab-org/security/gitlab!3058))
## 15.7.7 (2023-02-10)
No changes.

View File

@ -371,7 +371,7 @@ gem 'prometheus-client-mmap', '~> 0.17', require: 'prometheus/client'
gem 'warning', '~> 1.3.0'
group :development do
gem 'lefthook', '~> 1.3.2', require: false
gem 'lefthook', '~> 1.3.3', require: false
gem 'rubocop'
gem 'solargraph', '~> 0.47.2', require: false

View File

@ -313,7 +313,7 @@
{"name":"kramdown","version":"2.3.2","platform":"ruby","checksum":"cb4530c2e9d16481591df2c9336723683c354e5416a5dd3e447fa48215a6a71c"},
{"name":"kramdown-parser-gfm","version":"1.1.0","platform":"ruby","checksum":"fb39745516427d2988543bf01fc4cf0ab1149476382393e0e9c48592f6581729"},
{"name":"launchy","version":"2.5.0","platform":"ruby","checksum":"954243c4255920982ce682f89a42e76372dba94770bf09c23a523e204bdebef5"},
{"name":"lefthook","version":"1.3.2","platform":"ruby","checksum":"38607be9d670af5bfbbcb2159459f4403bc8e1b10885a923b9e512b3b72b3dec"},
{"name":"lefthook","version":"1.3.3","platform":"ruby","checksum":"8269a799d0abad6aaf188edb66a661c729abe6b74f3d8d660529d51f9ed2dc5d"},
{"name":"letter_opener","version":"1.7.0","platform":"ruby","checksum":"095bc0d58e006e5b43ea7d219e64ecf2de8d1f7d9dafc432040a845cf59b4725"},
{"name":"letter_opener_web","version":"2.0.0","platform":"ruby","checksum":"33860ad41e1785d75456500e8ca8bba8ed71ee6eaf08a98d06bbab67c5577b6f"},
{"name":"libyajl2","version":"1.2.0","platform":"ruby","checksum":"1117cd1e48db013b626e36269bbf1cef210538ca6d2e62d3fa3db9ded005b258"},

View File

@ -836,7 +836,7 @@ GEM
kramdown (~> 2.0)
launchy (2.5.0)
addressable (~> 2.7)
lefthook (1.3.2)
lefthook (1.3.3)
letter_opener (1.7.0)
launchy (~> 2.2)
letter_opener_web (2.0.0)
@ -1727,7 +1727,7 @@ DEPENDENCIES
knapsack (~> 1.21.1)
kramdown (~> 2.3.1)
kubeclient (~> 4.9.3)!
lefthook (~> 1.3.2)
lefthook (~> 1.3.3)
letter_opener_web (~> 2.0.0)
license_finder (~> 7.0)
licensee (~> 9.15)

View File

@ -1,6 +1,5 @@
<script>
import { GlButton, GlLink, GlTooltipDirective } from '@gitlab/ui';
import { ApolloMutation } from 'vue-apollo';
import * as Sentry from '@sentry/browser';
import { createAlert } from '~/flash';
import { __, s__ } from '~/locale';
@ -35,7 +34,6 @@ export default {
},
},
components: {
ApolloMutation,
DesignNote,
DesignNotePin,
DesignNoteSignedOut,
@ -108,7 +106,6 @@ export default {
},
data() {
return {
discussionComment: '',
isFormRendered: false,
activeDiscussion: {},
noteToDelete: null,
@ -119,10 +116,9 @@ export default {
};
},
computed: {
mutationPayload() {
mutationVariables() {
return {
noteableId: this.noteableId,
body: this.discussionComment,
discussionId: this.discussion.id,
};
},
@ -168,9 +164,15 @@ export default {
onDone({ data: { createNote } }) {
if (hasErrors(createNote)) {
createAlert({ message: ADD_DISCUSSION_COMMENT_ERROR });
} else {
/**
* https://gitlab.com/gitlab-org/gitlab/-/issues/388314
*
* Hide the form once the create note mutation is completed.
*/
this.hideForm();
}
this.discussionComment = '';
this.hideForm();
if (this.shouldChangeResolvedStatus) {
this.toggleResolvedStatus();
}
@ -180,7 +182,6 @@ export default {
},
hideForm() {
this.isFormRendered = false;
this.discussionComment = '';
},
showForm() {
this.$emit('open-form', this.discussion.id);
@ -362,33 +363,24 @@ export default {
:placeholder-text="__('Reply…')"
@focus="showForm"
/>
<apollo-mutation
<design-reply-form
v-else
#default="{ mutate, loading }"
:mutation="$options.createNoteMutation"
:variables="{
input: mutationPayload,
}"
@done="onDone"
@error="onCreateNoteError"
:design-note-mutation="$options.createNoteMutation"
:mutation-variables="mutationVariables"
:markdown-preview-path="markdownPreviewPath"
:noteable-id="noteableId"
:discussion-id="discussion.id"
@note-submit-complete="onDone"
@note-submit-failure="onCreateNoteError"
@cancel-form="hideForm"
>
<design-reply-form
v-model="discussionComment"
:is-saving="loading"
:markdown-preview-path="markdownPreviewPath"
:noteable-id="noteableId"
:discussion-id="discussion.id"
@submit-form="mutate"
@cancel-form="hideForm"
>
<template v-if="discussion.resolvable" #resolve-checkbox>
<label data-testid="resolve-checkbox">
<input v-model="shouldChangeResolvedStatus" type="checkbox" />
{{ resolveCheckboxText }}
</label>
</template>
</design-reply-form>
</apollo-mutation>
<template v-if="discussion.resolvable" #resolve-checkbox>
<label data-testid="resolve-checkbox">
<input v-model="shouldChangeResolvedStatus" type="checkbox" />
{{ resolveCheckboxText }}
</label>
</template>
</design-reply-form>
</template>
</li>
</ul>

View File

@ -8,7 +8,6 @@ import {
GlLink,
GlTooltipDirective,
} from '@gitlab/ui';
import { ApolloMutation } from 'vue-apollo';
import SafeHtml from '~/vue_shared/directives/safe_html';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { __ } from '~/locale';
@ -26,7 +25,6 @@ export default {
deleteCommentText: __('Delete comment'),
},
components: {
ApolloMutation,
DesignReplyForm,
GlAvatar,
GlAvatarLink,
@ -58,7 +56,6 @@ export default {
},
data() {
return {
noteText: this.note.body,
isEditing: false,
isError: true,
};
@ -76,10 +73,9 @@ export default {
isNoteLinked() {
return extractDesignNoteId(this.$route.hash) === this.noteAnchorId;
},
mutationPayload() {
mutationVariables() {
return {
id: this.note.id,
body: this.noteText,
};
},
isEditButtonVisible() {
@ -95,7 +91,6 @@ export default {
methods: {
hideForm() {
this.isEditing = false;
this.noteText = this.note.body;
},
onDone({ data }) {
this.hideForm();
@ -186,26 +181,18 @@ export default {
></div>
<slot name="resolved-status"></slot>
</template>
<apollo-mutation
<design-reply-form
v-else
#default="{ mutate, loading }"
:mutation="$options.updateNoteMutation"
:variables="{
input: mutationPayload,
}"
@error="$emit('error', $event)"
@done="onDone"
>
<design-reply-form
v-model="noteText"
:is-saving="loading"
:markdown-preview-path="markdownPreviewPath"
:is-new-comment="false"
:noteable-id="noteableId"
class="gl-mt-5"
@submit-form="mutate"
@cancel-form="hideForm"
/>
</apollo-mutation>
:markdown-preview-path="markdownPreviewPath"
:design-note-mutation="$options.updateNoteMutation"
:mutation-variables="mutationVariables"
:value="note.body"
:is-new-comment="false"
:noteable-id="noteableId"
class="gl-mt-5"
@note-submit-failure="$emit('error', $event)"
@note-submit-complete="onDone"
@cancel-form="hideForm"
/>
</timeline-entry-item>
</template>

View File

@ -25,19 +25,20 @@ export default {
GlButton,
},
props: {
designNoteMutation: {
type: Object,
required: true,
},
mutationVariables: {
type: Object,
required: false,
default: null,
},
markdownPreviewPath: {
type: String,
required: false,
default: '',
},
value: {
type: String,
required: true,
},
isSaving: {
type: Boolean,
required: true,
},
isNewComment: {
type: Boolean,
required: false,
@ -52,16 +53,23 @@ export default {
required: false,
default: 'new',
},
value: {
type: String,
required: false,
default: '',
},
},
data() {
return {
formText: this.value,
noteText: this.value,
saving: false,
noteUpdateDirty: false,
isLoggedIn: isLoggedIn(),
};
},
computed: {
hasValue() {
return this.value.trim().length > 0;
return this.noteText.length > 0;
},
buttonText() {
return this.isNewComment
@ -75,18 +83,63 @@ export default {
mounted() {
this.focusInput();
},
beforeDestroy() {
/**
* https://gitlab.com/gitlab-org/gitlab/-/issues/388314
* Reply form closes and component destroys
* only when comment submission was successful,
* so we're safe to clear autosave data here conditionally.
*/
this.$nextTick(() => {
if (!this.noteUpdateDirty) {
this.autosaveDiscussion.reset();
}
});
},
methods: {
handleInput() {
/**
* While the form is saving using ctrl+enter
* Do not mark it as dirty.
*
*/
if (!this.saving) {
this.noteUpdateDirty = true;
}
},
submitForm() {
if (this.hasValue) {
this.$emit('submit-form');
this.autosaveDiscussion.reset();
this.saving = true;
this.$apollo
.mutate({
mutation: this.designNoteMutation,
variables: {
input: {
...this.mutationVariables,
body: this.noteText,
},
},
update: () => {
this.noteUpdateDirty = false;
},
})
.then((response) => {
this.$emit('note-submit-complete', response);
})
.catch((errors) => {
this.$emit('note-submit-failure', errors);
})
.finally(() => {
this.saving = false;
});
}
},
cancelComment() {
if (this.hasValue && this.formText !== this.value) {
if (this.hasValue && this.noteUpdateDirty) {
this.confirmCancelCommentModal();
} else {
this.$emit('cancel-form');
this.noteUpdateDirty = false;
}
},
async confirmCancelCommentModal() {
@ -133,21 +186,21 @@ export default {
<markdown-field
:markdown-preview-path="markdownPreviewPath"
:enable-autocomplete="true"
:textarea-value="value"
:textarea-value="noteText"
:markdown-docs-path="$options.markdownDocsPath"
class="bordered-box"
>
<template #textarea>
<textarea
ref="textarea"
:value="value"
v-model.trim="noteText"
class="note-textarea js-gfm-input js-autosize markdown-area"
dir="auto"
data-supports-quick-actions="false"
data-qa-selector="note_textarea"
:aria-label="__('Description')"
:placeholder="__('Write a comment…')"
@input="$emit('input', $event.target.value)"
@input="handleInput"
@keydown.meta.enter="submitForm"
@keydown.ctrl.enter="submitForm"
@keyup.esc.stop="cancelComment"
@ -159,7 +212,8 @@ export default {
<div class="note-form-actions gl-display-flex">
<gl-button
ref="submitButton"
:disabled="!hasValue || isSaving"
:disabled="!hasValue"
:loading="saving"
class="gl-mr-3 gl-w-auto!"
category="primary"
variant="confirm"

View File

@ -2,7 +2,6 @@
import { GlAlert } from '@gitlab/ui';
import { isNull } from 'lodash';
import Mousetrap from 'mousetrap';
import { ApolloMutation } from 'vue-apollo';
import { keysFor, ISSUE_CLOSE_DESIGN } from '~/behaviors/shortcuts/keybindings';
import { createAlert } from '~/flash';
import { fetchPolicies } from '~/lib/graphql';
@ -51,7 +50,6 @@ const DEFAULT_MAX_SCALE = 2;
export default {
components: {
ApolloMutation,
DesignReplyForm,
DesignPresentation,
DesignScaler,
@ -91,7 +89,6 @@ export default {
data() {
return {
design: {},
comment: '',
annotationCoordinates: null,
errorMessage: '',
scale: DEFAULT_SCALE,
@ -130,9 +127,6 @@ export default {
markdownPreviewPath() {
return `/${this.projectPath}/preview_markdown?target_type=Issue`;
},
isSubmitButtonDisabled() {
return this.comment.trim().length === 0;
},
designVariables() {
return {
fullPath: this.projectPath,
@ -141,11 +135,10 @@ export default {
atVersion: this.designsVersion,
};
},
mutationPayload() {
mutationVariables() {
const { x, y, width, height } = this.annotationCoordinates;
return {
noteableId: this.design.id,
body: this.comment,
position: {
headSha: this.design.diffRefs.headSha,
baseSha: this.design.diffRefs.baseSha,
@ -197,13 +190,23 @@ export default {
Mousetrap.unbind(keysFor(ISSUE_CLOSE_DESIGN));
},
methods: {
addImageDiffNoteToStore(store, { data: { createImageDiffNote } }) {
addImageDiffNoteToStore({ data }) {
const { createImageDiffNote } = data;
/**
* https://gitlab.com/gitlab-org/gitlab/-/issues/388314
*
* The getClient method is not documented. In future,
* need to check for any alternative.
*/
const { cache } = this.$apollo.getClient();
updateStoreAfterAddImageDiffNote(
store,
cache,
createImageDiffNote,
getDesignQuery,
this.designVariables,
);
this.closeCommentForm(data);
},
updateImageDiffNoteInStore(store, { data: { repositionImageDiffNote } }) {
return updateStoreAfterRepositionImageDiffNote(
@ -289,7 +292,6 @@ export default {
}
},
closeCommentForm(data) {
this.comment = '';
this.annotationCoordinates = null;
if (data?.data && !isNull(this.prevCurrentUserTodos)) {
@ -407,27 +409,18 @@ export default {
@todoError="onTodoError"
>
<template #reply-form>
<apollo-mutation
<design-reply-form
v-if="isAnnotating"
#default="{ mutate, loading }"
:mutation="$options.createImageDiffNoteMutation"
:variables="{
input: mutationPayload,
}"
:update="addImageDiffNoteToStore"
@done="closeCommentForm"
@error="onCreateImageDiffNoteError"
>
<design-reply-form
ref="newDiscussionForm"
v-model="comment"
:is-saving="loading"
:markdown-preview-path="markdownPreviewPath"
:noteable-id="design.id"
@submit-form="mutate"
@cancel-form="closeCommentForm"
/> </apollo-mutation
></template>
ref="newDiscussionForm"
:design-note-mutation="$options.createImageDiffNoteMutation"
:mutation-variables="mutationVariables"
:markdown-preview-path="markdownPreviewPath"
:noteable-id="design.id"
@note-submit-complete="addImageDiffNoteToStore"
@note-submit-failure="onCreateImageDiffNoteError"
@cancel-form="closeCommentForm"
/>
</template>
</design-sidebar>
</div>
</template>

View File

@ -77,6 +77,7 @@ export default {
}"
class="title gl-font-size-h-display"
data-qa-selector="title_content"
data-testid="issue-title"
dir="auto"
></h1>
<gl-button

View File

@ -58,7 +58,7 @@ export const getLevelFromContributions = (count) => {
};
export default class ActivityCalendar {
constructor(
constructor({
container,
activitiesContainer,
timestamps,
@ -66,7 +66,8 @@ export default class ActivityCalendar {
utcOffset = 0,
firstDayOfWeek = firstDayOfWeekChoices.sunday,
monthsAgo = 12,
) {
onClickDay,
}) {
this.calendarActivitiesPath = calendarActivitiesPath;
this.clickDay = this.clickDay.bind(this);
this.currentSelectedDate = '';
@ -91,6 +92,7 @@ export default class ActivityCalendar {
this.firstDayOfWeek = firstDayOfWeek;
this.activitiesContainer = activitiesContainer;
this.container = container;
this.onClickDay = onClickDay;
// Loop through the timestamps to create a group of objects
// The group of objects will be grouped based on the day of the week they are
@ -152,7 +154,8 @@ export default class ActivityCalendar {
.append('svg')
.attr('width', width)
.attr('height', 169)
.attr('class', 'contrib-calendar');
.attr('class', 'contrib-calendar')
.attr('data-testid', 'contrib-calendar');
}
dayYPos(day) {
@ -281,6 +284,12 @@ export default class ActivityCalendar {
this.currentSelectedDate.getDate(),
].join('-');
if (this.onClickDay) {
this.onClickDay(date);
return;
}
$(this.activitiesContainer)
.empty()
.append(loadingIconForLegacyJS({ size: 'lg' }));

View File

@ -247,15 +247,15 @@ export default class UserTabs {
$calendarWrap.find('.calendar-hint').text(calendarHint);
// eslint-disable-next-line no-new
new ActivityCalendar(
'.tab-pane.active .js-contrib-calendar',
'.tab-pane.active .user-calendar-activities',
data,
new ActivityCalendar({
container: '.tab-pane.active .js-contrib-calendar',
activitiesContainer: '.tab-pane.active .user-calendar-activities',
timestamps: data,
calendarActivitiesPath,
utcOffset,
gon.first_day_of_week,
firstDayOfTheWeek: gon.first_day_of_week,
monthsAgo,
);
});
}
toggleLoading(status) {

View File

@ -0,0 +1,100 @@
<script>
import { GlLoadingIcon, GlAlert } from '@gitlab/ui';
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
import { debounce } from 'lodash';
import { __ } from '~/locale';
import AjaxCache from '~/lib/utils/ajax_cache';
import ActivityCalendar from '~/pages/users/activity_calendar';
import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants';
import { getVisibleCalendarPeriod } from '../utils';
export default {
i18n: {
errorAlertTitle: __('There was an error loading users activity calendar.'),
retry: __('Retry'),
calendarHint: __('Issues, merge requests, pushes, and comments.'),
},
components: { GlLoadingIcon, GlAlert },
inject: ['userCalendarPath', 'utcOffset'],
data() {
return {
isLoading: true,
showCalendar: true,
hasError: false,
};
},
mounted() {
this.renderActivityCalendar();
window.addEventListener('resize', this.handleResize);
},
beforeDestroy() {
window.removeEventListener('resize', this.handleResize);
},
methods: {
async renderActivityCalendar() {
if (bp.getBreakpointSize() === 'xs') {
this.showCalendar = false;
return;
}
this.showCalendar = true;
this.isLoading = true;
this.hasError = false;
try {
const data = await AjaxCache.retrieve(this.userCalendarPath);
this.isLoading = false;
// Wait for `calendarContainer` to render
await this.$nextTick();
const monthsAgo = getVisibleCalendarPeriod(this.$refs.calendarContainer);
// eslint-disable-next-line no-new
new ActivityCalendar({
container: this.$refs.calendarSvgContainer,
timestamps: data,
utcOffset: this.utcOffset,
firstDayOfWeek: gon.first_day_of_week,
monthsAgo,
onClickDay: this.handleClickDay,
});
} catch {
this.isLoading = false;
this.hasError = true;
}
},
handleResize: debounce(function debouncedHandleResize() {
this.renderActivityCalendar();
}, DEFAULT_DEBOUNCE_AND_THROTTLE_MS),
handleClickDay() {
// Render activities for specific day.
// Blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/378695
},
},
};
</script>
<template>
<div v-if="showCalendar" ref="calendarContainer">
<gl-loading-icon v-if="isLoading" size="md" />
<gl-alert
v-else-if="hasError"
:title="$options.i18n.errorAlertTitle"
:dismissible="false"
variant="danger"
:primary-button-text="$options.i18n.retry"
@primaryAction="renderActivityCalendar"
/>
<div v-else class="gl-text-center">
<div class="gl-display-inline-block gl-relative">
<div ref="calendarSvgContainer"></div>
<p class="gl-absolute gl-right-0 gl-bottom-0 gl-mb-0 gl-font-sm">
{{ $options.i18n.calendarHint }}
</p>
</div>
</div>
</div>
</template>

View File

@ -1,17 +1,18 @@
<script>
import { GlTab } from '@gitlab/ui';
import { s__ } from '~/locale';
import ActivityCalendar from './activity_calendar.vue';
export default {
i18n: {
title: s__('UserProfile|Overview'),
},
components: { GlTab },
components: { GlTab, ActivityCalendar },
};
</script>
<template>
<gl-tab :title="$options.i18n.title">
<!-- placeholder -->
<activity-calendar />
</gl-tab>
</template>

View File

@ -66,7 +66,12 @@ export default {
</script>
<template>
<gl-tabs>
<component :is="component" v-for="{ key, component } in $options.tabs" :key="key" />
<gl-tabs nav-class="gl-bg-gray-10" align="center">
<component
:is="component"
v-for="{ key, component } in $options.tabs"
:key="key"
class="container-fluid container-limited"
/>
</gl-tabs>
</template>

View File

@ -0,0 +1,7 @@
export const CALENDAR_PERIOD_6_MONTHS = 6;
export const CALENDAR_PERIOD_12_MONTHS = 12;
/* computation based on
* width = (group + 1) * this.daySizeWithSpace + this.getExtraWidthPadding(group);
* (see activity_calendar.js)
*/
export const OVERVIEW_CALENDAR_BREAKPOINT = 918;

View File

@ -7,8 +7,14 @@ export const initProfileTabs = () => {
if (!el) return false;
const { userCalendarPath, utcOffset } = el.dataset;
return new Vue({
el,
provide: {
userCalendarPath,
utcOffset,
},
render(createElement) {
return createElement(ProfileTabs);
},

View File

@ -0,0 +1,13 @@
import {
OVERVIEW_CALENDAR_BREAKPOINT,
CALENDAR_PERIOD_6_MONTHS,
CALENDAR_PERIOD_12_MONTHS,
} from './constants';
export const getVisibleCalendarPeriod = (calendarContainer) => {
const { width } = calendarContainer.getBoundingClientRect();
return width < OVERVIEW_CALENDAR_BREAKPOINT
? CALENDAR_PERIOD_6_MONTHS
: CALENDAR_PERIOD_12_MONTHS;
};

View File

@ -1,5 +1,5 @@
<script>
import { mapState } from 'vuex';
import { mapState, mapGetters } from 'vuex';
import ScopeNavigation from '~/search/sidebar/components/scope_navigation.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { SCOPE_ISSUES, SCOPE_MERGE_REQUESTS, SCOPE_BLOB } from '../constants';
@ -16,11 +16,12 @@ export default {
mixins: [glFeatureFlagsMixin()],
computed: {
...mapState(['urlQuery']),
...mapGetters(['currentScope']),
showIssueAndMergeFilters() {
return this.urlQuery.scope === SCOPE_ISSUES || this.urlQuery.scope === SCOPE_MERGE_REQUESTS;
return this.currentScope === SCOPE_ISSUES || this.currentScope === SCOPE_MERGE_REQUESTS;
},
showBlobFilter() {
return this.urlQuery.scope === SCOPE_BLOB && this.glFeatures.searchBlobsLanguageAggregation;
return this.currentScope === SCOPE_BLOB && this.glFeatures.searchBlobsLanguageAggregation;
},
},
};

View File

@ -19,7 +19,7 @@ export default {
},
computed: {
...mapState(['query']),
...mapGetters(['queryLangugageFilters']),
...mapGetters(['queryLanguageFilters']),
scope() {
return this.query.scope;
},
@ -31,7 +31,7 @@ export default {
},
selectedFilter: {
get() {
return intersection(this.flatDataFilterValues, this.queryLangugageFilters);
return intersection(this.flatDataFilterValues, this.queryLanguageFilters);
},
set(value) {
this.setQuery({ key: this.filtersData?.filterParam, value });

View File

@ -32,19 +32,19 @@ export default {
computed: {
...mapState(['aggregations', 'sidebarDirty']),
...mapGetters([
'langugageAggregationBuckets',
'languageAggregationBuckets',
'currentUrlQueryHasLanguageFilters',
'queryLangugageFilters',
'queryLanguageFilters',
]),
hasBuckets() {
return this.langugageAggregationBuckets.length > 0;
return this.languageAggregationBuckets.length > 0;
},
filtersData() {
return convertFiltersData(this.shortenedLanguageFilters);
},
shortenedLanguageFilters() {
if (!this.hasShowMore) {
return this.langugageAggregationBuckets;
return this.languageAggregationBuckets;
}
if (this.showAll) {
return this.trimBuckets(MAX_ITEM_LENGTH);
@ -52,16 +52,16 @@ export default {
return this.trimBuckets(DEFAULT_ITEM_LENGTH);
},
hasShowMore() {
return this.langugageAggregationBuckets.length > DEFAULT_ITEM_LENGTH;
return this.languageAggregationBuckets.length > DEFAULT_ITEM_LENGTH;
},
hasOverMax() {
return this.langugageAggregationBuckets.length > MAX_ITEM_LENGTH;
return this.languageAggregationBuckets.length > MAX_ITEM_LENGTH;
},
dividerClasses() {
return [...HR_DEFAULT_CLASSES, ...ONLY_SHOW_MD];
},
hasQueryFilters() {
return this.queryLangugageFilters.length > 0;
return this.queryLanguageFilters.length > 0;
},
},
async created() {
@ -78,7 +78,7 @@ export default {
this.showAll = true;
},
trimBuckets(length) {
return this.langugageAggregationBuckets.slice(0, length);
return this.languageAggregationBuckets.slice(0, length);
},
cleanResetFilters() {
if (this.currentUrlQueryHasLanguageFilters) {

View File

@ -44,9 +44,6 @@ export default {
isHighlighted ? 'gl-text-gray-900' : 'gl-text-gray-500',
];
},
isActive(scope, index) {
return this.urlQuery.scope ? this.urlQuery.scope === scope : index === 0;
},
qaSelectorValue(item) {
return `${slugifyWithUnderscore(item.label)}_tab`;
},
@ -60,16 +57,17 @@ export default {
<nav data-testid="search-filter">
<gl-nav vertical pills>
<gl-nav-item
v-for="(item, scope, index) in navigation"
v-for="(item, scope) in navigation"
:key="scope"
:link-classes="linkClasses(isActive(scope, index))"
:link-classes="linkClasses(item.active)"
class="gl-mb-1"
:href="item.link"
:active="isActive(scope, index)"
:active="item.active"
:data-qa-selector="qaSelectorValue(item)"
:data-testid="qaSelectorValue(item)"
@click="handleClick(scope)"
><span>{{ item.label }}</span
><span v-if="item.count" :class="countClasses(isActive(scope, index))">
><span data-testid="label">{{ item.label }}</span
><span v-if="item.count" data-testid="count" :class="countClasses(item.active)">
{{ showFormatedCount(item.count)
}}<gl-icon
v-if="isCountOverLimit(item.count)"

View File

@ -1,4 +1,4 @@
import { has } from 'lodash';
import { findKey, has } from 'lodash';
import { languageFilterData } from '~/search/sidebar/constants/language_filter_data';
import { GROUPS_LOCAL_STORAGE_KEY, PROJECTS_LOCAL_STORAGE_KEY } from './constants';
@ -11,7 +11,7 @@ export const frequentProjects = (state) => {
return state.frequentItems[PROJECTS_LOCAL_STORAGE_KEY];
};
export const langugageAggregationBuckets = (state) => {
export const languageAggregationBuckets = (state) => {
return (
state.aggregations.data.find(
(aggregation) => aggregation.name === languageFilterData.filterParam,
@ -19,9 +19,9 @@ export const langugageAggregationBuckets = (state) => {
);
};
export const queryLangugageFilters = (state) => {
return state.query[languageFilterData.filterParam] || [];
};
export const currentScope = (state) => findKey(state.navigation, { active: true });
export const queryLanguageFilters = (state) => state.query[languageFilterData.filterParam] || [];
export const currentUrlQueryHasLanguageFilters = (state) =>
has(state.urlQuery, languageFilterData.filterParam) &&

View File

@ -29,6 +29,11 @@ export default {
handleSubmit() {
this.$refs.titleEl.blur();
},
handlePaste(e) {
e.preventDefault();
const text = e.clipboardData.getData('text');
this.$refs.titleEl.innerText = text;
},
},
};
</script>
@ -48,6 +53,7 @@ export default {
:contenteditable="!disabled"
class="gl-px-4 gl-py-3 gl-ml-n4 gl-border gl-border-white gl-rounded-base gl-display-block"
:class="{ 'gl-hover-border-gray-200 gl-pseudo-placeholder': !disabled }"
@paste="handlePaste"
@blur="handleBlur"
@keyup="handleInput"
@keydown.enter.exact="handleSubmit"

View File

@ -1,15 +0,0 @@
@import 'page_bundles/mixins_and_variables_and_functions';
/*
When the single-stat component of gitlab UI adds the props of the title icon color,
remove this file and use the props of gitlab UI to set the color
Gitlab UI issue: https://gitlab.com/gitlab-org/gitlab-ui/-/issues/2157
*/
.code-quality-blocker .gl-icon {
@include gl-text-red-800;
}
.code-quality-critical .gl-icon {
@include gl-text-red-600;
}

View File

@ -8,6 +8,8 @@ class Oauth::JiraDvcs::AuthorizationsController < ApplicationController
skip_before_action :authenticate_user!
skip_before_action :verify_authenticity_token
before_action :validate_redirect_uri, only: :new
feature_category :integrations
# 1. Rewire Jira OAuth initial request to our stablished OAuth authorization URL.
@ -56,4 +58,15 @@ class Oauth::JiraDvcs::AuthorizationsController < ApplicationController
def normalize_scope(scope)
scope == 'repo' ? 'api' : scope
end
def validate_redirect_uri
client = Doorkeeper::OAuth::Client.find(params[:client_id])
return render_404 unless client
return true if Doorkeeper::OAuth::Helpers::URIChecker.valid_for_authorization?(
params['redirect_uri'], client.redirect_uri
)
render_403
end
end

View File

@ -117,7 +117,7 @@ class NotesFinder
when "snippet", "project_snippet"
SnippetsFinder.new(@current_user, project: @project).execute # rubocop: disable CodeReuse/Finder
when "personal_snippet"
PersonalSnippet.all
SnippetsFinder.new(@current_user, only_personal: true).execute # rubocop: disable CodeReuse/Finder
else
raise "invalid target_type '#{noteable_type}'"
end

View File

@ -36,13 +36,15 @@ module Mutations
raise_resource_not_available_error!
end
new_link = release.links.create(link_attrs)
result = ::Releases::Links::CreateService
.new(release, current_user, link_attrs)
.execute
unless new_link.persisted?
return { link: nil, errors: new_link.errors.full_messages }
if result.success?
{ link: result.payload[:link], errors: [] }
else
{ link: nil, errors: result.message }
end
{ link: new_link, errors: [] }
end
end
end

View File

@ -21,11 +21,15 @@ module Mutations
def resolve(id:)
link = authorized_find!(id)
unless link.destroy
return { link: nil, errors: link.errors.full_messages }
end
result = ::Releases::Links::DestroyService
.new(link.release, current_user)
.execute(link)
{ link: link, errors: [] }
if result.success?
{ link: result.payload[:link], errors: [] }
else
{ link: nil, errors: result.message }
end
end
def find_object(id)

View File

@ -46,11 +46,15 @@ module Mutations
def resolve(id:, **link_attrs)
link = authorized_find!(id)
unless link.update(link_attrs)
return { link: nil, errors: link.errors.full_messages }
end
result = ::Releases::Links::UpdateService
.new(link.release, current_user, link_attrs)
.execute(link)
{ link: link, errors: [] }
if result.success?
{ link: result.payload[:link], errors: [] }
else
{ link: nil, errors: result.message }
end
end
def find_object(id)

View File

@ -172,6 +172,13 @@ module UsersHelper
'https://about.gitlab.com/free-trial/'
end
def user_profile_tabs_app_data(user)
{
user_calendar_path: user_calendar_path(user, :json),
utc_offset: local_timezone_instance(user.timezone).now.utc_offset
}
end
private
def admin_users_paths

View File

@ -77,6 +77,7 @@ module Ci
delegate :trigger_short_token, to: :trigger_request, allow_nil: true
delegate :ensure_persistent_ref, to: :pipeline
delegate :enable_debug_trace!, to: :metadata
delegate :debug_trace_enabled?, to: :metadata
serialize :options # rubocop:disable Cop/ActiveRecordSerialize
serialize :yaml_variables, Gitlab::Serializer::Ci::Variables # rubocop:disable Cop/ActiveRecordSerialize
@ -1078,11 +1079,10 @@ module Ci
end
def debug_mode?
# TODO: Have `debug_mode?` check against data on sent back from runner
# to capture all the ways that variables can be set.
# See (https://gitlab.com/gitlab-org/gitlab/-/issues/290955)
variables['CI_DEBUG_TRACE']&.value&.casecmp('true') == 0 ||
variables['CI_DEBUG_SERVICES']&.value&.casecmp('true') == 0
# perform the check on both sides in case the runner version is old
debug_trace_enabled? ||
Gitlab::Utils.to_boolean(variables['CI_DEBUG_SERVICES']&.value, default: false) ||
Gitlab::Utils.to_boolean(variables['CI_DEBUG_TRACE']&.value, default: false)
end
def drop_with_exit_code!(failure_reason, exit_code)

View File

@ -43,14 +43,6 @@ class CommitStatus < Ci::ApplicationRecord
scope :order_id_desc, -> { order(id: :desc) }
scope :exclude_ignored, -> do
# We want to ignore failed but allowed to fail jobs.
#
# TODO, we also skip ignored optional manual actions.
where("allow_failure = ? OR status IN (?)",
false, all_state_names - [:failed, :canceled, :manual])
end
scope :latest, -> { where(retried: [false, nil]) }
scope :retried, -> { where(retried: true) }
scope :ordered, -> { order(:name) }
@ -239,10 +231,6 @@ class CommitStatus < Ci::ApplicationRecord
name.to_s.sub(regex, '').strip
end
def failed_but_allowed?
allow_failure? && (failed? || canceled?)
end
# Time spent running.
def duration
calculate_duration(started_at, finished_at)

View File

@ -510,7 +510,7 @@ class Integration < ApplicationRecord
end
def api_field_names
fields.reject { _1[:type] == 'password' }.pluck(:name)
fields.reject { _1[:type] == 'password' || _1[:name] == 'webhook' }.pluck(:name)
end
def form_fields

View File

@ -15,6 +15,7 @@ module Integrations
TAG_KEY_VALUE_RE = %r{\A [\w-]+ : .*\S.* \z}x.freeze
field :datadog_site,
exposes_secrets: true,
placeholder: DEFAULT_DOMAIN,
help: -> do
ERB::Util.html_escape(

View File

@ -3,6 +3,7 @@
module Integrations
class Prometheus < BaseMonitoring
include PrometheusAdapter
include Gitlab::Utils::StrongMemoize
field :manual_configuration,
type: 'checkbox',
@ -81,7 +82,7 @@ module Integrations
allow_local_requests: allow_local_api_url?
)
if behind_iap?
if behind_iap? && iap_client
# Adds the Authorization header
options[:headers] = iap_client.apply({})
end
@ -106,6 +107,22 @@ module Integrations
should_return_client?
end
alias_method :google_iap_service_account_json_raw, :google_iap_service_account_json
private :google_iap_service_account_json_raw
MASKED_VALUE = '*' * 8
def google_iap_service_account_json
json = google_iap_service_account_json_raw
return json unless json.present?
Gitlab::Json.parse(json)
.then { |hash| hash.transform_values { MASKED_VALUE } }
.then { |hash| Gitlab::Json.generate(hash) }
rescue Gitlab::Json.parser_error
json
end
private
delegate :allow_local_requests_from_web_hooks_and_services?, to: :current_settings, private: true
@ -155,17 +172,21 @@ module Integrations
end
def clean_google_iap_service_account
return unless google_iap_service_account_json
json = google_iap_service_account_json_raw
return unless json.present?
google_iap_service_account_json
.then { |json| Gitlab::Json.parse(json) }
.except('token_credential_uri')
Gitlab::Json.parse(json).except('token_credential_uri')
rescue Gitlab::Json.parser_error
{}
end
def iap_client
@iap_client ||= Google::Auth::Credentials
.new(clean_google_iap_service_account, target_audience: google_iap_audience_client_id)
.client
rescue StandardError
nil
end
strong_memoize_attr :iap_client
end
end

View File

@ -51,6 +51,7 @@ module Groups
publish_event(old_root_ancestor_id)
end
# Overridden in EE
def ensure_allowed_transfer
raise_transfer_error(:group_is_already_root) if group_is_already_root?
raise_transfer_error(:same_parent_as_current) if same_parent?
@ -208,6 +209,7 @@ module Groups
raise TransferError, localized_error_messages[message]
end
# Overridden in EE
def localized_error_messages
{
database_not_supported: s_('TransferGroup|Database is not supported.'),

View File

@ -0,0 +1,31 @@
# frozen_string_literal: true
module Releases
module Links
class BaseService
attr_accessor :release, :current_user, :params
def initialize(release, current_user = nil, params = {})
@release = release
@current_user = current_user
@params = params.dup
end
private
def allowed_params
@allowed_params ||= params.slice(:name, :url, :link_type).tap do |hash|
hash[:filepath] = filepath if provided_filepath?
end
end
def provided_filepath?
params.key?(:direct_asset_path) || params.key?(:filepath)
end
def filepath
params[:direct_asset_path] || params[:filepath]
end
end
end
end

View File

@ -0,0 +1,25 @@
# frozen_string_literal: true
module Releases
module Links
class CreateService < BaseService
def execute
return ServiceResponse.error(message: _('Access Denied')) unless allowed?
link = release.links.create(allowed_params)
if link.persisted?
ServiceResponse.success(payload: { link: link })
else
ServiceResponse.error(message: link.errors.full_messages)
end
end
private
def allowed?
Ability.allowed?(current_user, :create_release, release)
end
end
end
end

View File

@ -0,0 +1,24 @@
# frozen_string_literal: true
module Releases
module Links
class DestroyService < BaseService
def execute(link)
return ServiceResponse.error(message: _('Access Denied')) unless allowed?
return ServiceResponse.error(message: _('Link does not exist')) unless link
if link.destroy
ServiceResponse.success(payload: { link: link })
else
ServiceResponse.error(message: link.errors.full_messages)
end
end
private
def allowed?
Ability.allowed?(current_user, :destroy_release, release)
end
end
end
end

View File

@ -0,0 +1,24 @@
# frozen_string_literal: true
module Releases
module Links
class UpdateService < BaseService
def execute(link)
return ServiceResponse.error(message: _('Access Denied')) unless allowed?
return ServiceResponse.error(message: _('Link does not exist')) unless link
if link.update(allowed_params)
ServiceResponse.success(payload: { link: link })
else
ServiceResponse.error(message: link.errors.full_messages)
end
end
private
def allowed?
Ability.allowed?(current_user, :update_release, release)
end
end
end
end

View File

@ -121,7 +121,7 @@ module ResourceAccessTokens
def do_not_allow_owner_access_level_for_project_bot?(access_level)
resource.is_a?(Project) &&
access_level == Gitlab::Access::OWNER &&
access_level.to_i == Gitlab::Access::OWNER &&
!current_user.can?(:manage_owners, resource)
end
end

View File

@ -1,5 +1,4 @@
- page_title _('CI/CD Analytics')
- add_page_specific_style 'page_bundles/project_quality'
#js-project-pipelines-charts-app{ data: { project_path: @project.full_path,
should_render_dora_charts: should_render_dora_charts.to_s,

View File

@ -128,52 +128,50 @@
.profile-user-bio
= @user.bio
- unless profile_tabs.empty?
- if Feature.enabled?(:profile_tabs_vue, current_user)
#js-profile-tabs
- else
.scrolling-tabs-container
.fade-left= sprite_icon('chevron-lg-left', size: 12)
.fade-right= sprite_icon('chevron-lg-right', size: 12)
%ul.nav-links.user-profile-nav.scrolling-tabs.nav.nav-tabs
- if profile_tab?(:overview)
%li.js-overview-tab
= link_to user_path, data: { target: 'div#js-overview', action: 'overview', toggle: 'tab' } do
= s_('UserProfile|Overview')
- if profile_tab?(:activity)
%li.js-activity-tab
= link_to user_activity_path, data: { target: 'div#activity', action: 'activity', toggle: 'tab' } do
= s_('UserProfile|Activity')
- unless Feature.enabled?(:security_auto_fix) && @user.bot?
- if profile_tab?(:groups)
%li.js-groups-tab
= link_to user_groups_path, data: { target: 'div#groups', action: 'groups', toggle: 'tab', endpoint: user_groups_path(format: :json) } do
= s_('UserProfile|Groups')
- if profile_tab?(:contributed)
%li.js-contributed-tab
= link_to user_contributed_projects_path, data: { target: 'div#contributed', action: 'contributed', toggle: 'tab', endpoint: user_contributed_projects_path(format: :json) } do
= s_('UserProfile|Contributed projects')
- if profile_tab?(:projects)
%li.js-projects-tab
= link_to user_projects_path, data: { target: 'div#projects', action: 'projects', toggle: 'tab', endpoint: user_projects_path(format: :json) } do
= s_('UserProfile|Personal projects')
- if profile_tab?(:starred)
%li.js-starred-tab
= link_to user_starred_projects_path, data: { target: 'div#starred', action: 'starred', toggle: 'tab', endpoint: user_starred_projects_path(format: :json) } do
= s_('UserProfile|Starred projects')
- if profile_tab?(:snippets)
%li.js-snippets-tab
= link_to user_snippets_path, data: { target: 'div#snippets', action: 'snippets', toggle: 'tab', endpoint: user_snippets_path(format: :json) } do
= s_('UserProfile|Snippets')
- if profile_tab?(:followers)
%li.js-followers-tab
= link_to user_followers_path, data: { target: 'div#followers', action: 'followers', toggle: 'tab', endpoint: user_followers_path(format: :json) } do
= s_('UserProfile|Followers')
- if profile_tab?(:following)
%li.js-following-tab
= link_to user_following_path, data: { target: 'div#following', action: 'following', toggle: 'tab', endpoint: user_following_path(format: :json) } do
= s_('UserProfile|Following')
- if !profile_tabs.empty? && !Feature.enabled?(:profile_tabs_vue, current_user)
.scrolling-tabs-container
.fade-left= sprite_icon('chevron-lg-left', size: 12)
.fade-right= sprite_icon('chevron-lg-right', size: 12)
%ul.nav-links.user-profile-nav.scrolling-tabs.nav.nav-tabs
- if profile_tab?(:overview)
%li.js-overview-tab
= link_to user_path, data: { target: 'div#js-overview', action: 'overview', toggle: 'tab' } do
= s_('UserProfile|Overview')
- if profile_tab?(:activity)
%li.js-activity-tab
= link_to user_activity_path, data: { target: 'div#activity', action: 'activity', toggle: 'tab' } do
= s_('UserProfile|Activity')
- unless Feature.enabled?(:security_auto_fix) && @user.bot?
- if profile_tab?(:groups)
%li.js-groups-tab
= link_to user_groups_path, data: { target: 'div#groups', action: 'groups', toggle: 'tab', endpoint: user_groups_path(format: :json) } do
= s_('UserProfile|Groups')
- if profile_tab?(:contributed)
%li.js-contributed-tab
= link_to user_contributed_projects_path, data: { target: 'div#contributed', action: 'contributed', toggle: 'tab', endpoint: user_contributed_projects_path(format: :json) } do
= s_('UserProfile|Contributed projects')
- if profile_tab?(:projects)
%li.js-projects-tab
= link_to user_projects_path, data: { target: 'div#projects', action: 'projects', toggle: 'tab', endpoint: user_projects_path(format: :json) } do
= s_('UserProfile|Personal projects')
- if profile_tab?(:starred)
%li.js-starred-tab
= link_to user_starred_projects_path, data: { target: 'div#starred', action: 'starred', toggle: 'tab', endpoint: user_starred_projects_path(format: :json) } do
= s_('UserProfile|Starred projects')
- if profile_tab?(:snippets)
%li.js-snippets-tab
= link_to user_snippets_path, data: { target: 'div#snippets', action: 'snippets', toggle: 'tab', endpoint: user_snippets_path(format: :json) } do
= s_('UserProfile|Snippets')
- if profile_tab?(:followers)
%li.js-followers-tab
= link_to user_followers_path, data: { target: 'div#followers', action: 'followers', toggle: 'tab', endpoint: user_followers_path(format: :json) } do
= s_('UserProfile|Followers')
- if profile_tab?(:following)
%li.js-following-tab
= link_to user_following_path, data: { target: 'div#following', action: 'following', toggle: 'tab', endpoint: user_following_path(format: :json) } do
= s_('UserProfile|Following')
- if !profile_tabs.empty? && Feature.enabled?(:profile_tabs_vue, current_user)
#js-profile-tabs{ data: user_profile_tabs_app_data(@user) }
%div{ class: container_class }
- unless Feature.enabled?(:profile_tabs_vue, current_user)
.tab-content

View File

@ -312,7 +312,6 @@ module Gitlab
config.assets.precompile << "page_bundles/pipeline_editor.css"
config.assets.precompile << "page_bundles/productivity_analytics.css"
config.assets.precompile << "page_bundles/profile.css"
config.assets.precompile << "page_bundles/project_quality.css"
config.assets.precompile << "page_bundles/profile_two_factor_auth.css"
config.assets.precompile << "page_bundles/profiles/preferences.css"
config.assets.precompile << "page_bundles/project.css"

View File

@ -1,9 +0,0 @@
---
name: code_basic_search_files_by_regexp
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109987
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/389551
milestone: '15.9'
type: development
group: group::global search
default_enabled: false

View File

@ -0,0 +1,15 @@
# frozen_string_literal: true
# TODO: Remove this once we're on Ruby 3
# https://gitlab.com/gitlab-org/gitlab/-/issues/393651
unless YAML.respond_to?(:safe_load_file)
module YAML
# Temporary Ruby 2 back-compat workaround.
#
# This method only exists as of stdlib 3.0.0:
# https://ruby-doc.org/stdlib-3.0.0/libdoc/psych/rdoc/Psych.html
def self.safe_load_file(path, **options)
YAML.safe_load(File.read(path), **options)
end
end
end

View File

@ -14,7 +14,7 @@ module RestClient
self.hostname_override = hostname_override
rescue Gitlab::UrlBlocker::BlockedUrlError => e
raise ArgumentError, "URL '#{uri}' is blocked: #{e.message}"
raise ArgumentError, "URL is blocked: #{e.message}"
end
# Gitlab::UrlBlocker returns a Addressable::URI which we need to coerce

View File

@ -1,5 +1,7 @@
# frozen_string_literal: true
return if helper.stable_branch?
data_qa_selectors = /qa_selector|data-qa-selector/
deprecated_qa_selectors = /(?!.*\bdata-qa-)(?=class=.*qa-.*|class: .*qa-.*)/

View File

@ -139,7 +139,7 @@ We use PostgreSQL's own replication functionality to replicate data from the **p
We use Redis both as a cache store and to hold persistent data for our background jobs system. Because both
use-cases have data that are exclusive to the same Geo site, we don't replicate it between sites.
Elasticsearch is an optional database that for advanced searching capabilities. It can improve search
Elasticsearch is an optional database for advanced search. It can improve search
in both source-code level, and user generated content in issues, merge requests, and discussions.
Elasticsearch is not supported in Geo.

View File

@ -66,7 +66,7 @@ Learn how to install, configure, update, and maintain your GitLab instance.
- [Broadcast Messages](../user/admin_area/broadcast_messages.md): Send messages
to GitLab users through the UI.
- [Elasticsearch](../integration/advanced_search/elasticsearch.md): Enable Elasticsearch to
empower Advanced Search. Use when you deal with a huge amount of data.
empower advanced search. Use when you deal with a huge amount of data.
- [External Classification Policy Authorization](../user/admin_area/settings/external_authorization.md)
- [Add a license](../user/admin_area/license.md): Add a license to unlock
features that are in paid tiers of GitLab.

View File

@ -922,7 +922,7 @@ Reports that go over the 20 MB limit aren't loaded. Affected reports:
- [CI/CD parameter `artifacts:expose_as`](../ci/yaml/index.md#artifactsexpose_as)
- [Unit test reports](../ci/testing/unit_test_reports.md)
## Advanced Search limits
## Advanced search limits
### Maximum file size indexed
@ -945,7 +945,7 @@ is pre-allocated during indexing.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/201826) in GitLab 12.8.
You can set a limit on the content of text fields indexed for Advanced Search.
You can set a limit on the content of text fields indexed for advanced search.
Setting a maximum helps to reduce the load of the indexing processes. If any
text field exceeds this limit, then the text is truncated to this number of
characters. The rest of the text is not indexed, and not searchable.

View File

@ -180,7 +180,7 @@ In addition, the log contains the originating IP address,
(`remote_ip`), the user's ID (`user_id`), and username (`username`).
Some endpoints (such as `/search`) may make requests to Elasticsearch if using
[Advanced Search](../../user/search/advanced_search.md). These
[advanced search](../../user/search/advanced_search.md). These
additionally log `elasticsearch_calls` and `elasticsearch_call_duration_s`,
which correspond to:

View File

@ -170,7 +170,7 @@ To set up GitLab and its components to accommodate up to 10,000 users:
environment.
1. [Configure the object storage](#configure-the-object-storage)
used for shared data objects.
1. [Configure Advanced Search](#configure-advanced-search) (optional) for faster,
1. [Configure advanced search](#configure-advanced-search) (optional) for faster,
more advanced code search across your entire GitLab instance.
The servers start on the same 10.6.0.0/24 private network range, and can
@ -2223,9 +2223,9 @@ GitLab Runner returns job logs in chunks which Omnibus GitLab caches temporarily
While sharing the job logs through NFS is supported, it's recommended to avoid the need to use NFS by enabling [incremental logging](../job_logs.md#incremental-logging-architecture) (required when no NFS node has been deployed). Incremental logging uses Redis instead of disk space for temporary caching of job logs.
## Configure Advanced Search
## Configure advanced search
You can leverage Elasticsearch and [enable Advanced Search](../../integration/advanced_search/elasticsearch.md)
You can leverage Elasticsearch and [enable advanced search](../../integration/advanced_search/elasticsearch.md)
for faster, more advanced code search across your entire GitLab instance.
Elasticsearch cluster design and requirements are dependent on your specific

View File

@ -78,9 +78,9 @@ You can also optionally configure GitLab to use an [external PostgreSQL service]
or an [external object storage service](../object_storage.md) for added
performance and reliability at an increased complexity cost.
## Configure Advanced Search **(PREMIUM SELF)**
## Configure advanced search **(PREMIUM SELF)**
You can leverage Elasticsearch and [enable Advanced Search](../../integration/advanced_search/elasticsearch.md)
You can leverage Elasticsearch and [enable advanced search](../../integration/advanced_search/elasticsearch.md)
for faster, more advanced code search across your entire GitLab instance.
Elasticsearch cluster design and requirements are dependent on your specific

View File

@ -170,7 +170,7 @@ To set up GitLab and its components to accommodate up to 25,000 users:
environment.
1. [Configure the object storage](#configure-the-object-storage)
used for shared data objects.
1. [Configure Advanced Search](#configure-advanced-search) (optional) for faster,
1. [Configure advanced search](#configure-advanced-search) (optional) for faster,
more advanced code search across your entire GitLab instance.
The servers start on the same 10.6.0.0/24 private network range, and can
@ -2241,9 +2241,9 @@ GitLab Runner returns job logs in chunks which Omnibus GitLab caches temporarily
While sharing the job logs through NFS is supported, it's recommended to avoid the need to use NFS by enabling [incremental logging](../job_logs.md#incremental-logging-architecture) (required when no NFS node has been deployed). Incremental logging uses Redis instead of disk space for temporary caching of job logs.
## Configure Advanced Search
## Configure advanced search
You can leverage Elasticsearch and [enable Advanced Search](../../integration/advanced_search/elasticsearch.md)
You can leverage Elasticsearch and [enable advanced search](../../integration/advanced_search/elasticsearch.md)
for faster, more advanced code search across your entire GitLab instance.
Elasticsearch cluster design and requirements are dependent on your specific

View File

@ -101,7 +101,7 @@ To set up GitLab and its components to accommodate up to 2,000 users:
environment.
1. [Configure the object storage](#configure-the-object-storage) used for
shared data objects.
1. [Configure Advanced Search](#configure-advanced-search) (optional) for faster,
1. [Configure advanced search](#configure-advanced-search) (optional) for faster,
more advanced code search across your entire GitLab instance.
## Configure the external load balancer
@ -911,9 +911,9 @@ GitLab Runner returns job logs in chunks which Omnibus GitLab caches temporarily
While sharing the job logs through NFS is supported, it's recommended to avoid the need to use NFS by enabling [incremental logging](../job_logs.md#incremental-logging-architecture) (required when no NFS node has been deployed). Incremental logging uses Redis instead of disk space for temporary caching of job logs.
## Configure Advanced Search **(PREMIUM SELF)**
## Configure advanced search **(PREMIUM SELF)**
You can leverage Elasticsearch and [enable Advanced Search](../../integration/advanced_search/elasticsearch.md)
You can leverage Elasticsearch and [enable advanced search](../../integration/advanced_search/elasticsearch.md)
for faster, more advanced code search across your entire GitLab instance.
Elasticsearch cluster design and requirements are dependent on your specific

View File

@ -176,7 +176,7 @@ To set up GitLab and its components to accommodate up to 3,000 users:
environment.
1. [Configure the object storage](#configure-the-object-storage)
used for shared data objects.
1. [Configure Advanced Search](#configure-advanced-search) (optional) for faster,
1. [Configure advanced search](#configure-advanced-search) (optional) for faster,
more advanced code search across your entire GitLab instance.
The servers start on the same 10.6.0.0/24 private network range, and can
@ -2188,9 +2188,9 @@ GitLab Runner returns job logs in chunks which Omnibus GitLab caches temporarily
While sharing the job logs through NFS is supported, it's recommended to avoid the need to use NFS by enabling [incremental logging](../job_logs.md#incremental-logging-architecture) (required when no NFS node has been deployed). Incremental logging uses Redis instead of disk space for temporary caching of job logs.
## Configure Advanced Search
## Configure advanced search
You can leverage Elasticsearch and [enable Advanced Search](../../integration/advanced_search/elasticsearch.md)
You can leverage Elasticsearch and [enable advanced search](../../integration/advanced_search/elasticsearch.md)
for faster, more advanced code search across your entire GitLab instance.
Elasticsearch cluster design and requirements are dependent on your specific

View File

@ -170,7 +170,7 @@ To set up GitLab and its components to accommodate up to 50,000 users:
environment.
1. [Configure the object storage](#configure-the-object-storage)
used for shared data objects.
1. [Configure Advanced Search](#configure-advanced-search) (optional) for faster,
1. [Configure advanced search](#configure-advanced-search) (optional) for faster,
more advanced code search across your entire GitLab instance.
The servers start on the same 10.6.0.0/24 private network range, and can
@ -2240,9 +2240,9 @@ GitLab Runner returns job logs in chunks which Omnibus GitLab caches temporarily
While sharing the job logs through NFS is supported, it's recommended to avoid the need to use NFS by enabling [incremental logging](../job_logs.md#incremental-logging-architecture) (required when no NFS node has been deployed). Incremental logging uses Redis instead of disk space for temporary caching of job logs.
## Configure Advanced Search
## Configure advanced search
You can leverage Elasticsearch and [enable Advanced Search](../../integration/advanced_search/elasticsearch.md)
You can leverage Elasticsearch and [enable advanced search](../../integration/advanced_search/elasticsearch.md)
for faster, more advanced code search across your entire GitLab instance.
Elasticsearch cluster design and requirements are dependent on your specific

View File

@ -173,7 +173,7 @@ To set up GitLab and its components to accommodate up to 5,000 users:
environment.
1. [Configure the object storage](#configure-the-object-storage)
used for shared data objects.
1. [Configure Advanced Search](#configure-advanced-search) (optional) for faster,
1. [Configure advanced search](#configure-advanced-search) (optional) for faster,
more advanced code search across your entire GitLab instance.
The servers start on the same 10.6.0.0/24 private network range, and can
@ -2187,9 +2187,9 @@ GitLab Runner returns job logs in chunks which Omnibus GitLab caches temporarily
While sharing the job logs through NFS is supported, it's recommended to avoid the need to use NFS by enabling [incremental logging](../job_logs.md#incremental-logging-architecture) (required when no NFS node has been deployed). Incremental logging uses Redis instead of disk space for temporary caching of job logs.
## Configure Advanced Search
## Configure advanced search
You can leverage Elasticsearch and [enable Advanced Search](../../integration/advanced_search/elasticsearch.md)
You can leverage Elasticsearch and [enable advanced search](../../integration/advanced_search/elasticsearch.md)
for faster, more advanced code search across your entire GitLab instance.
Elasticsearch cluster design and requirements are dependent on your specific

View File

@ -31,8 +31,8 @@ GET /search
| `scope` | string | Yes | The scope to search in. Values include `projects`, `issues`, `merge_requests`, `milestones`, `snippet_titles`, `users`. [Additional scopes](#additional-scopes): `blobs`, `commits`, `notes`, `wiki_blobs`. |
| `search` | string | Yes | The search query. |
| `confidential` | boolean | No | Filter by confidentiality. Supports `issues` scope; other scopes are ignored. |
| `order_by` | string | No | Allowed values are `created_at` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for Advanced Search.|
| `sort` | string | No | Allowed values are `asc` or `desc` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for Advanced Search.|
| `order_by` | string | No | Allowed values are `created_at` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for advanced search.|
| `sort` | string | No | Allowed values are `asc` or `desc` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for advanced search.|
| `state` | string | No | Filter by state. Supports `issues` and `merge_requests` scopes; other scopes are ignored. |
### Scope: `projects`
@ -450,8 +450,8 @@ GET /groups/:id/search
| `scope` | string | Yes | The scope to search in. Values include `issues`, `merge_requests`, `milestones`, `projects`, `users`. [Additional scopes](#additional-scopes): `blobs`, `commits`, `notes`, `wiki_blobs`. |
| `search` | string | Yes | The search query. |
| `confidential` | boolean | No | Filter by confidentiality. Supports only `issues` scope; other scopes are ignored. |
| `order_by` | string | No | Allowed values are `created_at` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for Advanced Search.|
| `sort` | string | No | Allowed values are `asc` or `desc` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for Advanced Search.|
| `order_by` | string | No | Allowed values are `created_at` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for advanced search.|
| `sort` | string | No | Allowed values are `asc` or `desc` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for advanced search.|
| `state` | string | No | Filter by state. Supports `issues` and `merge_requests` only; other scopes are ignored. |
The response depends on the requested scope.
@ -841,8 +841,8 @@ GET /projects/:id/search
| `search` | string | Yes | The search query. |
| `confidential` | boolean | No | Filter by confidentiality. Supports `issues` scope; other scopes are ignored. |
| `ref` | string | No | The name of a repository branch or tag to search on. The project's default branch is used by default. Applicable only for scopes `blobs`, `commits`, and `wiki_blobs`. |
| `order_by` | string | No | Allowed values are `created_at` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for Advanced Search.|
| `sort` | string | No | Allowed values are `asc` or `desc` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for Advanced Search.|
| `order_by` | string | No | Allowed values are `created_at` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for advanced search.|
| `sort` | string | No | Allowed values are `asc` or `desc` only. If not set, results are sorted by `created_at` in descending order for basic search, or by the most relevant documents for advanced search.|
| `state` | string | No | Filter by state. Supports the `issues` and `merge_requests` scopes; other scopes are ignored. |
The response depends on the requested scope.

View File

@ -57,7 +57,7 @@ customers that wish to participate in the trial.
The main goals of this integration will be to implement the following highly
requested improvements to code search:
1. [Exact match (substring match) code searches in Advanced Search](https://gitlab.com/gitlab-org/gitlab/-/issues/325234)
1. [Exact match (substring match) code searches in advanced search](https://gitlab.com/gitlab-org/gitlab/-/issues/325234)
1. [Support regular expressions with Advanced Global Search](https://gitlab.com/gitlab-org/gitlab/-/issues/4175)
1. [Support multiple line matches in the same file](https://gitlab.com/gitlab-org/gitlab/-/issues/668)

View File

@ -4,7 +4,7 @@ group: Global Search
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Advanced Search development
# Advanced search development
This page includes information about developing and working with Elasticsearch.

View File

@ -448,7 +448,7 @@ Consul is a tool for service discovery and configuration. Consul is distributed,
- [Source](../integration/advanced_search/elasticsearch.md)
- [GDK](https://gitlab.com/gitlab-org/gitlab-development-kit/blob/main/doc/howto/elasticsearch.md)
- Layer: Core Service (Data)
- GitLab.com: [Get Advanced Search working on GitLab.com (Closed)](https://gitlab.com/groups/gitlab-org/-/epics/153) epic.
- GitLab.com: [Get advanced search working on GitLab.com (Closed)](https://gitlab.com/groups/gitlab-org/-/epics/153) epic.
Elasticsearch is a distributed RESTful search engine built for the cloud.

View File

@ -94,7 +94,7 @@ EE: true
uses system fonts for all text."
- Any client-facing change to our REST and GraphQL APIs **must** have a changelog entry.
See the [complete list what comprises a GraphQL breaking change](api_graphql_styleguide.md#breaking-changes).
- Any change that introduces an [Advanced Search migration](search/advanced_search_migration_styleguide.md#creating-a-new-advanced-search-migration)
- Any change that introduces an [advanced search migration](search/advanced_search_migration_styleguide.md#creating-a-new-advanced-search-migration)
**must** have a changelog entry.
- A fix for a regression introduced and then fixed in the same release (such as
fixing a bug introduced during a monthly release candidate) **should not**

View File

@ -57,13 +57,6 @@ Possible version history entries are:
> - [Generally available](issue-link) in GitLab X.Y. Feature flag `flag_name` removed.
```
You can combine entries if they happened in the same release:
```markdown
> - Introduced in GitLab 14.2 [with a flag](../../administration/feature_flags.md) named `ci_include_rules`. Disabled by default.
> - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/337507) in GitLab 14.3.
```
## Use a note to describe the state of the feature flag
Information about feature flags should be in a `FLAG` note at the start of the topic (just below the version history).
@ -144,3 +137,41 @@ And, when the feature is done and fully available to all users:
> - [Enabled on GitLab.com](https://gitlab.com/issue/etc) in GitLab 13.9.
> - [Generally available](issue-link) in GitLab 14.0. Feature flag `forti_token_cloud` removed.
```
## Simplify long version history
The version history can get long, but you can sometimes simplify or remove entries.
Combine entries if they happened in the same release:
- Before:
```markdown
> - [Introduced](issue-link) in GitLab 14.2 [with a flag](../../administration/feature_flags.md) named `ci_include_rules`. Disabled by default.
> - [Enabled on GitLab.com](issue-link) in GitLab 14.3.
> - [Enabled on self-managed](issue-link) in GitLab 14.3.
```
- After:
```markdown
> - [Introduced](issue-link) in GitLab 14.2 [with a flag](../../administration/feature_flags.md) named `ci_include_rules`. Disabled by default.
> - [Enabled on GitLab.com and self-managed](issue-link) in GitLab 14.3.
```
Remove `Enabled on GitLab.com` entries when the feature is enabled by default for both GitLab.com and self-managed:
- Before:
```markdown
> - [Introduced](issue-link) in GitLab 15.6 [with a flag](../../administration/feature_flags.md) named `ci_hooks_pre_get_sources_script`. Disabled by default.
> - [Enabled on GitLab.com](issue-link) in GitLab 15.9.
> - [Generally available](issue-link) in GitLab 15.10. Feature flag `ci_hooks_pre_get_sources_script` removed.
```
- After:
```markdown
> - [Introduced](issue-link) in GitLab 15.6 [with a flag](../../administration/feature_flags.md) named `ci_hooks_pre_get_sources_script`. Disabled by default.
> - [Generally available](issue-link) in GitLab 15.10. Feature flag `ci_hooks_pre_get_sources_script` removed.
```

View File

@ -82,6 +82,11 @@ If you can add the phrase "by zombies" to the phrase,
the construction is passive. For example, `The button is selected by zombies`
is passive. `Zombies select the button` is active.
## Admin Area
Use title case for **Admin Area** to refer to the area of the UI that you access when you select **Main menu > Admin**.
This area of the UI says **Admin Area** at the top of the page and on the menu.
## administrator
Use **administrator access** instead of **admin** when talking about a user's access level.
@ -99,10 +104,9 @@ Instead of:
- To do this thing, you must have the Admin role.
## Admin Area
## advanced search
Use title case **Admin Area** to refer to the area of the UI that you access when you select **Main menu > Admin**.
This area of the UI says **Admin Area** at the top of the page and on the menu.
Use lowercase for **advanced search** to refer to the faster, more efficient search across the entire GitLab instance.
## agent
@ -113,7 +117,7 @@ For example:
- Install the agent in your cluster.
- Select an agent from the list.
Do not use title case **GitLab Agent** or **GitLab Agent for Kubernetes**.
Do not use title case for **GitLab Agent** or **GitLab Agent for Kubernetes**.
## agent access token

View File

@ -79,7 +79,7 @@ Consult these topics for information on contributing to specific GitLab features
- [Adding a new Redis instance](redis/new_redis_instance.md)
- [Sidekiq guidelines](sidekiq/index.md) for working with Sidekiq workers
- [Working with Gitaly](gitaly.md)
- [Advanced Search integration docs](advanced_search.md)
- [Advanced search integration docs](advanced_search.md)
- [Working with merge request diffs](diffs.md)
- [Approval Rules](merge_request_concepts/approval_rules.md)
- [Repository mirroring](repository_mirroring.md)

View File

@ -67,7 +67,7 @@ listed here that also do not work properly in FIPS mode:
- [Static Application Security Testing (SAST)](../user/application_security/sast/index.md)
supports a reduced set of [analyzers](../user/application_security/sast/index.md#fips-enabled-images)
when operating in FIPS-compliant mode.
- Advanced Search is currently not included in FIPS mode. It must not be enabled to be FIPS-compliant.
- Advanced search is currently not included in FIPS mode. It must not be enabled to be FIPS-compliant.
- [Gravatar or Libravatar-based profile images](../administration/libravatar.md) are not FIPS-compliant.
Additionally, these package repositories are disabled in FIPS mode:

View File

@ -249,6 +249,15 @@ To expose the integration in the [REST API](../../api/integrations.md):
You can also refer to our [REST API style guide](../api_styleguide.md).
Sensitive fields are not exposed over the API. Sensitive fields are those fields that contain any of the following in their name:
- `key`
- `passphrase`
- `password`
- `secret`
- `token`
- `webhook`
#### GraphQL API
Integrations use the `Types::Projects::ServiceType` type by default,

View File

@ -4,9 +4,9 @@ group: Global Search
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Advanced Search migration style guide
# Advanced search migration style guide
## Creating a new Advanced Search migration
## Creating a new advanced search migration
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/234046) in GitLab 13.6.
@ -217,13 +217,13 @@ end
### Multi-version compatibility
These Advanced Search migrations, like any other GitLab changes, need to support the case where
These advanced search migrations, like any other GitLab changes, need to support the case where
[multiple versions of the application are running at the same time](../multi_version_compatibility.md).
Depending on the order of deployment, it's possible that the migration
has started or finished and there's still a server running the application code from before the
migration. We need to take this into consideration until we can
[ensure all Advanced Search migrations start after the deployment has finished](https://gitlab.com/gitlab-org/gitlab/-/issues/321619).
[ensure all advanced search migrations start after the deployment has finished](https://gitlab.com/gitlab-org/gitlab/-/issues/321619).
### Reverting a migration
@ -236,7 +236,7 @@ some data is moved) to a later merge request after the migrations have
completed successfully. To be safe, for self-managed customers we should also
defer it to another release if there is risk of important data loss.
### Best practices for Advanced Search migrations
### Best practices for advanced search migrations
Follow these best practices for best results:
@ -253,9 +253,9 @@ Follow these best practices for best results:
- Consider adding a retry limit if there is potential for the migration to fail.
This ensures that migrations can be halted if an issue occurs.
## Deleting Advanced Search migrations in a major version upgrade
## Deleting advanced search migrations in a major version upgrade
Because our Advanced Search migrations usually require us to support multiple
Because our advanced search migrations usually require us to support multiple
code paths for a long period of time, it's important to clean those up when we
safely can.
@ -265,7 +265,7 @@ backwards compatibility for indices that have not been fully migrated. We
We also choose to replace the migration code with the halted migration
and remove tests so that:
- We don't need to maintain any code that is called from our Advanced Search
- We don't need to maintain any code that is called from our advanced search
migrations.
- We don't waste CI time running tests for migrations that we don't support
anymore.
@ -281,7 +281,7 @@ GitLab.com to `%14.0` before the migrations in `%13.12` were finished. Because
our deployments to GitLab.com are automated and we don't have
automated checks to prevent this, the extra precaution is warranted.
Additionally, even if we did have automated checks to prevent it, we wouldn't
actually want to hold up GitLab.com deployments on Advanced Search migrations,
actually want to hold up GitLab.com deployments on advanced search migrations,
as they may still have another week to go, and that's too long to block
deployments.

View File

@ -43,7 +43,7 @@ Have a look at some of our most popular topics:
| [Activate GitLab EE with a license](user/admin_area/license.md) | Activate GitLab Enterprise Edition functionality with a license. |
| [Back up and restore GitLab](raketasks/backup_restore.md) | Rake tasks for backing up and restoring GitLab self-managed instances. |
| [GitLab release and maintenance policy](policy/maintenance.md) | Policies for version naming and cadence, and also upgrade recommendations. |
| [Elasticsearch integration](integration/advanced_search/elasticsearch.md) | Integrate Elasticsearch with GitLab to enable advanced searching. |
| [Elasticsearch integration](integration/advanced_search/elasticsearch.md) | Integrate Elasticsearch with GitLab to enable advanced search. |
| [Omnibus GitLab database settings](https://docs.gitlab.com/omnibus/settings/database.html) | Database settings for Omnibus GitLab self-managed instances. |
| [Omnibus GitLab NGINX settings](https://docs.gitlab.com/omnibus/settings/nginx.html) | NGINX settings for Omnibus GitLab self-managed instances. |
| [Omnibus GitLab SSL configuration](https://docs.gitlab.com/omnibus/settings/ssl.html) | SSL settings for Omnibus GitLab self-managed instances. |

View File

@ -56,7 +56,7 @@ installation.
## Cross-repository Code Search
- [Advanced Search](../integration/advanced_search/elasticsearch.md): Leverage [Elasticsearch](https://www.elastic.co/) or [OpenSearch](https://opensearch.org/) for
- [Advanced search](../integration/advanced_search/elasticsearch.md): Leverage [Elasticsearch](https://www.elastic.co/) or [OpenSearch](https://opensearch.org/) for
faster, more advanced code search across your entire GitLab instance.
## Scaling and replication

View File

@ -7,8 +7,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Elasticsearch **(PREMIUM SELF)**
This page describes how to enable Advanced Search. When enabled,
Advanced Search provides faster search response times and [improved search features](../../user/search/advanced_search.md).
This page describes how to enable advanced search. When enabled,
advanced search provides faster search response times and [improved search features](../../user/search/advanced_search.md).
## Version requirements
@ -16,7 +16,7 @@ Advanced Search provides faster search response times and [improved search featu
> Support for Elasticsearch 6.8 was [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/350275) in GitLab 15.0.
Advanced Search works with the following versions of Elasticsearch.
Advanced search works with the following versions of Elasticsearch.
| GitLab version | Elasticsearch version |
|-----------------------|--------------------------|
@ -25,7 +25,7 @@ Advanced Search works with the following versions of Elasticsearch.
| GitLab 13.3 - 13.8 | Elasticsearch 6.4 - 7.x |
| GitLab 12.7 - 13.2 | Elasticsearch 6.x - 7.x |
Advanced Search follows the [Elasticsearch end-of-life policy](https://www.elastic.co/support/eol).
Advanced search follows the [Elasticsearch end-of-life policy](https://www.elastic.co/support/eol).
When we change Elasticsearch supported versions in GitLab, we announce them in [deprecation notes](https://about.gitlab.com/handbook/marketing/blog/release-posts/#deprecations) in monthly release posts
before we remove them.
@ -46,7 +46,7 @@ If you are using a compatible version and after connecting to OpenSearch, you ge
Elasticsearch requires additional resources to those documented in the
[GitLab system requirements](../../install/requirements.md).
Memory, CPU, and storage resource amounts vary depending on the amount of data you index into the Elasticsearch cluster. Heavily used Elasticsearch clusters may require more resources. The [`estimate_cluster_size`](#gitlab-advanced-search-rake-tasks) Rake task ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/221177) in GitLab 13.10) uses the total repository size to estimate the Advanced Search storage requirements.
Memory, CPU, and storage resource amounts vary depending on the amount of data you index into the Elasticsearch cluster. Heavily used Elasticsearch clusters may require more resources. The [`estimate_cluster_size`](#gitlab-advanced-search-rake-tasks) Rake task ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/221177) in GitLab 13.10) uses the total repository size to estimate the advanced search storage requirements.
## Install Elasticsearch
@ -163,20 +163,20 @@ Errors from the [GitLab Elasticsearch Indexer](https://gitlab.com/gitlab-org/git
the [`elasticsearch.log`](../../administration/logs/index.md#elasticsearchlog) file and the [`sidekiq.log`](../../administration/logs/index.md#sidekiqlog) file with a `json.exception.class` of `Gitlab::Elastic::Indexer::Error`.
These errors may occur when indexing Git repository data.
## Enable Advanced Search
## Enable advanced search
For GitLab instances with more than 50 GB repository data you can follow the instructions for [how to index large instances efficiently](#how-to-index-large-instances-efficiently) below.
To enable Advanced Search, you must have administrator access to GitLab:
To enable advanced search, you must have administrator access to GitLab:
1. On the top bar, select **Main menu > Admin**.
1. On the left sidebar, select **Settings > Advanced Search**.
NOTE:
To see the Advanced Search section, you need an active GitLab Premium
To see the **Advanced Search** section, you need an active GitLab Premium
[license](../../user/admin_area/license.md).
1. Configure the [Advanced Search settings](#advanced-search-configuration) for
1. Configure the [advanced search settings](#advanced-search-configuration) for
your Elasticsearch cluster. Do not enable **Search with Elasticsearch enabled**
yet.
1. Enable **Elasticsearch indexing** and select **Save changes**. This creates
@ -202,7 +202,7 @@ you might have problems updating documents such as issues because your
instance queues a job to index the change, but cannot find a valid
Elasticsearch cluster.
### Advanced Search configuration
### Advanced search configuration
The following Elasticsearch settings are available:
@ -294,16 +294,16 @@ For more information, see [Identity and Access Management in Amazon OpenSearch S
When using fine-grained access control with a user in the internal database, you should use HTTP basic
authentication to connect to OpenSearch. You can provide the master username and password as part of the
OpenSearch URL or in the **Username** and **Password** text boxes in the Advanced Search settings. See
OpenSearch URL or in the **Username** and **Password** text boxes in the advanced search settings. See
[Tutorial: Internal user database and HTTP basic authentication](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac-walkthrough-basic.html) for details.
##### Connecting with an IAM user
When using fine-grained access control with IAM credentials, you can provide the credentials in the **AWS OpenSearch IAM credentials** section in the Advanced Search settings.
When using fine-grained access control with IAM credentials, you can provide the credentials in the **AWS OpenSearch IAM credentials** section in the advanced search settings.
##### Permissions for fine-grained access control
The following permissions are required for Advanced Search. See [Creating roles](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-roles) for details.
The following permissions are required for advanced search. See [Creating roles](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-roles) for details.
```json
{
@ -338,7 +338,7 @@ The following permissions are required for Advanced Search. See [Creating roles]
}
```
The index pattern `*` requires a few permissions for Advanced Search to work.
The index pattern `*` requires a few permissions for advanced search to work.
### Limit the number of namespaces and projects that can be indexed
@ -350,14 +350,14 @@ under **Elasticsearch indexing restrictions** more options become available.
You can select namespaces and projects to index exclusively. If the namespace is a group, it includes
any subgroups and projects belonging to those subgroups to be indexed as well.
Advanced Search only provides cross-group code/commit search (global) if all name-spaces are indexed. In this particular scenario where only a subset of namespaces are indexed, a global search does not provide a code or commit scope. This is possible only in the scope of an indexed namespace. There is no way to code/commit search in multiple indexed namespaces (when only a subset of namespaces has been indexed). For example if two groups are indexed, there is no way to run a single code search on both. You can only run a code search on the first group and then on the second.
Advanced search only provides cross-group code/commit search (global) if all name-spaces are indexed. In this particular scenario where only a subset of namespaces are indexed, a global search does not provide a code or commit scope. This is possible only in the scope of an indexed namespace. There is no way to code/commit search in multiple indexed namespaces (when only a subset of namespaces has been indexed). For example if two groups are indexed, there is no way to run a single code search on both. You can only run a code search on the first group and then on the second.
You can filter the selection dropdown list by writing part of the namespace or project name you're interested in.
![limit namespace filter](img/limit_namespace_filter.png)
NOTE:
If no namespaces or projects are selected, no Advanced Search indexing takes place.
If no namespaces or projects are selected, no advanced search indexing takes place.
WARNING:
If you have already indexed your instance, you must regenerate the index to delete all existing data
@ -385,11 +385,11 @@ For guidance on what to install, see the following Elasticsearch language plugin
| Parameter | Description |
|-------------------------------------------------------|-------------|
| `Enable Chinese (smartcn) custom analyzer: Indexing` | Enables or disables Chinese language support using [`smartcn`](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-smartcn.html) custom analyzer for newly created indices.|
| `Enable Chinese (smartcn) custom analyzer: Search` | Enables or disables using [`smartcn`](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-smartcn.html) fields for Advanced Search. Only enable this after [installing the plugin](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-smartcn.html), enabling custom analyzer indexing and recreating the index.|
| `Enable Chinese (smartcn) custom analyzer: Search` | Enables or disables using [`smartcn`](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-smartcn.html) fields for advanced search. Only enable this after [installing the plugin](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-smartcn.html), enabling custom analyzer indexing and recreating the index.|
| `Enable Japanese (kuromoji) custom analyzer: Indexing` | Enables or disables Japanese language support using [`kuromoji`](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-kuromoji.html) custom analyzer for newly created indices.|
| `Enable Japanese (kuromoji) custom analyzer: Search` | Enables or disables using [`kuromoji`](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-kuromoji.html) fields for Advanced Search. Only enable this after [installing the plugin](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-kuromoji.html), enabling custom analyzer indexing and recreating the index.|
| `Enable Japanese (kuromoji) custom analyzer: Search` | Enables or disables using [`kuromoji`](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-kuromoji.html) fields for advanced search. Only enable this after [installing the plugin](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-kuromoji.html), enabling custom analyzer indexing and recreating the index.|
## Disable Advanced Search
## Disable advanced search
To disable the Elasticsearch integration:
@ -423,7 +423,7 @@ the writes to the `primary` index. Then, we create another index and invoke the
index data onto the new index. After the reindexing job is complete, we switch to the new index by connecting the
index alias to it which becomes the new `primary` index. At the end, we resume the writes and typical operation resumes.
### Trigger the reindex via the Advanced Search administration
### Trigger the reindex via the advanced search administration
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34069) in GitLab 13.2.
> - A scheduled index deletion and the ability to cancel it was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38914) in GitLab 13.3.
@ -502,15 +502,15 @@ Sometimes, you might want to abandon the unfinished reindex job and resume the i
1. Expand **Advanced Search**.
1. Clear the **Pause Elasticsearch indexing** checkbox.
## Advanced Search migrations
## Advanced search migrations
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/234046) in GitLab 13.6.
With reindex migrations running in the background, there's no need for a manual
intervention. This usually happens in situations where new features are added to
Advanced Search, which means adding or changing the way content is indexed.
advanced search, which means adding or changing the way content is indexed.
To confirm that the Advanced Search migrations ran, you can check with:
To confirm that the advanced search migrations ran, you can check with:
```shell
curl "$CLUSTER_URL/gitlab-production-migrations/_search?q=*" | jq .
@ -554,7 +554,7 @@ To debug issues with the migrations you can check the [`elasticsearch.log` file]
### Retry a halted migration
Some migrations are built with a retry limit. If the migration cannot finish within the retry limit,
it is halted and a notification is displayed in the Advanced Search integration settings.
it is halted and a notification is displayed in the advanced search integration settings.
It is recommended to check the [`elasticsearch.log` file](../../administration/logs/index.md#elasticsearchlog) to
debug why the migration was halted and make any changes before retrying the migration. Once you believe you've
fixed the cause of the failure, select "Retry migration", and the migration is scheduled to be retried
@ -575,7 +575,7 @@ version. If you have halted migrations, these need to be resolved and
[retried](#retry-a-halted-migration) before proceeding with a major version
upgrade. Read more about [upgrading to a new major version](../../update/index.md#upgrading-to-a-new-major-version).
## GitLab Advanced Search Rake tasks
## GitLab advanced search Rake tasks
Rake tasks are available to:
@ -587,7 +587,7 @@ The following are some available Rake tasks:
| Task | Description |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`sudo gitlab-rake gitlab:elastic:info`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | Outputs debugging information for the Advanced Search integration. |
| [`sudo gitlab-rake gitlab:elastic:info`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | Outputs debugging information for the advanced search integration. |
| [`sudo gitlab-rake gitlab:elastic:index`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | Enables Elasticsearch indexing and run `gitlab:elastic:create_empty_index`, `gitlab:elastic:clear_index_status`, `gitlab:elastic:index_projects`, `gitlab:elastic:index_snippets`, and `gitlab:elastic:index_users`. |
| [`sudo gitlab-rake gitlab:elastic:pause_indexing`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | Pauses Elasticsearch indexing. Changes are still tracked. Useful for cluster/index migrations. |
| [`sudo gitlab-rake gitlab:elastic:resume_indexing`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | Resumes Elasticsearch indexing. |
@ -604,7 +604,7 @@ The following are some available Rake tasks:
| [`sudo gitlab-rake gitlab:elastic:mark_reindex_failed`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | Mark the most recent re-index job as failed. |
| [`sudo gitlab-rake gitlab:elastic:list_pending_migrations`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | List pending migrations. Pending migrations include those that have not yet started, have started but not finished, and those that are halted. |
| [`sudo gitlab-rake gitlab:elastic:estimate_cluster_size`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | Get an estimate of cluster size based on the total repository size. |
| [`sudo gitlab-rake gitlab:elastic:enable_search_with_elasticsearch`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | Enable advanced search with Elasticsearch. |
| [`sudo gitlab-rake gitlab:elastic:enable_search_with_elasticsearch`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | Enables advanced search with Elasticsearch. |
| [`sudo gitlab-rake gitlab:elastic:disable_search_with_elasticsearch`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/tasks/gitlab/elastic.rake) | Disables advanced search with Elasticsearch. |
### Environment variables
@ -633,7 +633,7 @@ Indexing project repositories...I, [2019-03-04T21:27:03.083410 #3384] INFO -- :
I, [2019-03-04T21:27:05.215266 #3384] INFO -- : Indexing GitLab User / test (ID=33) is done!
```
## Advanced Search index scopes
## Advanced search index scopes
When performing a search, the GitLab index uses the following scopes:
@ -671,7 +671,7 @@ For basic guidance on choosing a cluster configuration you may refer to [Elastic
- `refresh_interval` is a per index setting. You may want to adjust that from default `1s` to a bigger value if you don't need data in real-time. This changes how soon you see fresh results. If that's important for you, you should leave it as close as possible to the default value.
- You might want to raise [`indices.memory.index_buffer_size`](https://www.elastic.co/guide/en/elasticsearch/reference/current/indexing-buffer.html) to 30% or 40% if you have a lot of heavy indexing operations.
### Advanced Search integration settings guidance
### Advanced search integration settings guidance
- The `Number of Elasticsearch shards` setting usually corresponds with the number of CPUs available in your cluster. For example, if you have a 3-node cluster with 4 cores each, this means you benefit from having at least 3*4=12 shards in the cluster. It's only possible to change the shards number by using [Split index API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-split-index.html) or by reindexing to a different index with a changed number of shards.
- The `Number of Elasticsearch replicas` setting should most of the time be equal to `1` (each shard has 1 replica). Using `0` is not recommended, because losing one node corrupts the index.
@ -976,7 +976,7 @@ for the changes to take effect.
Sometimes there may be issues with your Elasticsearch index data and as such
GitLab allows you to revert to "basic search" when there are no search
results and assuming that basic search is supported in that scope. This "basic
search" behaves as though you don't have Advanced Search enabled at all for
search" behaves as though you don't have advanced search enabled at all for
your instance and search using other data sources (such as PostgreSQL data and Git
data).

View File

@ -101,12 +101,12 @@ Here are some common pitfalls and how to overcome them.
There are a couple of ways to achieve that:
- When you perform a search, in the upper-right corner of the search results page,
**Advanced search functionality is enabled** is displayed.
**Advanced search is enabled** is displayed.
This is always correctly identifying whether the current project/namespace
being searched is using Elasticsearch.
- From the Admin Area under **Settings > Advanced Search** check that the
Advanced Search settings are checked.
advanced search settings are checked.
Those same settings there can be obtained from the Rails console if necessary:
@ -212,7 +212,7 @@ More [complex Elasticsearch API calls](https://www.elastic.co/guide/en/elasticse
If the results:
- Sync up, check that you are using [supported syntax](../../user/search/advanced_search.md#syntax). Advanced Search does not support [exact substring matching](https://gitlab.com/gitlab-org/gitlab/-/issues/325234).
- Sync up, check that you are using [supported syntax](../../user/search/advanced_search.md#syntax). Advanced search does not support [exact substring matching](https://gitlab.com/gitlab-org/gitlab/-/issues/325234).
- Do not match up, this indicates a problem with the documents generated from the project. It is best to [re-index that project](../advanced_search/elasticsearch.md#indexing-a-range-of-projects-or-a-specific-project).
NOTE:
@ -247,7 +247,7 @@ sudo gitlab-rake gitlab:elastic:clear_locked_projects
If `ElasticCommitIndexerWorker` Sidekiq workers are failing with this error during indexing, it usually means that Elasticsearch is unable to keep up with the concurrency of indexing request. To address change the following settings:
- To decrease the indexing throughput you can decrease `Bulk request concurrency` (see [Advanced Search settings](elasticsearch.md#advanced-search-configuration)). This is set to `10` by default, but you change it to as low as 1 to reduce the number of concurrent indexing operations.
- To decrease the indexing throughput you can decrease `Bulk request concurrency` (see [Advanced search settings](elasticsearch.md#advanced-search-configuration)). This is set to `10` by default, but you change it to as low as 1 to reduce the number of concurrent indexing operations.
- If changing `Bulk request concurrency` didn't help, you can use the [routing rules](../../administration/sidekiq/processing_specific_job_classes.md#routing-rules) option to [limit indexing jobs only to specific Sidekiq nodes](elasticsearch.md#index-large-instances-with-dedicated-sidekiq-nodes-or-processes), which should reduce the number of indexing requests.
### Indexing is very slow or fails with `rejected execution of coordinating operation` messages
@ -437,11 +437,11 @@ Improvements to the `code_analyzer` pattern and filters are being discussed in [
In GitLab 13.9, a change was made where [binary file names are being indexed](https://gitlab.com/gitlab-org/gitlab/-/issues/301083). However, without indexing all projects' data from scratch, only binary files that are added or updated after the GitLab 13.9 release are searchable.
## How does Advanced Search handle private projects?
## How does advanced search handle private projects?
Advanced Search stores all the projects in the same Elasticsearch indices,
Advanced search stores all the projects in the same Elasticsearch indices,
however, searches only surface results that can be viewed by the user.
Advanced Search honors all permission checks in the application by
Advanced search honors all permission checks in the application by
filtering out projects that a user does not have access to at search time.
### Role mapping when using fine-grained access control with AWS Elasticsearch or OpenSearch

View File

@ -73,7 +73,7 @@ You can integrate GitLab with the following feature enhancements:
or [Kroki](../administration/integration/kroki.md) to use diagrams in AsciiDoc and Markdown documents.
- Attach merge requests to [Trello](trello_power_up.md) cards.
- Enable integrated code intelligence powered by [Sourcegraph](sourcegraph.md).
- Add [Elasticsearch](advanced_search/elasticsearch.md) for [Advanced Search](../user/search/advanced_search.md).
- Add [Elasticsearch](advanced_search/elasticsearch.md) for [advanced search](../user/search/advanced_search.md).
## Troubleshooting

View File

@ -106,7 +106,7 @@ the tiers are no longer mentioned in GitLab documentation:
- Search:
- [Filtering merge requests](../user/project/merge_requests/index.md#filter-the-list-of-merge-requests) by approvers
- [Filtering merge requests](../user/project/merge_requests/index.md#filter-the-list-of-merge-requests) by "approved by"
- [Advanced Search (Elasticsearch)](../user/search/advanced_search.md)
- [Advanced search (Elasticsearch)](../user/search/advanced_search.md)
- [Service Desk](../user/project/service_desk.md)
- [Storage usage statistics](../user/usage_quotas.md#storage-usage-statistics)
@ -128,7 +128,7 @@ Bronze-level subscribers:
- [Group iterations API](../api/group_iterations.md)
- Project milestones API: [Get all burndown chart events for a single milestone](../api/milestones.md#get-all-burndown-chart-events-for-a-single-milestone)
- [Project iterations API](../api/iterations.md)
- Fields in the [Search API](../api/search.md) available only to [Advanced Search (Elasticsearch)](../integration/advanced_search/elasticsearch.md) users
- Fields in the [Search API](../api/search.md) available only to [advanced search (Elasticsearch)](../integration/advanced_search/elasticsearch.md) users
- Fields in the [Merge requests API](../api/merge_requests.md) for [merge request approvals](../user/project/merge_requests/approvals/index.md)
- Fields in the [Protected branches API](../api/protected_branches.md) that specify users or groups allowed to merge
- [Merge request approvals API](../api/merge_request_approvals.md)

View File

@ -52,6 +52,10 @@ Private connectivity via [AWS PrivateLink](https://aws.amazon.com/privatelink/)
Data is encrypted at rest and in transit using the latest encryption standards.
#### Bring your own key encryption
During onboarding, you can specify an AWS KMS encryption key stored in your own AWS account that GitLab uses to encrypt the data for your Dedicated instance. This gives you full control over the data you store in GitLab.
### Compliance
#### Certifications
@ -97,6 +101,17 @@ GitLab Dedicated comes with the self-managed [Ultimate feature set](https://abou
With GitLab Dedicated, you must [install the GitLab Runner application](https://docs.gitlab.com/runner/install/index.html) on infrastructure that you own or manage. If hosting GitLab Runners on AWS, you can avoid having requests from the Runner fleet route through the public internet by setting up a secure connection from the Runner VPC to the GitLab Dedicated endpoint via AWS Private Link. Learn more about [networking options](#secure-networking).
#### Migration
To help you migrate your data to GitLab Dedicated, you can choose from the following options:
1. When migrating from another GitLab instance, you can either:
- Use the UI, including [group import](../../user/group/import/index.md) and [project import](../../user/project/settings/import_export.md).
- Use APIs, including the [group import API](../../api/group_import_export.md) and [project import API](../../api/project_import_export.md).
- Note: Import functionality behind a feature flag (such as `bulk_import_project`) is not supported in GitLab Dedicated.
1. When migrating from third-party services, you can use [the GitLab importers](../../user/project/import/index.md#available-project-importers).
1. You can perform a fully-automated migration through the [Congregate Automation Tool](../../user/project/import/index.md#automate-group-and-project-import), which supports migrating from existing GitLab instances as well as third-party services.
## Features that are not available
### GitLab application features
@ -105,7 +120,7 @@ The following GitLab application features are not available:
- LDAP, Smartcard, or Kerberos authentication
- Multiple login providers
- Advanced Search
- Advanced search
- GitLab Pages
- FortiAuthenticator, or FortiToken 2FA
- Reply-by email
@ -123,7 +138,6 @@ The following features will not be supported:
The following operational features are not available:
- Custom domains
- Bring Your Own Key (BYOK) encryption
- Multiple Geo secondaries (Geo replicas) beyond the secondary site included by default
- Self-serve purchasing and configuration
- Multiple login providers

View File

@ -107,11 +107,11 @@ To address the above two scenarios, it is advised to do the following prior to u
as your GitLab version. Both versions [should be the same](https://docs.gitlab.com/runner/#gitlab-runner-versions).
1. Unpause your runners and unblock new jobs from starting by reverting the previous `/etc/gitlab/gitlab.rb` change.
## Checking for pending Advanced Search migrations **(PREMIUM SELF)**
## Checking for pending advanced search migrations **(PREMIUM SELF)**
This section is only applicable if you have enabled the [Elasticsearch integration](../integration/advanced_search/elasticsearch.md) **(PREMIUM SELF)**.
Major releases require all [Advanced Search migrations](../integration/advanced_search/elasticsearch.md#advanced-search-migrations)
Major releases require all [advanced search migrations](../integration/advanced_search/elasticsearch.md#advanced-search-migrations)
to be finished from the most recent minor release in your current version
before the major version upgrade. You can find pending migrations by
running the following command:
@ -129,16 +129,16 @@ cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:elastic:list_pending_migrations
```
### What do you do if your Advanced Search migrations are stuck?
### What do you do if your advanced search migrations are stuck?
In GitLab 15.0, an Advanced Search migration named `DeleteOrphanedCommit` can be permanently stuck
In GitLab 15.0, an advanced search migration named `DeleteOrphanedCommit` can be permanently stuck
in a pending state across upgrades. This issue
[is corrected in GitLab 15.1](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89539).
If you are a self-managed customer who uses GitLab 15.0 with Advanced Search, you will experience performance degradation.
If you are a self-managed customer who uses GitLab 15.0 with advanced search, you will experience performance degradation.
To clean up the migration, upgrade to 15.1 or later.
For other Advanced Search migrations stuck in pending, see [how to retry a halted migration](../integration/advanced_search/elasticsearch.md#retry-a-halted-migration).
For other advanced search migrations stuck in pending, see [how to retry a halted migration](../integration/advanced_search/elasticsearch.md#retry-a-halted-migration).
### What do you do for the error `Elasticsearch version not compatible`
@ -166,7 +166,7 @@ It's also important to ensure that any [background migrations have been fully co
before upgrading to a new major version.
If you have enabled the [Elasticsearch integration](../integration/advanced_search/elasticsearch.md) **(PREMIUM SELF)**, then
[ensure all Advanced Search migrations are completed](#checking-for-pending-advanced-search-migrations) in the last minor version in
[ensure all advanced search migrations are completed](#checking-for-pending-advanced-search-migrations) in the last minor version in
your current version
before proceeding with the major version upgrade.

View File

@ -116,7 +116,7 @@ The steps can be summed up to:
sudo rm /etc/yum.repos.d/gitlab_gitlab-ce.repo
```
1. Optional. [Set up the Elasticsearch integration](../../integration/advanced_search/elasticsearch.md) to enable [Advanced Search](../../user/search/advanced_search.md).
1. Optional. [Set up the Elasticsearch integration](../../integration/advanced_search/elasticsearch.md) to enable [advanced search](../../user/search/advanced_search.md).
That's it! You can now use GitLab Enterprise Edition! To update to a newer
version, follow [Update using the official repositories](index.md#upgrade-using-the-official-repositories).

View File

@ -172,7 +172,7 @@ If you have Kubernetes clusters connected with GitLab, [upgrade your GitLab agen
#### Elasticsearch
Before updating GitLab, confirm Advanced Search migrations are complete by
Before updating GitLab, confirm advanced search migrations are complete by
[checking for pending advanced search migrations](background_migrations.md).
After updating GitLab, you may have to upgrade

View File

@ -155,10 +155,6 @@ helm upgrade --install gitlab-agent gitlab/gitlab-agent \
...
```
NOTE:
DNS rebind protection is disabled when either the HTTP_PROXY or the HTTPS_PROXY environment variable is set,
and the domain DNS can't be resolved.
#### Advanced installation method
GitLab also provides a [KPT package for the agent](https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/tree/master/build/deployment/gitlab-agent). This method provides greater flexibility, but is only recommended for advanced users.

View File

@ -7,8 +7,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Import your project from GitHub to GitLab **(FREE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/381902) in GitLab 15.8, GitLab no longer automatically creates namespaces or groups that don't exist. GitLab also no longer falls back to using the user's personal namespace if the namespace or group name is taken.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/378267) in GitLab 15.9, GitLab instances behind proxies no longer require `github.com` and `api.github.com` entries in the [allowlist for local requests](../../../security/webhooks.md#create-an-allowlist-for-local-requests).
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/381902) in GitLab 15.8, GitLab no longer automatically creates namespaces or groups that don't exist. GitLab also no longer falls back to using the user's personal namespace if the namespace or group name is taken.
You can import your GitHub projects from either GitHub.com or GitHub Enterprise. Importing projects does not
migrate or import any types of groups or organizations from GitHub to GitLab.
@ -63,8 +62,9 @@ prerequisites for those imports.
If you are importing from GitHub Enterprise to a self-managed GitLab instance:
- You must first enable the [GitHub integration](../../../integration/github.md).
- For GitLab 15.8 and earlier, you must add `github.com` and `api.github.com` entries in the
[allowlist for local requests](../../../security/webhooks.md#create-an-allowlist-for-local-requests).
- If GitLab is behind a HTTP/HTTPS proxy, you must populate the [allowlist for local requests](../../../security/webhooks.md#create-an-allowlist-for-local-requests)
with `github.com` and `api.github.com` to solve the hostname. For more information, read the issue
[Importing a GitHub project requires DNS resolution even when behind a proxy](https://gitlab.com/gitlab-org/gitlab/-/issues/37941).
### Importing from GitHub.com to self-managed GitLab

View File

@ -5,10 +5,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# DNS records overview **(FREE)**
_Read this document for a brief overview of DNS records in the scope
of GitLab Pages, for beginners in web development._
# GitLab Pages DNS records **(FREE)**
A Domain Name System (DNS) web service routes visitors to websites
by translating domain names (such as `www.example.com`) into the
@ -74,7 +71,7 @@ Example:
This way, visitors visiting `www.example.com` are redirected to
`example.com`.
## MX record
## `MX` record
MX records are used to define the mail exchanges that are used for the domain.
This helps email messages arrive at your mail server correctly.

View File

@ -5,7 +5,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Custom domains and SSL/TLS certificates **(FREE)**
# GitLab Pages custom domains **(FREE)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/238461) in GitLab 15.4, you can use verified domains to [bypass user email confirmation for SAML- or SCIM-provisioned users](../../../group/saml_sso/index.md#bypass-user-email-confirmation-with-verified-domains).

View File

@ -6,7 +6,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# GitLab Pages integration with Let's Encrypt **(FREE)**
# GitLab Pages Let's Encrypt certificates **(FREE)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/28996) in GitLab 12.1.

View File

@ -5,10 +5,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# SSL/TLS certificates **(FREE)**
_Read this document for a brief overview of SSL/TLS certificates in
the scope of GitLab Pages, for beginners in web development._
# GitLab Pages SSL/TLS certificates **(FREE)**
Every GitLab Pages project on GitLab.com is available under
HTTPS for the default Pages domain (`*.gitlab.io`). Once you set

View File

@ -5,7 +5,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Create a Pages website by using a CI/CD template **(FREE)**
# Create a GitLab Pages website from a CI/CD template **(FREE)**
GitLab provides `.gitlab-ci.yml` templates for the most popular Static Site Generators (SSGs).
You can create your own `.gitlab-ci.yml` file from one of these templates, and run

View File

@ -5,7 +5,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Create a Pages website from a forked sample **(FREE)**
# Create a GitLab Pages website from a forked sample project **(FREE)**
GitLab provides [sample projects for the most popular Static Site Generators (SSG)](https://gitlab.com/pages).
You can fork one of the sample projects and run the CI/CD pipeline to generate a Pages website.

View File

@ -4,7 +4,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Create a Pages website from a template **(FREE)**
# Create a GitLab Pages website from a project template **(FREE)**
GitLab provides templates for the most popular Static Site Generators (SSGs).
You can create a new project from a template and run the CI/CD pipeline to generate a Pages website.

View File

@ -4,7 +4,7 @@ group: Incubation
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Create a Pages deployment for your static site **(FREE)**
# Create a GitLab Pages deployment for a static site **(FREE)**
If you already have a GitLab project that contains your static site or framework,
you can generate a GitLab Pages website from it.

View File

@ -4,7 +4,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# GitLab Pages domain names, URLs, and base URLs **(FREE)**
# GitLab Pages default domain names and URLs **(FREE)**
On this document, learn how to name your project for GitLab Pages
according to your intended website's URL.

View File

@ -4,7 +4,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Exploring GitLab Pages **(FREE)**
# GitLab Pages settings **(FREE)**
This document is a user guide to explore the options and settings
GitLab Pages offers.

View File

@ -6,7 +6,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Configure the public files folder **(FREE)**
# GitLab Pages public folder **(FREE)**
All the files that should be accessible by the browser must be in a root-level folder called `public`.

View File

@ -4,7 +4,7 @@ group: Editor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Create redirects for GitLab Pages **(FREE)**
# GitLab Pages redirects **(FREE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/24) in GitLab Pages 1.25.0 and GitLab 13.4 behind a feature flag, disabled by default.
> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/367) in GitLab 13.5.

View File

@ -5,18 +5,18 @@ info: "To determine the technical writer assigned to the Stage/Group associated
type: reference
---
# Advanced Search **(PREMIUM)**
# Advanced search **(PREMIUM)**
> Moved to GitLab Premium in 13.9.
You can use Advanced Search for faster, more efficient search across the entire GitLab
instance. Advanced Search is based on Elasticsearch, a purpose-built full-text search
You can use advanced search for faster, more efficient search across the entire GitLab
instance. Advanced search is based on Elasticsearch, a purpose-built full-text search
engine you can horizontally scale to get results in up to a second in most cases.
You can find code you want to update in all projects at once to save
maintenance time and promote innersourcing.
You can use Advanced Search in:
You can use advanced search in:
- Projects
- Issues
@ -29,15 +29,15 @@ You can use Advanced Search in:
- Commits
- Project wikis (not [group wikis](../project/wiki/group.md))
## Enable Advanced Search
## Enable advanced search
- On GitLab.com, Advanced Search is enabled for groups with paid subscriptions.
- On GitLab.com, advanced search is enabled for groups with paid subscriptions.
- For self-managed GitLab instances, an administrator must
[enable Advanced Search](../../integration/advanced_search/elasticsearch.md#enable-advanced-search).
[enable advanced search](../../integration/advanced_search/elasticsearch.md#enable-advanced-search).
## Syntax
Advanced Search uses [Elasticsearch syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#simple-query-string-syntax). The syntax supports both exact and fuzzy search queries.
Advanced search uses [Elasticsearch syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#simple-query-string-syntax). The syntax supports both exact and fuzzy search queries.
<!-- markdownlint-disable -->
@ -90,7 +90,7 @@ In user search, a [fuzzy query](https://www.elastic.co/guide/en/elasticsearch/re
- You can only search files smaller than 1 MB.
For self-managed GitLab instances, an administrator can
[change this limit](../../integration/advanced_search/elasticsearch.md#advanced-search-configuration).
- You can only use Advanced Search on the default branch of a project.
- You can only use advanced search on the default branch of a project.
- The search query must not contain any of the following characters:
```plaintext

View File

@ -20,7 +20,7 @@ When performing any Code search in GitLab it will choose to use "Exact Code
Search" powered by [Zoekt](https://github.com/sourcegraph/zoekt) if the project
is part of an enabled Group.
The main differences between Zoekt and [Advanced Search](advanced_search.md)
The main differences between Zoekt and [advanced search](advanced_search.md)
are that Zoekt provides exact substring matching as well as allows you to
search for regular expressions. Since it allows searching for regular
expressions, certain special characters will require escaping. Backslash can

Some files were not shown because too many files have changed in this diff Show More