Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-10-20 00:11:14 +00:00
parent b6bf52d3e2
commit 1533e64a2c
180 changed files with 1131 additions and 286 deletions

View File

@ -71,8 +71,6 @@ rules:
- sibling
- index
pathGroups:
- pattern: '@sentry/browser'
group: external
- pattern: ~/**
group: internal
- pattern: emojis/**

View File

@ -764,13 +764,24 @@ rspec system pg14-as-if-foss clusterwide-db:
- .clusterwide-db
- .rails:rules:clusterwide-db
rspec-ee unit gitlab_duo_chat pg14:
rspec-ee unit gitlab-duo-chat pg14:
variables:
REAL_AI_REQUEST: "true"
VERTEX_AI_EMBEDDINGS: "true"
extends:
- .rspec-ee-base-pg14
- .rails:rules:ee-gitlab-duo-chat-vertex-ai
script:
- !reference [.base-script, script]
- rspec_paralellized_job "--fail-fast=${RSPEC_FAIL_FAST_THRESHOLD} --tag real_ai_request"
rspec-ee unit gitlab-duo-chat-open-ai pg14:
variables:
REAL_AI_REQUEST: "true"
OPENAI_EMBEDDINGS: "true"
extends:
- .rspec-ee-base-pg14
- .rails:rules:ee-gitlab-duo-chat
- .rails:rules:ee-gitlab-duo-chat-open-ai
script:
- !reference [.base-script, script]
- rspec_paralellized_job "--fail-fast=${RSPEC_FAIL_FAST_THRESHOLD} --tag real_ai_request"

View File

@ -371,6 +371,7 @@
# AI patterns:
.ai-patterns: &ai-patterns
- "{,ee/,jh/}lib/gitlab/llm/**/*"
- "{,ee/,jh/}{,spec/}lib/gitlab/llm/**/*"
# DB patterns + .ci-patterns
.db-patterns: &db-patterns
@ -2109,20 +2110,36 @@
- <<: *if-default-refs
changes: *code-backstage-patterns
.rails:rules:ee-gitlab-duo-chat:
.rails:rules:ee-gitlab-duo-chat-base:
rules:
- !reference [".strict-ee-only-rules", rules]
- if: '$REAL_AI_REQUEST == null'
when: never
- if: '$ANTHROPIC_API_KEY == null'
when: never
- if: '$OPENAI_EMBEDDINGS == null'
when: never
- <<: *if-merge-request
changes: *ai-patterns
when: manual
allow_failure: true
.rails:rules:ee-gitlab-duo-chat-vertex-ai:
rules:
- !reference [".rails:rules:ee-gitlab-duo-chat-base", rules]
- if: '$VERTEX_AI_PROJECT == null'
when: never
- if: '$VERTEX_AI_CREDENTIALS == null'
when: never
- if: '$VERTEX_AI_EMBEDDINGS == null'
when: never
.rails:rules:ee-gitlab-duo-chat-open-ai:
rules:
- !reference [".rails:rules:ee-gitlab-duo-chat-base", rules]
- if: '$OPENAI_API_KEY == null'
when: never
- if: '$OPENAI_EMBEDDINGS == null'
when: never
.rails:rules:as-if-foss-migration:
rules:
- !reference [".strict-ee-only-rules", rules]

View File

@ -136,6 +136,14 @@
"alternate": "rubocop/cop/{}.rb",
"type": "test"
},
"tooling/*.rb": {
"alternate": "spec/tooling/{}_spec.rb",
"type": "source"
},
"spec/tooling/*_spec.rb": {
"alternate": "tooling/{}.rb",
"type": "test"
},
"ee/lib/api/*.rb": {
"alternate": "ee/spec/requests/api/{}_spec.rb",
"type": "source"

View File

@ -3634,7 +3634,6 @@ RSpec/FeatureCategory:
- 'spec/lib/gitlab/github_import/importer/single_endpoint_issue_events_importer_spec.rb'
- 'spec/lib/gitlab/github_import/importer/single_endpoint_issue_notes_importer_spec.rb'
- 'spec/lib/gitlab/github_import/importer/single_endpoint_merge_request_notes_importer_spec.rb'
- 'spec/lib/gitlab/github_import/issuable_finder_spec.rb'
- 'spec/lib/gitlab/github_import/label_finder_spec.rb'
- 'spec/lib/gitlab/github_import/logger_spec.rb'
- 'spec/lib/gitlab/github_import/markdown_text_spec.rb'

View File

@ -1,5 +1,5 @@
import _ from 'lodash';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import Api from '~/api';
import { createAlert } from '~/alert';
import axios from '~/lib/utils/axios_utils';

View File

@ -1,5 +1,5 @@
import Vue from 'vue';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import Translate from '~/vue_shared/translate';
import BackgroundMigrationsDatabaseListbox from './components/database_listbox.vue';

View File

@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';
import Vue from 'vue';
import isEmpty from 'lodash/isEmpty';
import { GlAlert, GlLink, GlSprintf } from '@gitlab/ui';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { __ } from '~/locale';
export const VARIANT_SUCCESS = 'success';

View File

@ -13,8 +13,8 @@ import {
GlTabs,
GlTab,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { isEqual, isEmpty, omit } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import { PROMO_URL, DOCS_URL_IN_EE_DIR } from 'jh_else_ce/lib/utils/url_utility';
import {

View File

@ -1,8 +1,8 @@
<script>
import { GlAlert } from '@gitlab/ui';
import { GlLineChart } from '@gitlab/ui/dist/charts';
import * as Sentry from '@sentry/browser';
import { some, every } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import {
differenceInMonths,
formatDateAsMonth,

View File

@ -1,9 +1,9 @@
<script>
import { GlAlert } from '@gitlab/ui';
import { GlAreaChart } from '@gitlab/ui/dist/charts';
import * as Sentry from '@sentry/browser';
import produce from 'immer';
import { sortBy } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { formatDateAsMonth } from '~/lib/utils/datetime_utility';
import { __ } from '~/locale';
import ChartSkeletonLoader from '~/vue_shared/components/resizable_chart/skeleton_loader.vue';

View File

@ -1,5 +1,5 @@
import * as Sentry from '@sentry/browser';
import produce from 'immer';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { defaultClient } from '~/graphql_shared/issuable_client';
import listQuery from 'ee_else_ce/boards/graphql/board_lists_deferred.query.graphql';
import { listsDeferredQuery } from 'ee_else_ce/boards/constants';

View File

@ -1,5 +1,5 @@
import * as Sentry from '@sentry/browser';
import { sortBy } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import {
ListType,
inactiveId,

View File

@ -13,9 +13,9 @@ import {
GlSprintf,
GlLoadingIcon,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { uniqueId } from 'lodash';
import Vue from 'vue';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { fetchPolicies } from '~/lib/graphql';
import SafeHtml from '~/vue_shared/directives/safe_html';
import { redirectTo } from '~/lib/utils/url_utility'; // eslint-disable-line import/no-deprecated

View File

@ -4,7 +4,7 @@ import NO_PIPELINES_SVG from '@gitlab/svgs/dist/illustrations/empty-state/empty-
import ERROR_STATE_SVG from '@gitlab/svgs/dist/illustrations/pipelines_failed.svg?url';
import { GlEmptyState, GlIcon, GlLoadingIcon, GlCollapsibleListbox } from '@gitlab/ui';
import { isEqual } from 'lodash';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { createAlert, VARIANT_INFO, VARIANT_WARNING } from '~/alert';
import { getParameterByName } from '~/lib/utils/url_utility';
import { __, s__ } from '~/locale';

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
const COMPONENT_TAG = 'vue_component';

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
export const reportToSentry = (component, failureType) => {
Sentry.captureException(failureType, {

View File

@ -12,7 +12,7 @@ import {
GlTable,
GlTooltipDirective,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import Api, { DEFAULT_PER_PAGE } from '~/api';
import { HTTP_STATUS_PAYLOAD_TOO_LARGE } from '~/lib/utils/http_status';
import { __, s__, sprintf } from '~/locale';

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { createAlert } from '~/alert';
import axios from '~/lib/utils/axios_utils';
import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';

View File

@ -1,7 +1,7 @@
<script>
import * as Sentry from '@sentry/browser';
import { uniqueId } from 'lodash';
import { GlButton, GlTooltipDirective, GlModal, GlModalDirective, GlSprintf } from '@gitlab/ui';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { createAlert } from '~/alert';
import { __ } from '~/locale';
import deleteCustomEmojiMutation from '../queries/delete_custom_emoji.mutation.graphql';

View File

@ -1,6 +1,6 @@
<script>
import { GlButton, GlLink, GlTooltipDirective, GlFormCheckbox } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { createAlert } from '~/alert';
import { __, s__ } from '~/locale';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';

View File

@ -7,8 +7,8 @@ import {
GlLink,
GlTooltipDirective,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { produce } from 'immer';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import SafeHtml from '~/vue_shared/directives/safe_html';
import { getIdFromGraphQLId, convertToGraphQLId } from '~/graphql_shared/utils';
import { TYPENAME_USER } from '~/graphql_shared/constants';

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import axios from '~/lib/utils/axios_utils';
import { normalizeHeaders } from '~/lib/utils/common_utils';
import { joinPaths } from '~/lib/utils/url_utility';

View File

@ -1,6 +1,6 @@
import emptySvg from '@gitlab/svgs/dist/illustrations/security-dashboard-empty-state.svg?raw';
import { GlEmptyState } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { __ } from '~/locale';
export const ERROR_FETCHING_DATA_HEADER = __('Could not get the data properly');

View File

@ -3,8 +3,8 @@
* Render modal to confirm rollback/redeploy.
*/
import { GlModal, GlSprintf, GlLink } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { escape } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import csrf from '~/lib/utils/csrf';
import { __, s__, sprintf } from '~/locale';
import { helpPagePath } from '~/helpers/help_page_helper';

View File

@ -1,7 +1,7 @@
<!-- eslint-disable vue/multi-word-component-names -->
<script>
import { GlLoadingIcon } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { logError } from '~/lib/logger';
import { toggleQueryPollingByVisibility, etagQueryHeaders } from '~/graphql_shared/utils';
import ConfirmRollbackModal from '~/environments/components/confirm_rollback_modal.vue';

View File

@ -1,6 +1,6 @@
<script>
import { GlLoadingIcon } from '@gitlab/ui';
import { captureException } from '@sentry/browser';
import { captureException } from '~/sentry/sentry_browser_wrapper';
import PipelineWizard from '~/pipeline_wizard/pipeline_wizard.vue';
import PagesWizardTemplate from '~/pipeline_wizard/templates/pages.yml?raw';
import { logError } from '~/lib/logger';

View File

@ -1,5 +1,5 @@
import * as Sentry from '@sentry/browser';
import Vue from 'vue';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import AccessDropdown from './components/access_dropdown.vue';
export const initAccessDropdown = (el) => {

View File

@ -1,5 +1,5 @@
import Vue from 'vue';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import Translate from '~/vue_shared/translate';
import HeaderSearchApp from './components/app.vue';
import createStore from './store';

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { HEADER_INIT_EVENTS } from './constants';
async function eventHandler(callback = () => {}) {

View File

@ -1,6 +1,6 @@
<script>
import * as Sentry from '@sentry/browser';
import { GlCollapsibleListbox } from '@gitlab/ui';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { createAlert } from '~/alert';
import { __, s__ } from '~/locale';
import axios from '~/lib/utils/axios_utils';

View File

@ -1,9 +1,9 @@
<script>
import { GlAlert, GlForm } from '@gitlab/ui';
import axios from 'axios';
import * as Sentry from '@sentry/browser';
// eslint-disable-next-line no-restricted-imports
import { mapState, mapActions, mapGetters } from 'vuex';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { s__ } from '~/locale';
import SafeHtml from '~/vue_shared/directives/safe_html';
import {

View File

@ -1,6 +1,6 @@
<script>
import { GlLink, GlLoadingIcon, GlPagination, GlTable, GlAlert } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { DEFAULT_PER_PAGE } from '~/api';
import { fetchOverrides } from '~/integrations/overrides/api';

View File

@ -1,7 +1,7 @@
<script>
import * as Sentry from '@sentry/browser';
import { GlAlert } from '@gitlab/ui';
import { uniqueId } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import Api from '~/api';
import { BV_SHOW_MODAL, BV_HIDE_MODAL } from '~/lib/utils/constants';
import InviteModalBase from 'ee_else_ce/invite_members/components/invite_modal_base.vue';

View File

@ -5,7 +5,7 @@ import {
GlFilteredSearchToken,
GlTooltipDirective,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import getIssuesQuery from 'ee_else_ce/issues/dashboard/queries/get_issues.query.graphql';
import IssueCardStatistics from 'ee_else_ce/issues/list/components/issue_card_statistics.vue';
import IssueCardTimeInfo from 'ee_else_ce/issues/list/components/issue_card_time_info.vue';

View File

@ -9,11 +9,11 @@ import {
GlDrawer,
GlLink,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import produce from 'immer';
import fuzzaldrinPlus from 'fuzzaldrin-plus';
import { isEmpty } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import IssueCardStatistics from 'ee_else_ce/issues/list/components/issue_card_statistics.vue';
import IssueCardTimeInfo from 'ee_else_ce/issues/list/components/issue_card_time_info.vue';
import getIssuesQuery from 'ee_else_ce/issues/list/queries/get_issues.query.graphql';

View File

@ -1,7 +1,7 @@
<script>
import * as Sentry from '@sentry/browser';
import fuzzaldrinPlus from 'fuzzaldrin-plus';
import { isEmpty } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { fetchPolicies } from '~/lib/graphql';
import { isPositiveInteger } from '~/lib/utils/number_utils';
import axios from '~/lib/utils/axios_utils';

View File

@ -9,9 +9,9 @@ import {
GlModalDirective,
GlTooltipDirective,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
// eslint-disable-next-line no-restricted-imports
import { mapActions, mapGetters, mapState } from 'vuex';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { createAlert, VARIANT_SUCCESS } from '~/alert';
import { EVENT_ISSUABLE_VUE_APP_CHANGE } from '~/issuable/constants';
import { STATUS_CLOSED, TYPE_ISSUE, issuableTypeText } from '~/issues/constants';

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { sanitize } from '~/lib/dompurify';
// We currently load + parse the data from the issue app and related merge request

View File

@ -3,7 +3,7 @@ import { GlCollapsibleListbox } from '@gitlab/ui';
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
// eslint-disable-next-line no-restricted-imports
import { mapActions } from 'vuex';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { s__ } from '~/locale';
import { guestOverageConfirmAction } from 'ee_else_ce/members/guest_overage_confirm_action';

View File

@ -1,3 +1,4 @@
import ShowMlModel from './show_ml_model.vue';
import ShowMlModelVersion from './show_ml_model_version.vue';
export { ShowMlModel };
export { ShowMlModel, ShowMlModelVersion };

View File

@ -0,0 +1,16 @@
<script>
export default {
name: 'ShowMlModelVersionApp',
components: {},
props: {
modelVersion: {
type: Object,
required: true,
},
},
};
</script>
<template>
<div>{{ modelVersion.model.name }} - {{ modelVersion.version }}</div>
</template>

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import axios from '~/lib/utils/axios_utils';
function reportErrorAndThrow(e) {

View File

@ -1,6 +1,6 @@
<script>
import { GlAlert } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { s__ } from '~/locale';
import Composer from '~/packages_and_registries/package_registry/components/details/metadata/composer.vue';
import Conan from '~/packages_and_registries/package_registry/components/details/metadata/conan.vue';

View File

@ -12,7 +12,7 @@ import {
GlSprintf,
GlKeysetPagination,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { createAlert, VARIANT_SUCCESS, VARIANT_WARNING } from '~/alert';
import { NEXT, PREV } from '~/vue_shared/components/pagination/constants';
import { numberToHumanSize } from '~/lib/utils/number_utils';

View File

@ -1,7 +1,7 @@
<script>
import { GlAlert, GlLink, GlSprintf } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { first } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { truncateSha } from '~/lib/utils/text_utility';
import { s__, n__ } from '~/locale';

View File

@ -1,6 +1,6 @@
<script>
import { GlAlert } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { n__ } from '~/locale';
import VersionRow from '~/packages_and_registries/package_registry/components/details/version_row.vue';
import PackagesListLoader from '~/packages_and_registries/shared/components/packages_list_loader.vue';

View File

@ -0,0 +1,4 @@
import { initSimpleApp } from '~/helpers/init_simple_app_helper';
import { ShowMlModelVersion } from '~/ml/model_registry/apps';
initSimpleApp('#js-mount-show-ml-model-version', ShowMlModelVersion);

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { createAlert } from '~/alert';
import axios from '~/lib/utils/axios_utils';
import { joinPaths } from '~/lib/utils/url_utility';

View File

@ -1,5 +1,5 @@
import * as Sentry from '@sentry/browser';
import Vue from 'vue';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import AccessDropdown from './components/access_dropdown.vue';
export const initAccessDropdown = (el, options) => {

View File

@ -1,5 +1,5 @@
import Vue from 'vue';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import ProtectedTagEdit from './protected_tag_edit.vue';
export default class ProtectedTagEditList {

View File

@ -9,7 +9,7 @@ import {
GlSkeletonLoader,
GlIcon,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import SafeHtml from '~/vue_shared/directives/safe_html';
import Tracking from '~/tracking';
import { __, s__ } from '~/locale';

View File

@ -75,7 +75,7 @@ const initSentry = () => {
// The _Sentry object is globally exported so it can be used by
// ./sentry_browser_wrapper.js
// This hack allows us to load a single version of `@sentry/browser`
// This hack allows us to load a single version of `~/sentry/sentry_browser_wrapper`
// in the browser, see app/views/layouts/_head.html.haml to find how it is imported.
// eslint-disable-next-line no-underscore-dangle

View File

@ -25,7 +25,7 @@ index();
// The _Sentry object is globally exported so it can be used by
// ./sentry_browser_wrapper.js
// This hack allows us to load a single version of `@sentry/browser`
// This hack allows us to load a single version of `~/sentry/sentry_browser_wrapper`
// in the browser, see app/views/layouts/_head.html.haml to find how it is imported.
// eslint-disable-next-line no-underscore-dangle

View File

@ -2,7 +2,7 @@
import { debounce } from 'lodash';
import fuzzaldrinPlus from 'fuzzaldrin-plus';
import { GlDisclosureDropdownGroup, GlLoadingIcon } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import axios from '~/lib/utils/axios_utils';
import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants';
import Tracking from '~/tracking';

View File

@ -1,6 +1,6 @@
<script>
import * as Sentry from '@sentry/browser';
import { GlBreakpointInstance, breakpoints } from '@gitlab/ui/dist/utils';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import axios from '~/lib/utils/axios_utils';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { PANELS_WITH_PINS } from '../constants';

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import AccessorUtilities from '~/lib/utils/accessor';
import { FREQUENT_ITEMS, FIFTEEN_MINUTES_IN_MS } from '~/frequent_items/constants';
import axios from '~/lib/utils/axios_utils';

View File

@ -1,5 +1,4 @@
<script>
import * as Sentry from '@sentry/browser';
import {
GlButton,
GlFormGroup,
@ -8,6 +7,7 @@ import {
GlKeysetPagination,
GlDatepicker,
} from '@gitlab/ui';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { createAlert } from '~/alert';
import { formatTimeSpent } from '~/lib/utils/datetime_utility';
import { s__ } from '~/locale';

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import getStandardContext from './get_standard_context';
export function dispatchSnowplowEvent(

View File

@ -258,7 +258,7 @@ export default {
:category="action.category"
:loading="isApproving"
class="gl-mr-3"
data-qa-selector="approve_button"
data-testid="approve-button"
@click="action.action"
>
{{ action.text }}

View File

@ -137,7 +137,7 @@ export default {
</script>
<template>
<div data-qa-selector="approvals_summary_content">
<div data-testid="approvals-summary-content">
<span class="gl-font-weight-bold">{{ approvalLeftMessage }}</span>
<template v-if="hasApprovers">
<span v-if="approvalLeftMessage">{{ message }}</span>

View File

@ -1,7 +1,7 @@
<!-- eslint-disable vue/multi-word-component-names -->
<script>
import { GlButton, GlLoadingIcon, GlTooltipDirective, GlIntersectionObserver } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import SafeHtml from '~/vue_shared/directives/safe_html';
import { DynamicScroller, DynamicScrollerItem } from 'vendor/vue-virtual-scroller';
import { sprintf, s__, __ } from '~/locale';

View File

@ -1,7 +1,7 @@
<!-- eslint-disable vue/multi-word-component-names -->
<script>
import { GlButton, GlLink, GlTooltipDirective, GlLoadingIcon } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { normalizeHeaders } from '~/lib/utils/common_utils';
import { logError } from '~/lib/logger';
import SafeHtml from '~/vue_shared/directives/safe_html';

View File

@ -1,5 +1,5 @@
<script>
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { HTTP_STATUS_OK } from '~/lib/utils/http_status';
import { SEVERITY_ICONS_MR_WIDGET } from '~/ci/reports/codequality_report/constants';
import { capitalizeFirstCharacter } from '~/lib/utils/text_utility';

View File

@ -10,7 +10,7 @@ import {
GlTab,
GlButton,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import SafeHtml from '~/vue_shared/directives/safe_html';
import highlightCurrentUser from '~/behaviors/markdown/highlight_current_user';
import { fetchPolicies } from '~/lib/graphql';

View File

@ -1,6 +1,6 @@
<script>
import * as Sentry from '@sentry/browser';
import { GlFormInput } from '@gitlab/ui';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import {
DurationParseError,
outputChronicDuration,

View File

@ -1,6 +1,6 @@
<script>
import { GlAlert } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import axios from '~/lib/utils/axios_utils';
import { normalizeHeaders, parseIntPagination } from '~/lib/utils/common_utils';
import Api, { DEFAULT_PER_PAGE } from '~/api';

View File

@ -1,6 +1,6 @@
<script>
import { GlAlert } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import Api from '~/api';
import SafeHtml from '~/vue_shared/directives/safe_html';
import {

View File

@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { helpPagePath } from '~/helpers/help_page_helper';
import axios from '~/lib/utils/axios_utils';

View File

@ -1,5 +1,5 @@
<script>
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import Tracking from '~/tracking';
import { ASC } from '~/notes/constants';
import { __ } from '~/locale';

View File

@ -1,6 +1,6 @@
<script>
import { GlAvatarLink, GlAvatar } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import toast from '~/vue_shared/plugins/global_toast';
import { __ } from '~/locale';
import Tracking from '~/tracking';

View File

@ -5,7 +5,7 @@ import {
GlDisclosureDropdown,
GlDisclosureDropdownItem,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { __, sprintf } from '~/locale';
import UserAccessRoleBadge from '~/vue_shared/components/user_access_role_badge.vue';
import ReplyButton from '~/notes/components/note_actions/reply_button.vue';

View File

@ -1,5 +1,5 @@
<script>
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import AwardsList from '~/vue_shared/components/awards_list.vue';
import { getMutation, optimisticAwardUpdate } from '../../notes/award_utils';

View File

@ -8,7 +8,7 @@ import {
GlToggle,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { __, s__ } from '~/locale';
import Tracking from '~/tracking';

View File

@ -1,6 +1,6 @@
<script>
import * as Sentry from '@sentry/browser';
import { produce } from 'immer';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { getIdFromGraphQLId, convertToGraphQLId } from '~/graphql_shared/utils';
import AwardsList from '~/vue_shared/components/awards_list.vue';

View File

@ -1,6 +1,6 @@
<script>
import { GlAlert, GlButton, GlForm, GlFormGroup } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { helpPagePath } from '~/helpers/help_page_helper';
import { getDraft, clearDraft, updateDraft } from '~/lib/utils/autosave';
import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal';

View File

@ -1,6 +1,6 @@
<script>
import { GlButton, GlDatepicker, GlFormGroup } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { getDateWithUTC, newDateAsLocaleTime } from '~/lib/utils/datetime/date_calculation_utility';
import { s__ } from '~/locale';
import Tracking from '~/tracking';

View File

@ -1,7 +1,7 @@
<script>
import * as Sentry from '@sentry/browser';
import produce from 'immer';
import Draggable from 'vuedraggable';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { isLoggedIn } from '~/lib/utils/common_utils';
import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants';

View File

@ -1,7 +1,7 @@
<script>
import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import { cloneDeep } from 'lodash';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { __, s__ } from '~/locale';
import { isScopedLabel } from '~/lib/utils/common_utils';
import { createAlert } from '~/alert';

View File

@ -8,8 +8,8 @@ import {
GlSearchBoxByType,
GlDropdownText,
} from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { debounce } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import Tracking from '~/tracking';
import { s__, __ } from '~/locale';
import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants';

View File

@ -1,7 +1,7 @@
<script>
import { GlSkeletonLoader, GlModal } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { uniqueId } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { __ } from '~/locale';
import { scrollToTargetOnResize } from '~/lib/utils/resize_observer';
import { TYPENAME_DISCUSSION, TYPENAME_NOTE } from '~/graphql_shared/constants';

View File

@ -1,7 +1,7 @@
<script>
import { GlFormGroup, GlCollapsibleListbox } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import { debounce } from 'lodash';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants';
import { s__ } from '~/locale';

View File

@ -1,6 +1,6 @@
<script>
import { GlButton } from '@gitlab/ui';
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import Tracking from '~/tracking';
import { __, sprintf } from '~/locale';
import { capitalizeFirstCharacter } from '~/lib/utils/text_utility';

View File

@ -1,5 +1,5 @@
<script>
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import Tracking from '~/tracking';
import {
sprintfWorkItem,

View File

@ -1,5 +1,5 @@
<script>
import * as Sentry from '@sentry/browser';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import IssueCardStatistics from 'ee_else_ce/issues/list/components/issue_card_statistics.vue';
import IssueCardTimeInfo from 'ee_else_ce/issues/list/components/issue_card_time_info.vue';
import { STATUS_OPEN } from '~/issues/constants';

View File

@ -0,0 +1 @@
#js-mount-show-ml-model-version{ data: { view_model: view_model } }

View File

@ -0,0 +1,32 @@
# frozen_string_literal: true
module Projects
module Ml
class ShowMlModelVersionComponent < ViewComponent::Base
attr_reader :model_version, :model
def initialize(model_version:)
@model_version = model_version.present
@model = model_version.model.present
end
private
def view_model
vm = {
model_version: {
id: model_version.id,
version: model_version.version,
path: model_version.path,
model: {
name: model.name,
path: model.path
}
}
}
Gitlab::Json.generate(vm.deep_transform_keys { |k| k.to_s.camelize(:lower) })
end
end
end
end

View File

@ -5,7 +5,9 @@ class Admin::SpamLogsController < Admin::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def index
@spam_logs = SpamLog.includes(:user).order(id: :desc).page(params[:page]).without_count
@spam_logs = SpamLog.preload(user: [:trusted_with_spam_attribute])
.order(id: :desc)
.page(params[:page]).without_count
end
# rubocop: enable CodeReuse/ActiveRecord

View File

@ -164,6 +164,26 @@ class Admin::UsersController < Admin::ApplicationController
end
end
def trust
result = Users::TrustService.new(current_user).execute(user)
if result[:status] == :success
redirect_back_or_admin_user(notice: _("Successfully trusted"))
else
redirect_back_or_admin_user(alert: _("Error occurred. User was not updated"))
end
end
def untrust
result = Users::UntrustService.new(current_user).execute(user)
if result[:status] == :success
redirect_back_or_admin_user(notice: _("Successfully untrusted"))
else
redirect_back_or_admin_user(alert: _("Error occurred. User was not updated"))
end
end
def confirm
if update_user(&:force_confirm)
redirect_back_or_admin_user(notice: _("Successfully confirmed"))

View File

@ -0,0 +1,24 @@
# frozen_string_literal: true
module Projects
module Ml
class ModelVersionsController < ::Projects::ApplicationController
before_action :authorize_read_model_registry!
feature_category :mlops
def show
@model_version = ::Ml::ModelVersion.by_project_id_and_id(@project, params[:model_version_id])
return render_404 unless @model_version
@model = @model_version.model
end
private
def authorize_read_model_registry!
render_404 unless can?(current_user, :read_model_registry, @project)
end
end
end
end

View File

@ -2,6 +2,8 @@
module Ml
class ModelVersion < ApplicationRecord
include Presentable
validates :project, :model, presence: true
validates :version,
@ -25,6 +27,10 @@ module Ml
def find_or_create!(model, version, package)
create_with(package: package).find_or_create_by!(project: model.project, model: model, version: version)
end
def by_project_id_and_id(project_id, id)
find_by(project_id: project_id, id: id)
end
end
private

View File

@ -0,0 +1,19 @@
# frozen_string_literal: true
module Ml
class ModelVersionPresenter < Gitlab::View::Presenter::Delegated
presents ::Ml::ModelVersion, as: :model_version
def display_name
"#{model_version.model.name} / #{model_version.version}"
end
def path
Gitlab::Routing.url_helpers.project_ml_model_version_path(
model_version.model.project,
model_version.model,
model_version
)
end
end
end

View File

@ -29,7 +29,7 @@
variant: :danger,
method: :delete,
href: admin_spam_log_path(spam_log, remove_user: true),
button_options: { data: { confirm: _("USER %{user_name} WILL BE REMOVED! Are you sure?") % { user_name: user.name }, confirm_btn_variant: 'danger' }, aria: { label: _('Remove user') } }) do
button_options: { data: { confirm: _("User %{user_name} will be removed! Are you sure?") % { user_name: user.name }, confirm_btn_variant: 'danger' }, aria: { label: _('Remove user') } }) do
= _('Remove user')
%td
-# TODO: Remove conditonal once spamcheck supports this https://gitlab.com/gitlab-com/gl-security/engineering-and-research/automation-team/spam/spamcheck/-/issues/190
@ -48,11 +48,23 @@
= render Pajamas::ButtonComponent.new(size: :small,
method: :put,
href: block_admin_user_path(user),
button_options: { class: 'gl-mb-3', data: {confirm: _('USER WILL BE BLOCKED! Are you sure?')} }) do
button_options: { class: 'gl-mb-3', data: {confirm: _('User will be blocked! Are you sure?')} }) do
= _('Block user')
- else
= render Pajamas::ButtonComponent.new(size: :small, button_options: { class: 'disabled gl-mb-3'}) do
= _("Already blocked")
- if user && !user.trusted?
= render Pajamas::ButtonComponent.new(size: :small,
method: :put,
href: trust_admin_user_path(user),
button_options: { class: 'gl-mb-3', data: {confirm: _('User will be allowed to create possible spam! Are you sure?')} }) do
= _('Trust user')
- else
= render Pajamas::ButtonComponent.new(size: :small,
method: :put,
href: untrust_admin_user_path(user),
button_options: { class: 'gl-mb-3', data: {confirm: _('User will not be allowed to create possible spam! Are you sure?')} }) do
= _('Untrust user')
= render Pajamas::ButtonComponent.new(size: :small,
method: :delete,
href: [:admin, spam_log],

View File

@ -0,0 +1,6 @@
- add_to_breadcrumbs s_('ModelRegistry|Model registry'), project_ml_models_path(@project)
- add_to_breadcrumbs @model_version.name, project_ml_model_path(@project, @model)
- breadcrumb_title @model_version.version
- page_title "#{@model_version.name} / #{@model_version.version}"
= render(Projects::Ml::ShowMlModelVersionComponent.new(model_version: @model_version))

View File

@ -35,4 +35,4 @@
:ff,
labelFastForward,
help_text: ffTrainsHelpFullHelpText,
radio_options: { data: { qa_selector: 'merge_ff_radio' } }
radio_options: { data: { testid: 'merge-ff-radio' } }

View File

@ -9,5 +9,4 @@
help_text: s_('MergeChecks|Introduces the risk of merging changes that do not pass the pipeline.'),
checkbox_options: { class: 'gl-pl-6' }
= form.gitlab_ui_checkbox_component :only_allow_merge_if_all_discussions_are_resolved,
s_('MergeChecks|All threads must be resolved'),
checkbox_options: { data: { qa_selector: 'only_allow_merge_if_all_discussions_are_resolved_checkbox' } }
s_('MergeChecks|All threads must be resolved')

View File

@ -13,7 +13,7 @@
= gitlab_ui_form_for @project, url: project_settings_merge_requests_path(@project), html: { multipart: true, class: "merge-request-settings-form js-mr-settings-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-settings' }
= render 'projects/settings/merge_requests/merge_request_settings', form: f
= f.submit _('Save changes'), class: "rspec-save-merge-request-changes", data: { qa_selector: 'save_merge_request_changes_button' }, pajamas_button: true
= f.submit _('Save changes'), class: "rspec-save-merge-request-changes", data: { testid: 'save-merge-request-changes-button' }, pajamas_button: true
= render_if_exists 'projects/settings/merge_requests/merge_request_approvals_settings', expanded: true
= render_if_exists 'projects/settings/merge_requests/suggested_reviewers_settings', expanded: true

View File

@ -54,6 +54,8 @@ module Gitlab
# client - An instance of Gitlab::GithubImport::Client.
# project - An instance of Project.
def try_import(client, project)
project.import_state.refresh_jid_expiration
import(client, project)
rescue RateLimitError
self.class.perform_in(client.rate_limit_resets_in, project.id)

View File

@ -27,8 +27,6 @@ module Gitlab
klass.new(project, client).execute
end
project.import_state.refresh_jid_expiration
ImportPullRequestsWorker.perform_async(project.id)
end
end

View File

@ -20,7 +20,6 @@ module Gitlab
info(project.id, message: 'starting importer', importer: 'Importer::CollaboratorsImporter')
waiter = Importer::CollaboratorsImporter.new(project, client).execute
project.import_state.refresh_jid_expiration
move_to_next_stage(project, { waiter.key => waiter.jobs_remaining })
end

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