Add latest changes from gitlab-org/gitlab@master
|
|
@ -345,7 +345,6 @@ Layout/LineEndStringConcatenationIndentation:
|
|||
- 'ee/spec/lib/gitlab/usage/metrics/instrumentations/protected_environment_approval_rules_required_approvals_average_metric_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/usage/metrics/instrumentations/protected_environments_required_approvals_average_metric_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/vulnerability_scanning/security_report_builder_spec.rb'
|
||||
- 'ee/spec/lib/remote_development/rd_fast_spec_helper.rb'
|
||||
- 'ee/spec/lib/security/scan_result_policies/detailed_policy_violation_comment_spec.rb'
|
||||
- 'ee/spec/lib/security/scan_result_policies/policy_violation_details_spec.rb'
|
||||
- 'ee/spec/mailers/emails/abandoned_trial_notification_spec.rb'
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export default {
|
|||
<template #head(systemId)="{ label }">
|
||||
{{ label }}
|
||||
<help-popover>
|
||||
{{ s__('Runners|The unique ID for each runner that uses this configuration.') }}
|
||||
{{ s__('Runners|The ID of the machine hosting the runner.') }}
|
||||
</help-popover>
|
||||
</template>
|
||||
<template #cell(status)="{ item = {} }">
|
||||
|
|
|
|||
|
|
@ -514,6 +514,7 @@ class GfmAutoComplete {
|
|||
title: i.title,
|
||||
reference: i.reference,
|
||||
search: `${i.iid} ${i.title}`,
|
||||
iconName: i.icon_name,
|
||||
};
|
||||
});
|
||||
},
|
||||
|
|
@ -1155,8 +1156,9 @@ GfmAutoComplete.Issues = {
|
|||
// eslint-disable-next-line no-template-curly-in-string
|
||||
return value.reference || '${atwho-at}${id}';
|
||||
},
|
||||
templateFunction({ id, title, reference }) {
|
||||
return `<li><small>${escape(reference || id)}</small> ${escape(title)}</li>`;
|
||||
templateFunction({ id, title, reference, iconName }) {
|
||||
const icon = iconName ? spriteIcon(iconName, 'gl-text-secondary s16 gl-mr-2') : '';
|
||||
return `<li>${icon}<small>${escape(reference || id)}</small> ${escape(title)}</li>`;
|
||||
},
|
||||
};
|
||||
// Milestones
|
||||
|
|
|
|||
|
|
@ -219,6 +219,9 @@ export const config = {
|
|||
};
|
||||
},
|
||||
},
|
||||
MergeRequestApprovalState: {
|
||||
merge: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
confirmOverage() {
|
||||
this.$emit('confirm');
|
||||
},
|
||||
},
|
||||
render() {
|
||||
return null;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -35,8 +35,10 @@ export default {
|
|||
GlIcon,
|
||||
GlAlert,
|
||||
RoleSelector,
|
||||
GuestOverageConfirmation: () =>
|
||||
import('ee_component/members/components/table/guest_overage_confirmation.vue'),
|
||||
},
|
||||
inject: ['namespace'],
|
||||
inject: ['namespace', 'group'],
|
||||
props: {
|
||||
member: {
|
||||
type: Object,
|
||||
|
|
@ -94,11 +96,20 @@ export default {
|
|||
this.$emit('close');
|
||||
}
|
||||
},
|
||||
checkGuestOverage() {
|
||||
this.saveError = null;
|
||||
this.isSavingRole = true;
|
||||
const confirmOverageFn = this.$refs.guestOverageConfirmation.confirmOverage;
|
||||
// If guestOverageConfirmation is real instead of the CE dummy, check the guest overage. Otherwise, just update
|
||||
// the role.
|
||||
if (confirmOverageFn) {
|
||||
confirmOverageFn();
|
||||
} else {
|
||||
this.updateRole();
|
||||
}
|
||||
},
|
||||
async updateRole() {
|
||||
try {
|
||||
this.saveError = null;
|
||||
this.isSavingRole = true;
|
||||
|
||||
const url = this.memberPath.replace(':id', this.member.id);
|
||||
const accessLevelProp = ACCESS_LEVEL_PROPERTY_NAME[this.namespace];
|
||||
|
||||
|
|
@ -117,10 +128,15 @@ export default {
|
|||
const { member } = this;
|
||||
// Update the access level on the member object so that the members table shows the new role.
|
||||
member.accessLevel = {
|
||||
...this.selectedRole,
|
||||
stringValue: this.selectedRole.text,
|
||||
integerValue: this.selectedRole.accessLevel,
|
||||
description: this.selectedRole.description,
|
||||
memberRoleId: this.selectedRole.memberRoleId,
|
||||
};
|
||||
// Update the license usage info to show/hide the "Is using seat" badge.
|
||||
if (data?.using_license !== undefined) {
|
||||
member.usingLicense = data?.using_license;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
this.saveError = s__('MemberRole|Could not update role.');
|
||||
|
|
@ -131,6 +147,11 @@ export default {
|
|||
},
|
||||
resetRole() {
|
||||
this.selectedRole = this.initialRole;
|
||||
this.isSavingRole = false;
|
||||
},
|
||||
showCheckOverageError() {
|
||||
this.saveError = s__('MemberRole|Could not check guest overage.');
|
||||
this.isSavingRole = false;
|
||||
},
|
||||
},
|
||||
getContentWrapperHeight,
|
||||
|
|
@ -246,7 +267,7 @@ export default {
|
|||
variant="confirm"
|
||||
:loading="isSavingRole"
|
||||
data-testid="save-button"
|
||||
@click="updateRole"
|
||||
@click="checkGuestOverage"
|
||||
>
|
||||
{{ s__('MemberRole|Update role') }}
|
||||
</gl-button>
|
||||
|
|
@ -258,6 +279,15 @@ export default {
|
|||
>
|
||||
{{ __('Cancel') }}
|
||||
</gl-button>
|
||||
<guest-overage-confirmation
|
||||
ref="guestOverageConfirmation"
|
||||
:group-path="group.path"
|
||||
:member="member"
|
||||
:role="selectedRole"
|
||||
@confirm="updateRole"
|
||||
@cancel="resetRole"
|
||||
@error="showCheckOverageError"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</gl-drawer>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { s__ } from '~/locale';
|
|||
import showGlobalToast from '~/vue_shared/plugins/global_toast';
|
||||
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
|
||||
import { getParameterByName, setUrlParams } from '~/lib/utils/url_utility';
|
||||
import { ACCESS_LEVEL_GUEST_INTEGER } from '~/access_level/constants';
|
||||
import {
|
||||
FIELDS,
|
||||
DEFAULT_SORT,
|
||||
|
|
@ -49,6 +50,8 @@ export const roleDropdownItems = ({ validRoles }) => {
|
|||
accessLevel,
|
||||
memberRoleId: null, // The value `null` is need to downgrade from custom role to static role. See: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133430#note_1595153555
|
||||
value: `role-static-${accessLevel}`,
|
||||
// For base roles, only Guest and Minimal Access users won't occupy a seat.
|
||||
occupiesSeat: accessLevel > ACCESS_LEVEL_GUEST_INTEGER,
|
||||
}));
|
||||
|
||||
return { flatten: staticRoleDropdownItems, formatted: staticRoleDropdownItems };
|
||||
|
|
|
|||
|
|
@ -67,7 +67,11 @@ export default {
|
|||
<template #header>
|
||||
<approval-summary />
|
||||
</template>
|
||||
<reviewers-container :reviewers="reviewers" :loading-reviewers="loadingReviewers" />
|
||||
<reviewers-container
|
||||
:reviewers="reviewers"
|
||||
:loading-reviewers="loadingReviewers"
|
||||
@request-review="(params) => $emit('request-review', params)"
|
||||
/>
|
||||
<approval-rules-wrapper :reviewers="reviewers" />
|
||||
</gl-drawer>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { GlEmptyState, GlButton } from '@gitlab/ui';
|
|||
import noReviewersAssignedSvg from '@gitlab/svgs/dist/illustrations/add-user-sm.svg?url';
|
||||
import UncollapsedReviewerList from '~/sidebar/components/reviewers/uncollapsed_reviewer_list.vue';
|
||||
import { sprintf, __, n__ } from '~/locale';
|
||||
import ReviewerDropdown from '~/merge_requests/components/reviewers/reviewer_dropdown.vue';
|
||||
import UpdateReviewers from './update_reviewers.vue';
|
||||
import userPermissionsQuery from './queries/user_permissions.query.graphql';
|
||||
|
||||
|
|
@ -24,6 +25,7 @@ export default {
|
|||
GlButton,
|
||||
UncollapsedReviewerList,
|
||||
UpdateReviewers,
|
||||
ReviewerDropdown,
|
||||
},
|
||||
inject: ['projectPath', 'issuableIid'],
|
||||
props: {
|
||||
|
|
@ -64,14 +66,15 @@ export default {
|
|||
|
||||
<template>
|
||||
<div>
|
||||
<div class="gl-display-flex gl-mb-3">
|
||||
<div class="gl-leading-20 gl-font-bold gl-flex gl-w-full gl-align-items-center gl-mb-3">
|
||||
<template v-if="loadingReviewers">
|
||||
<div class="gl-animate-skeleton-loader gl-h-4 gl-rounded-base gl-w-20"></div>
|
||||
<div class="gl-animate-skeleton-loader gl-h-4 gl-rounded-base gl-w-2 gl-ml-auto"></div>
|
||||
<div class="gl-animate-skeleton-loader gl-h-4 gl-rounded-base gl-w-4 gl-ml-auto"></div>
|
||||
</template>
|
||||
<div v-else class="gl-leading-20 gl-text-gray-900 gl-font-bold">
|
||||
<template v-else>
|
||||
{{ reviewersTitle }}
|
||||
</div>
|
||||
<reviewer-dropdown :selected-reviewers="reviewers" class="gl-ml-auto" />
|
||||
</template>
|
||||
</div>
|
||||
<div v-if="loadingReviewers">
|
||||
<div class="gl-animate-skeleton-loader gl-h-4 gl-rounded-base gl-mb-3 gl-max-w-20!"></div>
|
||||
|
|
@ -83,6 +86,7 @@ export default {
|
|||
:root-path="relativeUrlRoot"
|
||||
:users="reviewers"
|
||||
issuable-type="merge_request"
|
||||
@request-review="(params) => $emit('request-review', params)"
|
||||
/>
|
||||
<gl-empty-state v-else :svg-path="$options.noReviewersAssignedSvg" :svg-height="70">
|
||||
<template #description>
|
||||
|
|
|
|||
|
|
@ -25,21 +25,20 @@ export default {
|
|||
computed: {
|
||||
isTemplate,
|
||||
title() {
|
||||
return sprintf(
|
||||
this.isTemplate
|
||||
? this.$options.i18n.deleteTemplateTitle
|
||||
: this.$options.i18n.deletePageTitle,
|
||||
{
|
||||
pageTitle: escape(this.pageHeading),
|
||||
},
|
||||
false,
|
||||
);
|
||||
let title = this.isTemplate
|
||||
? this.$options.i18n.deleteTemplateTitle
|
||||
: this.$options.i18n.deletePageTitle;
|
||||
if (this.isCustomSidebar) {
|
||||
title = this.$options.i18n.deleteSidebarTitle;
|
||||
}
|
||||
return sprintf(title, { pageTitle: escape(this.pageHeading) }, false);
|
||||
},
|
||||
primaryProps() {
|
||||
let deleteText = this.deleteTemplateText;
|
||||
if (this.isCustomSidebar) deleteText = this.$options.i18n.modalFooterSidebarButtonText;
|
||||
|
||||
return {
|
||||
text: this.isTemplate
|
||||
? this.$options.i18n.deleteTemplateText
|
||||
: this.$options.i18n.deletePageText,
|
||||
text: deleteText,
|
||||
attributes: {
|
||||
variant: 'danger',
|
||||
'data-testid': 'confirm-deletion-button',
|
||||
|
|
@ -47,12 +46,21 @@ export default {
|
|||
};
|
||||
},
|
||||
deleteTemplateText() {
|
||||
return this.isTemplate
|
||||
let buttonText = this.isTemplate
|
||||
? this.$options.i18n.deleteTemplateText
|
||||
: this.$options.i18n.deletePageText;
|
||||
|
||||
if (this.isCustomSidebar) buttonText = this.$options.i18n.deleteSidebarText;
|
||||
|
||||
return buttonText;
|
||||
},
|
||||
modalBody() {
|
||||
return this.isTemplate ? this.$options.i18n.modalBodyTemplate : this.$options.i18n.modalBody;
|
||||
let body = this.isTemplate
|
||||
? this.$options.i18n.modalBodyTemplate
|
||||
: this.$options.i18n.modalBody;
|
||||
if (this.isCustomSidebar) body = this.$options.i18n.modalBodySidebar;
|
||||
|
||||
return body;
|
||||
},
|
||||
cancelProps() {
|
||||
return {
|
||||
|
|
@ -68,6 +76,9 @@ export default {
|
|||
},
|
||||
};
|
||||
},
|
||||
isCustomSidebar() {
|
||||
return this.wikiUrl.endsWith('_sidebar');
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onSubmit() {
|
||||
|
|
@ -80,6 +91,12 @@ export default {
|
|||
deleteTemplateTitle: s__('WikiPageConfirmDelete|Delete template "%{pageTitle}"?'),
|
||||
deletePageText: s__('WikiPageConfirmDelete|Delete page'),
|
||||
deleteTemplateText: s__('WikiPageConfirmDelete|Delete template'),
|
||||
deleteSidebarText: s__('WikiPageConfirmDelete|Delete custom sidebar'),
|
||||
modalBodySidebar: s__(
|
||||
'WikiPageConfirmDelete|Are you sure you want to delete the custom sidebar?',
|
||||
),
|
||||
modalFooterSidebarButtonText: s__('WikiPageConfirmDelete|Delete'),
|
||||
deleteSidebarTitle: s__('WikiPageConfirmDelete|Delete custom sidebar?'),
|
||||
modalBody: s__('WikiPageConfirmDelete|Are you sure you want to delete this page?'),
|
||||
modalBodyTemplate: s__('WikiPageConfirmDelete|Are you sure you want to delete this template?'),
|
||||
cancelButtonText: __('Cancel'),
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ export default {
|
|||
submitButton: {
|
||||
existingPage: s__('WikiPage|Save changes'),
|
||||
newPage: s__('WikiPage|Create page'),
|
||||
newSidebar: s__('WikiPage|Create custom sidebar'),
|
||||
newTemplate: s__('WikiPage|Create template'),
|
||||
},
|
||||
cancel: s__('WikiPage|Cancel'),
|
||||
|
|
@ -119,7 +120,15 @@ export default {
|
|||
DeleteWikiModal,
|
||||
},
|
||||
mixins: [trackingMixin],
|
||||
inject: ['isEditingPath', 'formatOptions', 'pageInfo', 'drawioUrl', 'templates', 'pageHeading'],
|
||||
inject: [
|
||||
'isEditingPath',
|
||||
'formatOptions',
|
||||
'pageInfo',
|
||||
'drawioUrl',
|
||||
'templates',
|
||||
'pageHeading',
|
||||
'wikiUrl',
|
||||
],
|
||||
data() {
|
||||
const title = window.location.href.includes('random_title=true') ? '' : getTitle(this.pageInfo);
|
||||
return {
|
||||
|
|
@ -176,9 +185,16 @@ export default {
|
|||
return MARKDOWN_LINK_TEXT[this.format];
|
||||
},
|
||||
submitButtonText() {
|
||||
return this.pageInfo.persisted
|
||||
let buttonText = this.pageInfo.persisted
|
||||
? this.$options.i18n.submitButton.existingPage
|
||||
: this.$options.i18n.submitButton.newPage;
|
||||
|
||||
buttonText =
|
||||
this.isCustomSidebar && !this.pageInfo.persisted
|
||||
? this.$options.i18n.submitButton.newSidebar
|
||||
: buttonText;
|
||||
|
||||
return buttonText;
|
||||
},
|
||||
titleHelpText() {
|
||||
return this.pageInfo.persisted
|
||||
|
|
@ -214,6 +230,9 @@ export default {
|
|||
|
||||
return null;
|
||||
},
|
||||
isCustomSidebar() {
|
||||
return this.wikiUrl.endsWith('_sidebar');
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
title() {
|
||||
|
|
@ -277,7 +296,12 @@ export default {
|
|||
if (!this.title) return;
|
||||
|
||||
// Replace hyphens with spaces
|
||||
const newTitle = this.title.replace(/-+/g, ' ').replace('templates/', '');
|
||||
let newTitle = this.title.replace(/-+/g, ' ').replace('templates/', '');
|
||||
|
||||
// Replace _sidebar with sidebar
|
||||
if (this.isCustomSidebar) {
|
||||
newTitle = this.title.replace('_sidebar', 'sidebar');
|
||||
}
|
||||
|
||||
const newCommitMessage = sprintf(this.commitMessageI18n, { pageTitle: newTitle }, false);
|
||||
this.commitMessage = newCommitMessage;
|
||||
|
|
@ -355,6 +379,7 @@ export default {
|
|||
:label="$options.i18n.title.label"
|
||||
label-for="wiki_title"
|
||||
label-class="gl-sr-only"
|
||||
:class="{ 'gl-hidden': isCustomSidebar }"
|
||||
>
|
||||
<template v-if="!isTemplate" #description>
|
||||
<gl-icon name="bulb" />
|
||||
|
|
|
|||
|
|
@ -26,8 +26,31 @@ export default {
|
|||
'pageVersion',
|
||||
'authorUrl',
|
||||
'isEditingPath',
|
||||
'wikiUrl',
|
||||
'pagePersisted',
|
||||
],
|
||||
computed: {
|
||||
pageHeadingComputed() {
|
||||
let { pageHeading } = this;
|
||||
|
||||
if (this.isEditingPath) {
|
||||
if (this.wikiUrl.endsWith('_sidebar')) {
|
||||
pageHeading = this.pagePersisted
|
||||
? this.$options.i18n.editSidebar
|
||||
: this.$options.i18n.newSidebar;
|
||||
} else if (this.isPageTemplate) {
|
||||
pageHeading = this.pagePersisted
|
||||
? this.$options.i18n.editTemplate
|
||||
: this.$options.i18n.newTemplate;
|
||||
} else {
|
||||
pageHeading = this.pagePersisted
|
||||
? this.$options.i18n.editPage
|
||||
: this.$options.i18n.newPage;
|
||||
}
|
||||
}
|
||||
|
||||
return pageHeading;
|
||||
},
|
||||
editTooltipText() {
|
||||
return this.isPageTemplate ? this.$options.i18n.editTemplate : this.$options.i18n.editPage;
|
||||
},
|
||||
|
|
@ -57,8 +80,12 @@ export default {
|
|||
},
|
||||
i18n: {
|
||||
edit: __('Edit'),
|
||||
editPage: __('Edit page'),
|
||||
editTemplate: __('Edit template'),
|
||||
newPage: s__('Wiki|New page'),
|
||||
editPage: s__('Wiki|Edit page'),
|
||||
newTemplate: s__('Wiki|New template'),
|
||||
editTemplate: s__('Wiki|Edit template'),
|
||||
newSidebar: s__('Wiki|New custom sidebar'),
|
||||
editSidebar: s__('Wiki|Edit custom sidebar'),
|
||||
lastEdited: s__('Wiki|Last edited by %{author} %{timeago}'),
|
||||
},
|
||||
};
|
||||
|
|
@ -68,7 +95,7 @@ export default {
|
|||
<div
|
||||
class="wiki-page-header has-sidebar-toggle detail-page-header border-bottom-0 !gl-pt-0 gl-flex gl-flex-wrap"
|
||||
>
|
||||
<page-heading :heading="pageHeading" class="gl-w-full">
|
||||
<page-heading :heading="pageHeadingComputed" class="gl-w-full">
|
||||
<template v-if="!isEditingPath" #actions>
|
||||
<gl-button
|
||||
v-if="showEditButton"
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
toggleDrawerOpen(drawerOpen = !this.drawerOpen) {
|
||||
if (!this.glFeatures.reviewerAssignDrawer) return;
|
||||
|
||||
this.drawerOpen = drawerOpen;
|
||||
},
|
||||
},
|
||||
|
|
@ -61,33 +63,28 @@ export default {
|
|||
<template v-if="editable">
|
||||
<gl-button
|
||||
v-tooltip.hover
|
||||
:title="glFeatures.reviewerAssignDrawer ? __('Quick assign') : __('Change reviewer')"
|
||||
:aria-label="glFeatures.reviewerAssignDrawer ? __('Quick assign a reviewer') : null"
|
||||
class="js-sidebar-dropdown-toggle edit-link gl-ml-auto hide-collapsed gl-float-right"
|
||||
:title="
|
||||
glFeatures.reviewerAssignDrawer ? __('Add or edit reviewers') : __('Change reviewer')
|
||||
"
|
||||
class="gl-ml-auto hide-collapsed gl-float-right"
|
||||
:class="{ 'js-sidebar-dropdown-toggle edit-link': !glFeatures.reviewerAssignDrawer }"
|
||||
data-track-action="click_edit_button"
|
||||
data-track-label="right_sidebar"
|
||||
data-track-property="reviewer"
|
||||
data-testid="reviewers-edit-button"
|
||||
:data-testid="glFeatures.reviewerAssignDrawer ? 'drawer-toggle' : 'reviewers-edit-button'"
|
||||
category="tertiary"
|
||||
size="small"
|
||||
:icon="glFeatures.reviewerAssignDrawer ? 'plus' : ''"
|
||||
><template v-if="!glFeatures.reviewerAssignDrawer">{{ __('Edit') }}</template></gl-button
|
||||
>
|
||||
<gl-button
|
||||
v-if="glFeatures.reviewerAssignDrawer"
|
||||
v-tooltip.hover
|
||||
:title="__('Add or edit reviewers')"
|
||||
category="tertiary"
|
||||
size="small"
|
||||
class="gl-float-right gl-ml-2"
|
||||
data-testid="drawer-toggle"
|
||||
@click="toggleDrawerOpen(!drawerOpen)"
|
||||
>
|
||||
{{ __('Edit') }}
|
||||
</gl-button>
|
||||
</template>
|
||||
<mounting-portal v-if="glFeatures.reviewerAssignDrawer" mount-to="#js-reviewer-drawer-portal">
|
||||
<reviewer-drawer :open="drawerOpen" @close="toggleDrawerOpen(false)" />
|
||||
<reviewer-drawer
|
||||
:open="drawerOpen"
|
||||
@request-review="(params) => $emit('request-review', params)"
|
||||
@close="toggleDrawerOpen(false)"
|
||||
/>
|
||||
</mounting-portal>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ export default {
|
|||
:number-of-reviewers="reviewers.length"
|
||||
:loading="isLoading"
|
||||
:editable="canUpdate"
|
||||
@request-review="requestReview"
|
||||
/>
|
||||
<reviewers
|
||||
v-if="!initialLoading"
|
||||
|
|
|
|||
|
|
@ -101,8 +101,10 @@ export default {
|
|||
:deployment-class="deploymentClass"
|
||||
:has-deployment-metrics="hasDeploymentMetrics"
|
||||
/>
|
||||
|
||||
<merge-train-position-indicator
|
||||
class="mr-widget-extension"
|
||||
:merge-request-state="mr.mergeRequestState"
|
||||
:merge-train-index="mr.mergeTrainIndex"
|
||||
:merge-trains-count="mr.mergeTrainsCount"
|
||||
:merge-trains-path="mr.mergeTrainsPath"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#import "ee_else_ce/vue_merge_request_widget/queries/states/merge_train_position.fragment.graphql"
|
||||
|
||||
subscription getStateSubscription($issuableId: IssuableID!) {
|
||||
mergeRequestMergeStatusUpdated(issuableId: $issuableId) {
|
||||
... on MergeRequest {
|
||||
id
|
||||
detailedMergeStatus
|
||||
commitCount
|
||||
|
||||
...MergeTrainPosition
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,11 +204,7 @@ module WikiActions
|
|||
@page = response.payload[:page]
|
||||
|
||||
if response.success?
|
||||
flash[:toast] = s_('Wiki|Wiki page was successfully updated.')
|
||||
|
||||
redirect_to(
|
||||
wiki_page_path(wiki, page)
|
||||
)
|
||||
handle_action_success :updated, @page
|
||||
else
|
||||
@error = response.message
|
||||
@templates = templates_list
|
||||
|
|
@ -224,11 +220,7 @@ module WikiActions
|
|||
@page = response.payload[:page]
|
||||
|
||||
if response.success?
|
||||
flash[:toast] = s_('Wiki|Wiki page was successfully created.')
|
||||
|
||||
redirect_to(
|
||||
wiki_page_path(wiki, page)
|
||||
)
|
||||
handle_action_success :created, @page
|
||||
else
|
||||
@templates = templates_list
|
||||
|
||||
|
|
@ -292,6 +284,20 @@ module WikiActions
|
|||
|
||||
private
|
||||
|
||||
def handle_action_success(action, page)
|
||||
if page.title == Wiki::SIDEBAR
|
||||
flash[:toast] = s_('Wiki|Sidebar was successfully created.') if action == :created
|
||||
flash[:toast] = s_('Wiki|Sidebar was successfully updated.') if action == :updated
|
||||
|
||||
redirect_to wiki_path(wiki)
|
||||
else
|
||||
flash[:toast] = s_('Wiki|Wiki page was successfully created.') if action == :created
|
||||
flash[:toast] = s_('Wiki|Wiki page was successfully updated.') if action == :updated
|
||||
|
||||
redirect_to(wiki_page_path(wiki, page))
|
||||
end
|
||||
end
|
||||
|
||||
def container
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,25 +9,14 @@ module Types
|
|||
|
||||
connection_type_class Types::CountableConnectionType
|
||||
|
||||
field :open_issues_count, GraphQL::Types::Int, null: false,
|
||||
description: 'Count of open issues that belong to the the catalog resource.',
|
||||
alpha: { milestone: '16.3' }
|
||||
field :id, GraphQL::Types::ID, null: false, description: 'ID of the catalog resource.'
|
||||
|
||||
field :open_merge_requests_count, GraphQL::Types::Int, null: false,
|
||||
description: 'Count of open merge requests that belong to the the catalog resource.',
|
||||
alpha: { milestone: '16.3' }
|
||||
field :name, GraphQL::Types::String, null: true, description: 'Name of the catalog resource.'
|
||||
|
||||
field :id, GraphQL::Types::ID, null: false, description: 'ID of the catalog resource.',
|
||||
alpha: { milestone: '15.11' }
|
||||
|
||||
field :name, GraphQL::Types::String, null: true, description: 'Name of the catalog resource.',
|
||||
alpha: { milestone: '15.11' }
|
||||
|
||||
field :description, GraphQL::Types::String, null: true, description: 'Description of the catalog resource.',
|
||||
alpha: { milestone: '15.11' }
|
||||
field :description, GraphQL::Types::String, null: true, description: 'Description of the catalog resource.'
|
||||
|
||||
field :icon, GraphQL::Types::String, null: true, description: 'Icon for the catalog resource.',
|
||||
method: :avatar_path, alpha: { milestone: '15.11' }
|
||||
method: :avatar_path
|
||||
|
||||
field :full_path, GraphQL::Types::ID, null: true, description: 'Full project path of the catalog resource.',
|
||||
alpha: { milestone: '16.11' }
|
||||
|
|
@ -38,38 +27,26 @@ module Types
|
|||
field :versions, Types::Ci::Catalog::Resources::VersionType.connection_type, null: true,
|
||||
description: 'Versions of the catalog resource. This field can only be ' \
|
||||
'resolved for one catalog resource in any single request.',
|
||||
resolver: Resolvers::Ci::Catalog::Resources::VersionsResolver,
|
||||
alpha: { milestone: '16.2' }
|
||||
resolver: Resolvers::Ci::Catalog::Resources::VersionsResolver
|
||||
|
||||
field :verification_level, Types::Ci::Catalog::Resources::VerificationLevelEnum, null: true,
|
||||
description: 'Verification level of the catalog resource.',
|
||||
alpha: { milestone: '16.9' }
|
||||
description: 'Verification level of the catalog resource.'
|
||||
|
||||
field :latest_released_at, Types::TimeType, null: true,
|
||||
description: "Release date of the catalog resource's latest version.",
|
||||
alpha: { milestone: '16.5' }
|
||||
|
||||
field :star_count, GraphQL::Types::Int, null: false,
|
||||
description: 'Number of times the catalog resource has been starred.',
|
||||
alpha: { milestone: '16.1' }
|
||||
description: 'Number of times the catalog resource has been starred.'
|
||||
|
||||
field :starrers_path, GraphQL::Types::String, null: true,
|
||||
description: 'Relative path to the starrers page for the catalog resource project.',
|
||||
alpha: { milestone: '16.10' }
|
||||
description: 'Relative path to the starrers page for the catalog resource project.'
|
||||
|
||||
field :last_30_day_usage_count, GraphQL::Types::Int, null: false,
|
||||
description: 'Number of projects that used a component from this catalog resource in a pipeline, by using ' \
|
||||
'`include:component`, in the last 30 days.',
|
||||
alpha: { milestone: '17.0' }
|
||||
|
||||
def open_issues_count
|
||||
BatchLoader::GraphQL.wrap(object.project.open_issues_count)
|
||||
end
|
||||
|
||||
def open_merge_requests_count
|
||||
BatchLoader::GraphQL.wrap(object.project.open_merge_requests_count)
|
||||
end
|
||||
|
||||
def web_path
|
||||
::Gitlab::Routing.url_helpers.project_path(object.project)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,20 +9,16 @@ module Types
|
|||
graphql_name 'CiCatalogResourceComponent'
|
||||
|
||||
field :id, ::Types::GlobalIDType[::Ci::Catalog::Resources::Component], null: false,
|
||||
description: 'ID of the component.',
|
||||
alpha: { milestone: '16.7' }
|
||||
description: 'ID of the component.'
|
||||
|
||||
field :name, GraphQL::Types::String, null: true,
|
||||
description: 'Name of the component.',
|
||||
alpha: { milestone: '16.7' }
|
||||
description: 'Name of the component.'
|
||||
|
||||
field :include_path, GraphQL::Types::String, null: true,
|
||||
description: 'Path used to include the component.',
|
||||
alpha: { milestone: '16.7' }
|
||||
description: 'Path used to include the component.'
|
||||
|
||||
field :inputs, [Types::Ci::Catalog::Resources::Components::InputType], null: true,
|
||||
description: 'Inputs for the component.',
|
||||
alpha: { milestone: '16.7' }
|
||||
description: 'Inputs for the component.'
|
||||
|
||||
def inputs
|
||||
spec_inputs = object.spec.fetch('inputs', {})
|
||||
|
|
|
|||
|
|
@ -9,17 +9,9 @@ module Types
|
|||
class InputType < BaseObject
|
||||
graphql_name 'CiCatalogResourceComponentInput'
|
||||
|
||||
field :name, GraphQL::Types::String, null: true,
|
||||
description: 'Name of the input.',
|
||||
alpha: { milestone: '16.7' }
|
||||
|
||||
field :default, GraphQL::Types::String, null: true,
|
||||
description: 'Default value for the input.',
|
||||
alpha: { milestone: '16.7' }
|
||||
|
||||
field :required, GraphQL::Types::Boolean, null: true,
|
||||
description: 'Indicates if an input is required.',
|
||||
alpha: { milestone: '16.7' }
|
||||
field :default, GraphQL::Types::String, null: true, description: 'Default value for the input.'
|
||||
field :name, GraphQL::Types::String, null: true, description: 'Name of the input.'
|
||||
field :required, GraphQL::Types::Boolean, null: true, description: 'Indicates if an input is required.'
|
||||
end
|
||||
# rubocop: enable Graphql/AuthorizeTypes
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,37 +11,29 @@ module Types
|
|||
connection_type_class Types::CountableConnectionType
|
||||
|
||||
field :id, ::Types::GlobalIDType[::Ci::Catalog::Resources::Version], null: false,
|
||||
description: 'Global ID of the version.',
|
||||
alpha: { milestone: '16.7' }
|
||||
description: 'Global ID of the version.'
|
||||
|
||||
field :created_at, Types::TimeType, null: true, description: 'Timestamp of when the version was created.',
|
||||
alpha: { milestone: '16.7' }
|
||||
field :created_at, Types::TimeType, null: true, description: 'Timestamp of when the version was created.'
|
||||
|
||||
field :released_at, Types::TimeType, null: true, description: 'Timestamp of when the version was released.',
|
||||
alpha: { milestone: '16.7' }
|
||||
|
||||
field :name, GraphQL::Types::String, null: true,
|
||||
description: 'Name that uniquely identifies the version within the catalog resource.',
|
||||
alpha: { milestone: '16.8' }
|
||||
description: 'Name that uniquely identifies the version within the catalog resource.'
|
||||
|
||||
field :path, GraphQL::Types::String, null: true,
|
||||
description: 'Relative web path to the version\'s readme.',
|
||||
alpha: { milestone: '16.8' }
|
||||
description: 'Relative web path to the version.'
|
||||
|
||||
field :author, Types::UserType, null: true, description: 'User that created the version.',
|
||||
alpha: { milestone: '16.7' }
|
||||
field :author, Types::UserType, null: true, description: 'User that created the version.'
|
||||
|
||||
field :commit, Types::CommitType, null: true, complexity: 10, calls_gitaly: true,
|
||||
description: 'Commit associated with the version.',
|
||||
alpha: { milestone: '16.7' }
|
||||
description: 'Commit associated with the version.'
|
||||
|
||||
field :components, Types::Ci::Catalog::Resources::ComponentType.connection_type, null: true,
|
||||
description: 'Components belonging to the catalog resource.',
|
||||
alpha: { milestone: '16.7' }
|
||||
description: 'Components belonging to the catalog resource.'
|
||||
|
||||
field :readme, GraphQL::Types::String, null: true, calls_gitaly: true,
|
||||
description: 'Readme data.',
|
||||
alpha: { milestone: '16.8' } do
|
||||
description: 'Readme data.' do
|
||||
extension ::Gitlab::Graphql::Limit::FieldCallCount, limit: 1
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,13 @@ module Ci
|
|||
self.upsert(entry.attributes.compact, returning: %w[build_id], unique_by: :build_id)
|
||||
end
|
||||
|
||||
def namespace_transfer_params(namespace)
|
||||
{
|
||||
namespace_traversal_ids: namespace.traversal_ids,
|
||||
namespace_id: namespace.id
|
||||
}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def args_from_build(build)
|
||||
|
|
|
|||
|
|
@ -242,6 +242,8 @@ class Issue < ApplicationRecord
|
|||
scope :with_non_null_relative_position, -> { where.not(relative_position: nil) }
|
||||
scope :with_projects_matching_search_data, -> { where('issue_search_data.project_id = issues.project_id') }
|
||||
|
||||
scope :with_work_item_type, -> { joins(:work_item_type) }
|
||||
|
||||
before_validation :ensure_namespace_id, :ensure_work_item_type
|
||||
|
||||
after_save :ensure_metrics!, unless: :skip_metrics?
|
||||
|
|
|
|||
|
|
@ -6,4 +6,5 @@ class GroupIssuableAutocompleteEntity < Grape::Entity
|
|||
expose :reference do |issuable, options|
|
||||
issuable.to_reference(options[:parent_group])
|
||||
end
|
||||
expose :icon_name, safe: true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Ci
|
||||
class UpdateGroupPendingBuildService
|
||||
BATCH_SIZE = 500
|
||||
BATCH_QUIET_PERIOD = 2.seconds
|
||||
|
||||
def initialize(group, update_params)
|
||||
@group = group
|
||||
@update_params = update_params.symbolize_keys
|
||||
end
|
||||
|
||||
def execute
|
||||
Ci::UpdatePendingBuildService.new(@group, @update_params).execute
|
||||
|
||||
@group.descendants.each_batch(of: BATCH_SIZE) do |subgroups|
|
||||
subgroups.each do |subgroup|
|
||||
Ci::UpdatePendingBuildService.new(subgroup, update_params_for_group(subgroup)).execute
|
||||
end
|
||||
|
||||
sleep BATCH_QUIET_PERIOD
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def update_params_for_group(group)
|
||||
# Update the params with an eventual updated version from Ci::PendingBuild.namespace_transfer_params
|
||||
transfer_params = Ci::PendingBuild.namespace_transfer_params(group)
|
||||
@update_params.merge(transfer_params.slice(*@update_params.keys))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -35,7 +35,7 @@ module Ci
|
|||
def validate_params!
|
||||
extra_params = @update_params.keys - VALID_PARAMS
|
||||
|
||||
raise InvalidParamsError, "Unvalid params: #{extra_params.join(', ')}" unless extra_params.empty?
|
||||
raise InvalidParamsError, "Invalid params: #{extra_params.join(', ')}" if extra_params.any?
|
||||
|
||||
true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ module Git
|
|||
end
|
||||
|
||||
def branch_remove_hooks
|
||||
enqueue_jira_connect_remove_branches
|
||||
project.repository.after_remove_branch(expire_cache: false)
|
||||
end
|
||||
|
||||
|
|
@ -168,6 +169,20 @@ module Git
|
|||
end
|
||||
end
|
||||
|
||||
def enqueue_jira_connect_remove_branches
|
||||
return unless Feature.enabled?(:jira_connect_remove_branches, project)
|
||||
return unless project.jira_subscription_exists?
|
||||
|
||||
return unless Atlassian::JiraIssueKeyExtractors::Branch.has_keys?(project, branch_name)
|
||||
|
||||
Integrations::JiraConnect::RemoveBranchWorker.perform_async(
|
||||
project.id,
|
||||
{
|
||||
branch_name: branch_name
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
def filtered_commit_shas
|
||||
limited_commits.select { |commit| Atlassian::JiraIssueKeyExtractor.has_keys?(commit.safe_message) }.map(&:sha)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ module Groups
|
|||
IssuesFinder.new(current_user, finder_params)
|
||||
.execute
|
||||
.preload(project: :namespace)
|
||||
.select(:iid, :title, :project_id, :namespace_id)
|
||||
.with_work_item_type
|
||||
.select(:iid, :title, :project_id, :namespace_id, 'work_item_types.icon_name')
|
||||
end
|
||||
# rubocop: enable CodeReuse/ActiveRecord
|
||||
|
||||
|
|
|
|||
|
|
@ -307,10 +307,7 @@ module Groups
|
|||
end
|
||||
|
||||
def pending_builds_params
|
||||
{
|
||||
namespace_traversal_ids: group.traversal_ids,
|
||||
namespace_id: group.id
|
||||
}
|
||||
::Ci::PendingBuild.namespace_transfer_params(group)
|
||||
end
|
||||
|
||||
def update_crm_objects(was_root_group)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ module Groups
|
|||
group.run_after_commit_or_now do |group|
|
||||
pending_builds_params = { instance_runners_enabled: group.shared_runners_enabled }
|
||||
|
||||
::Ci::UpdatePendingBuildService.new(group, pending_builds_params).execute
|
||||
::Ci::PendingBuilds::UpdateGroupWorker.perform_async(group.id, pending_builds_params)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,10 @@ module Projects
|
|||
include Routing::WikiHelper
|
||||
|
||||
def issues
|
||||
IssuesFinder.new(current_user, project_id: project.id, state: 'opened').execute.select([:iid, :title])
|
||||
IssuesFinder.new(current_user, project_id: project.id, state: 'opened')
|
||||
.execute
|
||||
.with_work_item_type
|
||||
.select([:iid, :title, 'work_item_types.icon_name'])
|
||||
end
|
||||
|
||||
def milestones
|
||||
|
|
|
|||
|
|
@ -275,10 +275,7 @@ module Projects
|
|||
end
|
||||
|
||||
def pending_builds_params
|
||||
{
|
||||
namespace_id: new_namespace.id,
|
||||
namespace_traversal_ids: new_namespace.traversal_ids
|
||||
}
|
||||
::Ci::PendingBuild.namespace_transfer_params(new_namespace)
|
||||
end
|
||||
|
||||
def remove_issue_contacts
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
module Packages
|
||||
module GcsSignedUrlMetadata
|
||||
def url(*args, **kwargs)
|
||||
return super if ::Feature.disabled?(:augment_gcs_signed_url_with_metadata, Feature.current_request)
|
||||
return super unless fog_credentials[:provider] == 'Google' && Gitlab.com? # rubocop:disable Gitlab/AvoidGitlabInstanceChecks -- As per https://gitlab.com/groups/gitlab-org/-/epics/8834, we are only interested in egress traffic on Gitlab.com
|
||||
|
||||
project = model.try(:project)
|
||||
|
|
|
|||
|
|
@ -6,17 +6,12 @@
|
|||
- @noteable_type = 'Wiki'
|
||||
- templates = @templates.map { |t| wiki_page_basic_info(t) }
|
||||
|
||||
- if @page.persisted?
|
||||
- page_title = @page.template? ? s_("Wiki|Edit template") : s_("Wiki|Edit page")
|
||||
- else
|
||||
- page_title = @page.template? ? s_("Wiki|New template") : s_("Wiki|New page")
|
||||
|
||||
= form_errors(@page, truncate: :title)
|
||||
|
||||
#js-vue-wiki-edit-app{ data: {
|
||||
testid: 'wiki-page-edit-app',
|
||||
error: @error,
|
||||
page_heading: page_title,
|
||||
page_heading: @page.title,
|
||||
page_info: wiki_page_info(@page, uploads_path: wiki_attachment_upload_url).to_json,
|
||||
is_page_template: @page.template?.to_s,
|
||||
page_persisted: (@page.persisted? && can?(current_user, :create_wiki, @wiki.container)).to_s,
|
||||
|
|
|
|||
|
|
@ -1542,6 +1542,15 @@
|
|||
:weight: 2
|
||||
:idempotent: true
|
||||
:tags: []
|
||||
- :name: jira_connect:integrations_jira_connect_remove_branch
|
||||
:worker_name: Integrations::JiraConnect::RemoveBranchWorker
|
||||
:feature_category: :integrations
|
||||
:has_external_dependencies: true
|
||||
:urgency: :low
|
||||
:resource_boundary: :unknown
|
||||
:weight: 1
|
||||
:idempotent: false
|
||||
:tags: []
|
||||
- :name: jira_connect:jira_connect_forward_event
|
||||
:worker_name: JiraConnect::ForwardEventWorker
|
||||
:feature_category: :integrations
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ module Ci
|
|||
|
||||
def perform(group_id, update_params)
|
||||
::Group.find_by_id(group_id).try do |group|
|
||||
::Ci::UpdatePendingBuildService.new(group, update_params).execute
|
||||
::Ci::UpdateGroupPendingBuildService.new(group, update_params).execute
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Integrations
|
||||
module JiraConnect
|
||||
class RemoveBranchWorker # rubocop:disable Scalability/IdempotentWorker -- disabled in other JiraConnect workers
|
||||
include ApplicationWorker
|
||||
|
||||
sidekiq_options retry: 3
|
||||
queue_namespace :jira_connect
|
||||
feature_category :integrations
|
||||
data_consistency :delayed
|
||||
loggable_arguments 1, 2
|
||||
urgency :low
|
||||
|
||||
worker_has_external_dependencies!
|
||||
|
||||
def perform(project_id, params = {})
|
||||
project = Project.find_by_id(project_id)
|
||||
|
||||
return unless project
|
||||
|
||||
params.symbolize_keys!
|
||||
branch_name = params[:branch_name]
|
||||
|
||||
::JiraConnect::SyncService.new(project).execute(
|
||||
remove_branch_info: branch_name
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
name: ci_expand_nested_resource_group_variables
|
||||
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/361438
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155594
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/466168
|
||||
milestone: '17.1'
|
||||
group: group::pipeline security
|
||||
type: gitlab_com_derisk
|
||||
default_enabled: false
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
name: augment_gcs_signed_url_with_metadata
|
||||
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/443335
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147207
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/458729
|
||||
milestone: '17.0'
|
||||
group: group::package registry
|
||||
name: jira_connect_remove_branches
|
||||
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/351625
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148712
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/456457
|
||||
milestone: '17.1'
|
||||
group: group::import and integrate
|
||||
type: gitlab_com_derisk
|
||||
default_enabled: false
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class IndexUnarchivedSbomOccurrencesForAggregationsPackageManager < Gitlab::Database::Migration[2.2]
|
||||
INDEX_NAME = 'index_unarchived_occurrences_for_aggregations_package_manager'
|
||||
COLUMNS = [:traversal_ids, :package_manager, :component_id, :component_version_id]
|
||||
|
||||
milestone '17.1'
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
# rubocop:disable Migration/PreventIndexCreation -- Discussed in cop MR
|
||||
add_concurrent_index :sbom_occurrences, COLUMNS, where: 'archived = false', name: INDEX_NAME
|
||||
# rubocop:enable Migration/PreventIndexCreation
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name :sbom_occurrences, INDEX_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1 @@
|
|||
e5e5bcd546de58c4b4d09e30782bdaec70f754869044dd7c4a6fc90290b6cbb5
|
||||
|
|
@ -28420,6 +28420,8 @@ CREATE UNIQUE INDEX index_trending_projects_on_project_id ON trending_projects U
|
|||
|
||||
CREATE INDEX index_unarchived_occurrences_for_aggregations_component_name ON sbom_occurrences USING btree (traversal_ids, component_name, component_id, component_version_id) WHERE (archived = false);
|
||||
|
||||
CREATE INDEX index_unarchived_occurrences_for_aggregations_package_manager ON sbom_occurrences USING btree (traversal_ids, package_manager, component_id, component_version_id) WHERE (archived = false);
|
||||
|
||||
CREATE INDEX index_unarchived_occurrences_for_aggregations_severity ON sbom_occurrences USING btree (traversal_ids, highest_severity, component_id, component_version_id) WHERE (archived = false);
|
||||
|
||||
CREATE INDEX index_unarchived_occurrences_on_version_id_and_traversal_ids ON sbom_occurrences USING btree (component_version_id, traversal_ids) WHERE (archived = false);
|
||||
|
|
|
|||
|
|
@ -17518,18 +17518,16 @@ Represents the total number of issues and their weights for a particular day.
|
|||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="cicatalogresourcedescription"></a>`description` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 15.11. **Status**: Experiment. Description of the catalog resource. |
|
||||
| <a id="cicatalogresourcedescription"></a>`description` | [`String`](#string) | Description of the catalog resource. |
|
||||
| <a id="cicatalogresourcefullpath"></a>`fullPath` **{warning-solid}** | [`ID`](#id) | **Introduced** in GitLab 16.11. **Status**: Experiment. Full project path of the catalog resource. |
|
||||
| <a id="cicatalogresourceicon"></a>`icon` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 15.11. **Status**: Experiment. Icon for the catalog resource. |
|
||||
| <a id="cicatalogresourceid"></a>`id` **{warning-solid}** | [`ID!`](#id) | **Introduced** in GitLab 15.11. **Status**: Experiment. ID of the catalog resource. |
|
||||
| <a id="cicatalogresourceicon"></a>`icon` | [`String`](#string) | Icon for the catalog resource. |
|
||||
| <a id="cicatalogresourceid"></a>`id` | [`ID!`](#id) | ID of the catalog resource. |
|
||||
| <a id="cicatalogresourcelast30dayusagecount"></a>`last30DayUsageCount` **{warning-solid}** | [`Int!`](#int) | **Introduced** in GitLab 17.0. **Status**: Experiment. Number of projects that used a component from this catalog resource in a pipeline, by using `include:component`, in the last 30 days. |
|
||||
| <a id="cicatalogresourcelatestreleasedat"></a>`latestReleasedAt` **{warning-solid}** | [`Time`](#time) | **Introduced** in GitLab 16.5. **Status**: Experiment. Release date of the catalog resource's latest version. |
|
||||
| <a id="cicatalogresourcename"></a>`name` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 15.11. **Status**: Experiment. Name of the catalog resource. |
|
||||
| <a id="cicatalogresourceopenissuescount"></a>`openIssuesCount` **{warning-solid}** | [`Int!`](#int) | **Introduced** in GitLab 16.3. **Status**: Experiment. Count of open issues that belong to the the catalog resource. |
|
||||
| <a id="cicatalogresourceopenmergerequestscount"></a>`openMergeRequestsCount` **{warning-solid}** | [`Int!`](#int) | **Introduced** in GitLab 16.3. **Status**: Experiment. Count of open merge requests that belong to the the catalog resource. |
|
||||
| <a id="cicatalogresourcestarcount"></a>`starCount` **{warning-solid}** | [`Int!`](#int) | **Introduced** in GitLab 16.1. **Status**: Experiment. Number of times the catalog resource has been starred. |
|
||||
| <a id="cicatalogresourcestarrerspath"></a>`starrersPath` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 16.10. **Status**: Experiment. Relative path to the starrers page for the catalog resource project. |
|
||||
| <a id="cicatalogresourceverificationlevel"></a>`verificationLevel` **{warning-solid}** | [`CiCatalogResourceVerificationLevel`](#cicatalogresourceverificationlevel) | **Introduced** in GitLab 16.9. **Status**: Experiment. Verification level of the catalog resource. |
|
||||
| <a id="cicatalogresourcename"></a>`name` | [`String`](#string) | Name of the catalog resource. |
|
||||
| <a id="cicatalogresourcestarcount"></a>`starCount` | [`Int!`](#int) | Number of times the catalog resource has been starred. |
|
||||
| <a id="cicatalogresourcestarrerspath"></a>`starrersPath` | [`String`](#string) | Relative path to the starrers page for the catalog resource project. |
|
||||
| <a id="cicatalogresourceverificationlevel"></a>`verificationLevel` | [`CiCatalogResourceVerificationLevel`](#cicatalogresourceverificationlevel) | Verification level of the catalog resource. |
|
||||
| <a id="cicatalogresourcewebpath"></a>`webPath` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 16.1. **Status**: Experiment. Web path of the catalog resource. |
|
||||
|
||||
#### Fields with arguments
|
||||
|
|
@ -17538,10 +17536,6 @@ Represents the total number of issues and their weights for a particular day.
|
|||
|
||||
Versions of the catalog resource. This field can only be resolved for one catalog resource in any single request.
|
||||
|
||||
DETAILS:
|
||||
**Introduced** in GitLab 16.2.
|
||||
**Status**: Experiment.
|
||||
|
||||
Returns [`CiCatalogResourceVersionConnection`](#cicatalogresourceversionconnection).
|
||||
|
||||
This field returns a [connection](#connections). It accepts the
|
||||
|
|
@ -17560,10 +17554,10 @@ four standard [pagination arguments](#pagination-arguments):
|
|||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="cicatalogresourcecomponentid"></a>`id` **{warning-solid}** | [`CiCatalogResourcesComponentID!`](#cicatalogresourcescomponentid) | **Introduced** in GitLab 16.7. **Status**: Experiment. ID of the component. |
|
||||
| <a id="cicatalogresourcecomponentincludepath"></a>`includePath` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 16.7. **Status**: Experiment. Path used to include the component. |
|
||||
| <a id="cicatalogresourcecomponentinputs"></a>`inputs` **{warning-solid}** | [`[CiCatalogResourceComponentInput!]`](#cicatalogresourcecomponentinput) | **Introduced** in GitLab 16.7. **Status**: Experiment. Inputs for the component. |
|
||||
| <a id="cicatalogresourcecomponentname"></a>`name` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 16.7. **Status**: Experiment. Name of the component. |
|
||||
| <a id="cicatalogresourcecomponentid"></a>`id` | [`CiCatalogResourcesComponentID!`](#cicatalogresourcescomponentid) | ID of the component. |
|
||||
| <a id="cicatalogresourcecomponentincludepath"></a>`includePath` | [`String`](#string) | Path used to include the component. |
|
||||
| <a id="cicatalogresourcecomponentinputs"></a>`inputs` | [`[CiCatalogResourceComponentInput!]`](#cicatalogresourcecomponentinput) | Inputs for the component. |
|
||||
| <a id="cicatalogresourcecomponentname"></a>`name` | [`String`](#string) | Name of the component. |
|
||||
|
||||
### `CiCatalogResourceComponentInput`
|
||||
|
||||
|
|
@ -17571,9 +17565,9 @@ four standard [pagination arguments](#pagination-arguments):
|
|||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="cicatalogresourcecomponentinputdefault"></a>`default` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 16.7. **Status**: Experiment. Default value for the input. |
|
||||
| <a id="cicatalogresourcecomponentinputname"></a>`name` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 16.7. **Status**: Experiment. Name of the input. |
|
||||
| <a id="cicatalogresourcecomponentinputrequired"></a>`required` **{warning-solid}** | [`Boolean`](#boolean) | **Introduced** in GitLab 16.7. **Status**: Experiment. Indicates if an input is required. |
|
||||
| <a id="cicatalogresourcecomponentinputdefault"></a>`default` | [`String`](#string) | Default value for the input. |
|
||||
| <a id="cicatalogresourcecomponentinputname"></a>`name` | [`String`](#string) | Name of the input. |
|
||||
| <a id="cicatalogresourcecomponentinputrequired"></a>`required` | [`Boolean`](#boolean) | Indicates if an input is required. |
|
||||
|
||||
### `CiCatalogResourceVersion`
|
||||
|
||||
|
|
@ -17581,14 +17575,14 @@ four standard [pagination arguments](#pagination-arguments):
|
|||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="cicatalogresourceversionauthor"></a>`author` **{warning-solid}** | [`UserCore`](#usercore) | **Introduced** in GitLab 16.7. **Status**: Experiment. User that created the version. |
|
||||
| <a id="cicatalogresourceversioncommit"></a>`commit` **{warning-solid}** | [`Commit`](#commit) | **Introduced** in GitLab 16.7. **Status**: Experiment. Commit associated with the version. |
|
||||
| <a id="cicatalogresourceversioncomponents"></a>`components` **{warning-solid}** | [`CiCatalogResourceComponentConnection`](#cicatalogresourcecomponentconnection) | **Introduced** in GitLab 16.7. **Status**: Experiment. Components belonging to the catalog resource. |
|
||||
| <a id="cicatalogresourceversioncreatedat"></a>`createdAt` **{warning-solid}** | [`Time`](#time) | **Introduced** in GitLab 16.7. **Status**: Experiment. Timestamp of when the version was created. |
|
||||
| <a id="cicatalogresourceversionid"></a>`id` **{warning-solid}** | [`CiCatalogResourcesVersionID!`](#cicatalogresourcesversionid) | **Introduced** in GitLab 16.7. **Status**: Experiment. Global ID of the version. |
|
||||
| <a id="cicatalogresourceversionname"></a>`name` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 16.8. **Status**: Experiment. Name that uniquely identifies the version within the catalog resource. |
|
||||
| <a id="cicatalogresourceversionpath"></a>`path` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 16.8. **Status**: Experiment. Relative web path to the version's readme. |
|
||||
| <a id="cicatalogresourceversionreadme"></a>`readme` **{warning-solid}** | [`String`](#string) | **Introduced** in GitLab 16.8. **Status**: Experiment. Readme data. |
|
||||
| <a id="cicatalogresourceversionauthor"></a>`author` | [`UserCore`](#usercore) | User that created the version. |
|
||||
| <a id="cicatalogresourceversioncommit"></a>`commit` | [`Commit`](#commit) | Commit associated with the version. |
|
||||
| <a id="cicatalogresourceversioncomponents"></a>`components` | [`CiCatalogResourceComponentConnection`](#cicatalogresourcecomponentconnection) | Components belonging to the catalog resource. (see [Connections](#connections)) |
|
||||
| <a id="cicatalogresourceversioncreatedat"></a>`createdAt` | [`Time`](#time) | Timestamp of when the version was created. |
|
||||
| <a id="cicatalogresourceversionid"></a>`id` | [`CiCatalogResourcesVersionID!`](#cicatalogresourcesversionid) | Global ID of the version. |
|
||||
| <a id="cicatalogresourceversionname"></a>`name` | [`String`](#string) | Name that uniquely identifies the version within the catalog resource. |
|
||||
| <a id="cicatalogresourceversionpath"></a>`path` | [`String`](#string) | Relative web path to the version. |
|
||||
| <a id="cicatalogresourceversionreadme"></a>`readme` | [`String`](#string) | Readme data. |
|
||||
| <a id="cicatalogresourceversionreadmehtml"></a>`readmeHtml` | [`String`](#string) | GitLab Flavored Markdown rendering of `readme`. |
|
||||
| <a id="cicatalogresourceversionreleasedat"></a>`releasedAt` **{warning-solid}** | [`Time`](#time) | **Introduced** in GitLab 16.7. **Status**: Experiment. Timestamp of when the version was released. |
|
||||
|
||||
|
|
@ -22792,6 +22786,7 @@ Returns [`VulnerabilitySeveritiesCount`](#vulnerabilityseveritiescount).
|
|||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="groupvulnerabilityseveritiescountcapped"></a>`capped` | [`Boolean`](#boolean) | Default value is false. When set to true, the count returned for each severity is capped at a maximum of 1001. |
|
||||
| <a id="groupvulnerabilityseveritiescountclusteragentid"></a>`clusterAgentId` | [`[ClustersAgentID!]`](#clustersagentid) | Filter vulnerabilities by `cluster_agent_id`. Vulnerabilities with a `reportType` of `cluster_image_scanning` are only included with this filter. |
|
||||
| <a id="groupvulnerabilityseveritiescountdismissalreason"></a>`dismissalReason` | [`[VulnerabilityDismissalReason!]`](#vulnerabilitydismissalreason) | Filter by dismissal reason. |
|
||||
| <a id="groupvulnerabilityseveritiescounthasissues"></a>`hasIssues` | [`Boolean`](#boolean) | Filter vulnerabilities that do or do not have issues. |
|
||||
|
|
@ -23428,6 +23423,7 @@ Returns [`VulnerabilitySeveritiesCount`](#vulnerabilityseveritiescount).
|
|||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="instancesecuritydashboardvulnerabilityseveritiescountcapped"></a>`capped` | [`Boolean`](#boolean) | Default value is false. When set to true, the count returned for each severity is capped at a maximum of 1001. |
|
||||
| <a id="instancesecuritydashboardvulnerabilityseveritiescountclusteragentid"></a>`clusterAgentId` | [`[ClustersAgentID!]`](#clustersagentid) | Filter vulnerabilities by `cluster_agent_id`. Vulnerabilities with a `reportType` of `cluster_image_scanning` are only included with this filter. |
|
||||
| <a id="instancesecuritydashboardvulnerabilityseveritiescountdismissalreason"></a>`dismissalReason` | [`[VulnerabilityDismissalReason!]`](#vulnerabilitydismissalreason) | Filter by dismissal reason. |
|
||||
| <a id="instancesecuritydashboardvulnerabilityseveritiescounthasissues"></a>`hasIssues` | [`Boolean`](#boolean) | Filter vulnerabilities that do or do not have issues. |
|
||||
|
|
@ -29026,6 +29022,7 @@ Returns [`VulnerabilitySeveritiesCount`](#vulnerabilityseveritiescount).
|
|||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="projectvulnerabilityseveritiescountcapped"></a>`capped` | [`Boolean`](#boolean) | Default value is false. When set to true, the count returned for each severity is capped at a maximum of 1001. |
|
||||
| <a id="projectvulnerabilityseveritiescountclusteragentid"></a>`clusterAgentId` | [`[ClustersAgentID!]`](#clustersagentid) | Filter vulnerabilities by `cluster_agent_id`. Vulnerabilities with a `reportType` of `cluster_image_scanning` are only included with this filter. |
|
||||
| <a id="projectvulnerabilityseveritiescountdismissalreason"></a>`dismissalReason` | [`[VulnerabilityDismissalReason!]`](#vulnerabilitydismissalreason) | Filter by dismissal reason. |
|
||||
| <a id="projectvulnerabilityseveritiescounthasissues"></a>`hasIssues` | [`Boolean`](#boolean) | Filter vulnerabilities that do or do not have issues. |
|
||||
|
|
|
|||
|
|
@ -118,9 +118,9 @@ If you're proposing to fetch data from an external public database (e.g. fetchin
|
|||
|
||||
Using a new embedding model or persisting data into a new storage would require [legal reviews](https://handbook.gitlab.com/handbook/legal/). See the following links for more information:
|
||||
|
||||
- [Data privacy](../../../user/ai_data_usage.md#data-privacy)
|
||||
- [Data retention](../../../user/ai_data_usage.md#data-retention)
|
||||
- [Training data](../../../user/ai_data_usage.md#training-data)
|
||||
- [Data privacy](../../../user/gitlab_duo/data_usage.md#data-privacy)
|
||||
- [Data retention](../../../user/gitlab_duo/data_usage.md#data-retention)
|
||||
- [Training data](../../../user/gitlab_duo/data_usage.md#training-data)
|
||||
|
||||
## Evaluation
|
||||
|
||||
|
|
|
|||
|
|
@ -43,29 +43,19 @@ To break down implementation, we are taking the following steps:
|
|||
|
||||
## Implementation Details
|
||||
|
||||
### Stage 1 - Split GraphQL and REST Instances
|
||||
|
||||
| Issue | MR | Status |
|
||||
| ----- | -- | ------ |
|
||||
| [Move legacy files to new directory](https://gitlab.com/gitlab-org/gitlab/-/work_items/464375) | [154625](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154625) | ✅ |
|
||||
| [Move remaining legacy code](https://gitlab.com/gitlab-org/gitlab/-/work_items/464379) | [154818](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154818) | ✅ |
|
||||
| [Create README for PMG](https://gitlab.com/gitlab-org/gitlab/-/work_items/464632) | [154964](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154964) | In Review |
|
||||
|
||||
### Stage 2 - Complete GraphQL Support
|
||||
|
||||
| Issue | MR | Status |
|
||||
| ----- | -- | ------ |
|
||||
| [GraphQL Query Optimization](https://gitlab.com/gitlab-org/gitlab/-/issues/465309) | [465309](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155129) | In Review |
|
||||
| [Dedicated component for downstream pipelines](https://gitlab.com/gitlab-org/gitlab/-/work_items/465575) | [155382](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155382) | In Dev |
|
||||
| [Fetch Stage by ID](https://gitlab.com/gitlab-org/gitlab/-/issues/464100) | TBD | Not Started |
|
||||
|
||||
### Stage 3 - Rollout GraphQL Support Globally
|
||||
|
||||
| Issue | MR | Status |
|
||||
| ----- | -- | ------ |
|
||||
| Migrate available apps to GraphQL instance | TBD | Not Started |
|
||||
| [Rollout `ci_graphql_pipeline_mini_graph`](https://gitlab.com/gitlab-org/gitlab/-/issues/407818) | TBD | Not Started |
|
||||
| Remove GraphQL logic from commit widget, pipeline editor | TBD | Not Started |
|
||||
| Issue | Milestone | MR | Status |
|
||||
| ----- | --------- | -- | ------ |
|
||||
| [Move legacy files to new directory](https://gitlab.com/gitlab-org/gitlab/-/work_items/464375) | [17.1](https://gitlab.com/groups/gitlab-org/-/milestones/99#tab-issues) | [154625](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154625) | ✅ |
|
||||
| [Move remaining legacy code](https://gitlab.com/gitlab-org/gitlab/-/work_items/464379) | [17.1](https://gitlab.com/groups/gitlab-org/-/milestones/99#tab-issues) |[154818](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154818) | ✅ |
|
||||
| [Create README for PMG](https://gitlab.com/gitlab-org/gitlab/-/work_items/464632) | [17.1](https://gitlab.com/groups/gitlab-org/-/milestones/99#tab-issues) | [154964](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154964) | ✅ |
|
||||
| [GraphQL Query Optimization](https://gitlab.com/gitlab-org/gitlab/-/issues/465309) | [17.1](https://gitlab.com/groups/gitlab-org/-/milestones/99#tab-issues) | [465309](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155129) | ✅ |
|
||||
| [Dedicated component for downstream pipelines](https://gitlab.com/gitlab-org/gitlab/-/issues/466238) | [17.1](https://gitlab.com/groups/gitlab-org/-/milestones/99#tab-issues) | [155382](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155382) | In Review |
|
||||
| [Fetch Stage by ID](https://gitlab.com/gitlab-org/gitlab/-/issues/464100) | [17.2](https://gitlab.com/groups/gitlab-org/-/milestones/100#tab-issues) | TBD | In Dev |
|
||||
| [Rollout `ci_graphql_pipeline_mini_graph`](https://gitlab.com/gitlab-org/gitlab/-/issues/407818) | [17.2](https://gitlab.com/groups/gitlab-org/-/milestones/100#tab-issues) | TBD | Blocked |
|
||||
| [Migrate MR PMG to GraphQL instance](https://gitlab.com/gitlab-org/gitlab/-/issues/419725) | [17.2](https://gitlab.com/groups/gitlab-org/-/milestones/100#tab-issues) | TBD | Blocked |
|
||||
| [Migrate pipeline editor PMG to GraphQL instance](https://gitlab.com/gitlab-org/gitlab/-/issues/466275) | TBD | TBD | Blocked |
|
||||
| [Migrate commit page PMG to GraphQL instance](https://gitlab.com/gitlab-org/gitlab/-/issues/466274) | TBD | TBD | Blocked |
|
||||
| [Remove dead logic from PMG codebase](https://gitlab.com/gitlab-org/gitlab/-/issues/466277) | TBD | TBD | Blocked |
|
||||
|
||||
## Design Details
|
||||
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ To decide if the service is available or visible to the end user, we need to:
|
|||
```
|
||||
|
||||
- Optional. If the service has free access, this usually means that the experimental features are subject to the [Testing Agreement](https://handbook.gitlab.com/handbook/legal/testing-agreement/).
|
||||
- For GitLab Duo features, the customer needs to enable [experimental toggle](../../user/ai_features_enable.md#turn-on-beta-and-experimental-features) in order to use experimental features for free.
|
||||
- For GitLab Duo features, the customer needs to enable [experimental toggle](../../user/gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features) in order to use experimental features for free.
|
||||
|
||||
- On GitLab.com and self-managed GitLab, if the service is not accessible for free, check if the add-on bundled with this service has been purchased by the customer (for the group/namespace)
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ you can [configure](https://marketplace.visualstudio.com/items?itemName=GitLab.g
|
|||
- [Features to display or hide](https://gitlab.com/gitlab-org/gitlab-vscode-extension#extension-settings).
|
||||
- [Self-signed certificate](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#self-signed-certificates) information.
|
||||
- [Code Suggestions](../../user/project/repository/code_suggestions/index.md).
|
||||
- [GitLab Duo Chat](../../user/gitlab_duo_chat.md#use-gitlab-duo-chat-in-vs-code).
|
||||
- [GitLab Duo Chat](../../user/gitlab_duo_chat/index.md#use-gitlab-duo-chat-in-vs-code).
|
||||
|
||||
## Report issues with the extension
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ This table shows the features available with the Jira DVCS connector and the Git
|
|||
| Sync feature flags | **{dotted-circle}** No | **{check-circle}** Yes |
|
||||
| Sync interval | Up to 60 minutes | Real time |
|
||||
| Create branches | **{dotted-circle}** No | **{check-circle}** Yes (GitLab.com only) |
|
||||
| Delete branches | **{dotted-circle}** No | **{check-circle}** Yes ([introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148712) in GitLab 17.1) |
|
||||
| Create a merge request from a branch | **{check-circle}** Yes | **{check-circle}** Yes |
|
||||
| Create a branch from a Jira issue | **{dotted-circle}** No | **{check-circle}** Yes |
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ Prerequisites:
|
|||
#### Configure network and proxy settings
|
||||
|
||||
For self-managed instances, to enable GitLab Duo features,
|
||||
you must [enable network connectivity](../user/ai_features_enable.md#configure-gitlab-duo-on-a-self-managed-instance).
|
||||
you must [enable network connectivity](../user/ai_features_enable.md).
|
||||
|
||||
## Assign and remove GitLab Duo Pro seats in bulk
|
||||
|
||||
|
|
|
|||
|
|
@ -1,76 +1,11 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: AI Model Validation
|
||||
description: AI-powered features and functionality.
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
redirect_to: '../user/gitlab_duo/data_usage.md'
|
||||
remove_date: '2024-09-07'
|
||||
---
|
||||
|
||||
# GitLab Duo data usage
|
||||
This document was moved to [another location](../user/gitlab_duo/data_usage.md).
|
||||
|
||||
GitLab Duo uses generative AI to help increase your velocity and make you more productive. Each AI-powered feature operates independently and is not required for other features to function.
|
||||
|
||||
GitLab uses best-in-class large language models (LLMs) for specific tasks. These LLMs are
|
||||
[Google Vertex AI Models](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview#genai-models)
|
||||
and [Anthropic Claude](https://www.anthropic.com/product).
|
||||
|
||||
## Progressive enhancement
|
||||
|
||||
GitLab Duo AI-powered features are designed as a progressive enhancement to existing GitLab features across the DevSecOps platform. These features are designed to fail gracefully and should not prevent the core functionality of the underlying feature. You should note each feature is subject to its expected functionality as defined by the relevant [feature support policy](../policy/experiment-beta-support.md).
|
||||
|
||||
## Stability and performance
|
||||
|
||||
GitLab Duo AI-powered features are in a variety of [feature support levels](../policy/experiment-beta-support.md#beta). Due to the nature of these features, there may be high demand for usage which may cause degraded performance or unexpected downtime of the feature. We have built these features to gracefully degrade and have controls in place to allow us to mitigate abuse or misuse. GitLab may disable beta and experimental features for any or all customers at any time at our discretion.
|
||||
|
||||
## Data privacy
|
||||
|
||||
GitLab Duo AI-powered features are powered by a generative AI model. The processing of any personal data is in accordance with our [Privacy Statement](https://about.gitlab.com/privacy/). You may also visit the [Sub-Processors page](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors) to see the list of Sub-Processors we use to provide these features.
|
||||
|
||||
## Data retention
|
||||
|
||||
The below reflects the current retention periods of GitLab AI model [Sub-Processors](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors):
|
||||
|
||||
- Anthropic discards model input and output data immediately after the output is provided. Anthropic currently does not store data for abuse monitoring. Model input and output is not used to train models.
|
||||
- Google discards model input and output data immediately after the output is provided. Google currently does not store data for abuse monitoring. Model input and output is not used to train models.
|
||||
|
||||
All of these AI providers are under data protection agreements with GitLab that prohibit the use of Customer Content for their own purposes, except to perform their independent legal obligations.
|
||||
|
||||
GitLab retains input and output for up to 30 days for the purpose of troubleshooting, debugging, and addressing latency issues.
|
||||
|
||||
## Training data
|
||||
|
||||
GitLab does not train generative AI models based on private (non-public) data. The vendors we work with also do not train models based on private data.
|
||||
|
||||
For more information on our AI [sub-processors](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors), see:
|
||||
|
||||
- Google Vertex AI Models APIs [data governance](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance), [responsible AI](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/responsible-ai), and [release notes](https://cloud.google.com/vertex-ai/docs/release-notes).
|
||||
- Anthropic Claude's [constitution](https://www.anthropic.com/news/claudes-constitution), training data [FAQ](https://support.anthropic.com/en/articles/7996885-how-do-you-use-personal-data-in-model-training), and [data recency article](https://support.anthropic.com/en/articles/8114494-how-up-to-date-is-claude-s-training-data).
|
||||
|
||||
## Telemetry
|
||||
|
||||
GitLab Duo collects aggregated or de-identified first-party usage data through a [Snowplow collector](https://handbook.gitlab.com/handbook/business-technology/data-team/platform/snowplow/). This usage data includes the following metrics:
|
||||
|
||||
- Number of unique users
|
||||
- Number of unique instances
|
||||
- Prompt and suffix lengths
|
||||
- Model used
|
||||
- Status code responses
|
||||
- API responses times
|
||||
- Code Suggestions also collects:
|
||||
- Language the suggestion was in (for example, Python)
|
||||
- Editor being used (for example, VS Code)
|
||||
- Number of suggestions shown, accepted, rejected, or that had errors
|
||||
- Duration of time that a suggestion was shown
|
||||
|
||||
## Model accuracy and quality
|
||||
|
||||
Generative AI may produce unexpected results that may be:
|
||||
|
||||
- Low-quality
|
||||
- Incoherent
|
||||
- Incomplete
|
||||
- Produce failed pipelines
|
||||
- Insecure code
|
||||
- Offensive or insensitive
|
||||
- Out of date information
|
||||
|
||||
GitLab is actively iterating on all our AI-assisted capabilities to improve the quality of the generated content. We improve the quality through prompt engineering, evaluating new AI/ML models to power these features, and through novel heuristics built into these features directly.
|
||||
<!-- This redirect file can be deleted after <2024-09-07>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -1,130 +1,11 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: AI Model Validation
|
||||
description: AI-powered features and functionality.
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
redirect_to: '../user/gitlab_duo/experiments.md'
|
||||
remove_date: '2024-09-07'
|
||||
---
|
||||
|
||||
# GitLab Duo experiments
|
||||
This document was moved to [another location](../user/gitlab_duo/experiments.md).
|
||||
|
||||
The following GitLab Duo features are
|
||||
[experiments](../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
## Summarize issue discussions with Discussion summary
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10344) in GitLab 16.0 as an [experiment](../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
To use this feature:
|
||||
|
||||
- The parent group of the issue must:
|
||||
- Enable the [experiment and beta features setting](ai_features_enable.md#turn-on-beta-and-experimental-features).
|
||||
- You must:
|
||||
- Belong to at least one group with the [experiment and beta features setting](ai_features_enable.md#turn-on-beta-and-experimental-features) enabled.
|
||||
- Have sufficient permissions to view the issue.
|
||||
|
||||
You can generate a summary of discussions on an issue:
|
||||
|
||||
1. In an issue, scroll to the **Activity** section.
|
||||
1. Select **View summary**.
|
||||
|
||||
The comments in the issue are summarized in as many as 10 list items.
|
||||
The summary is displayed only for you.
|
||||
|
||||
Provide feedback on this experimental feature in [issue 407779](https://gitlab.com/gitlab-org/gitlab/-/issues/407779).
|
||||
|
||||
**Data usage**: When you use this feature, the text of all comments on the issue are sent to the large
|
||||
language model referenced above.
|
||||
|
||||
## Forecast deployment frequency with Value stream forecasting
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10228) in GitLab 16.2 as an [experiment](../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
To use this feature:
|
||||
|
||||
- The parent group of the project must:
|
||||
- Enable the [experiment and beta features setting](ai_features_enable.md#turn-on-beta-and-experimental-features).
|
||||
- You must:
|
||||
- Belong to at least one group with the [experiment and beta features setting](ai_features_enable.md#turn-on-beta-and-experimental-features) enabled.
|
||||
- Have sufficient permissions to view the CI/CD analytics.
|
||||
|
||||
In CI/CD Analytics, you can view a forecast of deployment frequency:
|
||||
|
||||
1. On the left sidebar, select **Search or go to** and find your project.
|
||||
1. Select **Analyze > CI/CD analytics**.
|
||||
1. Select the **Deployment frequency** tab.
|
||||
1. Turn on the **Show forecast** toggle.
|
||||
1. On the confirmation dialog, select **Accept testing terms**.
|
||||
|
||||
The forecast is displayed as a dotted line on the chart. Data is forecasted for a duration that is half of the selected date range.
|
||||
For example, if you select a 30-day range, a forecast for the following 15 days is displayed.
|
||||
|
||||

|
||||
|
||||
Provide feedback on this experimental feature in [issue 416833](https://gitlab.com/gitlab-org/gitlab/-/issues/416833).
|
||||
|
||||
## Root cause analysis
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123692) in GitLab 16.2 as an [experiment](../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
You can learn more about failed CI/CD jobs by using GitLab Duo Root cause analysis.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- The parent group of the project must:
|
||||
- Enable the [experiment and beta features setting](ai_features_enable.md#turn-on-beta-and-experimental-features).
|
||||
- You must:
|
||||
- Belong to at least one group with the [experiment and beta features setting](ai_features_enable.md#turn-on-beta-and-experimental-features) enabled.
|
||||
- Have sufficient permissions to view the CI/CD job.
|
||||
|
||||
To view root cause analysis:
|
||||
|
||||
1. Open a merge request.
|
||||
1. On the **Pipelines** tab, select the failed CI/CD job.
|
||||
1. Above the job output, select **Troubleshoot**.
|
||||
|
||||
An analysis of the reasons for the failure is displayed.
|
||||
|
||||
## Summarize an issue with Issue description generation
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10762) in GitLab 16.3 as an [experiment](../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
To use this feature:
|
||||
|
||||
- The parent group of the project must:
|
||||
- Enable the [experiment and beta features setting](ai_features_enable.md#turn-on-beta-and-experimental-features).
|
||||
- You must:
|
||||
- Belong to at least one group with the [experiment and beta features setting](ai_features_enable.md#turn-on-beta-and-experimental-features) enabled.
|
||||
- Have sufficient permissions to view the issue.
|
||||
|
||||
You can generate the description for an issue from a short summary.
|
||||
|
||||
1. Create a new issue.
|
||||
1. Above the **Description** field, select **GitLab Duo** (**{tanuki-ai}**) **> Generate issue description**.
|
||||
1. Write a short description and select **Submit**.
|
||||
|
||||
The issue description is replaced with AI-generated text.
|
||||
|
||||
Provide feedback on this experimental feature in [issue 409844](https://gitlab.com/gitlab-org/gitlab/-/issues/409844).
|
||||
|
||||
**Data usage**: When you use this feature, the text you enter is sent to the large
|
||||
language model referenced above.
|
||||
<!-- This redirect file can be deleted after <2024-09-07>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -1,233 +1,11 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: AI Model Validation
|
||||
description: AI-powered features and functionality.
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
redirect_to: '../user/gitlab_duo/index.md'
|
||||
remove_date: '2024-09-07'
|
||||
---
|
||||
|
||||
# GitLab Duo
|
||||
This document was moved to [another location](../user/gitlab_duo/index.md).
|
||||
|
||||
> - [First GitLab Duo features introduced](https://about.gitlab.com/blog/2023/05/03/gitlab-ai-assisted-features/) in GitLab 16.0.
|
||||
> - [Removed third-party AI setting](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136144) in GitLab 16.6.
|
||||
> - [Removed support for OpenAI from all GitLab Duo features](https://gitlab.com/groups/gitlab-org/-/epics/10964) in GitLab 16.6.
|
||||
|
||||
GitLab Duo is a suite of AI-powered features that assist you while you work in GitLab.
|
||||
These features aim to help increase velocity and solve key pain points across the software development lifecycle.
|
||||
|
||||
GitLab Duo features are available in [IDE extensions](../editor_extensions/index.md) and the GitLab UI.
|
||||
Some features are also available as part of [GitLab Duo Chat](gitlab_duo_chat_examples.md).
|
||||
|
||||
GitLab is [transparent](https://handbook.gitlab.com/handbook/values/#transparency).
|
||||
As GitLab Duo features mature, the documentation will be updated to clearly state
|
||||
how and where you can access these features.
|
||||
|
||||
## Generally available features
|
||||
|
||||
### GitLab Duo Chat
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
- Help you write and understand code faster, get up to speed on the status of projects,
|
||||
and quickly learn about GitLab by answering your questions in a chat window.
|
||||
- LLM: Anthropic [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai),
|
||||
Anthropic [`claude-3-haiku-20240307`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai),
|
||||
[`claude-2.1`](https://docs.anthropic.com/en/docs/legacy-model-guide#anthropics-legacy-models),
|
||||
and [Vertex AI Search](https://cloud.google.com/enterprise-search).
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=ZQBAuf-CTAY&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED)
|
||||
- [View documentation](gitlab_duo_chat.md).
|
||||
|
||||
NOTE:
|
||||
The LLM for GitLab Duo Chat depends on the question asked. For more information, see
|
||||
the [Duo Chat examples](gitlab_duo_chat_examples.md).
|
||||
For self-managed, the models also depend on your GitLab version.
|
||||
For the most benefit, use the latest GitLab version whenever possible.
|
||||
|
||||
### Code Suggestions
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Premium and Ultimate with [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
- Helps you write code more efficiently by generating code and showing suggestions as you type.
|
||||
- Large language model (LLM) for code completion: Vertex AI Codey [`code-gecko`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-completion)
|
||||
- LLM for code generation: Anthropic [`claude-3-sonnet-20240229`](https://docs.anthropic.com/claude/docs/models-overview)
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://youtu.be/ds7SG1wgcVM)
|
||||
- [View documentation](project/repository/code_suggestions/index.md).
|
||||
|
||||
### Code explanation in the IDE
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
- Helps you understand the selected code by explaining it more clearly.
|
||||
- LLM: Anthropic: [`claude-3-haiku-20240307`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
- View documentation for [explaining code in the IDE](../user/gitlab_duo_chat_examples.md#explain-code-in-the-ide).
|
||||
|
||||
### Test generation
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
- Helps catch bugs early by generating tests for the selected code.
|
||||
- LLM: Anthropic [`Claude-2.1`](https://docs.anthropic.com/claude/docs/models-overview#model-comparison)
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=zWhwuixUkYU&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED)
|
||||
- [View documentation](gitlab_duo_chat_examples.md#write-tests-in-the-ide).
|
||||
|
||||
### Suggested Reviewers
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Ultimate
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps create faster and higher-quality reviews by automatically suggesting reviewers for your merge request.
|
||||
- LLM: GitLab creates a machine learning model for each project, which is used to generate reviewers. [View the issue](https://gitlab.com/gitlab-org/modelops/applied-ml/applied-ml-updates/-/issues/10).
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=ivwZQgh4Rxw)
|
||||
- [View documentation](project/merge_requests/reviews/index.md#gitlab-duo-suggested-reviewers).
|
||||
|
||||
## Beta features
|
||||
|
||||
### Merge request template population
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps populate a merge request more quickly by generating a description based on the contents of the template.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text)
|
||||
- [View documentation](project/merge_requests/ai_in_merge_requests.md#generate-a-description-from-a-template).
|
||||
|
||||
### Merge request summary
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps populate a merge request more quickly by generating a description based on the code changes.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text)
|
||||
- [View documentation](project/merge_requests/ai_in_merge_requests.md#generate-a-description-by-summarizing-code-changes).
|
||||
|
||||
### Vulnerability explanation
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps you understand vulnerabilities, how they can be exploited, and how to fix them.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text). If degraded performance, then Anthropic [`Claude-2.1`](https://docs.anthropic.com/claude/docs/models-overview#model-comparison).
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://youtu.be/ctD_qcVpIJY)
|
||||
- [View documentation](application_security/vulnerabilities/index.md#explaining-a-vulnerability).
|
||||
|
||||
## Experimental features
|
||||
|
||||
### Issue description generation
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps populate an issue more quickly by generating a more in-depth description, based on a short summary you provide.
|
||||
- LLM: Anthropic [`Claude-2.1`](https://docs.anthropic.com/claude/docs/models-overview#model-comparison)
|
||||
- [View documentation](ai_experiments.md#summarize-an-issue-with-issue-description-generation).
|
||||
|
||||
### Discussion summary
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps everyone get up to speed by summarizing the lengthy conversations in an issue.
|
||||
- LLM: Anthropic [`Claude-2.1`](https://docs.anthropic.com/claude/docs/models-overview#model-comparison)
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=IcdxLfTIUgc)
|
||||
- [View documentation](ai_experiments.md#summarize-issue-discussions-with-discussion-summary).
|
||||
|
||||
### Code explanation in a file or merge request
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps you understand the selected code by explaining it more clearly.
|
||||
- LLM: Anthropic: [`claude-3-haiku-20240307`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
- View documentation for explaining code in:
|
||||
- [A file](../user/project/repository/code_explain.md).
|
||||
- [A merge request](../user/project/merge_requests/changes.md#explain-code-in-a-merge-request).
|
||||
|
||||
### GitLab Duo for the CLI
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- `glab duo ask` helps you discover or recall `git` commands when and where you need them.
|
||||
- LLM: Vertex AI Codey [`codechat-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-chat)
|
||||
- [View documentation](../editor_extensions/gitlab_cli/index.md#gitlab-duo-for-the-cli).
|
||||
|
||||
### Code review summary
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps make merge request handover to reviewers easier by summarizing all the comments in a merge request review.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text)
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=Bx6Zajyuy9k&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED)
|
||||
- [View documentation](project/merge_requests/ai_in_merge_requests.md#summarize-a-code-review).
|
||||
|
||||
### Merge and squash commit generation
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps you merge more quickly by generating meaningful commit messages.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text).
|
||||
- [View documentation](project/merge_requests/ai_in_merge_requests.md#generate-a-merge-or-squash-commit-message).
|
||||
|
||||
### Root cause analysis
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps you determine the root cause for a CI/CD job failure by analyzing the logs.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text)
|
||||
- [View documentation](ai_experiments.md#root-cause-analysis).
|
||||
|
||||
### Vulnerability resolution
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Help resolve a vulnerability by generating a merge request that addresses it.
|
||||
- LLM: Vertex AI Codey [`code-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-generation)
|
||||
- [View documentation](application_security/vulnerabilities/index.md#vulnerability-resolution).
|
||||
|
||||
### Product Analytics
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Processes and responds to your questions about your application's usage data.
|
||||
- LLM: Vertex AI Codey [`codechat-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-chat)
|
||||
- [View documentation](analytics/analytics_dashboards.md#generate-a-custom-visualization-with-gitlab-duo).
|
||||
|
||||
### Value stream forecasting
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
- Helps you improve planning and decision-making by predicting productivity metrics and identifying anomalies across your software development lifecycle.
|
||||
- LLM: Statistical forecasting
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=6u8_8QQ5pEQ&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED)
|
||||
- [View documentation](ai_experiments.md#forecast-deployment-frequency-with-value-stream-forecasting).
|
||||
|
||||
## Disable GitLab Duo features for specific groups or projects or an entire instance
|
||||
|
||||
Disable GitLab Duo features by [following these instructions](ai_features_enable.md).
|
||||
<!-- This redirect file can be deleted after <2024-09-07>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -1,169 +1,11 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: AI Model Validation
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
redirect_to: '../user/gitlab_duo/turn_on_off.md'
|
||||
remove_date: '2024-09-07'
|
||||
---
|
||||
|
||||
# Control GitLab Duo availability
|
||||
This document was moved to [another location](../user/gitlab_duo/turn_on_off.md).
|
||||
|
||||
> - [Settings to turn off AI features introduced](https://gitlab.com/groups/gitlab-org/-/epics/12404) in GitLab 16.10.
|
||||
> - [Settings to turn off AI features added to the UI](https://gitlab.com/gitlab-org/gitlab/-/issues/441489) in GitLab 16.11.
|
||||
|
||||
GitLab Duo features that are generally available are automatically turned on for all users that have access.
|
||||
In addition:
|
||||
|
||||
- If you have self-managed GitLab, you must
|
||||
[allow connectivity](#configure-gitlab-duo-on-a-self-managed-instance).
|
||||
- If you have GitLab Dedicated, you must have [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md).
|
||||
- For some generally available features, like [Code Suggestions](project/repository/code_suggestions/index.md),
|
||||
[you must assign seats](../subscriptions/subscription-add-ons.md#assign-gitlab-duo-pro-seats)
|
||||
to the users you want to have access.
|
||||
|
||||
GitLab Duo features that are experimental or beta are turned off by default
|
||||
and [must be turned on](#turn-on-beta-and-experimental-features).
|
||||
|
||||
## Configure GitLab Duo on a self-managed instance
|
||||
|
||||
To use GitLab Duo on a self-managed instance, you must ensure connectivity exists.
|
||||
|
||||
### Allow outbound connections from the GitLab instance
|
||||
|
||||
- Your firewalls and HTTP/S proxy servers must allow outbound connections
|
||||
to `cloud.gitlab.com` and `customers.gitlab.com` on port `443` both with `https://`.
|
||||
- To use an HTTP/S proxy, both `gitLab_workhorse` and `gitLab_rails` must have the necessary
|
||||
[web proxy environment variables](https://docs.gitlab.com/omnibus/settings/environment-variables.html) set.
|
||||
|
||||
### Allow inbound connections from clients to the GitLab instance
|
||||
|
||||
- GitLab instances must allow inbound connections from Duo clients (IDEs, Code Editors, and GitLab Web Frontend)
|
||||
on port 443 with `https://` and `wss://`.
|
||||
- Both `HTTP2` and the `'upgrade'` header must be allowed, because GitLab Duo
|
||||
uses both REST and WebSockets.
|
||||
- Check for restrictions on WebSocket (`wss://`) traffic to `wss://gitlab.example.com/-/cable` and other `.com` domains.
|
||||
Network policy restrictions on `wss://` traffic can cause issues with some GitLab Duo Chat
|
||||
services. Consider policy updates to allow these services.
|
||||
|
||||
## Turn off GitLab Duo features
|
||||
|
||||
You can turn off GitLab Duo for a group, project, or instance.
|
||||
|
||||
When GitLab Duo is turned off for a group, project, or instance:
|
||||
|
||||
- GitLab Duo features that access resources, like code, issues, and vulnerabilities, are not available.
|
||||
- Code Suggestions are not available.
|
||||
|
||||
However, GitLab Duo Chat works differently. When you turn off GitLab Duo:
|
||||
|
||||
- For a group or project:
|
||||
- You can still ask questions of GitLab Duo Chat. These questions must be generic, like
|
||||
asking about GitLab or asking general questions about code. GitLab Duo Chat will not access group or
|
||||
project resources, and will reject questions about them.
|
||||
|
||||
- For an instance:
|
||||
- The **GitLab Duo Chat** button is not available anywhere in the UI.
|
||||
|
||||
### Turn off for a group
|
||||
|
||||
You can turn off GitLab Duo for a group.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have the Owner role for the group or project.
|
||||
|
||||
To turn off GitLab Duo for a group:
|
||||
|
||||
<!-- vale gitlab.Substitutions = NO -->
|
||||
1. On the left sidebar, select **Search or go to** and find your group.
|
||||
1. Select **Settings > General**.
|
||||
1. Expand **Permissions and group features**.
|
||||
1. Clear the **Use Duo features** checkbox.
|
||||
1. Optional. Select the **Enforce for all subgroups** checkbox to cascade the setting to
|
||||
all subgroups.
|
||||
|
||||

|
||||
<!-- vale gitlab.Substitutions = YES -->
|
||||
|
||||
NOTE:
|
||||
An [issue exists](https://gitlab.com/gitlab-org/gitlab/-/issues/448709) for making the group-level
|
||||
setting cascade to all groups and projects. Right now the lower-level projects and groups do not
|
||||
display the setting of the top-level group.
|
||||
|
||||
### Turn off for a project
|
||||
|
||||
You can turn off GitLab Duo for a project.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have the Owner role for the project.
|
||||
|
||||
To turn off GitLab Duo for a project:
|
||||
|
||||
1. Use the GitLab GraphQL API
|
||||
[`projectSettingsUpdate`](../api/graphql/reference/index.md#mutationprojectsettingsupdate)
|
||||
mutation.
|
||||
1. Set the
|
||||
[`duo_features_enabled`](../api/graphql/getting_started.md#update-project-settings)
|
||||
setting to `false`. (The default is `true`.)
|
||||
|
||||
### Turn off for an instance
|
||||
|
||||
DETAILS:
|
||||
**Offering:** Self-managed
|
||||
|
||||
You can turn off GitLab Duo for the instance.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must be an administrator.
|
||||
|
||||
To turn off GitLab Duo for an instance:
|
||||
|
||||
<!-- vale gitlab.Substitutions = NO -->
|
||||
1. On the left sidebar, at the bottom, select **Admin Area**.
|
||||
1. Select **Settings > General**
|
||||
1. Expand **AI-powered features**.
|
||||
1. Clear the **Use Duo features** checkbox.
|
||||
1. Optional. Select the **Enforce for all subgroups** checkbox to cascade
|
||||
the setting to all groups in the instance.
|
||||
<!-- vale gitlab.Substitutions = YES -->
|
||||
|
||||
NOTE:
|
||||
An [issue exists](https://gitlab.com/gitlab-org/gitlab/-/issues/441532) to allow administrators
|
||||
to override the setting for specific groups or projects.
|
||||
|
||||
## Turn on beta and experimental features
|
||||
|
||||
GitLab Duo features that are experimental and beta are turned off by default.
|
||||
These features are subject to the [Testing Agreement](https://handbook.gitlab.com/handbook/legal/testing-agreement/).
|
||||
|
||||
### On GitLab.com
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Premium, Ultimate
|
||||
**Offering:** GitLab.com, Self-managed
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118222) in GitLab 16.0.
|
||||
> - [Added to GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147833) in GitLab 16.11.
|
||||
|
||||
You can turn on GitLab Duo experiment and beta features for your group on GitLab.com.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have the Owner role in the top-level group.
|
||||
|
||||
To turn on GitLab Duo experiment and beta features for a top-level group:
|
||||
|
||||
1. On the left sidebar, select **Search or go to** and find your group.
|
||||
1. Select **Settings > General**.
|
||||
1. Expand **Permissions and group features**.
|
||||
1. Under **Experiment and beta features**, select the **Use experiment and beta features** checkbox.
|
||||
1. Select **Save changes**.
|
||||
|
||||
This setting [cascades to all projects](../user/project/merge_requests/approvals/settings.md#cascade-settings-from-the-instance-or-top-level-group)
|
||||
that belong to the group.
|
||||
|
||||
### On self-managed
|
||||
|
||||
To enable GitLab Duo beta and experimental features for GitLab versions
|
||||
where GitLab Duo Chat is not yet generally available, see the
|
||||
[GitLab Duo Chat documentation](gitlab_duo_chat_enable.md#for-self-managed).
|
||||
<!-- This redirect file can be deleted after <2024-09-07>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ DETAILS:
|
|||
Prerequisites:
|
||||
|
||||
- The top-level group of the project must have GitLab Duo
|
||||
[experiment and beta features enabled](../ai_features_enable.md#turn-on-beta-and-experimental-features).
|
||||
[experiment and beta features enabled](../gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features).
|
||||
|
||||
To generate a custom visualization with GitLab Duo using a natural language query:
|
||||
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ GitLab in a Kubernetes cluster, you might need a different version of Kubernetes
|
|||
You can upgrade your
|
||||
Kubernetes version to a supported version at any time:
|
||||
|
||||
- 1.30 (support ends when GitLab version 18.2 is released or when 1.33 becomes supported)
|
||||
- 1.29 (support ends when GitLab version 17.10 is released or when 1.32 becomes supported)
|
||||
- 1.28 (support ends when GitLab version 17.5 is released or when 1.31 becomes supported)
|
||||
- 1.27 (support ends when GitLab version 17.2 is released or when 1.30 becomes supported)
|
||||
|
||||
GitLab aims to support a new minor Kubernetes version three months after its initial release. GitLab supports at least three production-ready Kubernetes minor
|
||||
versions at any given time.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: AI Model Validation
|
||||
description: AI-powered features and functionality.
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# GitLab Duo data usage
|
||||
|
||||
GitLab Duo uses generative AI to help increase your velocity and make you more productive. Each AI-powered feature operates independently and is not required for other features to function.
|
||||
|
||||
GitLab uses best-in-class large language models (LLMs) for specific tasks. These LLMs are
|
||||
[Google Vertex AI Models](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview#genai-models)
|
||||
and [Anthropic Claude](https://www.anthropic.com/product).
|
||||
|
||||
## Progressive enhancement
|
||||
|
||||
GitLab Duo AI-powered features are designed as a progressive enhancement to existing GitLab features across the DevSecOps platform. These features are designed to fail gracefully and should not prevent the core functionality of the underlying feature. You should note each feature is subject to its expected functionality as defined by the relevant [feature support policy](../../policy/experiment-beta-support.md).
|
||||
|
||||
## Stability and performance
|
||||
|
||||
GitLab Duo AI-powered features are in a variety of [feature support levels](../../policy/experiment-beta-support.md#beta). Due to the nature of these features, there may be high demand for usage which may cause degraded performance or unexpected downtime of the feature. We have built these features to gracefully degrade and have controls in place to allow us to mitigate abuse or misuse. GitLab may disable beta and experimental features for any or all customers at any time at our discretion.
|
||||
|
||||
## Data privacy
|
||||
|
||||
GitLab Duo AI-powered features are powered by a generative AI model. The processing of any personal data is in accordance with our [Privacy Statement](https://about.gitlab.com/privacy/). You may also visit the [Sub-Processors page](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors) to see the list of Sub-Processors we use to provide these features.
|
||||
|
||||
## Data retention
|
||||
|
||||
The below reflects the current retention periods of GitLab AI model [Sub-Processors](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors):
|
||||
|
||||
- Anthropic discards model input and output data immediately after the output is provided. Anthropic currently does not store data for abuse monitoring. Model input and output is not used to train models.
|
||||
- Google discards model input and output data immediately after the output is provided. Google currently does not store data for abuse monitoring. Model input and output is not used to train models.
|
||||
|
||||
All of these AI providers are under data protection agreements with GitLab that prohibit the use of Customer Content for their own purposes, except to perform their independent legal obligations.
|
||||
|
||||
GitLab retains input and output for up to 30 days for the purpose of troubleshooting, debugging, and addressing latency issues.
|
||||
|
||||
## Training data
|
||||
|
||||
GitLab does not train generative AI models based on private (non-public) data. The vendors we work with also do not train models based on private data.
|
||||
|
||||
For more information on our AI [sub-processors](https://about.gitlab.com/privacy/subprocessors/#third-party-sub-processors), see:
|
||||
|
||||
- Google Vertex AI Models APIs [data governance](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance), [responsible AI](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/responsible-ai), and [release notes](https://cloud.google.com/vertex-ai/docs/release-notes).
|
||||
- Anthropic Claude's [constitution](https://www.anthropic.com/news/claudes-constitution), training data [FAQ](https://support.anthropic.com/en/articles/7996885-how-do-you-use-personal-data-in-model-training), and [data recency article](https://support.anthropic.com/en/articles/8114494-how-up-to-date-is-claude-s-training-data).
|
||||
|
||||
## Telemetry
|
||||
|
||||
GitLab Duo collects aggregated or de-identified first-party usage data through a [Snowplow collector](https://handbook.gitlab.com/handbook/business-technology/data-team/platform/snowplow/). This usage data includes the following metrics:
|
||||
|
||||
- Number of unique users
|
||||
- Number of unique instances
|
||||
- Prompt and suffix lengths
|
||||
- Model used
|
||||
- Status code responses
|
||||
- API responses times
|
||||
- Code Suggestions also collects:
|
||||
- Language the suggestion was in (for example, Python)
|
||||
- Editor being used (for example, VS Code)
|
||||
- Number of suggestions shown, accepted, rejected, or that had errors
|
||||
- Duration of time that a suggestion was shown
|
||||
|
||||
## Model accuracy and quality
|
||||
|
||||
Generative AI may produce unexpected results that may be:
|
||||
|
||||
- Low-quality
|
||||
- Incoherent
|
||||
- Incomplete
|
||||
- Produce failed pipelines
|
||||
- Insecure code
|
||||
- Offensive or insensitive
|
||||
- Out of date information
|
||||
|
||||
GitLab is actively iterating on all our AI-assisted capabilities to improve the quality of the generated content. We improve the quality through prompt engineering, evaluating new AI/ML models to power these features, and through novel heuristics built into these features directly.
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: AI Model Validation
|
||||
description: AI-powered features and functionality.
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# GitLab Duo experiments
|
||||
|
||||
The following GitLab Duo features are
|
||||
[experiments](../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
## Summarize issue discussions with Discussion summary
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10344) in GitLab 16.0 as an [experiment](../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
To use this feature:
|
||||
|
||||
- The parent group of the issue must:
|
||||
- Enable the [experiment and beta features setting](turn_on_off.md#turn-on-beta-and-experimental-features).
|
||||
- You must:
|
||||
- Belong to at least one group with the [experiment and beta features setting](turn_on_off.md#turn-on-beta-and-experimental-features) enabled.
|
||||
- Have sufficient permissions to view the issue.
|
||||
|
||||
You can generate a summary of discussions on an issue:
|
||||
|
||||
1. In an issue, scroll to the **Activity** section.
|
||||
1. Select **View summary**.
|
||||
|
||||
The comments in the issue are summarized in as many as 10 list items.
|
||||
The summary is displayed only for you.
|
||||
|
||||
Provide feedback on this experimental feature in [issue 407779](https://gitlab.com/gitlab-org/gitlab/-/issues/407779).
|
||||
|
||||
**Data usage**: When you use this feature, the text of all comments on the issue are sent to the large
|
||||
language model referenced above.
|
||||
|
||||
## Forecast deployment frequency with Value stream forecasting
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10228) in GitLab 16.2 as an [experiment](../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
To use this feature:
|
||||
|
||||
- The parent group of the project must:
|
||||
- Enable the [experiment and beta features setting](turn_on_off.md#turn-on-beta-and-experimental-features).
|
||||
- You must:
|
||||
- Belong to at least one group with the [experiment and beta features setting](turn_on_off.md#turn-on-beta-and-experimental-features) enabled.
|
||||
- Have sufficient permissions to view the CI/CD analytics.
|
||||
|
||||
In CI/CD Analytics, you can view a forecast of deployment frequency:
|
||||
|
||||
1. On the left sidebar, select **Search or go to** and find your project.
|
||||
1. Select **Analyze > CI/CD analytics**.
|
||||
1. Select the **Deployment frequency** tab.
|
||||
1. Turn on the **Show forecast** toggle.
|
||||
1. On the confirmation dialog, select **Accept testing terms**.
|
||||
|
||||
The forecast is displayed as a dotted line on the chart. Data is forecasted for a duration that is half of the selected date range.
|
||||
For example, if you select a 30-day range, a forecast for the following 15 days is displayed.
|
||||
|
||||

|
||||
|
||||
Provide feedback on this experimental feature in [issue 416833](https://gitlab.com/gitlab-org/gitlab/-/issues/416833).
|
||||
|
||||
## Root cause analysis
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123692) in GitLab 16.2 as an [experiment](../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
You can learn more about failed CI/CD jobs by using GitLab Duo Root cause analysis.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- The parent group of the project must:
|
||||
- Enable the [experiment and beta features setting](turn_on_off.md#turn-on-beta-and-experimental-features).
|
||||
- You must:
|
||||
- Belong to at least one group with the [experiment and beta features setting](turn_on_off.md#turn-on-beta-and-experimental-features) enabled.
|
||||
- Have sufficient permissions to view the CI/CD job.
|
||||
|
||||
To view root cause analysis:
|
||||
|
||||
1. Open a merge request.
|
||||
1. On the **Pipelines** tab, select the failed CI/CD job.
|
||||
1. Above the job output, select **Troubleshoot**.
|
||||
|
||||
An analysis of the reasons for the failure is displayed.
|
||||
|
||||
## Summarize an issue with Issue description generation
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10762) in GitLab 16.3 as an [experiment](../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
To use this feature:
|
||||
|
||||
- The parent group of the project must:
|
||||
- Enable the [experiment and beta features setting](turn_on_off.md#turn-on-beta-and-experimental-features).
|
||||
- You must:
|
||||
- Belong to at least one group with the [experiment and beta features setting](turn_on_off.md#turn-on-beta-and-experimental-features) enabled.
|
||||
- Have sufficient permissions to view the issue.
|
||||
|
||||
You can generate the description for an issue from a short summary.
|
||||
|
||||
1. Create a new issue.
|
||||
1. Above the **Description** field, select **GitLab Duo** (**{tanuki-ai}**) **> Generate issue description**.
|
||||
1. Write a short description and select **Submit**.
|
||||
|
||||
The issue description is replaced with AI-generated text.
|
||||
|
||||
Provide feedback on this experimental feature in [issue 409844](https://gitlab.com/gitlab-org/gitlab/-/issues/409844).
|
||||
|
||||
**Data usage**: When you use this feature, the text you enter is sent to the large
|
||||
language model referenced above.
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
|
@ -0,0 +1,236 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: AI Model Validation
|
||||
description: AI-powered features and functionality.
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# GitLab Duo
|
||||
|
||||
> - [First GitLab Duo features introduced](https://about.gitlab.com/blog/2023/05/03/gitlab-ai-assisted-features/) in GitLab 16.0.
|
||||
> - [Removed third-party AI setting](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136144) in GitLab 16.6.
|
||||
> - [Removed support for OpenAI from all GitLab Duo features](https://gitlab.com/groups/gitlab-org/-/epics/10964) in GitLab 16.6.
|
||||
|
||||
GitLab Duo is a suite of AI-powered features that assist you while you work in GitLab.
|
||||
These features aim to help increase velocity and solve key pain points across the software development lifecycle.
|
||||
|
||||
GitLab Duo features are available in [IDE extensions](../../editor_extensions/index.md) and the GitLab UI.
|
||||
Some features are also available as part of [GitLab Duo Chat](../gitlab_duo_chat_examples.md).
|
||||
|
||||
GitLab is [transparent](https://handbook.gitlab.com/handbook/values/#transparency).
|
||||
As GitLab Duo features mature, the documentation will be updated to clearly state
|
||||
how and where you can access these features.
|
||||
|
||||
Each feature uses the large language models (LLMs) listed in this page. However, you can
|
||||
[use your own self-hosted models instead](../../administration/self_hosted_models/index.md).
|
||||
|
||||
## Generally available features
|
||||
|
||||
### GitLab Duo Chat
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
- Help you write and understand code faster, get up to speed on the status of projects,
|
||||
and quickly learn about GitLab by answering your questions in a chat window.
|
||||
- LLM: Anthropic [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai),
|
||||
Anthropic [`claude-3-haiku-20240307`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai),
|
||||
[`claude-2.1`](https://docs.anthropic.com/en/docs/legacy-model-guide#anthropics-legacy-models),
|
||||
and [Vertex AI Search](https://cloud.google.com/enterprise-search).
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=ZQBAuf-CTAY&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED)
|
||||
- [View documentation](../gitlab_duo_chat.md).
|
||||
|
||||
NOTE:
|
||||
The LLM for GitLab Duo Chat depends on the question asked. For more information, see
|
||||
the [Duo Chat examples](../gitlab_duo_chat_examples.md).
|
||||
For self-managed, the models also depend on your GitLab version.
|
||||
For the most benefit, use the latest GitLab version whenever possible.
|
||||
|
||||
### Code Suggestions
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Premium and Ultimate with [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
- Helps you write code more efficiently by generating code and showing suggestions as you type.
|
||||
- Large language model (LLM) for code completion: Vertex AI Codey [`code-gecko`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-completion)
|
||||
- LLM for code generation: Anthropic [`claude-3-sonnet-20240229`](https://docs.anthropic.com/claude/docs/models-overview)
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://youtu.be/ds7SG1wgcVM)
|
||||
- [View documentation](../project/repository/code_suggestions/index.md).
|
||||
|
||||
### Code explanation in the IDE
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
- Helps you understand the selected code by explaining it more clearly.
|
||||
- LLM: Anthropic: [`claude-3-haiku-20240307`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
- View documentation for [explaining code in the IDE](../gitlab_duo_chat/examples.md#explain-code-in-the-ide).
|
||||
|
||||
### Test generation
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
- Helps catch bugs early by generating tests for the selected code.
|
||||
- LLM: Anthropic [`Claude-2.1`](https://docs.anthropic.com/claude/docs/models-overview#model-comparison)
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=zWhwuixUkYU&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED)
|
||||
- [View documentation](../gitlab_duo_chat/examples.md#write-tests-in-the-ide).
|
||||
|
||||
### Suggested Reviewers
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Ultimate
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps create faster and higher-quality reviews by automatically suggesting reviewers for your merge request.
|
||||
- LLM: GitLab creates a machine learning model for each project, which is used to generate reviewers. [View the issue](https://gitlab.com/gitlab-org/modelops/applied-ml/applied-ml-updates/-/issues/10).
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=ivwZQgh4Rxw)
|
||||
- [View documentation](../project/merge_requests/reviews/index.md#gitlab-duo-suggested-reviewers).
|
||||
|
||||
## Beta features
|
||||
|
||||
### Merge request template population
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps populate a merge request more quickly by generating a description based on the contents of the template.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text)
|
||||
- [View documentation](../project/merge_requests/duo_in_merge_requests.md#generate-a-description-from-a-template).
|
||||
|
||||
### Merge request summary
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps populate a merge request more quickly by generating a description based on the code changes.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text)
|
||||
- [View documentation](../project/merge_requests/duo_in_merge_requests.md#generate-a-description-by-summarizing-code-changes).
|
||||
|
||||
### Vulnerability explanation
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps you understand vulnerabilities, how they can be exploited, and how to fix them.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text). If degraded performance, then Anthropic [`Claude-2.1`](https://docs.anthropic.com/claude/docs/models-overview#model-comparison).
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://youtu.be/ctD_qcVpIJY)
|
||||
- [View documentation](../application_security/vulnerabilities/index.md#explaining-a-vulnerability).
|
||||
|
||||
## Experimental features
|
||||
|
||||
### Issue description generation
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps populate an issue more quickly by generating a more in-depth description, based on a short summary you provide.
|
||||
- LLM: Anthropic [`Claude-2.1`](https://docs.anthropic.com/claude/docs/models-overview#model-comparison)
|
||||
- [View documentation](experiments.md#summarize-an-issue-with-issue-description-generation).
|
||||
|
||||
### Discussion summary
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps everyone get up to speed by summarizing the lengthy conversations in an issue.
|
||||
- LLM: Anthropic [`Claude-2.1`](https://docs.anthropic.com/claude/docs/models-overview#model-comparison)
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=IcdxLfTIUgc)
|
||||
- [View documentation](experiments.md#summarize-issue-discussions-with-discussion-summary).
|
||||
|
||||
### Code explanation in a file or merge request
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps you understand the selected code by explaining it more clearly.
|
||||
- LLM: Anthropic: [`claude-3-haiku-20240307`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
- View documentation for explaining code in:
|
||||
- [A file](../../user/project/repository/code_explain.md).
|
||||
- [A merge request](../../user/project/merge_requests/changes.md#explain-code-in-a-merge-request).
|
||||
|
||||
### GitLab Duo for the CLI
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- `glab duo ask` helps you discover or recall `git` commands when and where you need them.
|
||||
- LLM: Vertex AI Codey [`codechat-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-chat)
|
||||
- [View documentation](../../editor_extensions/gitlab_cli/index.md#gitlab-duo-for-the-cli).
|
||||
|
||||
### Code review summary
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps make merge request handover to reviewers easier by summarizing all the comments in a merge request review.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text)
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=Bx6Zajyuy9k&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED)
|
||||
- [View documentation](../project/merge_requests/duo_in_merge_requests.md#summarize-a-code-review).
|
||||
|
||||
### Merge and squash commit generation
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps you merge more quickly by generating meaningful commit messages.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text).
|
||||
- [View documentation](../project/merge_requests/duo_in_merge_requests.md#generate-a-merge-or-squash-commit-message).
|
||||
|
||||
### Root cause analysis
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Helps you determine the root cause for a CI/CD job failure by analyzing the logs.
|
||||
- LLM: Vertex AI Codey [`text-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text)
|
||||
- [View documentation](experiments.md#root-cause-analysis).
|
||||
|
||||
### Vulnerability resolution
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Help resolve a vulnerability by generating a merge request that addresses it.
|
||||
- LLM: Vertex AI Codey [`code-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-generation)
|
||||
- [View documentation](../application_security/vulnerabilities/index.md#vulnerability-resolution).
|
||||
|
||||
### Product Analytics
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
|
||||
- Processes and responds to your questions about your application's usage data.
|
||||
- LLM: Vertex AI Codey [`codechat-bison`](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-chat)
|
||||
- [View documentation](../analytics/analytics_dashboards.md#generate-a-custom-visualization-with-gitlab-duo).
|
||||
|
||||
### Value stream forecasting
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
- Helps you improve planning and decision-making by predicting productivity metrics and identifying anomalies across your software development lifecycle.
|
||||
- LLM: Statistical forecasting
|
||||
- <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Watch overview](https://www.youtube.com/watch?v=6u8_8QQ5pEQ&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED)
|
||||
- [View documentation](experiments.md#forecast-deployment-frequency-with-value-stream-forecasting).
|
||||
|
||||
## Disable GitLab Duo features for specific groups or projects or an entire instance
|
||||
|
||||
Disable GitLab Duo features by [following these instructions](turn_on_off.md).
|
||||
|
|
@ -0,0 +1,173 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: AI Model Validation
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# Control GitLab Duo availability
|
||||
|
||||
> - [Settings to turn off AI features introduced](https://gitlab.com/groups/gitlab-org/-/epics/12404) in GitLab 16.10.
|
||||
> - [Settings to turn off AI features added to the UI](https://gitlab.com/gitlab-org/gitlab/-/issues/441489) in GitLab 16.11.
|
||||
|
||||
GitLab Duo features that are generally available are automatically turned on for all users that have access.
|
||||
In addition:
|
||||
|
||||
- If you have self-managed GitLab, you must
|
||||
[allow connectivity](#configure-gitlab-duo-on-a-self-managed-instance).
|
||||
- If you have GitLab Dedicated, you must have [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md).
|
||||
- For some generally available features, like [Code Suggestions](../project/repository/code_suggestions/index.md),
|
||||
[you must assign seats](../../subscriptions/subscription-add-ons.md#assign-gitlab-duo-pro-seats)
|
||||
to the users you want to have access.
|
||||
|
||||
GitLab Duo features that are experimental or beta are turned off by default
|
||||
and [must be turned on](#turn-on-beta-and-experimental-features).
|
||||
|
||||
## Configure GitLab Duo on a self-managed instance
|
||||
|
||||
To use GitLab Duo on a self-managed instance, you must ensure connectivity exists.
|
||||
|
||||
### Allow outbound connections from the GitLab instance
|
||||
|
||||
- Your firewalls and HTTP/S proxy servers must allow outbound connections
|
||||
to `cloud.gitlab.com` and `customers.gitlab.com` on port `443` both with `https://`.
|
||||
- To use an HTTP/S proxy, both `gitLab_workhorse` and `gitLab_rails` must have the necessary
|
||||
[web proxy environment variables](https://docs.gitlab.com/omnibus/settings/environment-variables.html) set.
|
||||
|
||||
### Allow inbound connections from clients to the GitLab instance
|
||||
|
||||
- GitLab instances must allow inbound connections from Duo clients (IDEs, Code Editors, and GitLab Web Frontend)
|
||||
on port 443 with `https://` and `wss://`.
|
||||
- Both `HTTP2` and the `'upgrade'` header must be allowed, because GitLab Duo
|
||||
uses both REST and WebSockets.
|
||||
- Check for restrictions on WebSocket (`wss://`) traffic to `wss://gitlab.example.com/-/cable` and other `.com` domains.
|
||||
Network policy restrictions on `wss://` traffic can cause issues with some GitLab Duo Chat
|
||||
services. Consider policy updates to allow these services.
|
||||
|
||||
## Turn off GitLab Duo features
|
||||
|
||||
You can turn off GitLab Duo for a group, project, or instance.
|
||||
|
||||
When GitLab Duo is turned off for a group, project, or instance:
|
||||
|
||||
- GitLab Duo features that access resources, like code, issues, and vulnerabilities, are not available.
|
||||
- Code Suggestions are not available.
|
||||
|
||||
However, GitLab Duo Chat works differently. When you turn off GitLab Duo:
|
||||
|
||||
- For a group or project:
|
||||
- You can still ask questions of GitLab Duo Chat. These questions must be generic, like
|
||||
asking about GitLab or asking general questions about code. GitLab Duo Chat will not access group or
|
||||
project resources, and will reject questions about them.
|
||||
|
||||
- For an instance:
|
||||
- The **GitLab Duo Chat** button is not available anywhere in the UI.
|
||||
|
||||
### Turn off for a group
|
||||
|
||||
> - [in GitLab 16.10, 16.11, and 17.0](https://gitlab.com/gitlab-org/gitlab/-/issues/448709), `duo_features_enabled` was enabled by default. This feature flag controlled GitLab Duo for groups and subgroups, but not projects. Subgroups and projects could override the setting. Another flag, `lock_duo_features_enabled`, when set for the parent group, enforced the setting for all subgroups and projects, preventing them from overriding it.
|
||||
> - [In GitLab 17.1](https://gitlab.com/gitlab-org/gitlab/-/issues/448709), subgroups and projects automatically inherit the parent's setting but can override it.
|
||||
`lock_duo_features_enabled` on a parent group still enforces the setting for all subgroups and projects, preventing them from overriding it.
|
||||
|
||||
You can turn off GitLab Duo for a group.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have the Owner role for the group or project.
|
||||
|
||||
To turn off GitLab Duo for a group:
|
||||
|
||||
<!-- vale gitlab.Substitutions = NO -->
|
||||
1. On the left sidebar, select **Search or go to** and find your group.
|
||||
1. Select **Settings > General**.
|
||||
1. Expand **Permissions and group features**.
|
||||
1. Clear the **Use Duo features** checkbox.
|
||||
1. Optional. Select the **Enforce for all subgroups** checkbox to cascade the setting to
|
||||
all subgroups.
|
||||
|
||||

|
||||
<!-- vale gitlab.Substitutions = YES -->
|
||||
|
||||
NOTE:
|
||||
An [issue exists](https://gitlab.com/gitlab-org/gitlab/-/issues/448709) for making the group-level
|
||||
setting cascade to all groups and projects. Right now the lower-level projects and groups do not
|
||||
display the setting of the top-level group.
|
||||
|
||||
### Turn off for a project
|
||||
|
||||
You can turn off GitLab Duo for a project.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have the Owner role for the project.
|
||||
|
||||
To turn off GitLab Duo for a project:
|
||||
|
||||
1. Use the GitLab GraphQL API
|
||||
[`projectSettingsUpdate`](../../api/graphql/reference/index.md#mutationprojectsettingsupdate)
|
||||
mutation.
|
||||
1. Set the
|
||||
[`duo_features_enabled`](../../api/graphql/getting_started.md#update-project-settings)
|
||||
setting to `false`. (The default is `true`.)
|
||||
|
||||
### Turn off for an instance
|
||||
|
||||
DETAILS:
|
||||
**Offering:** Self-managed
|
||||
|
||||
You can turn off GitLab Duo for the instance.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must be an administrator.
|
||||
|
||||
To turn off GitLab Duo for an instance:
|
||||
|
||||
<!-- vale gitlab.Substitutions = NO -->
|
||||
1. On the left sidebar, at the bottom, select **Admin Area**.
|
||||
1. Select **Settings > General**
|
||||
1. Expand **AI-powered features**.
|
||||
1. Clear the **Use Duo features** checkbox.
|
||||
1. Optional. Select the **Enforce for all subgroups** checkbox to cascade
|
||||
the setting to all groups in the instance.
|
||||
<!-- vale gitlab.Substitutions = YES -->
|
||||
|
||||
NOTE:
|
||||
An [issue exists](https://gitlab.com/gitlab-org/gitlab/-/issues/441532) to allow administrators
|
||||
to override the setting for specific groups or projects.
|
||||
|
||||
## Turn on beta and experimental features
|
||||
|
||||
GitLab Duo features that are experimental and beta are turned off by default.
|
||||
These features are subject to the [Testing Agreement](https://handbook.gitlab.com/handbook/legal/testing-agreement/).
|
||||
|
||||
### On GitLab.com
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Premium, Ultimate
|
||||
**Offering:** GitLab.com, Self-managed
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118222) in GitLab 16.0.
|
||||
> - [Added to GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147833) in GitLab 16.11.
|
||||
|
||||
You can turn on GitLab Duo experiment and beta features for your group on GitLab.com.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have the Owner role in the top-level group.
|
||||
|
||||
To turn on GitLab Duo experiment and beta features for a top-level group:
|
||||
|
||||
1. On the left sidebar, select **Search or go to** and find your group.
|
||||
1. Select **Settings > General**.
|
||||
1. Expand **Permissions and group features**.
|
||||
1. Under **Experiment and beta features**, select the **Use experiment and beta features** checkbox.
|
||||
1. Select **Save changes**.
|
||||
|
||||
This setting [cascades to all projects](../../user/project/merge_requests/approvals/settings.md#cascade-settings-from-the-instance-or-top-level-group)
|
||||
that belong to the group.
|
||||
|
||||
### On self-managed
|
||||
|
||||
To enable GitLab Duo beta and experimental features for GitLab versions
|
||||
where GitLab Duo Chat is not yet generally available, see the
|
||||
[GitLab Duo Chat documentation](../gitlab_duo_chat/turn_on_off.md#for-self-managed).
|
||||
|
|
@ -0,0 +1,522 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: AI Model Validation
|
||||
description: AI-powered features and functionality.
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
<!-- This page is maintained by Developer Relations, author @dnsmichi. -->
|
||||
|
||||
# GitLab Duo use cases
|
||||
|
||||
The following use cases describe practical use cases with GitLab Duo.
|
||||
Learn how to start with software development and refactor existing source code.
|
||||
Dive into debugging problems with root cause analysis, solve security vulnerabilities,
|
||||
and use all stages of the DevSecOps lifecycle.
|
||||
|
||||
## Use GitLab Duo to solve development challenges
|
||||
|
||||
### Start with a C# application
|
||||
|
||||
In this example, open your C# application and start to explore how to use
|
||||
GitLab Duo AI-powered features for more efficiency.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch these steps in action in [GitLab Duo Coffee Chat: Get started with C#](https://www.youtube.com/watch?v=AdRtX9L--Po)
|
||||
<!-- Video published on 2024-01-30 -->
|
||||
|
||||
The challenge is to create a CLI tool for querying the GitLab REST API.
|
||||
|
||||
- Ask GitLab Duo Chat how to start a new C# project and learn how to use the dotNET CLI:
|
||||
|
||||
```markdown
|
||||
How can I get started creating an empty C# console application in VS Code?
|
||||
```
|
||||
|
||||
- Use Code Suggestions to generate a REST API client with a new code comment:
|
||||
|
||||
```csharp
|
||||
// Connect to a REST API and print the response
|
||||
```
|
||||
|
||||
- The generated source code might need an explanation: Use the code task `/explain`
|
||||
to get an insight how the REST API calls work.
|
||||
|
||||
After successfully generating the source code from a Code Suggestions comment,
|
||||
CI/CD configuration is needed.
|
||||
|
||||
- Chat can help with best practices for a `.gitignore` file for C#:
|
||||
|
||||
```markdown
|
||||
Please show a .gitignore and .gitlab-ci.yml configuration for a C# project.
|
||||
```
|
||||
|
||||
- If your CI/CD job fails, [Root Cause Analysis](../../user/gitlab_duo/experiments.md#root-cause-analysis)
|
||||
can help understand the problem. Alternatively, you can copy the error message into
|
||||
GitLab Duo Chat, and ask for help:
|
||||
|
||||
```markdown
|
||||
Please explain the CI/CD error: The current .NET SDK does not support targeting
|
||||
.NET 8.0
|
||||
```
|
||||
|
||||
- To create tests later, ask GitLab Duo to use the code task `/refactor` to refactor
|
||||
the selected code into a function.
|
||||
|
||||
- Chat can also explain programming language specific keywords and functions, or C#
|
||||
compiler errors.
|
||||
|
||||
```markdown
|
||||
Can you explain async and await in C# with practical examples?
|
||||
|
||||
explain error CS0122: 'Program' is inaccessible due to its protection level
|
||||
```
|
||||
|
||||
- Generate tests by using the `/tests` code task.
|
||||
|
||||
The next question is where to put the generated tests in C# solutions.
|
||||
As a beginner, you might not know that the application and test projects need to exist on the same solutions level to avoid import problems.
|
||||
|
||||
- GitLab Duo Chat can help by asking and refining the prompt questions:
|
||||
|
||||
```markdown
|
||||
In C# and VS Code, how can I add a reference to a project from a test project?
|
||||
|
||||
Please provide the XML configuration which I can add to a C# .csproj file to add a
|
||||
reference to another project in the existing solution?
|
||||
```
|
||||
|
||||
- Sometimes, you must refine the prompt to get better results. The prompt
|
||||
`/refactor into the public class` creates a proposal for code that can be accessed
|
||||
from the test project later.
|
||||
|
||||
```markdown
|
||||
/refactor into the public class
|
||||
```
|
||||
|
||||
- You can also use the `/refactor` code task to ask Chat how to execute tests in the
|
||||
`.gitlab-ci.yml` file.
|
||||
|
||||
```markdown
|
||||
/refactor add a job to run tests (the test project)
|
||||
```
|
||||
|
||||
Resources:
|
||||
|
||||
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-29)
|
||||
|
||||
### Refactor a C++ application with SQLite
|
||||
|
||||
In this example, existing source code with a single main function exists. It repeats code, and cannot be tested.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch these steps in action in [GitLab Duo Coffee Chat: C++, SQLite and CMake](https://www.youtube.com/watch?v=zGOo1jzQ5zM)
|
||||
<!-- Video published on 2024-01-10 -->
|
||||
|
||||
Refactoring the source code into reusable and testable functions is a great first step.
|
||||
|
||||
1. Open VS Code or the Web IDE with GitLab Duo enabled.
|
||||
1. Select the source code, and ask GitLab Duo Chat to refactor it into functions, using a refined prompt:
|
||||
|
||||
```markdown
|
||||
/refactor into functions
|
||||
```
|
||||
|
||||
This refactoring step might not work for the entire selected source code.
|
||||
|
||||
1. Split the refactoring strategy into functional blocks.
|
||||
For example, iterate on all insert, update, and delete operations in the database.
|
||||
|
||||
1. The next step is to generate tests for the newly created functions. Select the source code again.
|
||||
You can use the code task `/tests` with specific prompt instructions for the test framework:
|
||||
|
||||
```markdown
|
||||
/tests using the CTest test framework
|
||||
```
|
||||
|
||||
1. If your application uses the `Boost.Test` framework instead, refine the prompt:
|
||||
|
||||
```markdown
|
||||
/tests using the Boost.Test framework
|
||||
```
|
||||
|
||||
Resources:
|
||||
|
||||
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-09)
|
||||
|
||||
### Refactor C++ functions into object-oriented code
|
||||
|
||||
In this example, existing source code has been wrapped into functions.
|
||||
To support more database types in the future, the code needs to be refactored into classes and object inheritance.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch these steps in action in [GitLab Duo Coffee Chat: Refactor C++ functions into `OOP` classes](https://www.youtube.com/watch?v=Z9EJh0J9358)
|
||||
<!-- Video published on 2024-01-24 -->
|
||||
|
||||
#### Start working on the class
|
||||
|
||||
- Ask GitLab Duo Chat how to implement an object-oriented pattern for a base database class and inherit it in a SQLite class:
|
||||
|
||||
```markdown
|
||||
Explain a generic database implementation using a base class, and SQLite specific class using C++. Provide source examples and steps to follow.
|
||||
```
|
||||
|
||||
- The learning curve includes asking GitLab Duo Chat about pure virtual functions and virtual function overrides in the implementation class.
|
||||
|
||||
```markdown
|
||||
What is a pure virtual function, and what is required for the developer inheriting from that class?
|
||||
```
|
||||
|
||||
- Code tasks can help refactoring the code. Select the functions in the C++ header file, and use a refined prompt:
|
||||
|
||||
```markdown
|
||||
/refactor into class with public functions, and private path/db attributes. Inherit from the base class DB
|
||||
|
||||
/refactor into a base class with pure virtual functions called DB. Remote the SQLite specific parts.
|
||||
```
|
||||
|
||||
- GitLab Duo Chat also guides with constructor overloading, object initialization, and optimized memory management with shared pointers.
|
||||
|
||||
```markdown
|
||||
How to add a function implementation to a class in a cpp file?
|
||||
|
||||
How to pass values to class attributes through the class constructor call?
|
||||
```
|
||||
|
||||
#### Find better answers
|
||||
|
||||
- The following question did not provide enough context.
|
||||
|
||||
```markdown
|
||||
Should I use virtual override instead of just override?
|
||||
```
|
||||
|
||||
- Instead, try to add more context to get better answers.
|
||||
|
||||
```markdown
|
||||
When implementing a pure virtual function in an inherited class, should I use virtual function override, or just function override? Context is C++.
|
||||
```
|
||||
|
||||
- A relatively complex question involves how to instantiate an object from the newly created class, and call specific functions.
|
||||
|
||||
```markdown
|
||||
How to instantiate an object from a class in C++, call the constructor with the SQLite DB path and call the functions. Prefer pointers.
|
||||
```
|
||||
|
||||
- The result can be helpful, but needed refinements for shared pointers and required source code headers.
|
||||
|
||||
```markdown
|
||||
How to instantiate an object from a class in C++, call the constructor with the SQLite DB path and call the functions. Prefer shared pointers. Explain which header includes are necessary.
|
||||
```
|
||||
|
||||
- Code Suggestions help generate the correct syntax for `std::shared_ptr` pointer arithmetic and help improve the code quality.
|
||||
|
||||
```cpp
|
||||
// Define the SQLite path in a variable, default value database.db
|
||||
|
||||
// Create a shared pointer for the SQLite class
|
||||
|
||||
// Open a database connection using OpenConnection
|
||||
```
|
||||
|
||||
#### Refactor your code
|
||||
|
||||
- After refactoring the source code, compiler errors may occur. Ask Chat to explain them.
|
||||
|
||||
```markdown
|
||||
Explain the error: `db` is a private member of `SQLiteDB`
|
||||
```
|
||||
|
||||
- A specific SQL query string should be refactored into a multi-line string for more efficient editing.
|
||||
|
||||
```cpp
|
||||
std::string sql = "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT NOT NULL)";
|
||||
```
|
||||
|
||||
- Select the source code, and use the `/refactor` code task:
|
||||
|
||||
```markdown
|
||||
/refactor into a stringstream with multiple lines
|
||||
```
|
||||
|
||||
- You can also refactor utility functions into a class with static functions in C++ and then ask Chat how to call them.
|
||||
|
||||
```markdown
|
||||
/refactor into a class providing static functions
|
||||
|
||||
How to call the static functions in the class?
|
||||
```
|
||||
|
||||
After refactoring the source code, the foundation for more database types is built, and overall code quality improved.
|
||||
|
||||
Resources:
|
||||
|
||||
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-23)
|
||||
|
||||
## Explain and resolve vulnerabilities
|
||||
|
||||
In this example, detected security vulnerabilities in C should be fixed with the help from GitLab Duo.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch the [GitLab Duo Coffee Chat: Vulnerability Resolution Challenge #1](https://www.youtube.com/watch?v=Ypwx4lFnHP0)
|
||||
<!-- Video published on 2024-01-30 -->
|
||||
|
||||
[This source code snippet](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-30/-/blob/4685e4e1c658565ae956ad9befdfcc128e60c6cf/src/main-vulnerable-source.c)
|
||||
introduces a security vulnerability with a [buffer overflow](https://en.wikipedia.org/wiki/Buffer_overflow):
|
||||
|
||||
```c
|
||||
strcpy(region, "Hello GitLab Duo Vulnerability Resolution challenge");
|
||||
|
||||
printf("Contents of region: %s\n", region);
|
||||
```
|
||||
|
||||
[SAST security scanners](../application_security/sast/analyzers.md) can detect and report the problem. Use [Vulnerability Explanation](../application_security/vulnerabilities/index.md#explaining-a-vulnerability) to understand the problem.
|
||||
[Vulnerability resolution](../application_security/vulnerabilities/index.md#vulnerability-resolution) helps to generate an MR.
|
||||
If the suggested changes do not fit requirements, or would otherwise lead to problems, you can use [Code Suggestions](../project/repository/code_suggestions/index.md) and [Chat](index.md) to refine. For example:
|
||||
|
||||
1. Open VS Code or the Web IDE with GitLab Duo enabled, and add a comment with instructions:
|
||||
|
||||
```c
|
||||
// Avoid potential buffer overflows
|
||||
|
||||
// Possible AI-generated code below
|
||||
strncpy(region, "Hello GitLab Duo Vulnerability Resolution challenge", pagesize);
|
||||
region[pagesize-1] = '\0';
|
||||
printf("Contents of region: %s\n", region);
|
||||
```
|
||||
|
||||
1. Delete the suggested code, and use a different comment to use an alternative method.
|
||||
|
||||
```c
|
||||
// Avoid potential buffer overflows using snprintf()
|
||||
|
||||
// Possible AI-generated code below
|
||||
snprintf(region, pagesize, "Hello GitLab Duo Vulnerability Resolution challenge");
|
||||
|
||||
printf("Contents of region: %s\n", region);
|
||||
```
|
||||
|
||||
1. In addition, use GitLab Duo Chat to ask questions. The `/refactor` code task can generate different suggestions.
|
||||
If you prefer a specific algorithm or function, refine the prompt:
|
||||
|
||||
```markdown
|
||||
/refactor using snprintf
|
||||
```
|
||||
|
||||
Resources:
|
||||
|
||||
- Project with source code: [GitLab Duo Coffee Chat 2024-01-30 - Vulnerability Resolution Challenge](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-30)
|
||||
|
||||
### Answer questions about GitLab
|
||||
|
||||
In this example, the challenge is to use GitLab Duo Chat to solve problems.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch the recording here: [GitLab Duo Coffee Chat: Solve problems with GitLab Duo Chat Challenge](https://www.youtube.com/watch?v=Ypwx4lFnHP0)
|
||||
<!-- Video published on 2024-02-02 -->
|
||||
|
||||
- You can use GitLab Duo Chat to explain CI/CD errors.
|
||||
|
||||
```markdown
|
||||
Explain this CI/CD error: build.sh: line 14: go command not found
|
||||
```
|
||||
|
||||
- What happens when you are impatient, and input just one or two words?
|
||||
|
||||
```markdown
|
||||
labels
|
||||
|
||||
issue labels
|
||||
```
|
||||
|
||||
GitLab Duo Chat asks for more context.
|
||||
|
||||
- Refine your question into a full sentence, describing the problem and asking for a solution.
|
||||
|
||||
```markdown
|
||||
Explain labels in GitLab. Provide an example for efficient usage.
|
||||
```
|
||||
|
||||
Resources:
|
||||
|
||||
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-02-01)
|
||||
|
||||
## Use GitLab Duo to contribute to GitLab
|
||||
|
||||
GitLab Duo usage focuses on contributing to the GitLab codebase, and how customers can contribute more efficiently.
|
||||
|
||||
The GitLab codebase is large, and requires to understand sometimes complex algorithms or application specific implementations.
|
||||
Review the [architecture components](../../development/architecture.md) to learn more.
|
||||
|
||||
### Contribute to frontend: Profile Settings
|
||||
|
||||
In this example, the challenge was to update the GitLab profile page and improve the social networks settings.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch the recording here: [GitLab Duo Coffee Chat: Contribute to GitLab using Code Suggestions and Chat](https://www.youtube.com/watch?v=TauP7soXj-E)
|
||||
<!-- Video published on 2024-02-23 -->
|
||||
|
||||
GitLab Duo Chat can be helpful to explain and refactor code, and generate tests.
|
||||
Code Suggestions help complete existing code, and can generate new functions and algorithms in Ruby, Go, or VueJS.
|
||||
|
||||
1. Use the `/explain` code task to explain selected code sections, and learn how the HAML templates work.
|
||||
1. You can refine the code task prompts, and instead ask `/explain how HAML rendering works`
|
||||
|
||||
Alternatively, you can write in the chat prompt directly, for example:
|
||||
|
||||
```markdown
|
||||
how to populate a select in haml
|
||||
```
|
||||
|
||||
The refactoring examples involve the following:
|
||||
|
||||
1. `/refactor into a HAML dropdown`
|
||||
1. After inspecting the existing UI form code, refine the prompt to `/refactor into a HAML dropdown with a form select`
|
||||
|
||||
GitLab Duo Chat helped with error debugging, prefixing the error message:
|
||||
|
||||
```markdown
|
||||
please explain this error: undefined method `icon` for
|
||||
```
|
||||
|
||||
## Code generation prompts
|
||||
|
||||
The following examples provide helpful [code generation](../project/repository/code_suggestions/index.md#best-practices)
|
||||
prompts for the [supported languages](../project/repository/code_suggestions/supported_extensions.md) in GitLab Duo.
|
||||
Code generation prompts can be refined using multi-line comments.
|
||||
|
||||
The examples are stored in the [GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts), maintained by the Developer Relations team.
|
||||
|
||||
### C++ code generation prompts
|
||||
|
||||
Create an application to manage distributed file nodes.
|
||||
|
||||
```c++
|
||||
// Create an application to manage distributed file nodes
|
||||
// Provide an overview the health state of nodes
|
||||
// Use OOP patterns to define the base file node
|
||||
// Add specific filesystems inherited from the base file
|
||||
```
|
||||
|
||||
Create an eBPF program which attaches to `XDP` kernel events to measure network traffic.
|
||||
Only works on Linux kernels.
|
||||
|
||||
```c++
|
||||
// Create an eBPF program which attaches to XDP kernel events
|
||||
// Count all packets by IP address
|
||||
// Print a summary
|
||||
// Include necessary headers
|
||||
```
|
||||
|
||||
### `C#` code generation prompts
|
||||
|
||||
Create a medical analyzer app from different sensors, and store the data in `MSSQL`.
|
||||
|
||||
```c#
|
||||
// Create a medical analyzer app
|
||||
// Collect data from different sensors
|
||||
// Store data in MSSQL
|
||||
// Provide methods to access the sensor data
|
||||
```
|
||||
|
||||
### Go code generation prompts
|
||||
|
||||
Create an observability application for Kubernetes which reads and prints the state of containers, pods, and services in the cluster.
|
||||
|
||||
```go
|
||||
// Create a client for Kubernetes observability
|
||||
// Create a function that
|
||||
// Read the kubernetes configuration file from the KUBECONFIG env var
|
||||
// Create kubernetes context, namespace default
|
||||
// Inspect container, pod, service status and print an overview
|
||||
// Import necessary packages
|
||||
// Create main package
|
||||
```
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch the recording here: [GitLab Duo Coffee Chat: Code Generation Challenge with Go and Kubernetes Observability](https://www.youtube.com/watch?v=ORpRqp-A9hQ)
|
||||
<!-- Video published on 2024-03-27. Maintainer: Developer Relations. -->
|
||||
|
||||
### Java code generation prompts
|
||||
|
||||
Create a data analytics application, with different data sources for metrics.
|
||||
Provide an API for data queries and aggregation.
|
||||
|
||||
```java
|
||||
// Create a data analytics app
|
||||
// Parse different input sources and their values
|
||||
// Store the metrics in a columnar format
|
||||
// Provide an API to query and aggregate data
|
||||
```
|
||||
|
||||
### JavaScript code generation prompts
|
||||
|
||||
Create a paid-time-off application for employees in ReactJS, with a date-time picker.
|
||||
|
||||
```javascript
|
||||
// Create a Paid Time Off app for users
|
||||
// Create a date-time picker in ReactJS
|
||||
// Provide start and end options
|
||||
// Show public holidays based on the selected country
|
||||
// Send the request to a server API
|
||||
```
|
||||
|
||||
### PHP code generation prompts
|
||||
|
||||
Create an RSS feed fetcher for GitLab releases, allow filtering by title.
|
||||
|
||||
```php
|
||||
// Create a web form to show GitLab releases
|
||||
// Fetch the RSS feed from https://about.gitlab.com/atom.xml
|
||||
// Provide filter options for the title
|
||||
```
|
||||
|
||||
### Python code generation prompts
|
||||
|
||||
Create a webserver using Flask to manage users using the REST API, store them in SQLite.
|
||||
|
||||
```python
|
||||
# Create a Flask webserver
|
||||
# Add REST API entrypoints to manage users by ID
|
||||
# Implement create, update, delete functions
|
||||
# User data needs to be stored in SQlite, create table if not exists
|
||||
# Run the server on port 8080, support TLS
|
||||
# Print required packages for requirements.txt in a comment.
|
||||
# Use Python 3.10 as default
|
||||
```
|
||||
|
||||
### Ruby code generation prompts
|
||||
|
||||
Create a log parser application which stores log data in Elasticsearch.
|
||||
|
||||
```ruby
|
||||
# Create a Ruby app as log parser
|
||||
# Provide hooks to replace sensitive strings in log lines
|
||||
# Format the logs and store them in Elasticsearch
|
||||
```
|
||||
|
||||
### Rust code generation prompts
|
||||
|
||||
Create an RSS feed reader app, example from the blog post [Learn advanced Rust programming with a little help from AI](https://about.gitlab.com/blog/2023/10/12/learn-advanced-rust-programming-with-a-little-help-from-ai-code-suggestions/).
|
||||
|
||||
```rust
|
||||
// Create a function that iterates over the source array
|
||||
// and fetches the data using HTTP from the RSS feed items.
|
||||
// Store the results in a new hash map.
|
||||
// Print the hash map to the terminal.
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
Many of the use cases are available as hands-on recordings in the [GitLab Duo Coffee Chat YouTube playlist](https://www.youtube.com/playlist?list=PL05JrBw4t0Kp5uj_JgQiSvHw1jQu0mSVZ).
|
||||
The [GitLab Duo Coffee Chat](https://handbook.gitlab.com/handbook/marketing/developer-relations/developer-advocacy/projects/#gitlab-duo-coffee-chat) is a learning series maintained by the [Developer Relations team](https://handbook.gitlab.com/handbook/marketing/developer-relations/).
|
||||
|
||||
### Blog resources
|
||||
|
||||
- [10 best practices for using AI-powered GitLab Duo Chat](https://about.gitlab.com/blog/2024/04/02/10-best-practices-for-using-ai-powered-gitlab-duo-chat/)
|
||||
- [Learning Rust with a little help from AI](https://about.gitlab.com/blog/2023/08/10/learning-rust-with-a-little-help-from-ai-code-suggestions-getting-started/)
|
||||
- [Learn advanced Rust programming with a little help from AI](https://about.gitlab.com/blog/2023/10/12/learn-advanced-rust-programming-with-a-little-help-from-ai-code-suggestions/)
|
||||
- [Learning Python with a little help from AI](https://about.gitlab.com/blog/2023/11/09/learning-python-with-a-little-help-from-ai-code-suggestions/)
|
||||
- [Write Terraform plans faster with GitLab Duo Code Suggestions](https://about.gitlab.com/blog/2024/01/24/write-terraform-plans-faster-with-gitlab-duo-code-suggestions/)
|
||||
- [Explore the Dragon Realm: Build a C++ adventure game with a little help from AI](https://about.gitlab.com/blog/2023/08/24/building-a-text-adventure-using-cplusplus-and-code-suggestions/)
|
||||
- [GitLab uses Anthropic for smart, safe AI-assisted code generation](https://about.gitlab.com/blog/2024/01/16/gitlab-uses-anthropic-for-smart-safe-ai-assisted-code-generation/)
|
||||
|
|
@ -1,167 +1,11 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: Duo Chat
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
redirect_to: '../user/gitlab_duo_chat/index.md'
|
||||
remove_date: '2024-09-07'
|
||||
---
|
||||
|
||||
# GitLab Duo Chat
|
||||
This document was moved to [another location](../user/gitlab_duo_chat/index.md).
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117695) as an [experiment](../policy/experiment-beta-support.md#experiment) for SaaS in GitLab 16.0.
|
||||
> - Changed to [beta](../policy/experiment-beta-support.md#beta) for SaaS in GitLab 16.6.
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/11251) as a [beta](../policy/experiment-beta-support.md#beta) for self-managed in GitLab 16.8.
|
||||
> - Changed from Ultimate to [Premium](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142808) tier in GitLab 16.9 while in [beta](../policy/experiment-beta-support.md#beta).
|
||||
> - Changed to [generally available](../policy/experiment-beta-support.md#generally-available-ga) in GitLab 16.11.
|
||||
> - Freely available for Ultimate and Premium users for a limited time.
|
||||
|
||||
GitLab Duo Chat is your personal AI-powered assistant for boosting productivity.
|
||||
It can assist various tasks of your daily work with the AI-generated content.
|
||||
|
||||
> For a limited time, the following users have free access to GitLab Duo Chat:
|
||||
>
|
||||
> - GitLab.com users who are members of at least one group with a Premium or Ultimate subscription.
|
||||
> - GitLab self-managed users with a Premium or Ultimate subscription.
|
||||
>
|
||||
> Eventually a subscription add-on will be required for continued access to GitLab Duo Chat.
|
||||
> Learn more about [Duo Pro and Duo Enterprise pricing](https://about.gitlab.com/gitlab-duo/#pricing).
|
||||
|
||||
For GitLab Dedicated, you must have GitLab Duo Pro or Enterprise.
|
||||
|
||||
## Supported editor extensions
|
||||
|
||||
You can use GitLab Duo Chat in:
|
||||
|
||||
- The GitLab UI
|
||||
- [The GitLab Web IDE (VS Code in the cloud)](project/web_ide/index.md)
|
||||
- VS Code, with the [VS Code GitLab Workflow extension](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow)
|
||||
- JetBrains IDEs, with the [GitLab Duo Plugin for JetBrains](https://plugins.jetbrains.com/plugin/22325-gitlab-duo)
|
||||
|
||||
Visual Studio support is
|
||||
[under active development](https://gitlab.com/groups/gitlab-org/editor-extensions/-/epics/22).
|
||||
You can express interest in other IDE extension support
|
||||
[in this issue](https://gitlab.com/gitlab-org/editor-extensions/meta/-/issues/78).
|
||||
|
||||
## Use GitLab Duo Chat in the GitLab UI
|
||||
|
||||
1. In the upper-right corner, select **GitLab Duo Chat**. A drawer opens on the right side of your screen.
|
||||
1. Enter your question in the chat input box and press **Enter** or select **Send**. It may take a few seconds for the interactive AI chat to produce an answer.
|
||||
1. Optional. Ask a follow-up question.
|
||||
|
||||
To ask a new question unrelated to the previous conversation, you might receive better answers
|
||||
if you clear the context by typing `/reset` and selecting **Send**.
|
||||
|
||||
NOTE:
|
||||
Only the last 50 messages are retained in the chat history. The chat history expires 3 days after last use.
|
||||
|
||||
## Use GitLab Duo Chat in the Web IDE
|
||||
|
||||
> - Introduced in GitLab 16.6 as an [experiment](../policy/experiment-beta-support.md#experiment).
|
||||
> - Changed to generally available in GitLab 16.11.
|
||||
|
||||
To use GitLab Duo Chat in the Web IDE on GitLab:
|
||||
|
||||
1. Open the Web IDE:
|
||||
1. In the GitLab UI, on the left sidebar, select **Search or go to** and find your project.
|
||||
1. Select a file. Then in the upper right, select **Edit > Open in Web IDE**.
|
||||
1. Then open Chat by using one of the following methods:
|
||||
- On the left sidebar, select **GitLab Duo Chat**.
|
||||
- In the file that you have open in the editor, select some code.
|
||||
1. Right-click and select **GitLab Duo Chat**.
|
||||
1. Select **Explain selected code**, **Generate Tests**, or **Refactor**.
|
||||
- Use the keyboard shortcut: <kbd>ALT</kbd>+<kbd>d</kbd> (on Windows and Linux) or <kbd>Option</kbd>+<kbd>d</kbd> (on Mac)
|
||||
1. In the message box, enter your question and press **Enter** or select **Send**.
|
||||
|
||||
If you have selected code in the editor, this selection is sent along with your question to the AI. This way you can ask questions about this code selection. For instance, `Could you simplify this?`.
|
||||
|
||||
NOTE:
|
||||
GitLab Duo Chat is not available in the Web IDE on self-managed.
|
||||
|
||||
## Use GitLab Duo Chat in VS Code
|
||||
|
||||
> - Introduced in GitLab 16.6 as an [experiment](../policy/experiment-beta-support.md#experiment).
|
||||
> - Changed to generally available in GitLab 16.11.
|
||||
|
||||
To use GitLab Duo Chat in GitLab Workflow extension for VS Code:
|
||||
|
||||
1. Install and set up the Workflow extension for VS Code:
|
||||
1. In VS Code, download and install the [GitLab Workflow extension for VS Code](../editor_extensions/visual_studio_code/index.md#download-the-extension).
|
||||
1. Configure the [GitLab Workflow extension](../editor_extensions/visual_studio_code/index.md#configure-the-extension).
|
||||
1. In VS Code, open a file. The file does not need to be a file in a Git repository.
|
||||
1. Open Chat by using one of the following methods:
|
||||
- On the left sidebar, select **GitLab Duo Chat**.
|
||||
- In the file that you have open in the editor, select some code.
|
||||
1. Right-click and select **GitLab Duo Chat**.
|
||||
1. Select **Explain selected code** or **Generate Tests**.
|
||||
- Use the keyboard shortcut: <kbd>ALT</kbd>+<kbd>d</kbd> (on Windows and Linux) or <kbd>Option</kbd>+<kbd>d</kbd> (on Mac)
|
||||
1. In the message box, enter your question and press **Enter** or select **Send**.
|
||||
|
||||
If you have selected code in the editor, this selection is sent along with your question to the AI. This way you can ask questions about this code selection. For instance, `Could you simplify this?`.
|
||||
|
||||
## Use GitLab Duo Chat in JetBrains IDEs
|
||||
|
||||
> - Introduced as generally available in GitLab 16.11.
|
||||
|
||||
To use GitLab Duo Chat in the GitLab Duo plugin for JetBrains IDEs:
|
||||
|
||||
1. Install and set up the GitLab Duo plugin for JetBrains IDEs:
|
||||
1. In the JetBrains marketplace, download and install the [GitLab Duo plugin](../editor_extensions/jetbrains_ide/index.md#download-the-extension).
|
||||
1. Configure the [GitLab Duo plugin](../editor_extensions/jetbrains_ide/index.md#configure-the-extension).
|
||||
1. In a JetBrains IDE, open a project.
|
||||
1. Open Chat by using one of the following methods:
|
||||
- On the right tool window bar, select **GitLab Duo Chat**.
|
||||
- Use a keyboard shortcut: <kbd>ALT</kbd> + <kbd>d</kbd> on Windows and Linux, or
|
||||
<kbd>Option</kbd> + <kbd>d</kbd> on macOS.
|
||||
- In the file that you have open in the editor:
|
||||
1. Optional. Select some code.
|
||||
1. Right-click and select **GitLab Duo Chat**.
|
||||
1. Select **Open Chat Window**.
|
||||
1. Select **Explain Code**, **Generate Tests**, or **Refactor Code**.
|
||||
- Add keyboard or mouse shortcuts for each action under **Keymap** in the **Settings**.
|
||||
1. In the message box, enter your question and press **Enter** or select **Send**.
|
||||
|
||||
## Watch a demo and get tips
|
||||
|
||||
<div class="video-fallback">
|
||||
<a href="https://youtu.be/l6vsd1HMaYA?si=etXpFbj1cBvWyj3_">View how to set up and use GitLab Duo Chat</a>.
|
||||
</div>
|
||||
<figure class="video-container">
|
||||
<iframe src="https://www.youtube-nocookie.com/embed/l6vsd1HMaYA?si=etXpFbj1cBvWyj3_" frameborder="0" allowfullscreen> </iframe>
|
||||
</figure>
|
||||
|
||||
For tips and tricks about integrating GitLab Duo Chat into your AI-powered DevSecOps workflows,
|
||||
read the blog post:
|
||||
[10 best practices for using AI-powered GitLab Duo Chat](https://about.gitlab.com/blog/2024/04/02/10-best-practices-for-using-ai-powered-gitlab-duo-chat/).
|
||||
|
||||
[View examples of how to use GitLab Duo Chat](gitlab_duo_chat_examples.md).
|
||||
|
||||
## Get code explained, refactored, or generate tests
|
||||
|
||||
In VS Code, JetBrains IDEs, or in the Web IDE, you can
|
||||
have code explained, refactored, or generate test for it.
|
||||
|
||||
1. Select code in your editor.
|
||||
1. In the **Chat** box, type one the following slash commands:
|
||||
- [`/explain`](gitlab_duo_chat_examples.md#explain-code-in-the-ide)
|
||||
- [`/refactor`](gitlab_duo_chat_examples.md#refactor-code-in-the-ide)
|
||||
- [`/tests`](gitlab_duo_chat_examples.md#write-tests-in-the-ide)
|
||||
|
||||
Alternatively, use the context menu to perform these tasks.
|
||||
|
||||
When you use a slash command, you can also add additional instructions, for example: `/tests using the Boost.Test framework`.
|
||||
|
||||
## Delete all conversations
|
||||
|
||||
To delete all previous conversations:
|
||||
|
||||
- In the text box, type `/clear` and select **Send**.
|
||||
|
||||
## Give feedback
|
||||
|
||||
Your feedback is important to us as we continually enhance your GitLab Duo Chat experience.
|
||||
Leaving feedback helps us customize the Chat for your needs and improve its performance for everyone.
|
||||
|
||||
To give feedback about a specific response, use the feedback buttons in the response message.
|
||||
Or, you can add a comment in the [feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/430124).
|
||||
<!-- This redirect file can be deleted after <2024-09-07>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,218 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: Duo Chat
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# Ask GitLab Duo Chat
|
||||
|
||||
GitLab Duo Chat can help with a variety of questions. The following examples
|
||||
represent some of the areas where GitLab Duo Chat can be the most helpful.
|
||||
|
||||
For additional practical examples, see the [GitLab Duo use cases](../gitlab_duo/use_cases.md).
|
||||
|
||||
## Ask about GitLab
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** GitLab UI, Web IDE, VS Code, and JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai), [Vertex AI Search](https://cloud.google.com/enterprise-search)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117695) for GitLab.com in GitLab 16.0.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/451215) ability to ask doc-related questions on self-managed in GitLab 17.0 [with a flag](../../administration/feature_flags.md) named `ai_gateway_docs_search`. Enabled by default.
|
||||
> - [Generally available and feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154876) in GitLab 17.1.
|
||||
|
||||
You can ask questions about how GitLab works. Things like:
|
||||
|
||||
- `Explain the concept of a 'fork' in a concise manner.`
|
||||
- `Provide step-by-step instructions on how to reset a user's password.`
|
||||
|
||||
## Ask about code
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** GitLab UI, Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122235) for GitLab.com in GitLab 16.1.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122235) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
You can also ask GitLab Duo Chat to generate code:
|
||||
|
||||
- `Write a Ruby function that prints 'Hello, World!' when called.`
|
||||
- `Develop a JavaScript program that simulates a two-player Tic-Tac-Toe game. Provide both game logic and user interface, if applicable.`
|
||||
- `Create a regular expression for parsing IPv4 and IPv6 addresses in Python.`
|
||||
- `Generate code for parsing a syslog log file in Java. Use regular expressions when possible, and store the results in a hash map.`
|
||||
- `Create a product-consumer example with threads and shared memory in C++. Use atomic locks when possible.`
|
||||
- `Generate Rust code for high performance gRPC calls. Provide a source code example for a server and client.`
|
||||
|
||||
And you can ask GitLab Duo Chat to explain code:
|
||||
|
||||
- `Provide a clear explanation of the given Ruby code: def sum(a, b) a + b end. Describe what this code does and how it works.`
|
||||
|
||||
Alternatively, you can use the [`/explain` command](examples.md#explain-code-in-the-ide) to explain the selected code in your editor.
|
||||
|
||||
## Ask about CI/CD
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** GitLab UI, Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-2.1`](https://docs.anthropic.com/en/docs/legacy-model-guide#anthropics-legacy-models)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423524) for GitLab.com in GitLab 16.7.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423524) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
You can ask GitLab Duo Chat to create a CI/CD configuration:
|
||||
|
||||
- `Create a .gitlab-ci.yml configuration file for testing and building a Ruby on Rails application in a GitLab CI/CD pipeline.`
|
||||
- `Create a CI/CD configuration for building and linting a Python application.`
|
||||
- `Create a CI/CD configuration to build and test Rust code.`
|
||||
- `Create a CI/CD configuration for C++. Use gcc as compiler, and cmake as build tool.`
|
||||
- `Create a CI/CD configuration for VueJS. Use npm, and add SAST security scanning.`
|
||||
- `Generate a security scanning pipeline configuration, optimized for Java.`
|
||||
|
||||
You can also ask to explain specific job errors by copy-pasting the error message, prefixed with `Please explain this CI/CD job error message, in the context of <language>:`:
|
||||
|
||||
- `Please explain this CI/CD job error message in the context of a Go project: build.sh: line 14: go command not found`
|
||||
|
||||
Alternatively, you can use [root cause analysis in CI/CD](../gitlab_duo/experiments.md#root-cause-analysis).
|
||||
|
||||
## Explain code in the IDE
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for GitLab.com in GitLab 16.7.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
`/explain` is a special command to explain the selected code in your editor.
|
||||
You can also add additional instructions to be considered, for example: `/explain the performance`
|
||||
See [Use GitLab Duo Chat in VS Code](index.md#use-gitlab-duo-chat-in-vs-code) for more information.
|
||||
|
||||
- `/explain focus on the algorithm`
|
||||
- `/explain the performance gains or losses using this code`
|
||||
- `/explain the object inheritance` (classes, object-oriented)
|
||||
- `/explain why a static variable is used here` (C++)
|
||||
- `/explain how this function would cause a segmentation fault` (C)
|
||||
- `/explain how concurrency works in this context` (Go)
|
||||
- `/explain how the request reaches the client` (REST API, database)
|
||||
|
||||
You can also use the Web UI to explain code in:
|
||||
|
||||
- A [file](../project/repository/code_explain.md).
|
||||
- A [merge request](../project/merge_requests/changes.md#explain-code-in-a-merge-request).
|
||||
|
||||
## Refactor code in the IDE
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for GitLab.com in GitLab 16.7.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
`/refactor` is a special command to generate a refactoring suggestion for the selected code in your editor.
|
||||
You can include additional instructions to be considered. For example:
|
||||
|
||||
- Use a specific coding pattern, for example `/refactor with ActiveRecord` or `/refactor into a class providing static functions`.
|
||||
- Use a specific library, for example `/refactor using mysql`.
|
||||
- Use a specific function/algorithm, for example `/refactor into a stringstream with multiple lines` in C++.
|
||||
- Refactor to a different programming language, for example `/refactor to TypeScript`.
|
||||
- Focus on performance, for example `/refactor improving performance`.
|
||||
- Focus on potential vulnerabilities, for example `/refactor avoiding memory leaks and exploits`.
|
||||
|
||||
## Write tests in the IDE
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for GitLab.com in GitLab 16.7.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
`/tests` is a special command to generate a testing suggestion for the selected code in your editor.
|
||||
You can also add additional instructions to be considered, for example: `/tests using the Boost.Test framework`
|
||||
See [Use GitLab Duo Chat in VS Code](index.md#use-gitlab-duo-chat-in-vs-code) for more information.
|
||||
|
||||
- Use a specific test framework, for example `/tests using the Boost.test framework` (C++) or `/tests using Jest` (JavaScript).
|
||||
- Focus on extreme test cases, for example `/tests focus on extreme cases, force regression testing`.
|
||||
- Focus on performance, for example `/tests focus on performance`.
|
||||
- Focus on regressions and potential exploits, for example `/tests focus on regressions and potential exploits`.
|
||||
|
||||
## Ask about errors
|
||||
|
||||
Programming languages that require compiling the source code may throw cryptic error messages. Similarly, a script or a web application could throw a stack trace. You can ask GitLab Duo Chat by prefixing the copied error message with, for example, `Please explain this error message:`. Add the specific context, like the programming language.
|
||||
|
||||
- `Explain this error message in Java: Int and system cannot be resolved to a type`
|
||||
- `Explain when this C function would cause a segmentation fault: sqlite3_prepare_v2()`
|
||||
- `Explain what would cause this error in Python: ValueError: invalid literal for int()`
|
||||
- `Why is "this" undefined in VueJS? Provide common error cases, and explain how to avoid them.`
|
||||
- `How to debug a Ruby on Rails stacktrace? Share common strategies and an example exception.`
|
||||
|
||||
## Ask follow up questions
|
||||
|
||||
You can ask follow-up questions to delve deeper into the topic or task at hand.
|
||||
This helps you get more detailed and precise responses tailored to your specific needs,
|
||||
whether it's for further clarification, elaboration, or additional assistance.
|
||||
|
||||
A follow-up to the question `Write a Ruby function that prints 'Hello, World!' when called` could be:
|
||||
|
||||
- `Can you also explain how I can call and execute this Ruby function in a typical Ruby environment, such as the command line?`
|
||||
|
||||
A follow-up to the question `How to start a C# project?` could be:
|
||||
|
||||
- `Can you also please explain how to add a .gitignore and .gitlab-ci.yml file for C#?`
|
||||
|
||||
## Ask about a specific issue
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** GitLab UI, Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-haiku-20240307`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122235) for GitLab.com in GitLab 16.0.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122235) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
You can ask about a specific GitLab issue. For example:
|
||||
|
||||
- `Generate a summary for the issue identified via this link: <link to your issue>`
|
||||
- When you are viewing an issue in GitLab, you can ask `Generate a concise summary of the current issue.`
|
||||
- `How can I improve the description of <link to your issue> so that readers understand the value and problems to be solved?`
|
||||
|
||||
NOTE:
|
||||
If the issue contains a large amount of text (more than 40,000 words), GitLab Duo Chat might not be able to consider every word. The AI model has a limit to the amount of input it can process at one time.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
For tips on how GitLab Duo Chat can improve your productivity with issues and epics, see [Boost your productivity with GitLab Duo Chat](https://youtu.be/RJezT5_V6dI).
|
||||
<!-- Video published on 2024-04-17 -->
|
||||
|
||||
## Ask about a specific epic
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** GitLab UI, Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-haiku-20240307`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128487) for GitLab.com in GitLab 16.3.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128487) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
You can ask about a specific GitLab epic. For example:
|
||||
|
||||
- `Generate a summary for the epic identified via this link: <link to your epic>`
|
||||
- When you are viewing an epic in GitLab, you can ask `Generate a concise summary of the opened epic.`
|
||||
- `What are the unique use cases raised by commenters in <link to your epic>?`
|
||||
|
||||
NOTE:
|
||||
If the epic contains a large amount of text (more than 40,000 words), GitLab Duo Chat might not be able to consider every word. The AI model has a limit to the amount of input it can process at one time.
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: Duo Chat
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# GitLab Duo Chat
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117695) as an [experiment](../../policy/experiment-beta-support.md#experiment) for SaaS in GitLab 16.0.
|
||||
> - Changed to [beta](../../policy/experiment-beta-support.md#beta) for SaaS in GitLab 16.6.
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/11251) as a [beta](../../policy/experiment-beta-support.md#beta) for self-managed in GitLab 16.8.
|
||||
> - Changed from Ultimate to [Premium](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142808) tier in GitLab 16.9 while in [beta](../../policy/experiment-beta-support.md#beta).
|
||||
> - Changed to [generally available](../../policy/experiment-beta-support.md#generally-available-ga) in GitLab 16.11.
|
||||
> - Freely available for Ultimate and Premium users for a limited time.
|
||||
|
||||
GitLab Duo Chat is your personal AI-powered assistant for boosting productivity.
|
||||
It can assist various tasks of your daily work with the AI-generated content.
|
||||
|
||||
> For a limited time, the following users have free access to GitLab Duo Chat:
|
||||
>
|
||||
> - GitLab.com users who are members of at least one group with a Premium or Ultimate subscription.
|
||||
> - GitLab self-managed users with a Premium or Ultimate subscription.
|
||||
>
|
||||
> Eventually a subscription add-on will be required for continued access to GitLab Duo Chat.
|
||||
> Learn more about [Duo Pro and Duo Enterprise pricing](https://about.gitlab.com/gitlab-duo/#pricing).
|
||||
|
||||
For GitLab Dedicated, you must have GitLab Duo Pro or Enterprise.
|
||||
|
||||
## Supported editor extensions
|
||||
|
||||
You can use GitLab Duo Chat in:
|
||||
|
||||
- The GitLab UI
|
||||
- [The GitLab Web IDE (VS Code in the cloud)](../project/web_ide/index.md)
|
||||
- VS Code, with the [VS Code GitLab Workflow extension](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow)
|
||||
- JetBrains IDEs, with the [GitLab Duo Plugin for JetBrains](https://plugins.jetbrains.com/plugin/22325-gitlab-duo)
|
||||
|
||||
Visual Studio support is
|
||||
[under active development](https://gitlab.com/groups/gitlab-org/editor-extensions/-/epics/22).
|
||||
You can express interest in other IDE extension support
|
||||
[in this issue](https://gitlab.com/gitlab-org/editor-extensions/meta/-/issues/78).
|
||||
|
||||
## Use GitLab Duo Chat in the GitLab UI
|
||||
|
||||
1. In the upper-right corner, select **GitLab Duo Chat**. A drawer opens on the right side of your screen.
|
||||
1. Enter your question in the chat input box and press **Enter** or select **Send**. It may take a few seconds for the interactive AI chat to produce an answer.
|
||||
1. Optional. Ask a follow-up question.
|
||||
|
||||
To ask a new question unrelated to the previous conversation, you might receive better answers
|
||||
if you clear the context by typing `/reset` and selecting **Send**.
|
||||
|
||||
NOTE:
|
||||
Only the last 50 messages are retained in the chat history. The chat history expires 3 days after last use.
|
||||
|
||||
## Use GitLab Duo Chat in the Web IDE
|
||||
|
||||
> - Introduced in GitLab 16.6 as an [experiment](../../policy/experiment-beta-support.md#experiment).
|
||||
> - Changed to generally available in GitLab 16.11.
|
||||
|
||||
To use GitLab Duo Chat in the Web IDE on GitLab:
|
||||
|
||||
1. Open the Web IDE:
|
||||
1. In the GitLab UI, on the left sidebar, select **Search or go to** and find your project.
|
||||
1. Select a file. Then in the upper right, select **Edit > Open in Web IDE**.
|
||||
1. Then open Chat by using one of the following methods:
|
||||
- On the left sidebar, select **GitLab Duo Chat**.
|
||||
- In the file that you have open in the editor, select some code.
|
||||
1. Right-click and select **GitLab Duo Chat**.
|
||||
1. Select **Explain selected code**, **Generate Tests**, or **Refactor**.
|
||||
- Use the keyboard shortcut: <kbd>ALT</kbd>+<kbd>d</kbd> (on Windows and Linux) or <kbd>Option</kbd>+<kbd>d</kbd> (on Mac)
|
||||
1. In the message box, enter your question and press **Enter** or select **Send**.
|
||||
|
||||
If you have selected code in the editor, this selection is sent along with your question to the AI. This way you can ask questions about this code selection. For instance, `Could you simplify this?`.
|
||||
|
||||
NOTE:
|
||||
GitLab Duo Chat is not available in the Web IDE on self-managed.
|
||||
|
||||
## Use GitLab Duo Chat in VS Code
|
||||
|
||||
> - Introduced in GitLab 16.6 as an [experiment](../../policy/experiment-beta-support.md#experiment).
|
||||
> - Changed to generally available in GitLab 16.11.
|
||||
|
||||
To use GitLab Duo Chat in GitLab Workflow extension for VS Code:
|
||||
|
||||
1. Install and set up the Workflow extension for VS Code:
|
||||
1. In VS Code, download and install the [GitLab Workflow extension for VS Code](../../editor_extensions/visual_studio_code/index.md#download-the-extension).
|
||||
1. Configure the [GitLab Workflow extension](../../editor_extensions/visual_studio_code/index.md#configure-the-extension).
|
||||
1. In VS Code, open a file. The file does not need to be a file in a Git repository.
|
||||
1. Open Chat by using one of the following methods:
|
||||
- On the left sidebar, select **GitLab Duo Chat**.
|
||||
- In the file that you have open in the editor, select some code.
|
||||
1. Right-click and select **GitLab Duo Chat**.
|
||||
1. Select **Explain selected code** or **Generate Tests**.
|
||||
- Use the keyboard shortcut: <kbd>ALT</kbd>+<kbd>d</kbd> (on Windows and Linux) or <kbd>Option</kbd>+<kbd>d</kbd> (on Mac)
|
||||
1. In the message box, enter your question and press **Enter** or select **Send**.
|
||||
|
||||
If you have selected code in the editor, this selection is sent along with your question to the AI. This way you can ask questions about this code selection. For instance, `Could you simplify this?`.
|
||||
|
||||
## Use GitLab Duo Chat in JetBrains IDEs
|
||||
|
||||
> - Introduced as generally available in GitLab 16.11.
|
||||
|
||||
To use GitLab Duo Chat in the GitLab Duo plugin for JetBrains IDEs:
|
||||
|
||||
1. Install and set up the GitLab Duo plugin for JetBrains IDEs:
|
||||
1. In the JetBrains marketplace, download and install the [GitLab Duo plugin](../../editor_extensions/jetbrains_ide/index.md#download-the-extension).
|
||||
1. Configure the [GitLab Duo plugin](../../editor_extensions/jetbrains_ide/index.md#configure-the-extension).
|
||||
1. In a JetBrains IDE, open a project.
|
||||
1. Open Chat by using one of the following methods:
|
||||
- On the right tool window bar, select **GitLab Duo Chat**.
|
||||
- Use a keyboard shortcut: <kbd>ALT</kbd> + <kbd>d</kbd> on Windows and Linux, or
|
||||
<kbd>Option</kbd> + <kbd>d</kbd> on macOS.
|
||||
- In the file that you have open in the editor:
|
||||
1. Optional. Select some code.
|
||||
1. Right-click and select **GitLab Duo Chat**.
|
||||
1. Select **Open Chat Window**.
|
||||
1. Select **Explain Code**, **Generate Tests**, or **Refactor Code**.
|
||||
- Add keyboard or mouse shortcuts for each action under **Keymap** in the **Settings**.
|
||||
1. In the message box, enter your question and press **Enter** or select **Send**.
|
||||
|
||||
## Watch a demo and get tips
|
||||
|
||||
<div class="video-fallback">
|
||||
<a href="https://youtu.be/l6vsd1HMaYA?si=etXpFbj1cBvWyj3_">View how to set up and use GitLab Duo Chat</a>.
|
||||
</div>
|
||||
<figure class="video-container">
|
||||
<iframe src="https://www.youtube-nocookie.com/embed/l6vsd1HMaYA?si=etXpFbj1cBvWyj3_" frameborder="0" allowfullscreen> </iframe>
|
||||
</figure>
|
||||
|
||||
For tips and tricks about integrating GitLab Duo Chat into your AI-powered DevSecOps workflows,
|
||||
read the blog post:
|
||||
[10 best practices for using AI-powered GitLab Duo Chat](https://about.gitlab.com/blog/2024/04/02/10-best-practices-for-using-ai-powered-gitlab-duo-chat/).
|
||||
|
||||
[View examples of how to use GitLab Duo Chat](../gitlab_duo_chat/examples.md).
|
||||
|
||||
## Get code explained, refactored, or generate tests
|
||||
|
||||
In VS Code, JetBrains IDEs, or in the Web IDE, you can
|
||||
have code explained, refactored, or generate test for it.
|
||||
|
||||
1. Select code in your editor.
|
||||
1. In the **Chat** box, type one the following slash commands:
|
||||
- [`/explain`](../gitlab_duo_chat/examples.md#explain-code-in-the-ide)
|
||||
- [`/refactor`](../gitlab_duo_chat/examples.md#refactor-code-in-the-ide)
|
||||
- [`/tests`](../gitlab_duo_chat/examples.md#write-tests-in-the-ide)
|
||||
|
||||
Alternatively, use the context menu to perform these tasks.
|
||||
|
||||
When you use a slash command, you can also add additional instructions, for example: `/tests using the Boost.Test framework`.
|
||||
|
||||
## Delete all conversations
|
||||
|
||||
To delete all previous conversations:
|
||||
|
||||
- In the text box, type `/clear` and select **Send**.
|
||||
|
||||
## Give feedback
|
||||
|
||||
Your feedback is important to us as we continually enhance your GitLab Duo Chat experience.
|
||||
Leaving feedback helps us customize the Chat for your needs and improve its performance for everyone.
|
||||
|
||||
To give feedback about a specific response, use the feedback buttons in the response message.
|
||||
Or, you can add a comment in the [feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/430124).
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: Duo Chat
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# GitLab Duo Chat troubleshooting
|
||||
|
||||
When working with GitLab Duo Chat, you might encounter the following issues.
|
||||
|
||||
## The **GitLab Duo Chat** button is not displayed
|
||||
|
||||
If the button is not visible in the upper-right of the UI,
|
||||
ensure GitLab Duo Chat [is enabled](turn_on_off.md).
|
||||
|
||||
The **GitLab Duo Chat** button is not displayed on personal projects,
|
||||
as well as
|
||||
[groups and projects with GitLab Duo features disabled](turn_on_off.md).
|
||||
|
||||
After you enable GitLab Duo Chat, it might take a few minutes for the
|
||||
button to appear.
|
||||
|
||||
## `This feature is only allowed in groups or projects that enable this feature`
|
||||
|
||||
This error occurs when you ask about resources that do have
|
||||
GitLab Duo [disabled](turn_on_off.md).
|
||||
|
||||
If any of the settings are not enabled, information about resources
|
||||
(like issues, epics, and merge requests) in the group or project
|
||||
cannot be processed by GitLab Duo Chat.
|
||||
|
||||
## `I am sorry, I am unable to find what you are looking for`
|
||||
|
||||
This error occurs when you ask GitLab Duo Chat about resources you don't have access to,
|
||||
or about resources that do not exist.
|
||||
|
||||
Try again, asking about resources you have access to.
|
||||
|
||||
## `I'm sorry, I can't find the answer, but it's my fault, not yours. Please try something different`
|
||||
|
||||
This is a fallback error that occurs when there is a problem with GitLab Duo Chat.
|
||||
Please try your request again, or leave feedback to help us improve.
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: Duo Chat
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# Control GitLab Duo Chat availability
|
||||
|
||||
GitLab Duo Chat can be turned on and off, and availability changed.
|
||||
|
||||
## For GitLab.com
|
||||
|
||||
For a limited time, GitLab Duo Chat is automatically available for all GitLab.com users
|
||||
who are members of at least one group with a Premium or Ultimate subscription.
|
||||
|
||||
## For self-managed
|
||||
|
||||
To enable GitLab Duo Chat on a self-managed instance,
|
||||
you must have the following prerequisites.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have GitLab version 16.8 or later. You should use the latest GitLab version to benefit from the latest improvements to GitLab Duo Chat. The generally available version of GitLab Duo Chat in GitLab 16.11 has significant improvements in the quality of the answers.
|
||||
- You must have a Premium or Ultimate subscription that is [synchronized with GitLab](https://about.gitlab.com/pricing/licensing-faq/cloud-licensing/). To make sure GitLab Duo Chat works immediately, administrators can
|
||||
[manually synchronize your subscription](#manually-synchronize-your-subscription).
|
||||
- You must have [enabled network connectivity](../gitlab_duo/turn_on_off.md#configure-gitlab-duo-on-a-self-managed-instance).
|
||||
- All of the users in your instance must have the latest version of their IDE extension.
|
||||
|
||||
Then, depending on the version of GitLab you have, you can enable GitLab Duo Chat.
|
||||
|
||||
### In GitLab 16.11 and later
|
||||
|
||||
In GitLab 16.11 and later, GitLab Duo Chat is generally available
|
||||
and automatically enabled for all users who have a subscription to the Premium or Ultimate tier.
|
||||
|
||||
You do not need to do anything to enable GitLab Duo Chat if you have GitLab 16.11 or later.
|
||||
|
||||
### In earlier GitLab versions
|
||||
|
||||
In GitLab 16.8, 16.9, and 16.10, GitLab Duo Chat is available in beta. To enable GitLab Duo Chat for your self-managed GitLab instance, an administrator must enable experiment and beta features:
|
||||
|
||||
1. On the left sidebar, at the bottom, select **Admin Area**.
|
||||
1. Select **Settings > General**.
|
||||
1. Expand **AI-powered features** and select **Enable Experiment and Beta AI-powered features**.
|
||||
1. Select **Save changes**.
|
||||
1. To make sure GitLab Duo Chat works immediately, you must
|
||||
[manually synchronize your subscription](#manually-synchronize-your-subscription).
|
||||
|
||||
NOTE:
|
||||
Usage of GitLab Duo Chat beta is governed by the [GitLab Testing Agreement](https://handbook.gitlab.com/handbook/legal/testing-agreement/).
|
||||
Learn about [data usage when using GitLab Duo Chat](../gitlab_duo/data_usage.md).
|
||||
|
||||
### Manually synchronize your subscription
|
||||
|
||||
You can [manually synchronize your subscription](../../subscriptions/self_managed/index.md#manually-synchronize-your-subscription-details) if either:
|
||||
|
||||
- You have just purchased a subscription for the Premium or Ultimate tier, or have recently assigned seats for Duo Pro, and you have upgraded to GitLab 16.8.
|
||||
- You already have a subscription for the Premium or Ultimate tier, or you have recently assigned seats for Duo Pro, and you have upgraded to GitLab 16.8.
|
||||
|
||||
Without the manual synchronization, it might take up to 24 hours to activate GitLab Duo Chat on your instance.
|
||||
|
||||
## For GitLab Dedicated
|
||||
|
||||
In GitLab 16.11 and later, on GitLab Dedicated, GitLab Duo Chat is generally available and
|
||||
automatically enabled for those with GitLab Duo Pro or Enterprise.
|
||||
|
||||
In GitLab 16.8, 16.9, and 16.10, on GitLab Dedicated, GitLab Duo Chat is available in beta.
|
||||
|
||||
## Disable GitLab Duo Chat
|
||||
|
||||
To limit the data that Duo Chat has access to, follow the instructions for
|
||||
[disabling GitLab Duo features](../../user/gitlab_duo/turn_on_off.md#turn-off-gitlab-duo-features).
|
||||
|
||||
## Disable Chat in VS Code
|
||||
|
||||
To disable GitLab Duo Chat in VS Code:
|
||||
|
||||
1. Go to **Settings > Extensions > GitLab Workflow (GitLab VS Code Extension)**.
|
||||
1. Clear the **Enable GitLab Duo Chat assistant** checkbox.
|
||||
|
|
@ -1,79 +1,11 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: Duo Chat
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
redirect_to: '../user/gitlab_duo_chat/turn_on_off.md'
|
||||
remove_date: '2024-09-07'
|
||||
---
|
||||
|
||||
# Control GitLab Duo Chat availability
|
||||
This document was moved to [another location](../user/gitlab_duo_chat/turn_on_off.md).
|
||||
|
||||
GitLab Duo Chat can be turned on and off, and availability changed.
|
||||
|
||||
## For GitLab.com
|
||||
|
||||
For a limited time, GitLab Duo Chat is automatically available for all GitLab.com users
|
||||
who are members of at least one group with a Premium or Ultimate subscription.
|
||||
|
||||
## For self-managed
|
||||
|
||||
To enable GitLab Duo Chat on a self-managed instance,
|
||||
you must have the following prerequisites.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have GitLab version 16.8 or later. You should use the latest GitLab version to benefit from the latest improvements to GitLab Duo Chat. The generally available version of GitLab Duo Chat in GitLab 16.11 has significant improvements in the quality of the answers.
|
||||
- You must have a Premium or Ultimate subscription that is [synchronized with GitLab](https://about.gitlab.com/pricing/licensing-faq/cloud-licensing/). To make sure GitLab Duo Chat works immediately, administrators can
|
||||
[manually synchronize your subscription](#manually-synchronize-your-subscription).
|
||||
- You must have [enabled network connectivity](ai_features_enable.md#configure-gitlab-duo-on-a-self-managed-instance).
|
||||
- All of the users in your instance must have the latest version of their IDE extension.
|
||||
|
||||
Then, depending on the version of GitLab you have, you can enable GitLab Duo Chat.
|
||||
|
||||
### In GitLab 16.11 and later
|
||||
|
||||
In GitLab 16.11 and later, GitLab Duo Chat is generally available
|
||||
and automatically enabled for all users who have a subscription to the Premium or Ultimate tier.
|
||||
|
||||
You do not need to do anything to enable GitLab Duo Chat if you have GitLab 16.11 or later.
|
||||
|
||||
### In earlier GitLab versions
|
||||
|
||||
In GitLab 16.8, 16.9, and 16.10, GitLab Duo Chat is available in beta. To enable GitLab Duo Chat for your self-managed GitLab instance, an administrator must enable experiment and beta features:
|
||||
|
||||
1. On the left sidebar, at the bottom, select **Admin Area**.
|
||||
1. Select **Settings > General**.
|
||||
1. Expand **AI-powered features** and select **Enable Experiment and Beta AI-powered features**.
|
||||
1. Select **Save changes**.
|
||||
1. To make sure GitLab Duo Chat works immediately, you must
|
||||
[manually synchronize your subscription](#manually-synchronize-your-subscription).
|
||||
|
||||
NOTE:
|
||||
Usage of GitLab Duo Chat beta is governed by the [GitLab Testing Agreement](https://handbook.gitlab.com/handbook/legal/testing-agreement/).
|
||||
Learn about [data usage when using GitLab Duo Chat](ai_data_usage.md).
|
||||
|
||||
### Manually synchronize your subscription
|
||||
|
||||
You can [manually synchronize your subscription](../subscriptions/self_managed/index.md#manually-synchronize-your-subscription-details) if either:
|
||||
|
||||
- You have just purchased a subscription for the Premium or Ultimate tier, or have recently assigned seats for Duo Pro, and you have upgraded to GitLab 16.8.
|
||||
- You already have a subscription for the Premium or Ultimate tier, or you have recently assigned seats for Duo Pro, and you have upgraded to GitLab 16.8.
|
||||
|
||||
Without the manual synchronization, it might take up to 24 hours to activate GitLab Duo Chat on your instance.
|
||||
|
||||
## For GitLab Dedicated
|
||||
|
||||
In GitLab 16.11 and later, on GitLab Dedicated, GitLab Duo Chat is generally available and
|
||||
automatically enabled for those with GitLab Duo Pro or Enterprise.
|
||||
|
||||
In GitLab 16.8, 16.9, and 16.10, on GitLab Dedicated, GitLab Duo Chat is available in beta.
|
||||
|
||||
## Disable GitLab Duo Chat
|
||||
|
||||
To limit the data that Duo Chat has access to, follow the instructions for
|
||||
[disabling GitLab Duo features](ai_features_enable.md#turn-off-gitlab-duo-features).
|
||||
|
||||
## Disable Chat in VS Code
|
||||
|
||||
To disable GitLab Duo Chat in VS Code:
|
||||
|
||||
1. Go to **Settings > Extensions > GitLab Workflow (GitLab VS Code Extension)**.
|
||||
1. Clear the **Enable GitLab Duo Chat assistant** checkbox.
|
||||
<!-- This redirect file can be deleted after <2024-09-07>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -1,218 +1,11 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: Duo Chat
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
redirect_to: '../user/gitlab_duo_chat/examples.md'
|
||||
remove_date: '2024-09-07'
|
||||
---
|
||||
|
||||
# Ask GitLab Duo Chat
|
||||
This document was moved to [another location](../user/gitlab_duo_chat/examples.md).
|
||||
|
||||
GitLab Duo Chat can help with a variety of questions. The following examples
|
||||
represent some of the areas where GitLab Duo Chat can be the most helpful.
|
||||
|
||||
For additional practical examples, see the [GitLab Duo examples](gitlab_duo_examples.md).
|
||||
|
||||
## Ask about GitLab
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** GitLab UI, Web IDE, VS Code, and JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai), [Vertex AI Search](https://cloud.google.com/enterprise-search)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117695) for GitLab.com in GitLab 16.0.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/451215) ability to ask doc-related questions on self-managed in GitLab 17.0 [with a flag](../administration/feature_flags.md) named `ai_gateway_docs_search`. Enabled by default.
|
||||
> - [Generally available and feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/154876) in GitLab 17.1.
|
||||
|
||||
You can ask questions about how GitLab works. Things like:
|
||||
|
||||
- `Explain the concept of a 'fork' in a concise manner.`
|
||||
- `Provide step-by-step instructions on how to reset a user's password.`
|
||||
|
||||
## Ask about code
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** GitLab UI, Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122235) for GitLab.com in GitLab 16.1.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122235) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
You can also ask GitLab Duo Chat to generate code:
|
||||
|
||||
- `Write a Ruby function that prints 'Hello, World!' when called.`
|
||||
- `Develop a JavaScript program that simulates a two-player Tic-Tac-Toe game. Provide both game logic and user interface, if applicable.`
|
||||
- `Create a regular expression for parsing IPv4 and IPv6 addresses in Python.`
|
||||
- `Generate code for parsing a syslog log file in Java. Use regular expressions when possible, and store the results in a hash map.`
|
||||
- `Create a product-consumer example with threads and shared memory in C++. Use atomic locks when possible.`
|
||||
- `Generate Rust code for high performance gRPC calls. Provide a source code example for a server and client.`
|
||||
|
||||
And you can ask GitLab Duo Chat to explain code:
|
||||
|
||||
- `Provide a clear explanation of the given Ruby code: def sum(a, b) a + b end. Describe what this code does and how it works.`
|
||||
|
||||
Alternatively, you can use the [`/explain` command](gitlab_duo_chat_examples.md#explain-code-in-the-ide) to explain the selected code in your editor.
|
||||
|
||||
## Ask about CI/CD
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** GitLab UI, Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-2.1`](https://docs.anthropic.com/en/docs/legacy-model-guide#anthropics-legacy-models)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423524) for GitLab.com in GitLab 16.7.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/423524) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
You can ask GitLab Duo Chat to create a CI/CD configuration:
|
||||
|
||||
- `Create a .gitlab-ci.yml configuration file for testing and building a Ruby on Rails application in a GitLab CI/CD pipeline.`
|
||||
- `Create a CI/CD configuration for building and linting a Python application.`
|
||||
- `Create a CI/CD configuration to build and test Rust code.`
|
||||
- `Create a CI/CD configuration for C++. Use gcc as compiler, and cmake as build tool.`
|
||||
- `Create a CI/CD configuration for VueJS. Use npm, and add SAST security scanning.`
|
||||
- `Generate a security scanning pipeline configuration, optimized for Java.`
|
||||
|
||||
You can also ask to explain specific job errors by copy-pasting the error message, prefixed with `Please explain this CI/CD job error message, in the context of <language>:`:
|
||||
|
||||
- `Please explain this CI/CD job error message in the context of a Go project: build.sh: line 14: go command not found`
|
||||
|
||||
Alternatively, you can use [root cause analysis in CI/CD](ai_experiments.md#root-cause-analysis).
|
||||
|
||||
## Explain code in the IDE
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for GitLab.com in GitLab 16.7.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
`/explain` is a special command to explain the selected code in your editor.
|
||||
You can also add additional instructions to be considered, for example: `/explain the performance`
|
||||
See [Use GitLab Duo Chat in VS Code](gitlab_duo_chat.md#use-gitlab-duo-chat-in-vs-code) for more information.
|
||||
|
||||
- `/explain focus on the algorithm`
|
||||
- `/explain the performance gains or losses using this code`
|
||||
- `/explain the object inheritance` (classes, object-oriented)
|
||||
- `/explain why a static variable is used here` (C++)
|
||||
- `/explain how this function would cause a segmentation fault` (C)
|
||||
- `/explain how concurrency works in this context` (Go)
|
||||
- `/explain how the request reaches the client` (REST API, database)
|
||||
|
||||
You can also use the Web UI to explain code in:
|
||||
|
||||
- A [file](../user/project/repository/code_explain.md).
|
||||
- A [merge request](../user/project/merge_requests/changes.md#explain-code-in-a-merge-request).
|
||||
|
||||
## Refactor code in the IDE
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for GitLab.com in GitLab 16.7.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
`/refactor` is a special command to generate a refactoring suggestion for the selected code in your editor.
|
||||
You can include additional instructions to be considered. For example:
|
||||
|
||||
- Use a specific coding pattern, for example `/refactor with ActiveRecord` or `/refactor into a class providing static functions`.
|
||||
- Use a specific library, for example `/refactor using mysql`.
|
||||
- Use a specific function/algorithm, for example `/refactor into a stringstream with multiple lines` in C++.
|
||||
- Refactor to a different programming language, for example `/refactor to TypeScript`.
|
||||
- Focus on performance, for example `/refactor improving performance`.
|
||||
- Focus on potential vulnerabilities, for example `/refactor avoiding memory leaks and exploits`.
|
||||
|
||||
## Write tests in the IDE
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Pro or Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Pro or Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-sonnet-20240229`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for GitLab.com in GitLab 16.7.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/429915) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
`/tests` is a special command to generate a testing suggestion for the selected code in your editor.
|
||||
You can also add additional instructions to be considered, for example: `/tests using the Boost.Test framework`
|
||||
See [Use GitLab Duo Chat in VS Code](gitlab_duo_chat.md#use-gitlab-duo-chat-in-vs-code) for more information.
|
||||
|
||||
- Use a specific test framework, for example `/tests using the Boost.test framework` (C++) or `/tests using Jest` (JavaScript).
|
||||
- Focus on extreme test cases, for example `/tests focus on extreme cases, force regression testing`.
|
||||
- Focus on performance, for example `/tests focus on performance`.
|
||||
- Focus on regressions and potential exploits, for example `/tests focus on regressions and potential exploits`.
|
||||
|
||||
## Ask about errors
|
||||
|
||||
Programming languages that require compiling the source code may throw cryptic error messages. Similarly, a script or a web application could throw a stack trace. You can ask GitLab Duo Chat by prefixing the copied error message with, for example, `Please explain this error message:`. Add the specific context, like the programming language.
|
||||
|
||||
- `Explain this error message in Java: Int and system cannot be resolved to a type`
|
||||
- `Explain when this C function would cause a segmentation fault: sqlite3_prepare_v2()`
|
||||
- `Explain what would cause this error in Python: ValueError: invalid literal for int()`
|
||||
- `Why is "this" undefined in VueJS? Provide common error cases, and explain how to avoid them.`
|
||||
- `How to debug a Ruby on Rails stacktrace? Share common strategies and an example exception.`
|
||||
|
||||
## Ask follow up questions
|
||||
|
||||
You can ask follow-up questions to delve deeper into the topic or task at hand.
|
||||
This helps you get more detailed and precise responses tailored to your specific needs,
|
||||
whether it's for further clarification, elaboration, or additional assistance.
|
||||
|
||||
A follow-up to the question `Write a Ruby function that prints 'Hello, World!' when called` could be:
|
||||
|
||||
- `Can you also explain how I can call and execute this Ruby function in a typical Ruby environment, such as the command line?`
|
||||
|
||||
A follow-up to the question `How to start a C# project?` could be:
|
||||
|
||||
- `Can you also please explain how to add a .gitignore and .gitlab-ci.yml file for C#?`
|
||||
|
||||
## Ask about a specific issue
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** GitLab UI, Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-haiku-20240307`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122235) for GitLab.com in GitLab 16.0.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122235) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
You can ask about a specific GitLab issue. For example:
|
||||
|
||||
- `Generate a summary for the issue identified via this link: <link to your issue>`
|
||||
- When you are viewing an issue in GitLab, you can ask `Generate a concise summary of the current issue.`
|
||||
- `How can I improve the description of <link to your issue> so that readers understand the value and problems to be solved?`
|
||||
|
||||
NOTE:
|
||||
If the issue contains a large amount of text (more than 40,000 words), GitLab Duo Chat might not be able to consider every word. The AI model has a limit to the amount of input it can process at one time.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
For tips on how GitLab Duo Chat can improve your productivity with issues and epics, see [Boost your productivity with GitLab Duo Chat](https://youtu.be/RJezT5_V6dI).
|
||||
<!-- Video published on 2024-04-17 -->
|
||||
|
||||
## Ask about a specific epic
|
||||
|
||||
DETAILS:
|
||||
**Tier:** GitLab.com and Self-managed: For a limited time, Premium and Ultimate. In the future, [GitLab Duo Enterprise](../subscriptions/subscription-add-ons.md). <br>GitLab Dedicated: GitLab Duo Enterprise.
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
**Editors:** GitLab UI, Web IDE, VS Code, JetBrains IDEs
|
||||
**LLMs:** Anthropic: [`claude-3-haiku-20240307`](https://docs.anthropic.com/en/docs/models-overview#claude-3-a-new-generation-of-ai)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128487) for GitLab.com in GitLab 16.3.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128487) for self-managed and GitLab Dedicated in GitLab 16.8.
|
||||
|
||||
You can ask about a specific GitLab epic. For example:
|
||||
|
||||
- `Generate a summary for the epic identified via this link: <link to your epic>`
|
||||
- When you are viewing an epic in GitLab, you can ask `Generate a concise summary of the opened epic.`
|
||||
- `What are the unique use cases raised by commenters in <link to your epic>?`
|
||||
|
||||
NOTE:
|
||||
If the epic contains a large amount of text (more than 40,000 words), GitLab Duo Chat might not be able to consider every word. The AI model has a limit to the amount of input it can process at one time.
|
||||
<!-- This redirect file can be deleted after <2024-09-07>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -1,42 +1,11 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: Duo Chat
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
redirect_to: '../user/gitlab_duo_chat/troubleshooting.md'
|
||||
remove_date: '2024-09-07'
|
||||
---
|
||||
|
||||
# GitLab Duo Chat troubleshooting
|
||||
This document was moved to [another location](../user/gitlab_duo_chat/troubleshooting.md).
|
||||
|
||||
When working with GitLab Duo Chat, you might encounter the following issues.
|
||||
|
||||
## The **GitLab Duo Chat** button is not displayed
|
||||
|
||||
If the button is not visible in the upper-right of the UI,
|
||||
ensure GitLab Duo Chat [is enabled](gitlab_duo_chat_enable.md).
|
||||
|
||||
The **GitLab Duo Chat** button is not displayed on personal projects,
|
||||
as well as
|
||||
[groups and projects with GitLab Duo features disabled](ai_features_enable.md).
|
||||
|
||||
After you enable GitLab Duo Chat, it might take a few minutes for the
|
||||
button to appear.
|
||||
|
||||
## `This feature is only allowed in groups or projects that enable this feature`
|
||||
|
||||
This error occurs when you ask about resources that do have
|
||||
GitLab Duo [disabled](ai_features_enable.md).
|
||||
|
||||
If any of the settings are not enabled, information about resources
|
||||
(like issues, epics, and merge requests) in the group or project
|
||||
cannot be processed by GitLab Duo Chat.
|
||||
|
||||
## `I am sorry, I am unable to find what you are looking for`
|
||||
|
||||
This error occurs when you ask GitLab Duo Chat about resources you don't have access to,
|
||||
or about resources that do not exist.
|
||||
|
||||
Try again, asking about resources you have access to.
|
||||
|
||||
## `I'm sorry, I can't find the answer, but it's my fault, not yours. Please try something different`
|
||||
|
||||
This is a fallback error that occurs when there is a problem with GitLab Duo Chat.
|
||||
Please try your request again, or leave feedback to help us improve.
|
||||
<!-- This redirect file can be deleted after <2024-09-07>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -1,519 +1,11 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: Duo Chat
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
redirect_to: '../user/gitlab_duo/use_cases.md'
|
||||
remove_date: '2024-09-07'
|
||||
---
|
||||
|
||||
# GitLab Duo examples
|
||||
This document was moved to [another location](../user/gitlab_duo/use_cases.md).
|
||||
|
||||
The following use cases describe practical examples with GitLab Duo.
|
||||
Learn how to start with software development and refactor existing source code.
|
||||
Dive into debugging problems with root cause analysis, solve security vulnerabilities,
|
||||
and use all stages of the DevSecOps lifecycle.
|
||||
|
||||
## Use GitLab Duo to solve development challenges
|
||||
|
||||
### Start with a C# application
|
||||
|
||||
In this example, open your C# application and start to explore how to use
|
||||
GitLab Duo AI-powered features for more efficiency.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch these steps in action in [GitLab Duo Coffee Chat: Get started with C#](https://www.youtube.com/watch?v=AdRtX9L--Po)
|
||||
<!-- Video published on 2024-01-30 -->
|
||||
|
||||
The challenge is to create a CLI tool for querying the GitLab REST API.
|
||||
|
||||
- Ask GitLab Duo Chat how to start a new C# project and learn how to use the dotNET CLI:
|
||||
|
||||
```markdown
|
||||
How can I get started creating an empty C# console application in VS Code?
|
||||
```
|
||||
|
||||
- Use Code Suggestions to generate a REST API client with a new code comment:
|
||||
|
||||
```csharp
|
||||
// Connect to a REST API and print the response
|
||||
```
|
||||
|
||||
- The generated source code might need an explanation: Use the code task `/explain`
|
||||
to get an insight how the REST API calls work.
|
||||
|
||||
After successfully generating the source code from a Code Suggestions comment,
|
||||
CI/CD configuration is needed.
|
||||
|
||||
- Chat can help with best practices for a `.gitignore` file for C#:
|
||||
|
||||
```markdown
|
||||
Please show a .gitignore and .gitlab-ci.yml configuration for a C# project.
|
||||
```
|
||||
|
||||
- If your CI/CD job fails, [Root Cause Analysis](ai_experiments.md#root-cause-analysis)
|
||||
can help understand the problem. Alternatively, you can copy the error message into
|
||||
GitLab Duo Chat, and ask for help:
|
||||
|
||||
```markdown
|
||||
Please explain the CI/CD error: The current .NET SDK does not support targeting
|
||||
.NET 8.0
|
||||
```
|
||||
|
||||
- To create tests later, ask GitLab Duo to use the code task `/refactor` to refactor
|
||||
the selected code into a function.
|
||||
|
||||
- Chat can also explain programming language specific keywords and functions, or C#
|
||||
compiler errors.
|
||||
|
||||
```markdown
|
||||
Can you explain async and await in C# with practical examples?
|
||||
|
||||
explain error CS0122: 'Program' is inaccessible due to its protection level
|
||||
```
|
||||
|
||||
- Generate tests by using the `/tests` code task.
|
||||
|
||||
The next question is where to put the generated tests in C# solutions.
|
||||
As a beginner, you might not know that the application and test projects need to exist on the same solutions level to avoid import problems.
|
||||
|
||||
- GitLab Duo Chat can help by asking and refining the prompt questions:
|
||||
|
||||
```markdown
|
||||
In C# and VS Code, how can I add a reference to a project from a test project?
|
||||
|
||||
Please provide the XML configuration which I can add to a C# .csproj file to add a
|
||||
reference to another project in the existing solution?
|
||||
```
|
||||
|
||||
- Sometimes, you must refine the prompt to get better results. The prompt
|
||||
`/refactor into the public class` creates a proposal for code that can be accessed
|
||||
from the test project later.
|
||||
|
||||
```markdown
|
||||
/refactor into the public class
|
||||
```
|
||||
|
||||
- You can also use the `/refactor` code task to ask Chat how to execute tests in the
|
||||
`.gitlab-ci.yml` file.
|
||||
|
||||
```markdown
|
||||
/refactor add a job to run tests (the test project)
|
||||
```
|
||||
|
||||
Resources:
|
||||
|
||||
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-29)
|
||||
|
||||
### Refactor a C++ application with SQLite
|
||||
|
||||
In this example, existing source code with a single main function exists. It repeats code, and cannot be tested.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch these steps in action in [GitLab Duo Coffee Chat: C++, SQLite and CMake](https://www.youtube.com/watch?v=zGOo1jzQ5zM)
|
||||
<!-- Video published on 2024-01-10 -->
|
||||
|
||||
Refactoring the source code into reusable and testable functions is a great first step.
|
||||
|
||||
1. Open VS Code or the Web IDE with GitLab Duo enabled.
|
||||
1. Select the source code, and ask GitLab Duo Chat to refactor it into functions, using a refined prompt:
|
||||
|
||||
```markdown
|
||||
/refactor into functions
|
||||
```
|
||||
|
||||
This refactoring step might not work for the entire selected source code.
|
||||
|
||||
1. Split the refactoring strategy into functional blocks.
|
||||
For example, iterate on all insert, update, and delete operations in the database.
|
||||
|
||||
1. The next step is to generate tests for the newly created functions. Select the source code again.
|
||||
You can use the code task `/tests` with specific prompt instructions for the test framework:
|
||||
|
||||
```markdown
|
||||
/tests using the CTest test framework
|
||||
```
|
||||
|
||||
1. If your application uses the `Boost.Test` framework instead, refine the prompt:
|
||||
|
||||
```markdown
|
||||
/tests using the Boost.Test framework
|
||||
```
|
||||
|
||||
Resources:
|
||||
|
||||
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-09)
|
||||
|
||||
### Refactor C++ functions into object-oriented code
|
||||
|
||||
In this example, existing source code has been wrapped into functions.
|
||||
To support more database types in the future, the code needs to be refactored into classes and object inheritance.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch these steps in action in [GitLab Duo Coffee Chat: Refactor C++ functions into `OOP` classes](https://www.youtube.com/watch?v=Z9EJh0J9358)
|
||||
<!-- Video published on 2024-01-24 -->
|
||||
|
||||
#### Start working on the class
|
||||
|
||||
- Ask GitLab Duo Chat how to implement an object-oriented pattern for a base database class and inherit it in a SQLite class:
|
||||
|
||||
```markdown
|
||||
Explain a generic database implementation using a base class, and SQLite specific class using C++. Provide source examples and steps to follow.
|
||||
```
|
||||
|
||||
- The learning curve includes asking GitLab Duo Chat about pure virtual functions and virtual function overrides in the implementation class.
|
||||
|
||||
```markdown
|
||||
What is a pure virtual function, and what is required for the developer inheriting from that class?
|
||||
```
|
||||
|
||||
- Code tasks can help refactoring the code. Select the functions in the C++ header file, and use a refined prompt:
|
||||
|
||||
```markdown
|
||||
/refactor into class with public functions, and private path/db attributes. Inherit from the base class DB
|
||||
|
||||
/refactor into a base class with pure virtual functions called DB. Remote the SQLite specific parts.
|
||||
```
|
||||
|
||||
- GitLab Duo Chat also guides with constructor overloading, object initialization, and optimized memory management with shared pointers.
|
||||
|
||||
```markdown
|
||||
How to add a function implementation to a class in a cpp file?
|
||||
|
||||
How to pass values to class attributes through the class constructor call?
|
||||
```
|
||||
|
||||
#### Find better answers
|
||||
|
||||
- The following question did not provide enough context.
|
||||
|
||||
```markdown
|
||||
Should I use virtual override instead of just override?
|
||||
```
|
||||
|
||||
- Instead, try to add more context to get better answers.
|
||||
|
||||
```markdown
|
||||
When implementing a pure virtual function in an inherited class, should I use virtual function override, or just function override? Context is C++.
|
||||
```
|
||||
|
||||
- A relatively complex question involves how to instantiate an object from the newly created class, and call specific functions.
|
||||
|
||||
```markdown
|
||||
How to instantiate an object from a class in C++, call the constructor with the SQLite DB path and call the functions. Prefer pointers.
|
||||
```
|
||||
|
||||
- The result can be helpful, but needed refinements for shared pointers and required source code headers.
|
||||
|
||||
```markdown
|
||||
How to instantiate an object from a class in C++, call the constructor with the SQLite DB path and call the functions. Prefer shared pointers. Explain which header includes are necessary.
|
||||
```
|
||||
|
||||
- Code Suggestions help generate the correct syntax for `std::shared_ptr` pointer arithmetic and help improve the code quality.
|
||||
|
||||
```cpp
|
||||
// Define the SQLite path in a variable, default value database.db
|
||||
|
||||
// Create a shared pointer for the SQLite class
|
||||
|
||||
// Open a database connection using OpenConnection
|
||||
```
|
||||
|
||||
#### Refactor your code
|
||||
|
||||
- After refactoring the source code, compiler errors may occur. Ask Chat to explain them.
|
||||
|
||||
```markdown
|
||||
Explain the error: `db` is a private member of `SQLiteDB`
|
||||
```
|
||||
|
||||
- A specific SQL query string should be refactored into a multi-line string for more efficient editing.
|
||||
|
||||
```cpp
|
||||
std::string sql = "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT NOT NULL)";
|
||||
```
|
||||
|
||||
- Select the source code, and use the `/refactor` code task:
|
||||
|
||||
```markdown
|
||||
/refactor into a stringstream with multiple lines
|
||||
```
|
||||
|
||||
- You can also refactor utility functions into a class with static functions in C++ and then ask Chat how to call them.
|
||||
|
||||
```markdown
|
||||
/refactor into a class providing static functions
|
||||
|
||||
How to call the static functions in the class?
|
||||
```
|
||||
|
||||
After refactoring the source code, the foundation for more database types is built, and overall code quality improved.
|
||||
|
||||
Resources:
|
||||
|
||||
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-23)
|
||||
|
||||
## Explain and resolve vulnerabilities
|
||||
|
||||
In this example, detected security vulnerabilities in C should be fixed with the help from GitLab Duo.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch the [GitLab Duo Coffee Chat: Vulnerability Resolution Challenge #1](https://www.youtube.com/watch?v=Ypwx4lFnHP0)
|
||||
<!-- Video published on 2024-01-30 -->
|
||||
|
||||
[This source code snippet](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-30/-/blob/4685e4e1c658565ae956ad9befdfcc128e60c6cf/src/main-vulnerable-source.c)
|
||||
introduces a security vulnerability with a [buffer overflow](https://en.wikipedia.org/wiki/Buffer_overflow):
|
||||
|
||||
```c
|
||||
strcpy(region, "Hello GitLab Duo Vulnerability Resolution challenge");
|
||||
|
||||
printf("Contents of region: %s\n", region);
|
||||
```
|
||||
|
||||
[SAST security scanners](application_security/sast/analyzers.md) can detect and report the problem. Use [Vulnerability Explanation](application_security/vulnerabilities/index.md#explaining-a-vulnerability) to understand the problem.
|
||||
[Vulnerability resolution](application_security/vulnerabilities/index.md#vulnerability-resolution) helps to generate an MR.
|
||||
If the suggested changes do not fit requirements, or would otherwise lead to problems, you can use [Code Suggestions](project/repository/code_suggestions/index.md) and [Chat](gitlab_duo_chat.md) to refine. For example:
|
||||
|
||||
1. Open VS Code or the Web IDE with GitLab Duo enabled, and add a comment with instructions:
|
||||
|
||||
```c
|
||||
// Avoid potential buffer overflows
|
||||
|
||||
// Possible AI-generated code below
|
||||
strncpy(region, "Hello GitLab Duo Vulnerability Resolution challenge", pagesize);
|
||||
region[pagesize-1] = '\0';
|
||||
printf("Contents of region: %s\n", region);
|
||||
```
|
||||
|
||||
1. Delete the suggested code, and use a different comment to use an alternative method.
|
||||
|
||||
```c
|
||||
// Avoid potential buffer overflows using snprintf()
|
||||
|
||||
// Possible AI-generated code below
|
||||
snprintf(region, pagesize, "Hello GitLab Duo Vulnerability Resolution challenge");
|
||||
|
||||
printf("Contents of region: %s\n", region);
|
||||
```
|
||||
|
||||
1. In addition, use GitLab Duo Chat to ask questions. The `/refactor` code task can generate different suggestions.
|
||||
If you prefer a specific algorithm or function, refine the prompt:
|
||||
|
||||
```markdown
|
||||
/refactor using snprintf
|
||||
```
|
||||
|
||||
Resources:
|
||||
|
||||
- Project with source code: [GitLab Duo Coffee Chat 2024-01-30 - Vulnerability Resolution Challenge](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-01-30)
|
||||
|
||||
### Answer questions about GitLab
|
||||
|
||||
In this example, the challenge is to use GitLab Duo Chat to solve problems.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch the recording here: [GitLab Duo Coffee Chat: Solve problems with GitLab Duo Chat Challenge](https://www.youtube.com/watch?v=Ypwx4lFnHP0)
|
||||
<!-- Video published on 2024-02-02 -->
|
||||
|
||||
- You can use GitLab Duo Chat to explain CI/CD errors.
|
||||
|
||||
```markdown
|
||||
Explain this CI/CD error: build.sh: line 14: go command not found
|
||||
```
|
||||
|
||||
- What happens when you are impatient, and input just one or two words?
|
||||
|
||||
```markdown
|
||||
labels
|
||||
|
||||
issue labels
|
||||
```
|
||||
|
||||
GitLab Duo Chat asks for more context.
|
||||
|
||||
- Refine your question into a full sentence, describing the problem and asking for a solution.
|
||||
|
||||
```markdown
|
||||
Explain labels in GitLab. Provide an example for efficient usage.
|
||||
```
|
||||
|
||||
Resources:
|
||||
|
||||
- [Project with source code](https://gitlab.com/gitlab-da/use-cases/ai/gitlab-duo-coffee-chat/gitlab-duo-coffee-chat-2024-02-01)
|
||||
|
||||
## Use GitLab Duo to contribute to GitLab
|
||||
|
||||
GitLab Duo usage focuses on contributing to the GitLab codebase, and how customers can contribute more efficiently.
|
||||
|
||||
The GitLab codebase is large, and requires to understand sometimes complex algorithms or application specific implementations.
|
||||
Review the [architecture components](../development/architecture.md) to learn more.
|
||||
|
||||
### Contribute to frontend: Profile Settings
|
||||
|
||||
In this example, the challenge was to update the GitLab profile page and improve the social networks settings.
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch the recording here: [GitLab Duo Coffee Chat: Contribute to GitLab using Code Suggestions and Chat](https://www.youtube.com/watch?v=TauP7soXj-E)
|
||||
<!-- Video published on 2024-02-23 -->
|
||||
|
||||
GitLab Duo Chat can be helpful to explain and refactor code, and generate tests.
|
||||
Code Suggestions help complete existing code, and can generate new functions and algorithms in Ruby, Go, or VueJS.
|
||||
|
||||
1. Use the `/explain` code task to explain selected code sections, and learn how the HAML templates work.
|
||||
1. You can refine the code task prompts, and instead ask `/explain how HAML rendering works`
|
||||
|
||||
Alternatively, you can write in the chat prompt directly, for example:
|
||||
|
||||
```markdown
|
||||
how to populate a select in haml
|
||||
```
|
||||
|
||||
The refactoring examples involve the following:
|
||||
|
||||
1. `/refactor into a HAML dropdown`
|
||||
1. After inspecting the existing UI form code, refine the prompt to `/refactor into a HAML dropdown with a form select`
|
||||
|
||||
GitLab Duo Chat helped with error debugging, prefixing the error message:
|
||||
|
||||
```markdown
|
||||
please explain this error: undefined method `icon` for
|
||||
```
|
||||
|
||||
## Code generation prompts
|
||||
|
||||
The following examples provide helpful [code generation](project/repository/code_suggestions/index.md#best-practices)
|
||||
prompts for the [supported languages](project/repository/code_suggestions/supported_extensions.md) in GitLab Duo.
|
||||
Code generation prompts can be refined using multi-line comments.
|
||||
|
||||
The examples are stored in the [GitLab Duo Prompts project](https://gitlab.com/gitlab-da/use-cases/ai/ai-workflows/gitlab-duo-prompts), maintained by the Developer Relations team.
|
||||
|
||||
### C++ code generation prompts
|
||||
|
||||
Create an application to manage distributed file nodes.
|
||||
|
||||
```c++
|
||||
// Create an application to manage distributed file nodes
|
||||
// Provide an overview the health state of nodes
|
||||
// Use OOP patterns to define the base file node
|
||||
// Add specific filesystems inherited from the base file
|
||||
```
|
||||
|
||||
Create an eBPF program which attaches to `XDP` kernel events to measure network traffic.
|
||||
Only works on Linux kernels.
|
||||
|
||||
```c++
|
||||
// Create an eBPF program which attaches to XDP kernel events
|
||||
// Count all packets by IP address
|
||||
// Print a summary
|
||||
// Include necessary headers
|
||||
```
|
||||
|
||||
### `C#` code generation prompts
|
||||
|
||||
Create a medical analyzer app from different sensors, and store the data in `MSSQL`.
|
||||
|
||||
```c#
|
||||
// Create a medical analyzer app
|
||||
// Collect data from different sensors
|
||||
// Store data in MSSQL
|
||||
// Provide methods to access the sensor data
|
||||
```
|
||||
|
||||
### Go code generation prompts
|
||||
|
||||
Create an observability application for Kubernetes which reads and prints the state of containers, pods, and services in the cluster.
|
||||
|
||||
```go
|
||||
// Create a client for Kubernetes observability
|
||||
// Create a function that
|
||||
// Read the kubernetes configuration file from the KUBECONFIG env var
|
||||
// Create kubernetes context, namespace default
|
||||
// Inspect container, pod, service status and print an overview
|
||||
// Import necessary packages
|
||||
// Create main package
|
||||
```
|
||||
|
||||
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
|
||||
Watch the recording here: [GitLab Duo Coffee Chat: Code Generation Challenge with Go and Kubernetes Observability](https://www.youtube.com/watch?v=ORpRqp-A9hQ)
|
||||
<!-- Video published on 2024-03-27. Maintainer: Developer Relations. -->
|
||||
|
||||
### Java code generation prompts
|
||||
|
||||
Create a data analytics application, with different data sources for metrics.
|
||||
Provide an API for data queries and aggregation.
|
||||
|
||||
```java
|
||||
// Create a data analytics app
|
||||
// Parse different input sources and their values
|
||||
// Store the metrics in a columnar format
|
||||
// Provide an API to query and aggregate data
|
||||
```
|
||||
|
||||
### JavaScript code generation prompts
|
||||
|
||||
Create a paid-time-off application for employees in ReactJS, with a date-time picker.
|
||||
|
||||
```javascript
|
||||
// Create a Paid Time Off app for users
|
||||
// Create a date-time picker in ReactJS
|
||||
// Provide start and end options
|
||||
// Show public holidays based on the selected country
|
||||
// Send the request to a server API
|
||||
```
|
||||
|
||||
### PHP code generation prompts
|
||||
|
||||
Create an RSS feed fetcher for GitLab releases, allow filtering by title.
|
||||
|
||||
```php
|
||||
// Create a web form to show GitLab releases
|
||||
// Fetch the RSS feed from https://about.gitlab.com/atom.xml
|
||||
// Provide filter options for the title
|
||||
```
|
||||
|
||||
### Python code generation prompts
|
||||
|
||||
Create a webserver using Flask to manage users using the REST API, store them in SQLite.
|
||||
|
||||
```python
|
||||
# Create a Flask webserver
|
||||
# Add REST API entrypoints to manage users by ID
|
||||
# Implement create, update, delete functions
|
||||
# User data needs to be stored in SQlite, create table if not exists
|
||||
# Run the server on port 8080, support TLS
|
||||
# Print required packages for requirements.txt in a comment.
|
||||
# Use Python 3.10 as default
|
||||
```
|
||||
|
||||
### Ruby code generation prompts
|
||||
|
||||
Create a log parser application which stores log data in Elasticsearch.
|
||||
|
||||
```ruby
|
||||
# Create a Ruby app as log parser
|
||||
# Provide hooks to replace sensitive strings in log lines
|
||||
# Format the logs and store them in Elasticsearch
|
||||
```
|
||||
|
||||
### Rust code generation prompts
|
||||
|
||||
Create an RSS feed reader app, example from the blog post [Learn advanced Rust programming with a little help from AI](https://about.gitlab.com/blog/2023/10/12/learn-advanced-rust-programming-with-a-little-help-from-ai-code-suggestions/).
|
||||
|
||||
```rust
|
||||
// Create a function that iterates over the source array
|
||||
// and fetches the data using HTTP from the RSS feed items.
|
||||
// Store the results in a new hash map.
|
||||
// Print the hash map to the terminal.
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
Many of the use cases are available as hands-on recordings in the [GitLab Duo Coffee Chat YouTube playlist](https://www.youtube.com/playlist?list=PL05JrBw4t0Kp5uj_JgQiSvHw1jQu0mSVZ).
|
||||
The [GitLab Duo Coffee Chat](https://handbook.gitlab.com/handbook/marketing/developer-relations/developer-advocacy/projects/#gitlab-duo-coffee-chat) is a learning series maintained by the [Developer Relations team](https://handbook.gitlab.com/handbook/marketing/developer-relations/).
|
||||
|
||||
### Blog resources
|
||||
|
||||
- [10 best practices for using AI-powered GitLab Duo Chat](https://about.gitlab.com/blog/2024/04/02/10-best-practices-for-using-ai-powered-gitlab-duo-chat/)
|
||||
- [Learning Rust with a little help from AI](https://about.gitlab.com/blog/2023/08/10/learning-rust-with-a-little-help-from-ai-code-suggestions-getting-started/)
|
||||
- [Learn advanced Rust programming with a little help from AI](https://about.gitlab.com/blog/2023/10/12/learn-advanced-rust-programming-with-a-little-help-from-ai-code-suggestions/)
|
||||
- [Learning Python with a little help from AI](https://about.gitlab.com/blog/2023/11/09/learning-python-with-a-little-help-from-ai-code-suggestions/)
|
||||
- [Write Terraform plans faster with GitLab Duo Code Suggestions](https://about.gitlab.com/blog/2024/01/24/write-terraform-plans-faster-with-gitlab-duo-code-suggestions/)
|
||||
- [Explore the Dragon Realm: Build a C++ adventure game with a little help from AI](https://about.gitlab.com/blog/2023/08/24/building-a-text-adventure-using-cplusplus-and-code-suggestions/)
|
||||
- [GitLab uses Anthropic for smart, safe AI-assisted code generation](https://about.gitlab.com/blog/2024/01/16/gitlab-uses-anthropic-for-smart-safe-ai-assisted-code-generation/)
|
||||
<!-- This redirect file can be deleted after <2024-09-07>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -151,8 +151,8 @@ To create a new project and add its README to your profile:
|
|||

|
||||
1. For **Project Configuration**, ensure **Initialize repository with a README** is selected.
|
||||
1. Select **Create project**.
|
||||
1. Create a README file inside this project. The file can be any valid [README or index file](../project/repository/index.md#readme-and-index-files).
|
||||
1. Populate the README file with [Markdown](../markdown.md), or another [supported markup language](../project/repository/index.md#supported-markup-languages).
|
||||
1. Create a README file inside this project. The file can be any valid [README or index file](../project/repository/files/index.md#readme-and-index-files).
|
||||
1. Populate the README file with [Markdown](../markdown.md), or another [supported markup language](../project/repository/files/index.md#supported-markup-languages).
|
||||
|
||||
GitLab displays the contents of your README below your contribution graph.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,128 +1,11 @@
|
|||
---
|
||||
stage: Create
|
||||
group: Code Review
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
description: "Use AI-assisted features for relevant information about a merge request."
|
||||
redirect_to: 'duo_in_merge_requests.md'
|
||||
remove_date: '2024-09-07'
|
||||
---
|
||||
|
||||
# GitLab Duo in merge requests
|
||||
This document was moved to [another location](duo_in_merge_requests.md).
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Ultimate
|
||||
**Offering:** GitLab.com
|
||||
|
||||
GitLab Duo is designed to provide contextually relevant information during the lifecycle of a merge request.
|
||||
|
||||
## Generate a description by summarizing code changes
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Beta
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10401) in GitLab 16.2 as an [experiment](../../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
Use GitLab Duo Merge request summary to create a merge request description when you
|
||||
create or edit a merge request.
|
||||
|
||||
1. [Create a new merge request](creating_merge_requests.md).
|
||||
1. In the **Description** field, put your cursor where you want to insert the description.
|
||||
1. Above the description, select **Summarize code changes**.
|
||||
|
||||

|
||||
|
||||
The description is inserted where your cursor was.
|
||||
|
||||
Provide feedback on this feature in [issue 443236](https://gitlab.com/gitlab-org/gitlab/-/issues/443236).
|
||||
|
||||
**Data usage**: The diff of changes between the source branch's head and the target branch is sent to the large language model.
|
||||
|
||||
## Generate a description from a template
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Beta
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10591) in GitLab 16.3 as an [experiment](../../../policy/experiment-beta-support.md#experiment).
|
||||
> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/429882) to beta in GitLab 16.10.
|
||||
|
||||
Many projects include [templates](../description_templates.md#create-a-merge-request-template)
|
||||
that you populate when you create a merge request. These templates help populate the description
|
||||
of the merge request. They can help the team conform to standards, and help reviewers
|
||||
and others understand the purpose and changes proposed in the merge request.
|
||||
|
||||
When you create a merge request, GitLab Duo Merge request template population
|
||||
can generate a description for your merge request, based on the contents of the template.
|
||||
GitLab Duo fills in the template and replaces the contents of the description.
|
||||
|
||||
To use GitLab Duo to generate a merge request description:
|
||||
|
||||
1. [Create a new merge request](creating_merge_requests.md) and go to the **Description** field.
|
||||
1. Select **GitLab Duo** (**{tanuki-ai}**).
|
||||
1. Select **Fill in merge request template**.
|
||||
|
||||
The updated description is applied. You can edit or revise the description before you finish creating your merge request.
|
||||
|
||||
Provide feedback on this experimental feature in [issue 416537](https://gitlab.com/gitlab-org/gitlab/-/issues/416537).
|
||||
|
||||
**Data usage**: When you use this feature, the following data is sent to the large language model referenced above:
|
||||
|
||||
- Title of the merge request
|
||||
- Contents of the description
|
||||
- Diff of changes between the source branch's head and the target branch
|
||||
|
||||
## Summarize a code review
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10466) in GitLab 16.0 as an [experiment](../../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
When you've completed your review of a merge request and are ready to [submit your review](reviews/index.md#submit-a-review), generate a GitLab Duo Code review summary:
|
||||
|
||||
1. On the left sidebar, select **Search or go to** and find your project.
|
||||
1. Select **Code > Merge requests** and find the merge request you want to review.
|
||||
1. When you are ready to submit your review, select **Finish review**.
|
||||
1. Select **Summarize my pending comments**.
|
||||
|
||||
The summary is displayed in the comment box. You can edit and refine the summary prior to submitting your review.
|
||||
|
||||
Provide feedback on this experimental feature in [issue 408991](https://gitlab.com/gitlab-org/gitlab/-/issues/408991).
|
||||
|
||||
**Data usage**: When you use this feature, the following data is sent to the large language model referenced above:
|
||||
|
||||
- Draft comment's text
|
||||
|
||||
## Generate a merge or squash commit message
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10453) in GitLab 16.2 as an [experiment](../../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
When preparing to merge your merge request you might wish to edit the proposed squash or merge commit message.
|
||||
|
||||
To generate a commit message with GitLab Duo:
|
||||
|
||||
1. On the left sidebar, select **Search or go to** and find your project.
|
||||
1. Select **Code > Merge requests** and find your merge request.
|
||||
1. Select the **Edit commit message** checkbox on the merge widget.
|
||||
1. Select **Generate commit message**.
|
||||
1. Review the commit message provide and choose **Insert** to add it to the commit.
|
||||
|
||||
Provide feedback on this experimental feature in [issue 408994](https://gitlab.com/gitlab-org/gitlab/-/issues/408994).
|
||||
|
||||
**Data usage**: When you use this feature, the following data is sent to the large language model referenced above:
|
||||
|
||||
- Contents of the file
|
||||
- The filename
|
||||
|
||||
## Related topics
|
||||
|
||||
- [Control GitLab Duo availability](../../ai_features_enable.md)
|
||||
- [All GitLab Duo features](../../ai_features.md)
|
||||
<!-- This redirect file can be deleted after <2024-09-07>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ you can ask GitLab Duo to explain the code to you.
|
|||
Prerequisites:
|
||||
|
||||
- You must belong to at least one group with the
|
||||
[experiment and beta features setting](../../../user/ai_features_enable.md#turn-on-beta-and-experimental-features) enabled.
|
||||
[experiment and beta features setting](../../../user/gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features) enabled.
|
||||
- You must have access to view the project.
|
||||
|
||||
To explain the code in a merge request:
|
||||
|
|
@ -239,7 +239,7 @@ We cannot guarantee that the large language model produces results that are corr
|
|||
You can also explain code in:
|
||||
|
||||
- A [file](../../../user/project/repository/code_explain.md).
|
||||
- The [IDE](../../../user/gitlab_duo_chat_examples.md#explain-code-in-the-ide).
|
||||
- The [IDE](../../../user/gitlab_duo_chat/examples.md#explain-code-in-the-ide).
|
||||
|
||||
## Expand or collapse comments
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,128 @@
|
|||
---
|
||||
stage: Create
|
||||
group: Code Review
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
description: "Use AI-assisted features for relevant information about a merge request."
|
||||
---
|
||||
|
||||
# GitLab Duo in merge requests
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Ultimate
|
||||
**Offering:** GitLab.com
|
||||
|
||||
GitLab Duo is designed to provide contextually relevant information during the lifecycle of a merge request.
|
||||
|
||||
## Generate a description by summarizing code changes
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Beta
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10401) in GitLab 16.2 as an [experiment](../../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
Use GitLab Duo Merge request summary to create a merge request description when you
|
||||
create or edit a merge request.
|
||||
|
||||
1. [Create a new merge request](creating_merge_requests.md).
|
||||
1. In the **Description** field, put your cursor where you want to insert the description.
|
||||
1. Above the description, select **Summarize code changes**.
|
||||
|
||||

|
||||
|
||||
The description is inserted where your cursor was.
|
||||
|
||||
Provide feedback on this feature in [issue 443236](https://gitlab.com/gitlab-org/gitlab/-/issues/443236).
|
||||
|
||||
**Data usage**: The diff of changes between the source branch's head and the target branch is sent to the large language model.
|
||||
|
||||
## Generate a description from a template
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Beta
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10591) in GitLab 16.3 as an [experiment](../../../policy/experiment-beta-support.md#experiment).
|
||||
> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/429882) to beta in GitLab 16.10.
|
||||
|
||||
Many projects include [templates](../description_templates.md#create-a-merge-request-template)
|
||||
that you populate when you create a merge request. These templates help populate the description
|
||||
of the merge request. They can help the team conform to standards, and help reviewers
|
||||
and others understand the purpose and changes proposed in the merge request.
|
||||
|
||||
When you create a merge request, GitLab Duo Merge request template population
|
||||
can generate a description for your merge request, based on the contents of the template.
|
||||
GitLab Duo fills in the template and replaces the contents of the description.
|
||||
|
||||
To use GitLab Duo to generate a merge request description:
|
||||
|
||||
1. [Create a new merge request](creating_merge_requests.md) and go to the **Description** field.
|
||||
1. Select **GitLab Duo** (**{tanuki-ai}**).
|
||||
1. Select **Fill in merge request template**.
|
||||
|
||||
The updated description is applied. You can edit or revise the description before you finish creating your merge request.
|
||||
|
||||
Provide feedback on this experimental feature in [issue 416537](https://gitlab.com/gitlab-org/gitlab/-/issues/416537).
|
||||
|
||||
**Data usage**: When you use this feature, the following data is sent to the large language model referenced above:
|
||||
|
||||
- Title of the merge request
|
||||
- Contents of the description
|
||||
- Diff of changes between the source branch's head and the target branch
|
||||
|
||||
## Summarize a code review
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10466) in GitLab 16.0 as an [experiment](../../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
When you've completed your review of a merge request and are ready to [submit your review](reviews/index.md#submit-a-review), generate a GitLab Duo Code review summary:
|
||||
|
||||
1. On the left sidebar, select **Search or go to** and find your project.
|
||||
1. Select **Code > Merge requests** and find the merge request you want to review.
|
||||
1. When you are ready to submit your review, select **Finish review**.
|
||||
1. Select **Summarize my pending comments**.
|
||||
|
||||
The summary is displayed in the comment box. You can edit and refine the summary prior to submitting your review.
|
||||
|
||||
Provide feedback on this experimental feature in [issue 408991](https://gitlab.com/gitlab-org/gitlab/-/issues/408991).
|
||||
|
||||
**Data usage**: When you use this feature, the following data is sent to the large language model referenced above:
|
||||
|
||||
- Draft comment's text
|
||||
|
||||
## Generate a merge or squash commit message
|
||||
|
||||
DETAILS:
|
||||
**Tier:** For a limited time, Ultimate. In the future, [GitLab Duo Enterprise](../../../subscriptions/subscription-add-ons.md).
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Experiment
|
||||
|
||||
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/10453) in GitLab 16.2 as an [experiment](../../../policy/experiment-beta-support.md#experiment).
|
||||
|
||||
When preparing to merge your merge request you might wish to edit the proposed squash or merge commit message.
|
||||
|
||||
To generate a commit message with GitLab Duo:
|
||||
|
||||
1. On the left sidebar, select **Search or go to** and find your project.
|
||||
1. Select **Code > Merge requests** and find your merge request.
|
||||
1. Select the **Edit commit message** checkbox on the merge widget.
|
||||
1. Select **Generate commit message**.
|
||||
1. Review the commit message provide and choose **Insert** to add it to the commit.
|
||||
|
||||
Provide feedback on this experimental feature in [issue 408994](https://gitlab.com/gitlab-org/gitlab/-/issues/408994).
|
||||
|
||||
**Data usage**: When you use this feature, the following data is sent to the large language model referenced above:
|
||||
|
||||
- Contents of the file
|
||||
- The filename
|
||||
|
||||
## Related topics
|
||||
|
||||
- [Control GitLab Duo availability](../../ai_features_enable.md)
|
||||
- [All GitLab Duo features](../../ai_features.md)
|
||||
|
|
@ -21,7 +21,7 @@ you can ask GitLab Duo to explain the code to you.
|
|||
Prerequisites:
|
||||
|
||||
- You must belong to at least one group with the
|
||||
[experiment and beta features setting](../../../user/ai_features_enable.md#turn-on-beta-and-experimental-features) enabled.
|
||||
[experiment and beta features setting](../../../user/gitlab_duo/turn_on_off.md#turn-on-beta-and-experimental-features) enabled.
|
||||
- You must have access to view the project.
|
||||
|
||||
To explain the code in a file:
|
||||
|
|
@ -43,4 +43,4 @@ We cannot guarantee that the large language model produces results that are corr
|
|||
You can also explain code in:
|
||||
|
||||
- A [merge request](../../../user/project/merge_requests/changes.md#explain-code-in-a-merge-request).
|
||||
- The [IDE](../../../user/gitlab_duo_chat_examples.md#explain-code-in-the-ide).
|
||||
- The [IDE](../../../user/gitlab_duo_chat/examples.md#explain-code-in-the-ide).
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ To disable Code Suggestions, disable the feature in your IDE editor extension.
|
|||
For details, see the documentation for your extension.
|
||||
|
||||
If you'd prefer, you can
|
||||
[turn off GitLab Duo for a group, project, or instance](../../../ai_features_enable.md#turn-off-gitlab-duo-features).
|
||||
[turn off GitLab Duo for a group, project, or instance](../../../../user/gitlab_duo/turn_on_off.md).
|
||||
|
||||
## Feedback
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
stage: Create
|
||||
group: Source Code
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
description: "How GeoJSON files are rendered when viewed in GitLab projects."
|
||||
---
|
||||
|
||||
# GeoJSON files
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Free, Premium, Ultimate
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14134) in GitLab 16.1.
|
||||
|
||||
A GeoJSON file is a format for encoding geographical data structures using JavaScript Object Notation (JSON).
|
||||
It is commonly used for representing geographic features, such as points, lines, and polygons, along with their associated attributes.
|
||||
|
||||
When added to a repository, files with a `.geojson` extension are rendered as a map containing the GeoJSON data when viewed in GitLab.
|
||||
|
||||
Map data comes from [OpenStreetMap](https://www.openstreetmap.org/) under the [Open Database License](https://www.openstreetmap.org/copyright).
|
||||
|
||||

|
||||
|
Before Width: | Height: | Size: 264 KiB After Width: | Height: | Size: 264 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
|
@ -18,10 +18,68 @@ features in your browser. You can:
|
|||
- Change file handling.
|
||||
- Explore the history of an entire file, or a single line.
|
||||
|
||||
When you add files of these types to your project, GitLab renders them in human-readable formats:
|
||||
## Understand how file types render in the UI
|
||||
|
||||
- [GeoJSON](../geojson.md) files display as maps.
|
||||
- [Jupyter Notebook](../jupyter_notebooks/index.md) files display as rendered HTML.
|
||||
When you add files of these types to your project, GitLab renders them to improve
|
||||
their readability:
|
||||
|
||||
- [GeoJSON](geojson.md) files display as maps.
|
||||
- [Jupyter Notebook](jupyter_notebooks/index.md) files display as rendered HTML.
|
||||
- Files in many markup languages are rendered for display, with
|
||||
|
||||
### Supported markup languages
|
||||
|
||||
If your file has one of the these file extensions, GitLab renders the contents of the file's
|
||||
[markup language](https://en.wikipedia.org/wiki/Lightweight_markup_language) in the UI.
|
||||
|
||||
| Markup language | Extensions |
|
||||
|--------------------------------------------------------------|------------|
|
||||
| Plain text | `txt` |
|
||||
| [Markdown](../../../markdown.md) | `mdown`, `mkd`, `mkdn`, `md`, `markdown` |
|
||||
| [reStructuredText](https://docutils.sourceforge.io/rst.html) | `rst` |
|
||||
| [AsciiDoc](../../../asciidoc.md) | `adoc`, `ad`, `asciidoc` |
|
||||
| [Textile](https://textile-lang.com/) | `textile` |
|
||||
| [Rdoc](https://rdoc.sourceforge.net/doc/index.html) | `rdoc` |
|
||||
| [Org mode](https://orgmode.org/) | `org` |
|
||||
| [creole](http://www.wikicreole.org/) | `creole` |
|
||||
| [MediaWiki](https://www.mediawiki.org/wiki/MediaWiki) | `wiki`, `mediawiki` |
|
||||
|
||||
### README and index files
|
||||
|
||||
When a `README` or `index` file is present in a repository, GitLab renders its contents.
|
||||
These files can either be plain text or have the extension of a
|
||||
supported markup language.
|
||||
|
||||
- When both a `README` and an `index` file are present, the `README` takes precedence.
|
||||
- When multiple files with the same name have different extensions, the files are
|
||||
ordered alphabetically. GitLab orders files without an extension last, like this:
|
||||
|
||||
1. `README.adoc`
|
||||
1. `README.md`
|
||||
1. `README.rst`
|
||||
1. `README`.
|
||||
|
||||
### Render OpenAPI files
|
||||
|
||||
GitLab renders OpenAPI specification files if the filename includes `openapi` or `swagger`,
|
||||
and the extension is `yaml`, `yml`, or `json`. These examples are all correct:
|
||||
|
||||
- `openapi.yml`, `openapi.yaml`, `openapi.json`
|
||||
- `swagger.yml`, `swagger.yaml`, `swagger.json`
|
||||
- `OpenAPI.YML`, `openapi.Yaml`, `openapi.JSON`
|
||||
- `openapi_gitlab.yml`, `openapi.gitlab.yml`
|
||||
- `gitlab_swagger.yml`
|
||||
- `gitlab.openapi.yml`
|
||||
|
||||
To render an OpenAPI file:
|
||||
|
||||
1. [Search for](#search-for-a-file) the OpenAPI file in your repository.
|
||||
1. Select **Display rendered file**.
|
||||
1. To display the `operationId` in the operations list, add `displayOperationId=true` to the query string.
|
||||
|
||||
NOTE:
|
||||
When `displayOperationId` is present in the query string and has _any_ value, it
|
||||
evaluates to `true`. This behavior matches the default behavior of Swagger.
|
||||
|
||||
## View Git records for a file
|
||||
|
||||
|
|
@ -72,3 +130,42 @@ To change the default handling of a file or file type, create a
|
|||
## Related topics
|
||||
|
||||
- [Repository files API](../../../../api/repository_files.md)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Repository Languages: excessive CPU use
|
||||
|
||||
To determine which languages are in a repository's files, GitLab uses a Ruby gem.
|
||||
When the gem parses a file to determine its file type, [the process can use excessive CPU](https://gitlab.com/gitlab-org/gitaly/-/issues/1565).
|
||||
The gem contains a [heuristics configuration file](https://github.com/github/linguist/blob/master/lib/linguist/heuristics.yml)
|
||||
that defines which file extensions to parse. These file types can take excessive CPU:
|
||||
|
||||
- Files with the `.txt` extension.
|
||||
- XML files with an extension not defined by the gem.
|
||||
|
||||
To fix this problem, edit your `.gitattributes` file and assign a language to
|
||||
specific file extensions. You can also use this approach to fix misidentified file types:
|
||||
|
||||
1. Identify the language to specify. The gem contains a
|
||||
[configuration file for known data types](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
|
||||
|
||||
1. To add an entry for text files, for example:
|
||||
|
||||
```yaml
|
||||
Text:
|
||||
type: prose
|
||||
wrap: true
|
||||
aliases:
|
||||
- fundamental
|
||||
- plain text
|
||||
extensions:
|
||||
- ".txt"
|
||||
```
|
||||
|
||||
1. Add or edit `.gitattributes` in the root of your repository:
|
||||
|
||||
```plaintext
|
||||
*.txt linguist-language=Text
|
||||
```
|
||||
|
||||
`*.txt` files have an entry in the heuristics file. This example prevents parsing of these files.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
---
|
||||
stage: Create
|
||||
group: Source Code
|
||||
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments"
|
||||
description: "GitLab projects display Jupyter Notebook files as clean, human-readable files instead of raw files."
|
||||
---
|
||||
# Jupyter Notebook files
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Free, Premium, Ultimate
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
[Jupyter Notebook](https://jupyter.org/) (previously, IPython Notebook) files are used for
|
||||
interactive computing in many fields. They contain a complete record of the
|
||||
user's sessions and include:
|
||||
|
||||
- Code.
|
||||
- Narrative text.
|
||||
- Equations.
|
||||
- Rich output.
|
||||
|
||||
When you add a Jupyter Notebook (with `.ipynb` extension) to your repository,
|
||||
it's rendered into HTML when you view it:
|
||||
|
||||

|
||||
|
||||
Interactive features, including JavaScript plots, don't work when viewed in
|
||||
GitLab.
|
||||
|
||||
## Cleaner diffs and raw diffs
|
||||
|
||||
> - [Reintroduced toggle](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85079) in GitLab 15.0 [with a flag](../../../../../administration/feature_flags.md) named `ipynb_semantic_diff`. Enabled by default.
|
||||
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95373) in GitLab 15.6. Feature flag `ipynb_semantic_diff` removed.
|
||||
|
||||
When commits include changes to Jupyter Notebook files, GitLab:
|
||||
|
||||
- Transforms the machine-readable `.ipynb` file into a human-readable Markdown file.
|
||||
- Displays a cleaner version of the diff that includes syntax highlighting.
|
||||
- Enables switching between raw and rendered diffs on the Commit and Compare pages. (Not available on merge request pages.)
|
||||
- Renders images on the diffs.
|
||||
|
||||
Code Suggestions are not available on diffs and merge requests for `.ipynb` files.
|
||||
|
||||
Cleaner notebook diffs are not generated when the notebook is too large.
|
||||
|
||||

|
||||
|
||||
## Jupyter Git integration
|
||||
|
||||
Jupyter can be configured as an OAuth application with repository access, acting
|
||||
on behalf of the authenticated user. See the
|
||||
[Runbooks documentation](../../../clusters/runbooks/index.md) for an
|
||||
example configuration.
|
||||
|
|
@ -1,23 +1,11 @@
|
|||
---
|
||||
stage: Create
|
||||
group: Source Code
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
description: "How GeoJSON files are rendered when viewed in GitLab projects."
|
||||
redirect_to: 'files/geojson.md'
|
||||
remove_date: '2024-09-08'
|
||||
---
|
||||
|
||||
# GeoJSON files
|
||||
This document was moved to [another location](files/geojson.md).
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Free, Premium, Ultimate
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14134) in GitLab 16.1.
|
||||
|
||||
A GeoJSON file is a format for encoding geographical data structures using JavaScript Object Notation (JSON).
|
||||
It is commonly used for representing geographic features, such as points, lines, and polygons, along with their associated attributes.
|
||||
|
||||
When added to a repository, files with a `.geojson` extension are rendered as a map containing the GeoJSON data when viewed in GitLab.
|
||||
|
||||
Map data comes from [OpenStreetMap](https://www.openstreetmap.org/) under the [Open Database License](https://www.openstreetmap.org/copyright).
|
||||
|
||||

|
||||
<!-- This redirect file can be deleted after <2024-09-08>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ When new files are added, this information can take up to five minutes to update
|
|||
### Add repository languages
|
||||
|
||||
Not all files are detected and listed on the **Project overview** page. Documentation,
|
||||
vendor code, and most markup languages are excluded.
|
||||
vendor code, and [most markup languages](files/index.md#supported-markup-languages) are excluded.
|
||||
|
||||
You can change this behavior by overriding the default settings.
|
||||
|
||||
|
|
@ -178,66 +178,7 @@ View a list of
|
|||
[supported data types](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
|
||||
|
||||
This feature can use excessive CPU.
|
||||
For more information, see the [troubleshooting section](#repository-languages-excessive-cpu-use).
|
||||
|
||||
### Supported markup languages
|
||||
|
||||
If your file has one of the following file extensions, GitLab renders the
|
||||
contents of the file's [markup language](https://en.wikipedia.org/wiki/Lightweight_markup_language) in the UI.
|
||||
|
||||
| Markup language | Extensions |
|
||||
| --------------- | ---------- |
|
||||
| Plain text | `txt` |
|
||||
| [Markdown](../../markdown.md) | `mdown`, `mkd`, `mkdn`, `md`, `markdown` |
|
||||
| [reStructuredText](https://docutils.sourceforge.io/rst.html) | `rst` |
|
||||
| [AsciiDoc](../../asciidoc.md) | `adoc`, `ad`, `asciidoc` |
|
||||
| [Textile](https://textile-lang.com/) | `textile` |
|
||||
| [Rdoc](https://rdoc.sourceforge.net/doc/index.html) | `rdoc` |
|
||||
| [Org mode](https://orgmode.org/) | `org` |
|
||||
| [creole](http://www.wikicreole.org/) | `creole` |
|
||||
| [MediaWiki](https://www.mediawiki.org/wiki/MediaWiki) | `wiki`, `mediawiki` |
|
||||
|
||||
### README and index files
|
||||
|
||||
When a `README` or `index` file is present in a repository, GitLab renders its contents.
|
||||
These files can either be plain text or have the extension of a
|
||||
[supported markup language](#supported-markup-languages).
|
||||
|
||||
- When both a `README` and an `index` file are present, the `README` always
|
||||
takes precedence.
|
||||
- When multiple files have the same name but a different extension, the files are
|
||||
ordered alphabetically. Any file without an extension is ordered last.
|
||||
For example, `README.adoc` takes precedence over `README.md`, and `README.rst`
|
||||
takes precedence over `README`.
|
||||
|
||||
### OpenAPI viewer
|
||||
|
||||
GitLab can render OpenAPI specification files. The filename must include `openapi` or `swagger` and the extension must be `yaml`,
|
||||
`yml`, or `json`. The following examples are all correct:
|
||||
|
||||
- `openapi.yml`
|
||||
- `openapi.yaml`
|
||||
- `openapi.json`
|
||||
- `swagger.yml`
|
||||
- `swagger.yaml`
|
||||
- `swagger.json`
|
||||
- `gitlab_swagger.yml`
|
||||
- `openapi_gitlab.yml`
|
||||
- `OpenAPI.YML`
|
||||
- `openapi.Yaml`
|
||||
- `openapi.JSON`
|
||||
- `openapi.gitlab.yml`
|
||||
- `gitlab.openapi.yml`
|
||||
|
||||
To render an OpenAPI file:
|
||||
|
||||
1. Go to the OpenAPI file in your repository.
|
||||
1. Select **Display rendered file**.
|
||||
1. To display the `operationId` in the operations list, add `displayOperationId=true` to the query string.
|
||||
|
||||
NOTE:
|
||||
When `displayOperationId` is present in the query string and has _any_ value, it
|
||||
evaluates to `true`. This behavior matches the default behavior of Swagger.
|
||||
For more information, see the [troubleshooting section](files/index.md#repository-languages-excessive-cpu-use).
|
||||
|
||||
## Repository size
|
||||
|
||||
|
|
@ -307,44 +248,9 @@ because they can't follow redirects:
|
|||
- [Create a directory](web_editor.md#create-a-directory)
|
||||
- [Find file history](git_history.md)
|
||||
- [Identify changes by line (Git blame)](git_blame.md)
|
||||
- [Use Jupyter notebooks with GitLab](jupyter_notebooks/index.md)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Repository Languages: excessive CPU use
|
||||
|
||||
To determine which languages are in a repository's files, GitLab uses a Ruby gem.
|
||||
When the gem parses a file to determine which type it is, [the process can use excessive CPU](https://gitlab.com/gitlab-org/gitaly/-/issues/1565).
|
||||
The gem contains a [heuristics configuration file](https://github.com/github/linguist/blob/master/lib/linguist/heuristics.yml)
|
||||
that defines which file extensions must be parsed.
|
||||
|
||||
Files with the `.txt` extension and XML files with an extension not defined by the gem can take excessive CPU.
|
||||
|
||||
The workaround is to specify the language to assign to specific file extensions.
|
||||
The same approach should also allow misidentified file types to be fixed.
|
||||
|
||||
1. Identify the language to specify. The gem contains a [configuration file for known data types](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
|
||||
To add an entry for text files, for example:
|
||||
|
||||
```yaml
|
||||
Text:
|
||||
type: prose
|
||||
wrap: true
|
||||
aliases:
|
||||
- fundamental
|
||||
- plain text
|
||||
extensions:
|
||||
- ".txt"
|
||||
```
|
||||
|
||||
1. Add or modify `.gitattributes` in the root of your repository:
|
||||
|
||||
```plaintext
|
||||
*.txt linguist-language=Text
|
||||
```
|
||||
|
||||
`*.txt` files have an entry in the heuristics file. This example prevents parsing of these files.
|
||||
|
||||
### Search sequence of pushes to a repository
|
||||
|
||||
If it seems that a commit has gone "missing", search the sequence of pushes to a repository.
|
||||
|
|
|
|||
|
|
@ -1,53 +1,11 @@
|
|||
---
|
||||
stage: Create
|
||||
group: Source Code
|
||||
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments"
|
||||
description: "GitLab projects display Jupyter Notebook files as clean, human-readable files instead of raw files."
|
||||
redirect_to: '../files/jupyter_notebooks/index.md'
|
||||
remove_date: '2024-09-08'
|
||||
---
|
||||
# Jupyter Notebook files
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Free, Premium, Ultimate
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
This document was moved to [another location](../files/jupyter_notebooks/index.md).
|
||||
|
||||
[Jupyter Notebook](https://jupyter.org/) (previously, IPython Notebook) files are used for
|
||||
interactive computing in many fields. They contain a complete record of the
|
||||
user's sessions and include:
|
||||
|
||||
- Code.
|
||||
- Narrative text.
|
||||
- Equations.
|
||||
- Rich output.
|
||||
|
||||
When you add a Jupyter Notebook (with `.ipynb` extension) to your repository,
|
||||
it's rendered into HTML when you view it:
|
||||
|
||||

|
||||
|
||||
Interactive features, including JavaScript plots, don't work when viewed in
|
||||
GitLab.
|
||||
|
||||
## Cleaner diffs and raw diffs
|
||||
|
||||
> - [Reintroduced toggle](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85079) in GitLab 15.0 [with a flag](../../../../administration/feature_flags.md) named `ipynb_semantic_diff`. Enabled by default.
|
||||
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95373) in GitLab 15.6. Feature flag `ipynb_semantic_diff` removed.
|
||||
|
||||
When commits include changes to Jupyter Notebook files, GitLab:
|
||||
|
||||
- Transforms the machine-readable `.ipynb` file into a human-readable Markdown file.
|
||||
- Displays a cleaner version of the diff that includes syntax highlighting.
|
||||
- Enables switching between raw and rendered diffs on the Commit and Compare pages. (Not available on merge request pages.)
|
||||
- Renders images on the diffs.
|
||||
|
||||
Code Suggestions are not available on diffs and merge requests for `.ipynb` files.
|
||||
|
||||
Cleaner notebook diffs are not generated when the notebook is too large.
|
||||
|
||||

|
||||
|
||||
## Jupyter Git integration
|
||||
|
||||
Jupyter can be configured as an OAuth application with repository access, acting
|
||||
on behalf of the authenticated user. See the
|
||||
[Runbooks documentation](../../../project/clusters/runbooks/index.md) for an
|
||||
example configuration.
|
||||
<!-- This redirect file can be deleted after <2024-09-08>. -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ To uninstall an extension in the Web IDE:
|
|||
|
||||
## Related topics
|
||||
|
||||
- [GitLab Duo Chat in the Web IDE](../../gitlab_duo_chat.md#use-gitlab-duo-chat-in-the-web-ide)
|
||||
- [GitLab Duo Chat in the Web IDE](../../gitlab_duo_chat/index.md#use-gitlab-duo-chat-in-the-web-ide)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ For public projects, and members of internal and private projects
|
|||
with [permissions to view the project's code](../permissions.md#project-members-permissions),
|
||||
the project landing page shows:
|
||||
|
||||
- A [`README` or index file](repository/index.md#readme-and-index-files).
|
||||
- A [`README` or index file](repository/files/index.md#readme-and-index-files).
|
||||
- A list of directories in the project's repository.
|
||||
|
||||
For users without permission to view the project's code, the landing page shows:
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ PATH
|
|||
rainbow (~> 3.1)
|
||||
require_all (~> 3.0)
|
||||
thor (~> 1.3)
|
||||
tty-prompt (~> 0.23.1)
|
||||
tty-spinner (~> 0.9.3)
|
||||
tty-which (~> 0.5.0)
|
||||
|
||||
|
|
@ -49,6 +50,8 @@ GEM
|
|||
parser (3.3.0.5)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
pastel (0.8.0)
|
||||
tty-color (~> 0.5)
|
||||
pry (0.14.2)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
|
|
@ -113,13 +116,23 @@ GEM
|
|||
simplecov-html (0.12.3)
|
||||
simplecov_json_formatter (0.1.4)
|
||||
thor (1.3.1)
|
||||
tty-color (0.6.0)
|
||||
tty-cursor (0.7.1)
|
||||
tty-prompt (0.23.1)
|
||||
pastel (~> 0.8)
|
||||
tty-reader (~> 0.8)
|
||||
tty-reader (0.9.0)
|
||||
tty-cursor (~> 0.7)
|
||||
tty-screen (~> 0.8)
|
||||
wisper (~> 2.0)
|
||||
tty-screen (0.8.2)
|
||||
tty-spinner (0.9.3)
|
||||
tty-cursor (~> 0.7)
|
||||
tty-which (0.5.0)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
unicode-display_width (2.5.0)
|
||||
wisper (2.0.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|||
spec.add_dependency "rainbow", "~> 3.1"
|
||||
spec.add_dependency "require_all", "~> 3.0"
|
||||
spec.add_dependency "thor", "~> 1.3"
|
||||
spec.add_dependency "tty-prompt", "~> 0.23.1"
|
||||
spec.add_dependency "tty-spinner", "~> 0.9.3"
|
||||
spec.add_dependency "tty-which", "~> 0.5.0"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
require "thor"
|
||||
require "require_all"
|
||||
require "uri"
|
||||
require "tty-prompt"
|
||||
|
||||
# make sure helpers are required first
|
||||
require_rel "lib/helpers/**/*.rb"
|
||||
|
|
@ -34,6 +35,9 @@ module Gitlab
|
|||
|
||||
desc "log [SUBCOMMAND]", "Manage deployment related logs"
|
||||
subcommand "log", Commands::Log
|
||||
|
||||
desc "destroy [SUBCOMMAND]", "Manage deployment related object cleanup"
|
||||
subcommand "destroy", Commands::Destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Cng
|
||||
module Commands
|
||||
# Destroy command consisting of cleanup for cluster and deployments
|
||||
#
|
||||
class Destroy < Command
|
||||
desc "cluster", "Destroy kind cluster"
|
||||
option :name,
|
||||
desc: "Cluster name",
|
||||
default: "gitlab",
|
||||
type: :string,
|
||||
aliases: "-n"
|
||||
def cluster
|
||||
delete = TTY::Prompt.new.yes?("Are you sure you want to delete cluster #{options[:name]}?")
|
||||
return unless delete
|
||||
|
||||
Kind::Cluster.destroy(options[:name])
|
||||
end
|
||||
|
||||
desc "deployment [NAME]", "Destroy specific deployment and all it's resources, " \
|
||||
"where NAME is helm relase name. " \
|
||||
"Default: #{Subcommands::Deployment::DEFAULT_HELM_RELEASE_NAME}"
|
||||
option :type,
|
||||
desc: "Specific deployment configuration type name",
|
||||
type: :string,
|
||||
enum: Subcommands::Deployment.commands.keys.reject { |c| c == "help" }
|
||||
option :namespace,
|
||||
desc: "Deployment namespace",
|
||||
default: "gitlab",
|
||||
type: :string,
|
||||
aliases: "-n"
|
||||
option :timeout,
|
||||
desc: "Timeout for helm release uninstall",
|
||||
default: "10m",
|
||||
type: :string
|
||||
def deployment(name = Subcommands::Deployment::DEFAULT_HELM_RELEASE_NAME)
|
||||
prompt = TTY::Prompt.new
|
||||
delete = prompt.yes?("Are you sure you want to delete deployment '#{name}'?")
|
||||
return unless delete
|
||||
|
||||
type = options[:type] || prompt.select(
|
||||
"Select deployment configuration type:", Subcommands::Deployment.commands.keys.reject { |c| c == "help" }
|
||||
)
|
||||
cleanup_configuration = Deployment::Configurations::Cleanup
|
||||
.const_get(type.capitalize, false)
|
||||
.new(options[:namespace])
|
||||
|
||||
Deployment::Installation.uninstall(
|
||||
name,
|
||||
cleanup_configuration: cleanup_configuration,
|
||||
timeout: options[:timeout]
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -13,6 +13,8 @@ module Gitlab
|
|||
# with appropriate configuration class which encapsulates optional deployment hooks and specific helm values
|
||||
#
|
||||
class Deployment < Command
|
||||
DEFAULT_HELM_RELEASE_NAME = "gitlab"
|
||||
|
||||
class << self
|
||||
# Add common deployment options for each deployment command defined as public method
|
||||
#
|
||||
|
|
@ -46,7 +48,8 @@ module Gitlab
|
|||
end
|
||||
end
|
||||
|
||||
desc "kind [NAME]", "Create CNG deployment against local kind k8s cluster where NAME is deployment name"
|
||||
desc "kind [NAME]", "Create CNG deployment against local kind k8s cluster where NAME is helm release name. " \
|
||||
"Default: #{DEFAULT_HELM_RELEASE_NAME}"
|
||||
option :create_cluster,
|
||||
desc: "Create kind cluster for local deployments before creating deployment",
|
||||
type: :boolean,
|
||||
|
|
@ -79,7 +82,7 @@ module Gitlab
|
|||
"Useful for reproducing CI deployments. Only valid with --ci flag.",
|
||||
type: :boolean,
|
||||
default: false
|
||||
def kind(name = "gitlab")
|
||||
def kind(name = DEFAULT_HELM_RELEASE_NAME)
|
||||
return print_deploy_args("kind") if options[:print_deploy_args] && options[:ci]
|
||||
|
||||
if options[:create_cluster]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Cng
|
||||
module Deployment
|
||||
module Configurations
|
||||
module Cleanup
|
||||
# Base class for deployment cleanup
|
||||
#
|
||||
# This class should implement a single method #{run} which deletes all the objects that are created
|
||||
# in specific configuration classes
|
||||
#
|
||||
class Base
|
||||
include Helpers::Output
|
||||
|
||||
def initialize(namespace)
|
||||
@namespace = namespace
|
||||
end
|
||||
|
||||
# Run cleanup
|
||||
#
|
||||
# @return [void]
|
||||
def run
|
||||
raise(NoMethodError, "run not implemented")
|
||||
end
|
||||
|
||||
# Instance of {Kubectl::Client}
|
||||
#
|
||||
# @return [Kubectl::Client]
|
||||
def kubeclient
|
||||
@kubeclient ||= Kubectl::Client.new(namespace)
|
||||
end
|
||||
|
||||
attr_reader :namespace
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Cng
|
||||
module Deployment
|
||||
module Configurations
|
||||
module Cleanup
|
||||
class Kind < Base
|
||||
def run
|
||||
remove_password_secret
|
||||
remove_hook_configmap
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Remove admin password secret
|
||||
#
|
||||
# @return [void]
|
||||
def remove_password_secret
|
||||
log("Removing secret '#{Configurations::Kind::ADMIN_PASSWORD_SECRET}'", :info)
|
||||
puts kubeclient.delete_resource("secret", Configurations::Kind::ADMIN_PASSWORD_SECRET)
|
||||
end
|
||||
|
||||
# Remove pre-receive hook configmap
|
||||
#
|
||||
# @return [void]
|
||||
def remove_hook_configmap
|
||||
log("Removing configmap '#{Configurations::Kind::PRE_RECEIVE_HOOK_CONFIGMAP_NAME}'", :info)
|
||||
puts kubeclient.delete_resource('configmap', Configurations::Kind::PRE_RECEIVE_HOOK_CONFIGMAP_NAME)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -11,6 +11,8 @@ module Gitlab
|
|||
class Installation
|
||||
include Helpers::Output
|
||||
include Helpers::Shell
|
||||
extend Helpers::Output
|
||||
extend Helpers::Shell
|
||||
|
||||
LICENSE_SECRET = "gitlab-license"
|
||||
|
||||
|
|
@ -25,6 +27,35 @@ module Gitlab
|
|||
@chart_sha = chart_sha
|
||||
end
|
||||
|
||||
# Delete installation
|
||||
#
|
||||
# @param [String] name
|
||||
# @param [Configurations::Cleanup::Base] cleanup_configuration
|
||||
# @param [String] timeout
|
||||
# @return [void]
|
||||
def self.uninstall(name, cleanup_configuration:, timeout:)
|
||||
helm = Helm::Client.new
|
||||
namespace = cleanup_configuration.namespace
|
||||
|
||||
log("Performing full deployment cleanup", :info, bright: true)
|
||||
return log("Helm release '#{name}' not found, skipping", :warn) unless helm.status(name, namespace: namespace)
|
||||
|
||||
Helpers::Spinner.spin("uninstalling helm release '#{name}'") do
|
||||
helm.uninstall(name, namespace: namespace, timeout: timeout)
|
||||
|
||||
log("Removing license secret", :info)
|
||||
puts cleanup_configuration.kubeclient.delete_resource("secret", LICENSE_SECRET)
|
||||
end
|
||||
|
||||
Helpers::Spinner.spin("removing configuration specific objects") do
|
||||
cleanup_configuration.run
|
||||
end
|
||||
|
||||
Helpers::Spinner.spin("removing namespace '#{namespace}'") do
|
||||
puts cleanup_configuration.kubeclient.delete_resource("namespace", namespace)
|
||||
end
|
||||
end
|
||||
|
||||
# Perform deployment with all the additional setup
|
||||
#
|
||||
# @return [void]
|
||||
|
|
@ -166,14 +197,6 @@ module Gitlab
|
|||
secret = Kubectl::Resources::Secret.new(LICENSE_SECRET, "license", license)
|
||||
puts mask_secrets(kubeclient.create_resource(secret), [license, Base64.encode64(license)])
|
||||
end
|
||||
|
||||
# Run helm command
|
||||
#
|
||||
# @param [Array] cmd
|
||||
# @return [String]
|
||||
def run_helm_cmd(cmd, stdin = nil)
|
||||
execute_shell(["helm", *cmd], stdin_data: stdin)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -54,6 +54,28 @@ module Gitlab
|
|||
], values)
|
||||
end
|
||||
|
||||
# Uninstall helm relase
|
||||
#
|
||||
# @param [String] name
|
||||
# @param [String] namespace
|
||||
# @param [String] timeout
|
||||
# @return [void]
|
||||
def uninstall(name, namespace:, timeout:)
|
||||
log("Uninstalling helm release '#{name}' in namespace '#{namespace}'", :info)
|
||||
puts run_helm(%W[uninstall #{name} --namespace #{namespace} --timeout #{timeout} --wait])
|
||||
end
|
||||
|
||||
# Display status of helm release
|
||||
#
|
||||
# @param [String] name
|
||||
# @param [String] namespace
|
||||
# @return [<String, nil>] status of helm release or nil if release is not found
|
||||
def status(name, namespace:)
|
||||
run_helm(%W[status #{name} --namespace #{namespace}])
|
||||
rescue Helpers::Shell::CommandFailure => e
|
||||
e.message.include?("release: not found") ? nil : raise(e)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Temporary directory for helm chart
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ module Gitlab
|
|||
class Cluster
|
||||
include Helpers::Output
|
||||
include Helpers::Shell
|
||||
extend Helpers::Output
|
||||
extend Helpers::Shell
|
||||
|
||||
HTTP_PORT = 32080
|
||||
SSH_PORT = 32022
|
||||
|
|
@ -23,6 +25,19 @@ module Gitlab
|
|||
@docker_hostname = ci ? docker_hostname || "docker" : docker_hostname
|
||||
end
|
||||
|
||||
# Destroy kind cluster
|
||||
#
|
||||
# @param [String] name
|
||||
# @return [void]
|
||||
def self.destroy(name)
|
||||
log("Destroying cluster '#{name}'", :info, bright: true)
|
||||
return log("Cluster not found, skipping!", :warn) unless execute_shell(%w[kind get clusters]).include?(name)
|
||||
|
||||
Helpers::Spinner.spin("destroying cluster") do
|
||||
puts execute_shell(%W[kind delete cluster --name #{name}])
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
log("Creating cluster '#{name}'", :info, bright: true)
|
||||
return log(" cluster '#{name}' already exists, skipping!", :warn) if cluster_exists?
|
||||
|
|
|
|||
|
|
@ -31,6 +31,18 @@ module Gitlab
|
|||
run_in_namespace("apply", args: ["-f", "-"], stdin_data: resource.json)
|
||||
end
|
||||
|
||||
# Remove kubernetes resource
|
||||
#
|
||||
# @param [String] resource_type
|
||||
# @param [String] resource_name
|
||||
# @param [Boolean] ignore_not_found
|
||||
# @return [String] command output
|
||||
def delete_resource(resource_type, resource_name, ignore_not_found: true)
|
||||
run_in_namespace("delete", resource_type, resource_name, args: [
|
||||
"--ignore-not-found=#{ignore_not_found}", "--wait"
|
||||
])
|
||||
end
|
||||
|
||||
# Execute command in a pod
|
||||
#
|
||||
# @param [String] pod full or part of pod name
|
||||
|
|
|
|||
|
|
@ -1,18 +1,14 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe "cng" do
|
||||
let(:usage) do
|
||||
<<~USAGE
|
||||
Commands:
|
||||
cng create [SUBCOMMAND] # Manage deployment related object creation
|
||||
cng doctor # Validate presence of all required system dependencies
|
||||
cng help [COMMAND] # Describe available commands or one specific command
|
||||
cng log [SUBCOMMAND] # Manage deployment related logs
|
||||
cng version # Print cng orchestrator version
|
||||
USAGE
|
||||
end
|
||||
|
||||
it "runs executable" do
|
||||
expect(`bundle exec exe/cng`.strip).to eq(usage.strip)
|
||||
expect(`bundle exec exe/cng`).to(
|
||||
match(/cng create \[SUBCOMMAND\]/)
|
||||
.and(match(/cng destroy \[SUBCOMMAND\]/))
|
||||
.and(match(/cng doctor/))
|
||||
.and(match(/cng help \[COMMAND\]/))
|
||||
.and(match(/cng log \[SUBCOMMAND\]/))
|
||||
.and(match(/cng version/))
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
|||