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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-11-22 06:11:41 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-22 06:11:41 +0300
commit9ff55fb235c23c9260305f5a96e2a1af8fed8f19 (patch)
tree1c35b6f03664fea4ec5cc7924867c2252cea56be
parente3736bd03e55076fb8d9f5b4cc4602b32d13b2ec (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.gitlab/ci/rules.gitlab-ci.yml2
-rw-r--r--GITALY_SERVER_VERSION2
-rw-r--r--app/assets/javascripts/boards/components/board_card_inner.vue15
-rw-r--r--app/assets/javascripts/ci/reports/codequality_report/store/actions.js30
-rw-r--r--app/assets/javascripts/ci/reports/codequality_report/store/getters.js63
-rw-r--r--app/assets/javascripts/ci/reports/codequality_report/store/index.js18
-rw-r--r--app/assets/javascripts/ci/reports/codequality_report/store/mutation_types.js5
-rw-r--r--app/assets/javascripts/ci/reports/codequality_report/store/mutations.js27
-rw-r--r--app/assets/javascripts/ci/reports/codequality_report/store/state.js16
-rw-r--r--app/assets/stylesheets/themes/_dark.scss13
-rw-r--r--app/models/project_repository.rb4
-rw-r--r--config/feature_flags/development/product_analytics_usage_quota.yml8
-rw-r--r--db/migrate/20231114091124_add_object_format_to_project_repositories.rb11
-rw-r--r--db/schema_migrations/202311140911241
-rw-r--r--db/structure.sql3
-rw-r--r--doc/ci/components/index.md14
-rw-r--r--doc/development/ai_features/glossary.md81
-rw-r--r--doc/development/ai_features/index.md9
-rw-r--r--doc/user/packages/container_registry/reduce_container_registry_storage.md15
-rw-r--r--doc/user/product_analytics/index.md8
-rw-r--r--lib/gitlab/database/migrations/pg_backend_pid.rb2
-rw-r--r--locale/gitlab.pot25
-rw-r--r--qa/Gemfile2
-rw-r--r--qa/Gemfile.lock20
-rw-r--r--spec/frontend/boards/board_card_inner_spec.js10
-rw-r--r--spec/frontend/boards/mock_data.js1
-rw-r--r--spec/frontend/ci/reports/codequality_report/store/actions_spec.js190
-rw-r--r--spec/frontend/ci/reports/codequality_report/store/getters_spec.js94
-rw-r--r--spec/frontend/ci/reports/codequality_report/store/mutations_spec.js100
-rw-r--r--spec/lib/gitlab/database/migrations/pg_backend_pid_spec.rb11
-rw-r--r--spec/models/project_repository_spec.rb26
31 files changed, 215 insertions, 611 deletions
diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml
index ad315df370c..00b10c2ae2b 100644
--- a/.gitlab/ci/rules.gitlab-ci.yml
+++ b/.gitlab/ci/rules.gitlab-ci.yml
@@ -2842,6 +2842,8 @@
changes: *code-backstage-patterns
- <<: *if-default-refs
changes: *workhorse-patterns
+ - <<: *if-default-branch-refs
+ changes: *setup-test-env-patterns
- <<: *if-merge-request-labels-run-all-rspec
- <<: *if-merge-request-labels-frontend-and-feature-flag
- <<: *if-merge-request
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index 5b711ab30f5..40ee5c26ff4 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-276bfb610a543a5de88a1d5f69219811dad13a6b
+db9003ccaed4618cb6c9e1d8ce99f7794c868a65
diff --git a/app/assets/javascripts/boards/components/board_card_inner.vue b/app/assets/javascripts/boards/components/board_card_inner.vue
index a7f46dc9325..2c9ff3105bf 100644
--- a/app/assets/javascripts/boards/components/board_card_inner.vue
+++ b/app/assets/javascripts/boards/components/board_card_inner.vue
@@ -15,7 +15,6 @@ import { isScopedLabel } from '~/lib/utils/common_utils';
import { updateHistory } from '~/lib/utils/url_utility';
import { sprintf, __, n__ } from '~/locale';
import isShowingLabelsQuery from '~/graphql_shared/client/is_showing_labels.query.graphql';
-import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import WorkItemTypeIcon from '~/work_items/components/work_item_type_icon.vue';
import IssuableBlockedIcon from '~/vue_shared/components/issuable_blocked_icon/issuable_blocked_icon.vue';
@@ -32,7 +31,6 @@ export default {
GlLoadingIcon,
GlIcon,
UserAvatarLink,
- TooltipOnTruncate,
IssueDueDate,
IssueTimeEstimate,
IssueCardWeight: () => import('ee_component/boards/components/issue_card_weight.vue'),
@@ -155,6 +153,9 @@ export default {
const { referencePath } = this.item;
return referencePath.split(this.itemPrefix)[0];
},
+ directNamespaceReference() {
+ return this.itemReferencePath.split('/').slice(-1)[0];
+ },
orderedLabels() {
return sortBy(this.item.labels.filter(this.isNonListLabel), 'title');
},
@@ -308,13 +309,15 @@ export default {
:work-item-type="item.type"
show-tooltip-on-hover
/>
- <tooltip-on-truncate
+ <span
v-if="showReferencePath"
+ v-gl-tooltip
:title="itemReferencePath"
- placement="bottom"
- class="board-item-path gl-text-truncate gl-font-weight-bold"
- >{{ itemReferencePath }}</tooltip-on-truncate
+ data-placement="bottom"
+ class="board-item-path gl-text-truncate gl-font-weight-bold gl-cursor-help"
>
+ {{ directNamespaceReference }}
+ </span>
{{ itemId }}
</span>
<span class="board-info-items gl-mt-3 gl-display-inline-block">
diff --git a/app/assets/javascripts/ci/reports/codequality_report/store/actions.js b/app/assets/javascripts/ci/reports/codequality_report/store/actions.js
deleted file mode 100644
index 5247faef363..00000000000
--- a/app/assets/javascripts/ci/reports/codequality_report/store/actions.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import pollUntilComplete from '~/lib/utils/poll_until_complete';
-import { STATUS_NOT_FOUND } from '../../constants';
-import { parseCodeclimateMetrics } from '../utils/codequality_parser';
-import * as types from './mutation_types';
-
-export const setPaths = ({ commit }, paths) => commit(types.SET_PATHS, paths);
-
-export const fetchReports = ({ state, dispatch, commit }) => {
- commit(types.REQUEST_REPORTS);
-
- return pollUntilComplete(state.reportsPath)
- .then(({ data }) => {
- if (data.status === STATUS_NOT_FOUND) {
- return dispatch('receiveReportsError', data);
- }
- return dispatch('receiveReportsSuccess', {
- newIssues: parseCodeclimateMetrics(data.new_errors, state.headBlobPath),
- resolvedIssues: parseCodeclimateMetrics(data.resolved_errors, state.baseBlobPath),
- });
- })
- .catch((error) => dispatch('receiveReportsError', error));
-};
-
-export const receiveReportsSuccess = ({ commit }, data) => {
- commit(types.RECEIVE_REPORTS_SUCCESS, data);
-};
-
-export const receiveReportsError = ({ commit }, error) => {
- commit(types.RECEIVE_REPORTS_ERROR, error);
-};
diff --git a/app/assets/javascripts/ci/reports/codequality_report/store/getters.js b/app/assets/javascripts/ci/reports/codequality_report/store/getters.js
deleted file mode 100644
index 70d11e96a54..00000000000
--- a/app/assets/javascripts/ci/reports/codequality_report/store/getters.js
+++ /dev/null
@@ -1,63 +0,0 @@
-import { spriteIcon } from '~/lib/utils/common_utils';
-import { sprintf, s__, n__ } from '~/locale';
-import { LOADING, ERROR, SUCCESS, STATUS_NOT_FOUND } from '../../constants';
-
-export const hasCodequalityIssues = (state) =>
- Boolean(state.newIssues?.length || state.resolvedIssues?.length);
-
-export const codequalityStatus = (state) => {
- if (state.isLoading) {
- return LOADING;
- }
- if (state.hasError) {
- return ERROR;
- }
-
- return SUCCESS;
-};
-
-export const codequalityText = (state) => {
- const { newIssues, resolvedIssues } = state;
- let text;
- if (!newIssues.length && !resolvedIssues.length) {
- text = s__('ciReport|No changes to code quality');
- } else if (newIssues.length && resolvedIssues.length) {
- text = sprintf(
- s__(`ciReport|Code quality scanning detected %{issueCount} changes in merged results`),
- {
- issueCount: newIssues.length + resolvedIssues.length,
- },
- );
- } else if (resolvedIssues.length) {
- text = n__(
- `ciReport|Code quality improved due to 1 resolved issue`,
- `ciReport|Code quality improved due to %d resolved issues`,
- resolvedIssues.length,
- );
- } else if (newIssues.length) {
- text = n__(
- `ciReport|Code quality degraded due to 1 new issue`,
- `ciReport|Code quality degraded due to %d new issues`,
- newIssues.length,
- );
- }
-
- return text;
-};
-
-export const codequalityPopover = (state) => {
- if (state.status === STATUS_NOT_FOUND) {
- return {
- title: s__('ciReport|Base pipeline codequality artifact not found'),
- content: sprintf(
- s__('ciReport|%{linkStartTag}Learn more about codequality reports %{linkEndTag}'),
- {
- linkStartTag: `<a href="${state.helpPath}" target="_blank" rel="noopener noreferrer">`,
- linkEndTag: `${spriteIcon('external-link', 's16')}</a>`,
- },
- false,
- ),
- };
- }
- return {};
-};
diff --git a/app/assets/javascripts/ci/reports/codequality_report/store/index.js b/app/assets/javascripts/ci/reports/codequality_report/store/index.js
deleted file mode 100644
index c2f706e56e6..00000000000
--- a/app/assets/javascripts/ci/reports/codequality_report/store/index.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import Vue from 'vue';
-// eslint-disable-next-line no-restricted-imports
-import Vuex from 'vuex';
-import * as actions from './actions';
-import * as getters from './getters';
-import mutations from './mutations';
-import state from './state';
-
-Vue.use(Vuex);
-
-export const getStoreConfig = (initialState) => ({
- actions,
- getters,
- mutations,
- state: state(initialState),
-});
-
-export default (initialState) => new Vuex.Store(getStoreConfig(initialState));
diff --git a/app/assets/javascripts/ci/reports/codequality_report/store/mutation_types.js b/app/assets/javascripts/ci/reports/codequality_report/store/mutation_types.js
deleted file mode 100644
index c362c973ae1..00000000000
--- a/app/assets/javascripts/ci/reports/codequality_report/store/mutation_types.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export const SET_PATHS = 'SET_PATHS';
-
-export const REQUEST_REPORTS = 'REQUEST_REPORTS';
-export const RECEIVE_REPORTS_SUCCESS = 'RECEIVE_REPORTS_SUCCESS';
-export const RECEIVE_REPORTS_ERROR = 'RECEIVE_REPORTS_ERROR';
diff --git a/app/assets/javascripts/ci/reports/codequality_report/store/mutations.js b/app/assets/javascripts/ci/reports/codequality_report/store/mutations.js
deleted file mode 100644
index 249c2f35c0b..00000000000
--- a/app/assets/javascripts/ci/reports/codequality_report/store/mutations.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import * as types from './mutation_types';
-
-export default {
- [types.SET_PATHS](state, paths) {
- state.baseBlobPath = paths.baseBlobPath;
- state.headBlobPath = paths.headBlobPath;
- state.reportsPath = paths.reportsPath;
- state.helpPath = paths.helpPath;
- },
- [types.REQUEST_REPORTS](state) {
- state.isLoading = true;
- },
- [types.RECEIVE_REPORTS_SUCCESS](state, data) {
- state.hasError = false;
- state.status = '';
- state.statusReason = '';
- state.isLoading = false;
- state.newIssues = data.newIssues;
- state.resolvedIssues = data.resolvedIssues;
- },
- [types.RECEIVE_REPORTS_ERROR](state, error) {
- state.isLoading = false;
- state.hasError = true;
- state.status = error?.status || '';
- state.statusReason = error?.response?.data?.status_reason;
- },
-};
diff --git a/app/assets/javascripts/ci/reports/codequality_report/store/state.js b/app/assets/javascripts/ci/reports/codequality_report/store/state.js
deleted file mode 100644
index f68dbc2a5fa..00000000000
--- a/app/assets/javascripts/ci/reports/codequality_report/store/state.js
+++ /dev/null
@@ -1,16 +0,0 @@
-export default () => ({
- reportsPath: null,
-
- baseBlobPath: null,
- headBlobPath: null,
-
- isLoading: false,
- hasError: false,
- status: '',
- statusReason: '',
-
- newIssues: [],
- resolvedIssues: [],
-
- helpPath: null,
-});
diff --git a/app/assets/stylesheets/themes/_dark.scss b/app/assets/stylesheets/themes/_dark.scss
index 69d0431c9a8..303ea9dd005 100644
--- a/app/assets/stylesheets/themes/_dark.scss
+++ b/app/assets/stylesheets/themes/_dark.scss
@@ -8,6 +8,19 @@ $gray-dark: darken($gray-100, 2);
$gray-darker: darken($gray-200, 2);
$gray-darkest: $gray-700;
+// $data-viz blue shades required for $calendar-activity-colors
+$data-viz-blue-50: #2a2b59;
+$data-viz-blue-100: #303470;
+$data-viz-blue-200: #374291;
+$data-viz-blue-300: #3f51ae;
+$data-viz-blue-400: #4e65cd;
+$data-viz-blue-500: #617ae2;
+$data-viz-blue-600: #7992f5;
+$data-viz-blue-700: #97acff;
+$data-viz-blue-800: #b7c6ff;
+$data-viz-blue-900: #d2dcff;
+$data-viz-blue-950: #e9ebff;
+
// Some of the other $t-gray-a variables are used
// for borders and some other places, so we cannot override
// them. These are used only for box shadows so we can
diff --git a/app/models/project_repository.rb b/app/models/project_repository.rb
index a9cef16f3ac..4119a00b84b 100644
--- a/app/models/project_repository.rb
+++ b/app/models/project_repository.rb
@@ -4,6 +4,10 @@ class ProjectRepository < ApplicationRecord
include EachBatch
include Shardable
+ enum object_format: { sha1: 0, sha256: 1 }
+
+ validates :object_format, presence: true
+
belongs_to :project, inverse_of: :project_repository
class << self
diff --git a/config/feature_flags/development/product_analytics_usage_quota.yml b/config/feature_flags/development/product_analytics_usage_quota.yml
deleted file mode 100644
index d5807c5b507..00000000000
--- a/config/feature_flags/development/product_analytics_usage_quota.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: product_analytics_usage_quota
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133781
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/427838
-milestone: '16.6'
-type: development
-group: group::product analytics
-default_enabled: false
diff --git a/db/migrate/20231114091124_add_object_format_to_project_repositories.rb b/db/migrate/20231114091124_add_object_format_to_project_repositories.rb
new file mode 100644
index 00000000000..62a152b3381
--- /dev/null
+++ b/db/migrate/20231114091124_add_object_format_to_project_repositories.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddObjectFormatToProjectRepositories < Gitlab::Database::Migration[2.2]
+ milestone '16.7'
+
+ enable_lock_retries!
+
+ def change
+ add_column :project_repositories, :object_format, :smallint, null: false, default: 0
+ end
+end
diff --git a/db/schema_migrations/20231114091124 b/db/schema_migrations/20231114091124
new file mode 100644
index 00000000000..cf32ed90b03
--- /dev/null
+++ b/db/schema_migrations/20231114091124
@@ -0,0 +1 @@
+db370c884442e7d24d04721f7987f03d14a7d7fbd5372d8f226dae853713d80c \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 8da37f5f26e..5dda019cc2f 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -21968,7 +21968,8 @@ CREATE TABLE project_repositories (
id bigint NOT NULL,
shard_id integer NOT NULL,
disk_path character varying NOT NULL,
- project_id integer NOT NULL
+ project_id integer NOT NULL,
+ object_format smallint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE project_repositories_id_seq
diff --git a/doc/ci/components/index.md b/doc/ci/components/index.md
index 3d46ec5bbd5..f7c23964606 100644
--- a/doc/ci/components/index.md
+++ b/doc/ci/components/index.md
@@ -473,3 +473,17 @@ can be converted to a CI/CD component:
or making it [more efficient](../pipelines/pipeline_efficiency.md).
1. Leverage the `.gitlab-ci.yml` in the components repository to [test changes to the component](index.md#test-the-component).
1. Tag and [release the component](index.md#release-a-component).
+
+## Troubleshooting
+
+### `content not found` message
+
+You might receive an error message similar to the following when using the `~latest`
+version qualifier to reference a component hosted by a [catalog resource](catalog.md#add-a-components-repository-to-the-catalog):
+
+```plaintext
+This GitLab CI configuration is invalid: component 'gitlab.com/my-namespace/my-project/my-component@~latest' - content not found`
+```
+
+The `~latest` behavior [was updated](https://gitlab.com/gitlab-org/gitlab/-/issues/429707)
+in GitLab 16.7. It now refers to the latest published version of the catalog resource. To resolve this issue, [create a new release](#release-a-component).
diff --git a/doc/development/ai_features/glossary.md b/doc/development/ai_features/glossary.md
new file mode 100644
index 00000000000..889b5ef4f57
--- /dev/null
+++ b/doc/development/ai_features/glossary.md
@@ -0,0 +1,81 @@
+---
+stage: AI-powered
+group: AI Framework
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
+---
+
+# GitLab Duo Glossary
+
+This is a list of terms that may have a general meaning but also may have a
+specific meaning at GitLab. If you encounter a piece of technical jargon related
+to AI that you think could benefit from being in this list, please add it!
+
+- **AI Gateway**: standalone service used to give access to AI features to
+ non-SaaS GitLab users. This logic will be moved to Cloud Connector when that
+ service is ready. Eventually, the AI Gateway will be used to host endpoints that
+ proxy requests to AI providers, removing the need for the GitLab Rails monolith
+ to integrate and communicate directly with third-party LLMs.
+ [Blueprint](../../architecture/blueprints/ai_gateway/index.md).
+- **Chat Evaluation**: automated mechanism for determining the helpfulness and
+ accuracy of GitLab Duo Chat to various user questions. The MVC is an RSpec test
+ run via GitLab CI that asks a set of questions to Chat and then has a
+ two different third-party LLMs determine if the generated answer is accurate or not.
+ [MVC](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134610).
+ [Design doc for next iteration](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136127).
+- **Cloud Connector**: Today, Cloud Connector is not a system. It is an umbrella
+ term for all the projects we engage in that make existing SaaS-only features
+ available to self-managed and GitLab Dedicated customers. Today, the only
+ feature available through Cloud Connector is Code Suggestions.
+ Cloud Connector also refer to a planned GitLab-hosted edge service which would
+ act as a way for non-SaaS GitLab instances to access SaaS offerings.
+ [Cloud Connector MVC](../cloud_connector/code_suggestions_for_sm.md).
+ [Blueprint for future Cloud Connector service](../../architecture/blueprints/cloud_connector/index.md).
+- **Consensus Filtering**: method for LLM evaluation where you instruct an LLM
+ to evaluate the output of another LLM based on the question and context that
+ resulted in the output. This is the method of evaluation being used for the Chat
+ Evaluation MVC.
+ [Issue from Model Validation team](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/prompt-library/-/issues/91#metric-2-consensus-filtering-with-llm-based-evaluation).
+- **Context**: relevant information that surrounds a data point, an event, or a
+ piece of information, which helps to clarify its meaning and implications.
+ For GitLab Duo Chat, context is the attributes of the Issue or Epic being
+ referenced in a user question.
+- **Golden Questions**: a small subset of the types of questions we think a user
+ should be able to ask GitLab Duo Chat. Used to generate data for Chat evaluation.
+ [Questions for Chat Beta](https://gitlab.com/groups/gitlab-org/-/epics/10550#what-the-user-can-ask).
+- **Ground Truth**: data that is determined to be the true
+ output for a given input, representing the reality that the AI model aims to
+ learn and predict. Ground truth data is usually human-annotated.
+- **Model Validation**: group within the AI-powered Stage working on the Prompt
+ Library and researching AI/ML models to support other use-cases for AI at GitLab.
+ [Team handbook section](https://about.gitlab.com/handbook/product/categories/features/#ai-poweredai-model-validation-group).
+- **Prompt library**: The ["Prompt Library"](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/prompt-library) is a Python library that provides a CLI for testing different prompting techniques with LLMs. It enables data-driven improvements to LLM applications by facilitating hypothesis testing. Key features include the ability to manage and run dataflow pipelines using Apache Beam, and the execution of multiple evaluation experiments in a single pipeline run.
+ on prompts with various third-party AI Services.
+ [Code](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/prompt-library).
+- **Prompt Registry**: stored, versioned prompts used to interact with third-party
+ AI Services. [Blueprint](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/135872).
+- **Prompt**: instructions sent to an LLM to perform certain tasks. [Prompt guidelines](prompts.md).
+- **RAG Pipeline**: (Retrieval-Augmented Generation) is a mechanism used to take
+ an input (such as a user question) into a system, retrieve any relevant data
+ for that input, augment the input with additional context, and then
+ synthesize the information to generate a coherent, contextualy-relevant answer.
+ This design pattern is helpful in open-domain question answering with LLMs,
+ which is why we use this design pattern for answering questions to GitLab Duo Chat.
+- **Similarity Score**: method to determine the likeness between answers produced by an LLM and the reference ground truth answers.
+ [Issue from Model Validation team](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/prompt-library/-/issues/91#metric-1-similarity-score-as-comparisons-for-llms).
+- **Tool**: logic that performs a specific LLM-related task; each tool has a
+ description and its own prompt. [How to add a new tool](duo_chat.md#adding-a-new-tool).
+- **Word-Level Metrics**: method for LLM evaluation that compares aspects of
+ text at the granularity of individual words.
+ [Issue from Model Validation team](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/prompt-library/-/issues/98#metric-3-word-level-metrics).
+- **Zero-shot agent**: in the general world of AI, a learning model or system
+ that can perform tasks without having seen any examples of that task during
+ training. At GitLab, we use this term to refer specifically to a piece of our
+ code that serves as a sort of LLM-powered air traffic controller for GitLab Duo Chat.
+ The GitLab zero-shot agent has a system prompt that explains how an LLM should
+ interpret user input from GitLab Duo Chat as well as a list of tool descriptions.
+ Using this information, the agent determines which tool to use to answer a
+ user's question. The agent may decide that no tools are required and answer the
+ question directly. If a tool is used, the answer from the tool is fed back to
+ the zero-shot agent to evaluate if the answer is sufficient or if an additional
+ tool must be used to answer the question.
+ [Code](https://gitlab.com/gitlab-org/gitlab/-/blob/6b747cbd7c6a71145a8bfb8201db3c857b5aed6a/ee/lib/gitlab/llm/chain/agents/zero_shot/executor.rb). [Zero-shot agent in action](https://gitlab.com/gitlab-org/gitlab/-/issues/427979).
diff --git a/doc/development/ai_features/index.md b/doc/development/ai_features/index.md
index 87c8abea405..aa8dc4715c7 100644
--- a/doc/development/ai_features/index.md
+++ b/doc/development/ai_features/index.md
@@ -37,7 +37,7 @@ Apply the following two feature flags to any AI feature work:
- A general flag (`ai_global_switch`) that applies to all AI features.
- A flag specific to that feature. The feature flag name [must be different](../feature_flags/index.md#feature-flags-for-licensed-features) than the licensed feature name.
-See the [feature flag tracker](https://gitlab.com/gitlab-org/gitlab/-/issues/405161) for the list of all feature flags and how to use them.
+See the [feature flag tracker epic](https://gitlab.com/groups/gitlab-org/-/epics/10524) for the list of all feature flags and how to use them.
## Implement a new AI action
@@ -61,10 +61,10 @@ Use [this snippet](https://gitlab.com/gitlab-org/gitlab/-/snippets/2554994) for
1. Ensure you have followed [the process to obtain an EE license](https://about.gitlab.com/handbook/developer-onboarding/#working-on-gitlab-ee-developer-licenses) for your local instance
1. Simulate the GDK to [simulate SaaS](../ee_features.md#simulate-a-saas-instance) and ensure the group you want to test has an Ultimate license
-1. Enable `Experimental features`:
+1. Enable `Experiment & Beta features`
1. Go to the group with the Ultimate license
1. **Group Settings** > **General** -> **Permissions and group features**
- 1. Enable **Experiment features**
+ 1. Enable **Experiment & Beta features**
1. Enable the specific feature flag for the feature you want to test
1. Set the required access token. To receive an access token:
1. For Vertex, follow the [instructions below](#configure-gcp-vertex-access).
@@ -72,9 +72,6 @@ Use [this snippet](https://gitlab.com/gitlab-org/gitlab/-/snippets/2554994) for
### Set up the embedding database
-NOTE:
-Use [this snippet](https://gitlab.com/gitlab-org/gitlab/-/snippets/2554994) for help automating the following section.
-
For features that use the embedding database, additional setup is needed.
1. Enable [`pgvector`](https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/pgvector.md#enable-pgvector-in-the-gdk) in GDK
diff --git a/doc/user/packages/container_registry/reduce_container_registry_storage.md b/doc/user/packages/container_registry/reduce_container_registry_storage.md
index b4e37714a5d..75dfa13a9d8 100644
--- a/doc/user/packages/container_registry/reduce_container_registry_storage.md
+++ b/doc/user/packages/container_registry/reduce_container_registry_storage.md
@@ -15,12 +15,17 @@ if you add a large number of images or tags:
You should delete unnecessary images and tags and set up a [cleanup policy](#cleanup-policy)
to automatically manage your container registry usage.
-## Check Container Registry storage use **(FREE SAAS)**
+## View container registry usage **(FREE SAAS)**
-The Usage Quotas page (**Settings > Usage Quotas > Storage**) displays storage usage for Packages.
-Measuring usage is only possible on the new version of the GitLab Container Registry backed by a
-metadata database, which is [available on GitLab.com](https://gitlab.com/groups/gitlab-org/-/epics/5523) since GitLab 15.7.
-For information on the planned availability for self-managed instances, see [epic 5521](https://gitlab.com/groups/gitlab-org/-/epics/5521).
+> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/5523) in GitLab 15.7
+
+To view the storage usage for the container registry:
+
+1. On the left sidebar, select **Search or go to** and find your project.
+1. Select **Settings > Usage Quotas**.
+
+You cannot view Container Registry usage for self-managed instances, but this is
+proposed in [epic 5521](https://gitlab.com/groups/gitlab-org/-/epics/5521).
## How container registry usage is calculated
diff --git a/doc/user/product_analytics/index.md b/doc/user/product_analytics/index.md
index 245ffc34783..db52f9e51cc 100644
--- a/doc/user/product_analytics/index.md
+++ b/doc/user/product_analytics/index.md
@@ -299,12 +299,8 @@ If the request is successful, the returned JSON includes an array of rows of res
## View product analytics usage quota
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/424153) in GitLab 16.6 with a [flag](../../administration/feature_flags.md) named `product_analytics_usage_quota`. Disabled by default.
-
-FLAG:
-On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, an administrator can [enable the feature flag](../../administration/feature_flags.md) named `product_analytics_usage_quota`.
-On GitLab.com, this feature is not available.
-This feature is not ready for production use.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/424153) in GitLab 16.6 with a [flag](../../administration/feature_flags.md) named `product_analytics_usage_quota`. Disabled by default.
+> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/427838) in GitLab 16.7. Feature flag `product_analytics_usage_quota` removed.
Product analytics usage quota is calculated from the number of events received from instrumented applications.
The tab displays the monthly totals for the group, and a breakdown of usage per project. Current month shows events counted to date.
diff --git a/lib/gitlab/database/migrations/pg_backend_pid.rb b/lib/gitlab/database/migrations/pg_backend_pid.rb
index b59eb55cc6e..52f309e4058 100644
--- a/lib/gitlab/database/migrations/pg_backend_pid.rb
+++ b/lib/gitlab/database/migrations/pg_backend_pid.rb
@@ -13,7 +13,7 @@ module Gitlab
Gitlab::Database::Migrations::PgBackendPid.say(conn)
yield(conn)
-
+ ensure
Gitlab::Database::Migrations::PgBackendPid.say(conn)
end
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 737d28501f0..67b5d53a254 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -56683,9 +56683,6 @@ msgstr ""
msgid "ciReport|%{improvedNum} improved"
msgstr ""
-msgid "ciReport|%{linkStartTag}Learn more about codequality reports %{linkEndTag}"
-msgstr ""
-
msgid "ciReport|%{prefix} %{strong_start}%{score}%{strong_end} %{delta} %{deltaPercent} in %{path}"
msgstr ""
@@ -56731,9 +56728,6 @@ msgstr ""
msgid "ciReport|Automatically opens a merge request with a solution generated by AI"
msgstr ""
-msgid "ciReport|Base pipeline codequality artifact not found"
-msgstr ""
-
msgid "ciReport|Browser Performance"
msgstr ""
@@ -56769,19 +56763,6 @@ msgstr ""
msgid "ciReport|Code Quality is loading"
msgstr ""
-msgid "ciReport|Code quality degraded due to 1 new issue"
-msgid_plural "ciReport|Code quality degraded due to %d new issues"
-msgstr[0] ""
-msgstr[1] ""
-
-msgid "ciReport|Code quality improved due to 1 resolved issue"
-msgid_plural "ciReport|Code quality improved due to %d resolved issues"
-msgstr[0] ""
-msgstr[1] ""
-
-msgid "ciReport|Code quality scanning detected %{issueCount} changes in merged results"
-msgstr ""
-
msgid "ciReport|Container Scanning"
msgstr ""
@@ -56901,9 +56882,6 @@ msgstr ""
msgid "ciReport|New vulnerabilities are vulnerabilities that the security scan detects in the merge request that are different to existing vulnerabilities in the default branch."
msgstr ""
-msgid "ciReport|No changes to code quality"
-msgstr ""
-
msgid "ciReport|No code quality issues found"
msgstr ""
@@ -56973,9 +56951,6 @@ msgstr ""
msgid "ciReport|There was an error dismissing the vulnerability: %{error}"
msgstr ""
-msgid "ciReport|There was an error fetching the codequality report."
-msgstr ""
-
msgid "ciReport|There was an error reverting the dismissal. Please try again."
msgstr ""
diff --git a/qa/Gemfile b/qa/Gemfile
index 3b0e8fa888c..289c16533c1 100644
--- a/qa/Gemfile
+++ b/qa/Gemfile
@@ -3,7 +3,7 @@
source 'https://rubygems.org'
gem 'gitlab-qa', '~> 12', '>= 12.5.0', require: 'gitlab/qa'
-gem 'gitlab_quality-test_tooling', '~> 0.9.3', require: false
+gem 'gitlab_quality-test_tooling', '~> 1.5.3', require: false
gem 'gitlab-utils', path: '../gems/gitlab-utils'
gem 'activesupport', '~> 7.0.8' # This should stay in sync with the root's Gemfile
gem 'allure-rspec', '~> 2.20.0'
diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock
index a1563a7351e..ea59d41703a 100644
--- a/qa/Gemfile.lock
+++ b/qa/Gemfile.lock
@@ -39,6 +39,9 @@ GEM
require_all (>= 2, < 4)
rspec-expectations (~> 3.12)
uuid (>= 2.3, < 3)
+ amatch (0.4.1)
+ mize
+ tins (~> 1.0)
ast (2.4.2)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
@@ -130,8 +133,9 @@ GEM
rainbow (>= 3, < 4)
table_print (= 1.5.7)
zeitwerk (>= 2, < 3)
- gitlab_quality-test_tooling (0.9.3)
- activesupport (>= 6.1, < 7.1)
+ gitlab_quality-test_tooling (1.5.3)
+ activesupport (>= 6.1, < 7.2)
+ amatch (~> 0.4.1)
gitlab (~> 4.19)
http (~> 5.0)
nokogiri (~> 1.10)
@@ -209,6 +213,8 @@ GEM
mini_mime (1.1.0)
mini_portile2 (2.8.2)
minitest (5.20.0)
+ mize (0.4.1)
+ protocol (~> 2.0)
multi_json (1.15.0)
multi_xml (0.6.0)
netrc (0.11.0)
@@ -229,6 +235,8 @@ GEM
coderay
parser
unparser
+ protocol (2.0.0)
+ ruby_parser (~> 3.0)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
@@ -292,6 +300,8 @@ GEM
ruby-debug-ide (0.7.3)
rake (>= 0.8.1)
ruby2_keywords (0.0.5)
+ ruby_parser (3.20.3)
+ sexp_processor (~> 4.16)
rubyzip (2.3.2)
sawyer (0.9.2)
addressable (>= 2.3.5)
@@ -300,16 +310,20 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
+ sexp_processor (4.17.0)
signet (0.17.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
slack-notifier (2.4.0)
+ sync (0.5.0)
systemu (2.6.5)
table_print (1.5.7)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
+ tins (1.32.1)
+ sync
trailblazer-option (0.1.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
@@ -353,7 +367,7 @@ DEPENDENCIES
fog-google (~> 1.19)
gitlab-qa (~> 12, >= 12.5.0)
gitlab-utils!
- gitlab_quality-test_tooling (~> 0.9.3)
+ gitlab_quality-test_tooling (~> 1.5.3)
influxdb-client (~> 2.9)
knapsack (~> 4.0)
nokogiri (~> 1.15, >= 1.15.4)
diff --git a/spec/frontend/boards/board_card_inner_spec.js b/spec/frontend/boards/board_card_inner_spec.js
index c70e461da83..6312b6694ed 100644
--- a/spec/frontend/boards/board_card_inner_spec.js
+++ b/spec/frontend/boards/board_card_inner_spec.js
@@ -16,7 +16,7 @@ import eventHub from '~/boards/eventhub';
import defaultStore from '~/boards/stores';
import { TYPE_ISSUE } from '~/issues/constants';
import { updateHistory } from '~/lib/utils/url_utility';
-import { mockLabelList, mockIssue, mockIssueFullPath } from './mock_data';
+import { mockLabelList, mockIssue, mockIssueFullPath, mockIssueDirectNamespace } from './mock_data';
jest.mock('~/lib/utils/url_utility');
jest.mock('~/boards/eventhub');
@@ -162,11 +162,13 @@ describe('Board card component', () => {
createStore();
createWrapper({ isGroupBoard: false });
- expect(wrapper.find('.board-card-number').text()).not.toContain(mockIssueFullPath);
+ expect(wrapper.find('.board-card-number').text()).not.toContain(mockIssueDirectNamespace);
+ expect(wrapper.find('.board-item-path').exists()).toBe(false);
});
- it('renders item reference path', () => {
- expect(wrapper.find('.board-card-number').text()).toContain(mockIssueFullPath);
+ it('renders item direct namespace path with full reference path in a tooltip', () => {
+ expect(wrapper.find('.board-item-path').text()).toBe(mockIssueDirectNamespace);
+ expect(wrapper.find('.board-item-path').attributes('title')).toBe(mockIssueFullPath);
});
describe('blocked', () => {
diff --git a/spec/frontend/boards/mock_data.js b/spec/frontend/boards/mock_data.js
index 0be17db9450..3aaf4b7ae3f 100644
--- a/spec/frontend/boards/mock_data.js
+++ b/spec/frontend/boards/mock_data.js
@@ -275,6 +275,7 @@ export const labels = [
];
export const mockIssueFullPath = 'gitlab-org/test-subgroup/gitlab-test';
+export const mockIssueDirectNamespace = 'gitlab-test';
export const mockEpicFullPath = 'gitlab-org/test-subgroup';
export const rawIssue = {
diff --git a/spec/frontend/ci/reports/codequality_report/store/actions_spec.js b/spec/frontend/ci/reports/codequality_report/store/actions_spec.js
deleted file mode 100644
index a606bce3d78..00000000000
--- a/spec/frontend/ci/reports/codequality_report/store/actions_spec.js
+++ /dev/null
@@ -1,190 +0,0 @@
-import MockAdapter from 'axios-mock-adapter';
-import testAction from 'helpers/vuex_action_helper';
-import { TEST_HOST } from 'spec/test_constants';
-import axios from '~/lib/utils/axios_utils';
-import {
- HTTP_STATUS_INTERNAL_SERVER_ERROR,
- HTTP_STATUS_NO_CONTENT,
- HTTP_STATUS_OK,
-} from '~/lib/utils/http_status';
-import createStore from '~/ci/reports/codequality_report/store';
-import * as actions from '~/ci/reports/codequality_report/store/actions';
-import * as types from '~/ci/reports/codequality_report/store/mutation_types';
-import { STATUS_NOT_FOUND } from '~/ci/reports/constants';
-import { reportIssues, parsedReportIssues } from '../mock_data';
-
-const pollInterval = 123;
-const pollIntervalHeader = {
- 'Poll-Interval': pollInterval,
-};
-
-describe('Codequality Reports actions', () => {
- let localState;
- let localStore;
-
- beforeEach(() => {
- localStore = createStore();
- localState = localStore.state;
- });
-
- describe('setPaths', () => {
- it('should commit SET_PATHS mutation', () => {
- const paths = {
- baseBlobPath: 'baseBlobPath',
- headBlobPath: 'headBlobPath',
- reportsPath: 'reportsPath',
- };
-
- return testAction(
- actions.setPaths,
- paths,
- localState,
- [{ type: types.SET_PATHS, payload: paths }],
- [],
- );
- });
- });
-
- describe('fetchReports', () => {
- const endpoint = `${TEST_HOST}/codequality_reports.json`;
- let mock;
-
- beforeEach(() => {
- localState.reportsPath = endpoint;
- mock = new MockAdapter(axios);
- });
-
- afterEach(() => {
- mock.restore();
- });
-
- describe('on success', () => {
- it('commits REQUEST_REPORTS and dispatches receiveReportsSuccess', () => {
- mock.onGet(endpoint).reply(HTTP_STATUS_OK, reportIssues);
-
- return testAction(
- actions.fetchReports,
- null,
- localState,
- [{ type: types.REQUEST_REPORTS }],
- [
- {
- payload: parsedReportIssues,
- type: 'receiveReportsSuccess',
- },
- ],
- );
- });
- });
-
- describe('on error', () => {
- it('commits REQUEST_REPORTS and dispatches receiveReportsError', () => {
- mock.onGet(endpoint).reply(HTTP_STATUS_INTERNAL_SERVER_ERROR);
-
- return testAction(
- actions.fetchReports,
- null,
- localState,
- [{ type: types.REQUEST_REPORTS }],
- [{ type: 'receiveReportsError', payload: expect.any(Error) }],
- );
- });
- });
-
- describe('when base report is not found', () => {
- it('commits REQUEST_REPORTS and dispatches receiveReportsError', () => {
- const data = { status: STATUS_NOT_FOUND };
- mock.onGet(`${TEST_HOST}/codequality_reports.json`).reply(HTTP_STATUS_OK, data);
-
- return testAction(
- actions.fetchReports,
- null,
- localState,
- [{ type: types.REQUEST_REPORTS }],
- [{ type: 'receiveReportsError', payload: data }],
- );
- });
- });
-
- describe('while waiting for report results', () => {
- it('continues polling until it receives data', () => {
- mock
- .onGet(endpoint)
- .replyOnce(HTTP_STATUS_NO_CONTENT, undefined, pollIntervalHeader)
- .onGet(endpoint)
- .reply(HTTP_STATUS_OK, reportIssues);
-
- return Promise.all([
- testAction(
- actions.fetchReports,
- null,
- localState,
- [{ type: types.REQUEST_REPORTS }],
- [
- {
- payload: parsedReportIssues,
- type: 'receiveReportsSuccess',
- },
- ],
- ),
- axios
- // wait for initial NO_CONTENT response to be fulfilled
- .waitForAll()
- .then(() => {
- jest.advanceTimersByTime(pollInterval);
- }),
- ]);
- });
-
- it('continues polling until it receives an error', () => {
- mock
- .onGet(endpoint)
- .replyOnce(HTTP_STATUS_NO_CONTENT, undefined, pollIntervalHeader)
- .onGet(endpoint)
- .reply(HTTP_STATUS_INTERNAL_SERVER_ERROR);
-
- return Promise.all([
- testAction(
- actions.fetchReports,
- null,
- localState,
- [{ type: types.REQUEST_REPORTS }],
- [{ type: 'receiveReportsError', payload: expect.any(Error) }],
- ),
- axios
- // wait for initial NO_CONTENT response to be fulfilled
- .waitForAll()
- .then(() => {
- jest.advanceTimersByTime(pollInterval);
- }),
- ]);
- });
- });
- });
-
- describe('receiveReportsSuccess', () => {
- it('commits RECEIVE_REPORTS_SUCCESS', () => {
- const data = { issues: [] };
-
- return testAction(
- actions.receiveReportsSuccess,
- data,
- localState,
- [{ type: types.RECEIVE_REPORTS_SUCCESS, payload: data }],
- [],
- );
- });
- });
-
- describe('receiveReportsError', () => {
- it('commits RECEIVE_REPORTS_ERROR', () => {
- return testAction(
- actions.receiveReportsError,
- null,
- localState,
- [{ type: types.RECEIVE_REPORTS_ERROR, payload: null }],
- [],
- );
- });
- });
-});
diff --git a/spec/frontend/ci/reports/codequality_report/store/getters_spec.js b/spec/frontend/ci/reports/codequality_report/store/getters_spec.js
deleted file mode 100644
index f4505204f67..00000000000
--- a/spec/frontend/ci/reports/codequality_report/store/getters_spec.js
+++ /dev/null
@@ -1,94 +0,0 @@
-import createStore from '~/ci/reports/codequality_report/store';
-import * as getters from '~/ci/reports/codequality_report/store/getters';
-import { LOADING, ERROR, SUCCESS, STATUS_NOT_FOUND } from '~/ci/reports/constants';
-
-describe('Codequality reports store getters', () => {
- let localState;
- let localStore;
-
- beforeEach(() => {
- localStore = createStore();
- localState = localStore.state;
- });
-
- describe('hasCodequalityIssues', () => {
- describe('when there are issues', () => {
- it('returns true', () => {
- localState.newIssues = [{ reason: 'repetitive code' }];
- localState.resolvedIssues = [];
-
- expect(getters.hasCodequalityIssues(localState)).toEqual(true);
-
- localState.newIssues = [];
- localState.resolvedIssues = [{ reason: 'repetitive code' }];
-
- expect(getters.hasCodequalityIssues(localState)).toEqual(true);
- });
- });
-
- describe('when there are no issues', () => {
- it('returns false when there are no issues', () => {
- expect(getters.hasCodequalityIssues(localState)).toEqual(false);
- });
- });
- });
-
- describe('codequalityStatus', () => {
- describe('when loading', () => {
- it('returns loading status', () => {
- localState.isLoading = true;
-
- expect(getters.codequalityStatus(localState)).toEqual(LOADING);
- });
- });
-
- describe('on error', () => {
- it('returns error status', () => {
- localState.hasError = true;
-
- expect(getters.codequalityStatus(localState)).toEqual(ERROR);
- });
- });
-
- describe('when successfully loaded', () => {
- it('returns error status', () => {
- expect(getters.codequalityStatus(localState)).toEqual(SUCCESS);
- });
- });
- });
-
- describe('codequalityText', () => {
- it.each`
- resolvedIssues | newIssues | expectedText
- ${0} | ${0} | ${'No changes to code quality'}
- ${0} | ${1} | ${'Code quality degraded due to 1 new issue'}
- ${2} | ${0} | ${'Code quality improved due to 2 resolved issues'}
- ${1} | ${2} | ${'Code quality scanning detected 3 changes in merged results'}
- `(
- 'returns a summary containing $resolvedIssues resolved issues and $newIssues new issues',
- ({ newIssues, resolvedIssues, expectedText }) => {
- localState.newIssues = new Array(newIssues).fill({ reason: 'Repetitive code' });
- localState.resolvedIssues = new Array(resolvedIssues).fill({ reason: 'Repetitive code' });
-
- expect(getters.codequalityText(localState)).toEqual(expectedText);
- },
- );
- });
-
- describe('codequalityPopover', () => {
- describe('when base report is not available', () => {
- it('returns a popover with a documentation link', () => {
- localState.status = STATUS_NOT_FOUND;
- localState.helpPath = 'codequality_help.html';
-
- expect(getters.codequalityPopover(localState).title).toEqual(
- 'Base pipeline codequality artifact not found',
- );
- expect(getters.codequalityPopover(localState).content).toContain(
- 'Learn more about codequality reports',
- 'href="codequality_help.html"',
- );
- });
- });
- });
-});
diff --git a/spec/frontend/ci/reports/codequality_report/store/mutations_spec.js b/spec/frontend/ci/reports/codequality_report/store/mutations_spec.js
deleted file mode 100644
index 22ff86b1040..00000000000
--- a/spec/frontend/ci/reports/codequality_report/store/mutations_spec.js
+++ /dev/null
@@ -1,100 +0,0 @@
-import createStore from '~/ci/reports/codequality_report/store';
-import mutations from '~/ci/reports/codequality_report/store/mutations';
-import { STATUS_NOT_FOUND } from '~/ci/reports/constants';
-
-describe('Codequality Reports mutations', () => {
- let localState;
- let localStore;
-
- beforeEach(() => {
- localStore = createStore();
- localState = localStore.state;
- });
-
- describe('SET_PATHS', () => {
- it('sets paths to given values', () => {
- const baseBlobPath = 'base/blob/path/';
- const headBlobPath = 'head/blob/path/';
- const reportsPath = 'reports.json';
- const helpPath = 'help.html';
-
- mutations.SET_PATHS(localState, {
- baseBlobPath,
- headBlobPath,
- reportsPath,
- helpPath,
- });
-
- expect(localState.baseBlobPath).toEqual(baseBlobPath);
- expect(localState.headBlobPath).toEqual(headBlobPath);
- expect(localState.reportsPath).toEqual(reportsPath);
- expect(localState.helpPath).toEqual(helpPath);
- });
- });
-
- describe('REQUEST_REPORTS', () => {
- it('sets isLoading to true', () => {
- mutations.REQUEST_REPORTS(localState);
-
- expect(localState.isLoading).toEqual(true);
- });
- });
-
- describe('RECEIVE_REPORTS_SUCCESS', () => {
- it('sets isLoading to false', () => {
- mutations.RECEIVE_REPORTS_SUCCESS(localState, {});
-
- expect(localState.isLoading).toEqual(false);
- });
-
- it('sets hasError to false', () => {
- mutations.RECEIVE_REPORTS_SUCCESS(localState, {});
-
- expect(localState.hasError).toEqual(false);
- });
-
- it('clears status and statusReason', () => {
- mutations.RECEIVE_REPORTS_SUCCESS(localState, {});
-
- expect(localState.status).toEqual('');
- expect(localState.statusReason).toEqual('');
- });
-
- it('sets newIssues and resolvedIssues from response data', () => {
- const data = { newIssues: [{ id: 1 }], resolvedIssues: [{ id: 2 }] };
- mutations.RECEIVE_REPORTS_SUCCESS(localState, data);
-
- expect(localState.newIssues).toEqual(data.newIssues);
- expect(localState.resolvedIssues).toEqual(data.resolvedIssues);
- });
- });
-
- describe('RECEIVE_REPORTS_ERROR', () => {
- it('sets isLoading to false', () => {
- mutations.RECEIVE_REPORTS_ERROR(localState);
-
- expect(localState.isLoading).toEqual(false);
- });
-
- it('sets hasError to true', () => {
- mutations.RECEIVE_REPORTS_ERROR(localState);
-
- expect(localState.hasError).toEqual(true);
- });
-
- it('sets status based on error object', () => {
- const error = { status: STATUS_NOT_FOUND };
- mutations.RECEIVE_REPORTS_ERROR(localState, error);
-
- expect(localState.status).toEqual(error.status);
- });
-
- it('sets statusReason to string from error response data', () => {
- const data = { status_reason: 'This merge request does not have codequality reports' };
- const error = { response: { data } };
- mutations.RECEIVE_REPORTS_ERROR(localState, error);
-
- expect(localState.statusReason).toEqual(data.status_reason);
- });
- });
-});
diff --git a/spec/lib/gitlab/database/migrations/pg_backend_pid_spec.rb b/spec/lib/gitlab/database/migrations/pg_backend_pid_spec.rb
index 33e83ea2575..a9ef28a4b51 100644
--- a/spec/lib/gitlab/database/migrations/pg_backend_pid_spec.rb
+++ b/spec/lib/gitlab/database/migrations/pg_backend_pid_spec.rb
@@ -18,6 +18,17 @@ RSpec.describe Gitlab::Database::Migrations::PgBackendPid, feature_category: :da
expect { |b| patched_instance.with_advisory_lock_connection(&b) }.to yield_with_args(:conn)
end
+
+ it 're-yields with same arguments and wraps it with calls to .say even when error is raised' do
+ patched_instance = klass.prepend(described_class).new
+ expect(Gitlab::Database::Migrations::PgBackendPid).to receive(:say).twice
+
+ expect do
+ patched_instance.with_advisory_lock_connection do
+ raise ActiveRecord::ConcurrentMigrationError, 'test'
+ end
+ end.to raise_error ActiveRecord::ConcurrentMigrationError
+ end
end
describe '.patch!' do
diff --git a/spec/models/project_repository_spec.rb b/spec/models/project_repository_spec.rb
index eba908b0fdb..a38782cfd51 100644
--- a/spec/models/project_repository_spec.rb
+++ b/spec/models/project_repository_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe ProjectRepository do
+RSpec.describe ProjectRepository, feature_category: :source_code_management do
describe 'associations' do
it { is_expected.to belong_to(:shard) }
it { is_expected.to belong_to(:project) }
@@ -25,4 +25,28 @@ RSpec.describe ProjectRepository do
expect(described_class.find_project('@@unexisting/path/to/project')).to be_nil
end
end
+
+ describe '#object_format' do
+ subject { project_repository.object_format }
+
+ let(:project_repository) { build(:project_repository, object_format: object_format) }
+
+ context 'when object format is sha1' do
+ let(:object_format) { 'sha1' }
+
+ it { is_expected.to eq 'sha1' }
+ end
+
+ context 'when object format is sha256' do
+ let(:object_format) { 'sha256' }
+
+ it { is_expected.to eq 'sha256' }
+ end
+
+ context 'when object format is not set' do
+ let(:project_repository) { build(:project_repository) }
+
+ it { is_expected.to eq 'sha1' }
+ end
+ end
end