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>2022-10-27 15:11:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-27 15:11:01 +0300
commitc52a9411d8e66b8c6a1a1b3672626a326d73e884 (patch)
tree14fbb7768d935c7751cc8b2b7a66887312908312
parent8588e8b9316538f27f45a6e380bd0663bb509d66 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.checksum2
-rw-r--r--Gemfile.lock5
-rw-r--r--app/assets/javascripts/filtered_search/dropdown_user.js3
-rw-r--r--app/assets/javascripts/filtered_search/droplab/plugins/ajax_filter.js3
-rw-r--r--app/assets/javascripts/jobs/components/job/sidebar/sidebar.vue13
-rw-r--r--app/assets/javascripts/lib/utils/url_utility.js2
-rw-r--r--app/assets/javascripts/notes/mixins/discussion_navigation.js2
-rw-r--r--app/assets/javascripts/pages/admin/application_settings/general/components/signup_form.vue18
-rw-r--r--app/assets/javascripts/projects/commits/store/actions.js3
-rw-r--r--app/assets/javascripts/projects/settings/api/access_dropdown_api.js3
-rw-r--r--app/assets/javascripts/users_select/constants.js3
-rw-r--r--app/assets/javascripts/users_select/index.js26
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue2
-rw-r--r--app/assets/stylesheets/page_bundles/merge_requests.scss2
-rw-r--r--app/finders/autocomplete/users_finder.rb6
-rw-r--r--app/helpers/application_settings_helper.rb4
-rw-r--r--app/models/ci/build_trace_chunk.rb2
-rw-r--r--app/models/ci/secure_file.rb2
-rw-r--r--app/presenters/ci/pipeline_presenter.rb3
-rw-r--r--app/serializers/ci/pipeline_entity.rb5
-rw-r--r--app/serializers/merge_requests/pipeline_entity.rb8
-rw-r--r--doc/api/graphql/reference/index.md2
-rw-r--r--doc/api/pipeline_triggers.md2
-rw-r--r--doc/architecture/blueprints/_template.md7
-rw-r--r--doc/architecture/blueprints/ci_data_decay/index.md43
-rw-r--r--doc/architecture/blueprints/ci_pipeline_components/index.md45
-rw-r--r--doc/architecture/blueprints/cloud_native_build_logs/index.md36
-rw-r--r--doc/architecture/blueprints/cloud_native_gitlab_pages/index.md47
-rw-r--r--doc/architecture/blueprints/composable_codebase_using_rails_engines/index.md42
-rw-r--r--doc/architecture/blueprints/consolidating_groups_and_projects/index.md40
-rw-r--r--doc/architecture/blueprints/container_registry_metadata_database/index.md33
-rw-r--r--doc/architecture/blueprints/database_testing/index.md35
-rw-r--r--doc/architecture/blueprints/feature_flags_development/index.md35
-rw-r--r--doc/architecture/blueprints/gitlab_to_kubernetes_communication/index.md37
-rw-r--r--doc/architecture/blueprints/graphql_api/index.md51
-rw-r--r--doc/architecture/blueprints/image_resizing/index.md12
-rw-r--r--doc/architecture/blueprints/object_storage/index.md32
-rw-r--r--doc/architecture/blueprints/pods/index.md32
-rw-r--r--doc/architecture/blueprints/rate_limiting/index.md48
-rw-r--r--doc/architecture/blueprints/runner_scaling/index.md11
-rw-r--r--doc/architecture/blueprints/work_items/index.md32
-rw-r--r--doc/architecture/index.md6
-rw-r--r--doc/ci/variables/where_variables_can_be_used.md1
-rw-r--r--doc/ci/yaml/index.md25
-rw-r--r--doc/development/documentation/styleguide/word_list.md8
-rw-r--r--doc/user/clusters/agent/install/index.md2
-rw-r--r--lib/api/api.rb2
-rw-r--r--lib/api/ci/triggers.rb3
-rw-r--r--lib/gitlab/ci/pipeline/chain/populate.rb6
-rw-r--r--lib/gitlab/ci/pipeline/seed/pipeline.rb4
-rw-r--r--lib/gitlab/database/tables_truncate.rb9
-rw-r--r--locale/gitlab.pot5
-rw-r--r--spec/contracts/contracts/project/pipeline/index/pipelines#index-get_list_project_pipelines.json3
-rw-r--r--spec/finders/autocomplete/users_finder_spec.rb49
-rw-r--r--spec/frontend/admin/signup_restrictions/components/signup_form_spec.js18
-rw-r--r--spec/frontend/admin/signup_restrictions/mock_data.js4
-rw-r--r--spec/frontend/filtered_search/droplab/plugins/ajax_filter_spec.js7
-rw-r--r--spec/frontend/jobs/components/job/sidebar_spec.js72
-rw-r--r--spec/frontend/jobs/mock_data.js1
-rw-r--r--spec/frontend/notes/mixins/discussion_navigation_spec.js2
-rw-r--r--spec/frontend/pipelines/mock_data.js2
-rw-r--r--spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_spec.js2
-rw-r--r--spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb19
-rw-r--r--spec/lib/gitlab/ci/pipeline/seed/pipeline_spec.rb12
-rw-r--r--spec/lib/gitlab/conflict/file_spec.rb25
-rw-r--r--spec/lib/gitlab/database/tables_truncate_spec.rb20
-rw-r--r--spec/models/ci/build_trace_chunk_spec.rb5
-rw-r--r--spec/models/ci/secure_file_spec.rb9
-rw-r--r--spec/presenters/ci/pipeline_presenter_spec.rb4
-rw-r--r--spec/requests/api/ci/triggers_spec.rb2
-rw-r--r--spec/serializers/ci/pipeline_entity_spec.rb7
-rw-r--r--spec/serializers/merge_requests/pipeline_entity_spec.rb7
-rw-r--r--spec/services/ci/create_pipeline_service/rules_spec.rb38
-rw-r--r--spec/support/helpers/test_env.rb2
75 files changed, 539 insertions, 583 deletions
diff --git a/Gemfile b/Gemfile
index 91f0c5f3336..ed250fa16ea 100644
--- a/Gemfile
+++ b/Gemfile
@@ -280,7 +280,7 @@ gem 'hangouts-chat', '~> 0.0.5', require: 'hangouts_chat'
gem 'asana', '~> 0.10.13'
# FogBugz integration
-gem 'ruby-fogbugz', '~> 0.2.1'
+gem 'ruby-fogbugz', '~> 0.3.0'
# Kubernetes integration
gem 'kubeclient', '~> 4.9.3'
diff --git a/Gemfile.checksum b/Gemfile.checksum
index ab35a36a185..642d3f89a92 100644
--- a/Gemfile.checksum
+++ b/Gemfile.checksum
@@ -501,7 +501,7 @@
{"name":"rubocop-performance","version":"1.14.3","platform":"ruby","checksum":"ee45ae3e40388ff809d9c5e2ef6ef9d59dc86c59c97110f96d5540267f860751"},
{"name":"rubocop-rails","version":"2.15.2","platform":"ruby","checksum":"1891ab46a6eaf36b841ad27c9c8a22e77a2c3ae85bc334111d3f8075e417643c"},
{"name":"rubocop-rspec","version":"2.12.1","platform":"ruby","checksum":"9278d22d4525261caf30d591eef3d47910a125e74f75f41ffa470acd208423f9"},
-{"name":"ruby-fogbugz","version":"0.2.1","platform":"ruby","checksum":"15b2e7fe7e95b021a94ee6e9d8bb32fdad6ae44e820c2ce0dc312fe6e77d40ca"},
+{"name":"ruby-fogbugz","version":"0.3.0","platform":"ruby","checksum":"5e04cde474648f498a71cf1e1a7ab42c66b953862fbe224f793ec0a7a1d5f657"},
{"name":"ruby-magic","version":"0.5.4","platform":"ruby","checksum":"2c17b185130d10a83791f63a40baa358c4b138af37da3f4dab53690121c421d5"},
{"name":"ruby-progressbar","version":"1.11.0","platform":"ruby","checksum":"cc127db3866dc414ffccbf92928a241e585b3aa2b758a5563e74a6ee0f57d50a"},
{"name":"ruby-saml","version":"1.13.0","platform":"ruby","checksum":"d31cbdf5fb8fdd6aa3187e48dba3085cfeb751af30276a5739aa3659a66f069c"},
diff --git a/Gemfile.lock b/Gemfile.lock
index c7543076468..654c5bbe340 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1251,8 +1251,9 @@ GEM
rubocop (>= 1.7.0, < 2.0)
rubocop-rspec (2.12.1)
rubocop (~> 1.31)
- ruby-fogbugz (0.2.1)
+ ruby-fogbugz (0.3.0)
crack (~> 0.4)
+ multipart-post (~> 2.0)
ruby-magic (0.5.4)
mini_portile2 (~> 2.6)
ruby-progressbar (1.11.0)
@@ -1773,7 +1774,7 @@ DEPENDENCIES
rspec_junit_formatter
rspec_profiling (~> 0.0.6)
rubocop
- ruby-fogbugz (~> 0.2.1)
+ ruby-fogbugz (~> 0.3.0)
ruby-magic (~> 0.5)
ruby-progressbar (~> 1.10)
ruby-saml (~> 1.13.0)
diff --git a/app/assets/javascripts/filtered_search/dropdown_user.js b/app/assets/javascripts/filtered_search/dropdown_user.js
index 26507a85fa8..fe580aab108 100644
--- a/app/assets/javascripts/filtered_search/dropdown_user.js
+++ b/app/assets/javascripts/filtered_search/dropdown_user.js
@@ -1,3 +1,4 @@
+import { ACTIVE_AND_BLOCKED_USER_STATES } from '~/users_select/constants';
import { addClassIfElementExists } from '../lib/utils/dom_utils';
import DropdownAjaxFilter from './dropdown_ajax_filter';
@@ -14,7 +15,7 @@ export default class DropdownUser extends DropdownAjaxFilter {
return {
...super.ajaxFilterConfig(),
params: {
- active: true,
+ states: ACTIVE_AND_BLOCKED_USER_STATES,
group_id: this.getGroupId(),
project_id: this.getProjectId(),
current_user: true,
diff --git a/app/assets/javascripts/filtered_search/droplab/plugins/ajax_filter.js b/app/assets/javascripts/filtered_search/droplab/plugins/ajax_filter.js
index d0f2d205bb6..d6abab4c9ed 100644
--- a/app/assets/javascripts/filtered_search/droplab/plugins/ajax_filter.js
+++ b/app/assets/javascripts/filtered_search/droplab/plugins/ajax_filter.js
@@ -1,6 +1,7 @@
/* eslint-disable */
import AjaxCache from '~/lib/utils/ajax_cache';
+import { mergeUrlParams } from '~/lib/utils/url_utility';
const AjaxFilter = {
init: function (hook) {
@@ -62,7 +63,7 @@ const AjaxFilter = {
this.loading = true;
var params = config.params || {};
params[config.searchKey] = searchValue;
- var url = config.endpoint + this.buildParams(params);
+ var url = mergeUrlParams(params, config.endpoint, { spreadArrays: true });
return AjaxCache.retrieve(url)
.then((data) => {
this._loadData(data, config);
diff --git a/app/assets/javascripts/jobs/components/job/sidebar/sidebar.vue b/app/assets/javascripts/jobs/components/job/sidebar/sidebar.vue
index b0db48df01f..aac6a0ad6d3 100644
--- a/app/assets/javascripts/jobs/components/job/sidebar/sidebar.vue
+++ b/app/assets/javascripts/jobs/components/job/sidebar/sidebar.vue
@@ -63,10 +63,23 @@ export default {
commit() {
return this.job?.pipeline?.commit || {};
},
+ selectedStageData() {
+ return this.stages.find((val) => val.name === this.selectedStage);
+ },
shouldShowJobRetryForwardDeploymentModal() {
return this.job.retry_path && this.hasForwardDeploymentFailure;
},
},
+ watch: {
+ job(value, oldValue) {
+ const hasNewStatus = value.status.text !== oldValue.status.text;
+ const isCurrentStage = value?.stage === this.selectedStage;
+
+ if (hasNewStatus && isCurrentStage) {
+ this.fetchJobsForStage(this.selectedStageData);
+ }
+ },
+ },
methods: {
...mapActions(['fetchJobsForStage']),
},
diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js
index ca90eee69c7..b1a0baf8150 100644
--- a/app/assets/javascripts/lib/utils/url_utility.js
+++ b/app/assets/javascripts/lib/utils/url_utility.js
@@ -178,7 +178,7 @@ export function mergeUrlParams(params, url, options = {}) {
const mergedKeys = sort ? Object.keys(merged).sort() : Object.keys(merged);
const newQuery = mergedKeys
- .filter((key) => merged[key] !== null)
+ .filter((key) => merged[key] !== null && merged[key] !== undefined)
.map((key) => {
let value = merged[key];
const encodedKey = encodeURIComponent(key);
diff --git a/app/assets/javascripts/notes/mixins/discussion_navigation.js b/app/assets/javascripts/notes/mixins/discussion_navigation.js
index d75a4158440..c4d542083bd 100644
--- a/app/assets/javascripts/notes/mixins/discussion_navigation.js
+++ b/app/assets/javascripts/notes/mixins/discussion_navigation.js
@@ -2,7 +2,7 @@ import { mapGetters, mapActions, mapState } from 'vuex';
import { scrollToElement, contentTop } from '~/lib/utils/common_utils';
function getAllDiscussionElements() {
- const containerEl = window.mrTabs?.currentAction === 'diffs' ? '.diffs' : '.notes';
+ const containerEl = window.mrTabs?.currentAction === 'diffs' ? '.diffs' : '.tab-pane.notes';
return Array.from(
document.querySelectorAll(
`${containerEl} div[data-discussion-id]:not([data-discussion-resolved])`,
diff --git a/app/assets/javascripts/pages/admin/application_settings/general/components/signup_form.vue b/app/assets/javascripts/pages/admin/application_settings/general/components/signup_form.vue
index 95c1f575fe4..b68148e5461 100644
--- a/app/assets/javascripts/pages/admin/application_settings/general/components/signup_form.vue
+++ b/app/assets/javascripts/pages/admin/application_settings/general/components/signup_form.vue
@@ -59,6 +59,8 @@ export default {
'emailRestrictions',
'afterSignUpText',
'pendingUserCount',
+ 'projectSharingHelpLink',
+ 'groupSharingHelpLink',
],
data() {
return {
@@ -83,6 +85,8 @@ export default {
supportedSyntaxLinkUrl: this.supportedSyntaxLinkUrl,
emailRestrictions: this.emailRestrictions,
afterSignUpText: this.afterSignUpText,
+ projectSharingHelpLink: this.projectSharingHelpLink,
+ groupSharingHelpLink: this.groupSharingHelpLink,
},
};
},
@@ -219,7 +223,7 @@ export default {
),
userCapLabel: s__('ApplicationSettings|User cap'),
userCapDescription: s__(
- 'ApplicationSettings|After the instance reaches the user cap, any user who is added or requests access must be approved by an administrator. Leave blank for unlimited.',
+ 'ApplicationSettings|After the instance reaches the user cap, any user who is added or requests access must be approved by an administrator. Leave blank for an unlimited user cap. If you change the user cap to unlimited, you must re-enable %{projectSharingLinkStart}project sharing%{projectSharingLinkEnd} and %{groupSharingLinkStart}group sharing%{groupSharingLinkEnd}.',
),
domainDenyListGroupLabel: s__('ApplicationSettings|Domain denylist'),
domainDenyListLabel: s__('ApplicationSettings|Enable domain denylist for sign-ups'),
@@ -308,6 +312,7 @@ export default {
<gl-form-group
:label="$options.i18n.userCapLabel"
:description="$options.i18n.userCapDescription"
+ data-testid="user-cap-form-group"
>
<gl-form-input
v-model="form.userCap"
@@ -315,6 +320,17 @@ export default {
name="application_setting[new_user_signups_cap]"
data-testid="user-cap-input"
/>
+
+ <template #description>
+ <gl-sprintf :message="$options.i18n.userCapDescription">
+ <template #projectSharingLink="{ content }">
+ <gl-link :href="projectSharingHelpLink" target="_blank">{{ content }}</gl-link>
+ </template>
+ <template #groupSharingLink="{ content }">
+ <gl-link :href="groupSharingHelpLink" target="_blank">{{ content }}</gl-link>
+ </template>
+ </gl-sprintf>
+ </template>
</gl-form-group>
<gl-form-group :label="$options.i18n.minimumPasswordLengthLabel">
diff --git a/app/assets/javascripts/projects/commits/store/actions.js b/app/assets/javascripts/projects/commits/store/actions.js
index 603fdfdf80a..9365066418b 100644
--- a/app/assets/javascripts/projects/commits/store/actions.js
+++ b/app/assets/javascripts/projects/commits/store/actions.js
@@ -3,6 +3,7 @@ import { createAlert } from '~/flash';
import axios from '~/lib/utils/axios_utils';
import { joinPaths } from '~/lib/utils/url_utility';
import { __ } from '~/locale';
+import { ACTIVE_AND_BLOCKED_USER_STATES } from '~/users_select/constants';
import * as types from './mutation_types';
export default {
@@ -23,7 +24,7 @@ export default {
.get(joinPaths(gon.relative_url_root || '', '/-/autocomplete/users.json'), {
params: {
project_id: projectId,
- active: true,
+ states: ACTIVE_AND_BLOCKED_USER_STATES,
search: author,
},
})
diff --git a/app/assets/javascripts/projects/settings/api/access_dropdown_api.js b/app/assets/javascripts/projects/settings/api/access_dropdown_api.js
index 10f6c28a7bf..df99aac6b9e 100644
--- a/app/assets/javascripts/projects/settings/api/access_dropdown_api.js
+++ b/app/assets/javascripts/projects/settings/api/access_dropdown_api.js
@@ -12,7 +12,7 @@ const buildUrl = (urlRoot, url) => {
return newUrl;
};
-export const getUsers = (query) => {
+export const getUsers = (query, states) => {
return axios.get(buildUrl(gon.relative_url_root || '', USERS_PATH), {
params: {
search: query,
@@ -20,6 +20,7 @@ export const getUsers = (query) => {
active: true,
project_id: gon.current_project_id,
push_code: true,
+ states,
},
});
};
diff --git a/app/assets/javascripts/users_select/constants.js b/app/assets/javascripts/users_select/constants.js
index 6b91d7e7c10..c100c1f4ca5 100644
--- a/app/assets/javascripts/users_select/constants.js
+++ b/app/assets/javascripts/users_select/constants.js
@@ -7,4 +7,7 @@ export const AJAX_USERS_SELECT_PARAMS_MAP = {
current_user: 'showCurrentUser',
author_id: 'authorId',
skip_users: 'skipUsers',
+ states: 'states',
};
+
+export const ACTIVE_AND_BLOCKED_USER_STATES = ['active', 'blocked'];
diff --git a/app/assets/javascripts/users_select/index.js b/app/assets/javascripts/users_select/index.js
index a0550737e24..fbf7e0b3a86 100644
--- a/app/assets/javascripts/users_select/index.js
+++ b/app/assets/javascripts/users_select/index.js
@@ -29,27 +29,29 @@ function UsersSelect(currentUser, els, options = {}) {
}
}
- const { handleClick } = options;
+ const { handleClick, states } = options;
$els.each((i, dropdown) => {
const userSelect = this;
- const options = {};
const $dropdown = $(dropdown);
- options.projectId = $dropdown.data('projectId');
- options.groupId = $dropdown.data('groupId');
- options.showCurrentUser = $dropdown.data('currentUser');
- options.todoFilter = $dropdown.data('todoFilter');
- options.todoStateFilter = $dropdown.data('todoStateFilter');
- options.iid = $dropdown.data('iid');
- options.issuableType = $dropdown.data('issuableType');
- options.targetBranch = $dropdown.data('targetBranch');
- options.showSuggested = $dropdown.data('showSuggested');
+ const options = {
+ states,
+ projectId: $dropdown.data('projectId'),
+ groupId: $dropdown.data('groupId'),
+ showCurrentUser: $dropdown.data('currentUser'),
+ todoFilter: $dropdown.data('todoFilter'),
+ todoStateFilter: $dropdown.data('todoStateFilter'),
+ iid: $dropdown.data('iid'),
+ issuableType: $dropdown.data('issuableType'),
+ targetBranch: $dropdown.data('targetBranch'),
+ authorId: $dropdown.data('authorId'),
+ showSuggested: $dropdown.data('showSuggested'),
+ };
const showNullUser = $dropdown.data('nullUser');
const defaultNullUser = $dropdown.data('nullUserDefault');
const showMenuAbove = $dropdown.data('showMenuAbove');
const showAnyUser = $dropdown.data('anyUser');
const firstUser = $dropdown.data('firstUser');
- options.authorId = $dropdown.data('authorId');
const defaultLabel = $dropdown.data('defaultLabel');
const issueURL = $dropdown.data('issueUpdate');
const $selectbox = $dropdown.closest('.selectbox');
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
index fe69e96bd87..97c6de37054 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
@@ -200,7 +200,7 @@ export default {
data-testid="pipeline-info-container"
data-qa-selector="merge_request_pipeline_info_content"
>
- {{ pipeline.details.name }}
+ {{ pipeline.details.event_type_name || pipeline.details.name }}
<gl-link
:href="pipeline.path"
class="pipeline-id gl-font-weight-normal pipeline-number"
diff --git a/app/assets/stylesheets/page_bundles/merge_requests.scss b/app/assets/stylesheets/page_bundles/merge_requests.scss
index 29ab1f91b7c..4a5143befc5 100644
--- a/app/assets/stylesheets/page_bundles/merge_requests.scss
+++ b/app/assets/stylesheets/page_bundles/merge_requests.scss
@@ -269,7 +269,7 @@ $tabs-holder-z-index: 250;
position: -webkit-sticky;
position: sticky;
- top: var(--top-pos);
+ top: calc(var(--top-pos) + var(--performance-bar-height, 0px));
max-height: calc(100vh - var(--top-pos) - var(--system-header-height, 0px) - var(--performance-bar-height, 0px) - var(--review-bar-height, 0px));
.drag-handle {
diff --git a/app/finders/autocomplete/users_finder.rb b/app/finders/autocomplete/users_finder.rb
index 33d9a8a3dbc..bb91f84de99 100644
--- a/app/finders/autocomplete/users_finder.rb
+++ b/app/finders/autocomplete/users_finder.rb
@@ -12,7 +12,7 @@ module Autocomplete
attr_reader :current_user, :project, :group, :search, :skip_users,
:author_id, :todo_filter, :todo_state_filter,
- :filter_by_current_user
+ :filter_by_current_user, :states
def initialize(params:, current_user:, project:, group:)
@current_user = current_user
@@ -24,6 +24,7 @@ module Autocomplete
@todo_filter = params[:todo_filter]
@todo_state_filter = params[:todo_state_filter]
@filter_by_current_user = params[:current_user]
+ @states = params[:states] || ['active']
end
def execute
@@ -60,7 +61,8 @@ module Autocomplete
# reorder_by_name() is called _before_ optionally_search(), otherwise
# reorder_by_name will break the ORDER BY applied in optionally_search().
find_users
- .active
+ .where(state: states)
+ .non_internal
.reorder_by_name
.optionally_search(search, use_minimum_char_limit: use_minimum_char_limit)
.where_not_in(skip_users)
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index 9678d8bf2fd..b48f843135d 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -561,7 +561,9 @@ module ApplicationSettingsHelper
supported_syntax_link_url: 'https://github.com/google/re2/wiki/Syntax',
email_restrictions: @application_setting.email_restrictions.to_s,
after_sign_up_text: @application_setting[:after_sign_up_text].to_s,
- pending_user_count: pending_user_count
+ pending_user_count: pending_user_count,
+ project_sharing_help_link: help_page_path('user/group/access_and_permissions', anchor: 'prevent-a-project-from-being-shared-with-groups'),
+ group_sharing_help_link: help_page_path('user/group/access_and_permissions', anchor: 'prevent-group-sharing-outside-the-group-hierarchy')
}
end
end
diff --git a/app/models/ci/build_trace_chunk.rb b/app/models/ci/build_trace_chunk.rb
index 221a2284106..7baa98b59f9 100644
--- a/app/models/ci/build_trace_chunk.rb
+++ b/app/models/ci/build_trace_chunk.rb
@@ -10,7 +10,7 @@ module Ci
belongs_to :build, class_name: "Ci::Build", foreign_key: :build_id
- default_value_for :data_store, :redis_trace_chunks
+ attribute :data_store, default: :redis_trace_chunks
after_create { metrics.increment_trace_operation(operation: :chunked) }
diff --git a/app/models/ci/secure_file.rb b/app/models/ci/secure_file.rb
index ffff7eebbee..df38398e5a9 100644
--- a/app/models/ci/secure_file.rb
+++ b/app/models/ci/secure_file.rb
@@ -27,7 +27,7 @@ module Ci
serialize :metadata, Serializers::Json # rubocop:disable Cop/ActiveRecordSerialize
- default_value_for(:file_store) { Ci::SecureFileUploader.default_store }
+ attribute :file_store, default: -> { Ci::SecureFileUploader.default_store }
mount_file_store_uploader Ci::SecureFileUploader
diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb
index 5cdc6ff12cb..aa0cd476191 100644
--- a/app/presenters/ci/pipeline_presenter.rb
+++ b/app/presenters/ci/pipeline_presenter.rb
@@ -53,8 +53,7 @@ module Ci
}.freeze
end
- delegator_override :name
- def name
+ def event_type_name
# Currently, `merge_request_event_type` is the only source to name pipelines
# but this could be extended with the other types in the future.
localized_names.fetch(pipeline.merge_request_event_type, s_('Pipeline|Pipeline'))
diff --git a/app/serializers/ci/pipeline_entity.rb b/app/serializers/ci/pipeline_entity.rb
index 20aeb978520..8edb07e4f59 100644
--- a/app/serializers/ci/pipeline_entity.rb
+++ b/app/serializers/ci/pipeline_entity.rb
@@ -4,7 +4,7 @@ class Ci::PipelineEntity < Grape::Entity
include RequestAwareEntity
include Gitlab::Utils::StrongMemoize
- delegate :name, :failure_reason, :coverage, to: :presented_pipeline
+ delegate :event_type_name, :failure_reason, :coverage, to: :presented_pipeline
expose :id
expose :iid
@@ -40,7 +40,8 @@ class Ci::PipelineEntity < Grape::Entity
expose :stages, using: StageEntity
expose :duration
expose :finished_at
- expose :name
+ expose :event_type_name
+ expose :event_type_name, as: :name # To be removed in 15.7
end
expose :merge_request, if: -> (*) { has_presentable_merge_request? }, with: MergeRequestForPipelineEntity do |pipeline|
diff --git a/app/serializers/merge_requests/pipeline_entity.rb b/app/serializers/merge_requests/pipeline_entity.rb
index f4fb01604d0..9c2545a2834 100644
--- a/app/serializers/merge_requests/pipeline_entity.rb
+++ b/app/serializers/merge_requests/pipeline_entity.rb
@@ -17,8 +17,12 @@ class MergeRequests::PipelineEntity < Grape::Entity
expose :commit, using: CommitEntity
expose :details do
- expose :name do |pipeline|
- pipeline.present.name
+ expose :event_type_name do |pipeline|
+ pipeline.present.event_type_name
+ end
+
+ expose :name do |pipeline| # To be removed in 15.7
+ pipeline.present.event_type_name
end
expose :artifacts do |pipeline, options|
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index 432f338b5af..a68ae262686 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -10960,6 +10960,7 @@ Represents a ComplianceFramework associated with a Project.
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="complianceframeworkcolor"></a>`color` | [`String!`](#string) | Hexadecimal representation of compliance framework's label color. |
+| <a id="complianceframeworkdefault"></a>`default` | [`Boolean`](#boolean) | Default compliance framework for the group. |
| <a id="complianceframeworkdescription"></a>`description` | [`String!`](#string) | Description of the compliance framework. |
| <a id="complianceframeworkid"></a>`id` | [`ID!`](#id) | Compliance framework ID. |
| <a id="complianceframeworkname"></a>`name` | [`String!`](#string) | Name of the compliance framework. |
@@ -23422,6 +23423,7 @@ Attributes for defining a CI/CD variable.
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="complianceframeworkinputcolor"></a>`color` | [`String`](#string) | New color representation of the compliance framework in hex format. e.g. #FCA121. |
+| <a id="complianceframeworkinputdefault"></a>`default` | [`Boolean`](#boolean) | Set this compliance framework as the default framework for the group. |
| <a id="complianceframeworkinputdescription"></a>`description` | [`String`](#string) | New description for the compliance framework. |
| <a id="complianceframeworkinputname"></a>`name` | [`String`](#string) | New name for the compliance framework. |
| <a id="complianceframeworkinputpipelineconfigurationfullpath"></a>`pipelineConfigurationFullPath` | [`String`](#string) | Full path of the compliance pipeline configuration stored in a project repository, such as `.gitlab/.compliance-gitlab-ci.yml@compliance/hipaa` **(ULTIMATE)**. |
diff --git a/doc/api/pipeline_triggers.md b/doc/api/pipeline_triggers.md
index 1fc29d2a654..c039181d247 100644
--- a/doc/api/pipeline_triggers.md
+++ b/doc/api/pipeline_triggers.md
@@ -170,7 +170,7 @@ Supported attributes:
| `id` | integer/string | **{check-circle}** Yes | The ID or [URL-encoded path of the project](index.md#namespaced-path-encoding) owned by the authenticated user. |
| `ref` | string | **{check-circle}** Yes | The branch or tag to run the pipeline on. |
| `token` | string | **{check-circle}** Yes | The trigger token or CI/CD job token. |
-| `variables` | array | **{dotted-circle}** No | An [array of hashes](index.md#array-of-hashes) containing the variables available in the pipeline, matching the structure `[{ 'key': 'UPLOAD_TO_S3', 'variable_type': 'file', 'value': 'true' }, {'key': 'TEST', 'value': 'test variable'}]`. If `variable_type` is excluded, it defaults to `env_var`. |
+| `variables` | array | **{dotted-circle}** No | A map of key-valued strings containing the pipeline variables. For example: `{ VAR1: "value1", VAR2: "value2" }`. |
Example request:
diff --git a/doc/architecture/blueprints/_template.md b/doc/architecture/blueprints/_template.md
index 7637c3bf5fa..798d51a97ad 100644
--- a/doc/architecture/blueprints/_template.md
+++ b/doc/architecture/blueprints/_template.md
@@ -1,14 +1,11 @@
---
-stage: none
-group: unassigned
-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
status: proposed
creation-date: yyyy-mm-dd
authors: [ "@username" ]
coach: "@username"
-owning-section: "~section::<section>"
-participating-sections: []
approvers: [ "@product-manager", "@engineering-manager" ]
+owning-stage: "~devops::<stage>"
+participating-stages: []
---
<!--
diff --git a/doc/architecture/blueprints/ci_data_decay/index.md b/doc/architecture/blueprints/ci_data_decay/index.md
index f1942ceeb3f..e38fe26dc79 100644
--- a/doc/architecture/blueprints/ci_data_decay/index.md
+++ b/doc/architecture/blueprints/ci_data_decay/index.md
@@ -1,8 +1,11 @@
---
-stage: none
-group: unassigned
-comments: false
-description: 'CI/CD data time decay'
+status: ready
+creation-date: "2021-09-10"
+authors: [ "@grzesiek" ]
+coach: "@kamil"
+approvers: [ "@jporter", "@cheryl.li" ]
+owning-stage: "~devops::verify"
+participating-stages: []
---
# CI/CD data time decay
@@ -246,35 +249,3 @@ In progress.
- 2022-04-30: Additional [benchmarking started](https://gitlab.com/gitlab-org/gitlab/-/issues/361019) to evaluate impact.
- 2022-06-31: [Pipeline partitioning design](pipeline_partitioning.md) document [merge request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/87683) merged.
- 2022-09-01: Engineering effort started to implement partitioning.
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Grzegorz Bizon |
-| Engineering Leader | Cheryl Li |
-| Product Manager | Jackie Porter |
-| Architecture Evolution Coach | Kamil Trzciński |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Leadership | Cheryl Li |
-| Product | Jackie Porter |
-| Engineering | Grzegorz Bizon |
-
-Domain experts:
-
-| Area | Who
-|------------------------------|------------------------|
-| Verify / Pipeline execution | Fabio Pitino |
-| Verify / Pipeline execution | Marius Bobin |
-| Verify / Pipeline insights | Maxime Orefice |
-| PostgreSQL Database | Andreas Brandl |
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/ci_pipeline_components/index.md b/doc/architecture/blueprints/ci_pipeline_components/index.md
index 6e5ab8040ae..a3c72227f3e 100644
--- a/doc/architecture/blueprints/ci_pipeline_components/index.md
+++ b/doc/architecture/blueprints/ci_pipeline_components/index.md
@@ -1,12 +1,13 @@
---
-stage: Stage
-group: Pipeline Authoring
-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
-comments: false
-description: 'Create a catalog of shareable pipeline constructs'
+status: proposed
+creation-date: "2022-09-14"
+authors: [ "@fabio", "@grzesiek" ]
+coach: "@kamil"
+approvers: [ "@dov" ]
+owning-stage: "~devops::verify"
+participating-stages: []
---
-
# CI/CD pipeline components catalog
## Summary
@@ -187,35 +188,3 @@ Some limits we could consider adding:
- Allow self-managed administrators to populate their self-managed catalog by importing/updating
components from GitLab.com or from repository exports.
- Iterate on feedback.
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Fabio Pitino |
-| Engineering Leader | ? |
-| Product Manager | Dov Hershkovitch |
-| Architecture Evolution Coach | Kamil Trzciński |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Leadership | ? |
-| Product | Dov Hershkovitch |
-| Engineering | ? |
-| UX | Nadia Sotnikova |
-
-Domain experts:
-
-| Area | Who
-|------------------------------|------------------------|
-| Verify / Pipeline authoring | Avielle Wolfe |
-| Verify / Pipeline authoring | Furkan Ayhan |
-| Verify / Pipeline execution | Fabio Pitino |
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/cloud_native_build_logs/index.md b/doc/architecture/blueprints/cloud_native_build_logs/index.md
index df807d45694..20cfb46abc4 100644
--- a/doc/architecture/blueprints/cloud_native_build_logs/index.md
+++ b/doc/architecture/blueprints/cloud_native_build_logs/index.md
@@ -1,9 +1,11 @@
---
-stage: none
-group: unassigned
-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
-comments: false
-description: 'Next iteration of build logs architecture at GitLab'
+status: implemented
+creation-date: "2020-08-26"
+authors: [ "@grzesiek" ]
+coach: "@kamil"
+approvers: [ "@thaoyeager", "@darbyfrey" ]
+owning-stage: "~devops::release"
+participating-stages: []
---
# Cloud Native Build Logs
@@ -121,27 +123,3 @@ Enabling this feature on GitLab.com is a subtask of
This change has been implemented and enabled on GitLab.com.
We are working on [an epic to make this feature more resilient and observable](https://gitlab.com/groups/gitlab-org/-/epics/4860).
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Grzegorz Bizon |
-| Architecture Evolution Coach | Gerardo Lopez-Fernandez |
-| Engineering Leader | Darby Frey |
-| Domain Expert | Kamil Trzciński |
-| Domain Expert | Sean McGivern |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Product | Thao Yeager |
-| Leadership | Darby Frey |
-| Engineering | Grzegorz Bizon |
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/cloud_native_gitlab_pages/index.md b/doc/architecture/blueprints/cloud_native_gitlab_pages/index.md
index 127badabb71..b6f3a59dc0b 100644
--- a/doc/architecture/blueprints/cloud_native_gitlab_pages/index.md
+++ b/doc/architecture/blueprints/cloud_native_gitlab_pages/index.md
@@ -1,9 +1,11 @@
---
-stage: none
-group: unassigned
-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
-comments: false
-description: 'Making GitLab Pages a Cloud Native application - architecture blueprint.'
+status: implemented
+creation-date: "2019-05-16"
+authors: [ "@grzesiek" ]
+coach: "@kamil"
+approvers: [ "@ogolowinski", "@dcroft", "@vshushlin" ]
+owning-stage: "~devops::release"
+participating-stages: []
---
# GitLab Pages New Architecture
@@ -100,38 +102,3 @@ too.
[GitLab Pages Architecture](https://gitlab.com/groups/gitlab-org/-/epics/1316)
epic with detailed roadmap is also available.
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Grzegorz Bizon |
-| Architecture Evolution Coach | Kamil Trzciński |
-| Engineering Leader | Daniel Croft |
-| Domain Expert | Grzegorz Bizon |
-| Domain Expert | Vladimir Shushlin |
-| Domain Expert | Jaime Martinez |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Product | Orit Golowinski |
-| Leadership | Daniel Croft |
-| Engineering | Vladimir Shushlin |
-
-Domain Experts:
-
-| Role | Who
-|------------------------------|------------------------|
-| Domain Expert | Kamil Trzciński |
-| Domain Expert | Grzegorz Bizon |
-| Domain Expert | Vladimir Shushlin |
-| Domain Expert | Jaime Martinez |
-| Domain Expert | Krasimir Angelov |
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/composable_codebase_using_rails_engines/index.md b/doc/architecture/blueprints/composable_codebase_using_rails_engines/index.md
index 4111e2ef056..8b39f2f9934 100644
--- a/doc/architecture/blueprints/composable_codebase_using_rails_engines/index.md
+++ b/doc/architecture/blueprints/composable_codebase_using_rails_engines/index.md
@@ -1,9 +1,11 @@
---
-stage: none
-group: unassigned
-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
-comments: false
-description: 'Making a GitLab codebase composable - allowing to run parts of the application'
+status: proposed
+creation-date: "2021-05-19"
+authors: [ "@kamil", "@mkaeppler" ]
+coach: "@glopezfernandez"
+approvers: []
+owning-stage: "~devops::non_devops"
+participating-stages: []
---
NOTE:
@@ -585,33 +587,3 @@ to be created to ensure that we do not have explosion of engines.
- [Use nested structure to organize CI classes](https://gitlab.com/gitlab-org/gitlab/-/issues/209745)
- [WIP: Make it simple to build and use "Decoupled Services"](https://gitlab.com/gitlab-org/gitlab/-/issues/31121)
- [Rails takes awhile to boot, let's see if we can improve this](https://gitlab.com/gitlab-org/gitlab/-/issues/213992)
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Kamil Trzciński |
-| Architecture Evolution Coach | ? |
-| Engineering Leader | ? |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Product | ? |
-| Leadership | Craig Gomes |
-| Engineering | ? |
-
-Domain Experts:
-
-| Role | Who
-|------------------------------|------------------------|
-| Domain Expert | Nikola Milojevic |
-| Domain Expert | ? |
-| Domain Expert | ? |
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/consolidating_groups_and_projects/index.md b/doc/architecture/blueprints/consolidating_groups_and_projects/index.md
index 433c23bf188..0818d9b973d 100644
--- a/doc/architecture/blueprints/consolidating_groups_and_projects/index.md
+++ b/doc/architecture/blueprints/consolidating_groups_and_projects/index.md
@@ -1,9 +1,11 @@
---
-stage: none
-group: unassigned
-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
-comments: false
-description: Consolidating groups and projects
+status: proposed
+creation-date: "2021-02-07"
+authors: [ "@alexpooley", "@ifarkas" ]
+coach: "@grzesiek"
+approvers: [ "@m_gill", "@mushakov" ]
+owning-stage: "~devops::plan"
+participating-stages: []
---
# Consolidating Groups and Projects
@@ -143,34 +145,6 @@ The initial iteration will provide a framework to house features under `Namespac
- Start small: What are the product changes that need to be made to assist with the migration?
- Move fast: Prioritise these solution ideas, document in issues, and create a roadmap for implementation.
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------------------|
-| Author | Alex Pooley, Imre Farkas |
-| Architecture Evolution Coach | Dmitriy Zaporozhets, Grzegorz Bizon |
-| Engineering Leader | Michelle Gill |
-| Domain Expert | Jan Provaznik |
-
-<!-- vale gitlab.Spelling = YES -->
-
-DRIs:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|------------------------|
-| Product | Melissa Ushakov |
-| Leadership | Michelle Gill |
-| Engineering | Imre Farkas |
-| Design | Nick Post |
-
-<!-- vale gitlab.Spelling = YES -->
-
## Related topics
- [Workspace developer documentation](../../../development/workspace/index.md)
diff --git a/doc/architecture/blueprints/container_registry_metadata_database/index.md b/doc/architecture/blueprints/container_registry_metadata_database/index.md
index 40549ca68a0..63e27286756 100644
--- a/doc/architecture/blueprints/container_registry_metadata_database/index.md
+++ b/doc/architecture/blueprints/container_registry_metadata_database/index.md
@@ -1,9 +1,11 @@
---
-stage: Package
-group: Container Registry
-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
-comments: false
-description: 'Container Registry metadata database'
+status: implemented
+creation-date: "2020-09-29"
+authors: [ "@jdrpereira" ]
+coach: "@glopezfernandez"
+approvers: [ "@trizzi", "@hswimelar" ]
+owning-stage: "~devops::package"
+participating-stages: []
---
# Container Registry Metadata Database
@@ -344,24 +346,3 @@ A more detailed list of all tasks, as well as periodic progress updates can be f
- [Gradual migration proposal for the GitLab.com container registry](https://gitlab.com/gitlab-org/container-registry/-/issues/191)
- [Create a self-serve registry deployment](https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/316)
- [Database cluster for container registry](https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/11154)
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | João Pereira |
-| Architecture Evolution Coach | Gerardo Lopez-Fernandez |
-| Engineering Leader | |
-| Domain Expert | Hayley Swimelar |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Product | Tim Rizzi |
-| Leadership | |
-| Engineering | João Pereira |
diff --git a/doc/architecture/blueprints/database_testing/index.md b/doc/architecture/blueprints/database_testing/index.md
index 3f8041ea416..fe6dcf1723d 100644
--- a/doc/architecture/blueprints/database_testing/index.md
+++ b/doc/architecture/blueprints/database_testing/index.md
@@ -1,9 +1,11 @@
---
-stage: none
-group: unassigned
-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
-comments: false
-description: 'Database Testing'
+status: accepted
+creation-date: "2021-02-08"
+authors: [ "@abrandl" ]
+coach: "@glopezfernandez"
+approvers: [ "@fabian", "@craig-gomes" ]
+owning-stage: "~devops::data_stores"
+participating-stages: []
---
# Database Testing
@@ -122,26 +124,3 @@ An alternative approach we have discussed and abandoned is to "scrub" and anonym
- Annotating data as "sensitive" is error prone, with the wrong anonymization approach used for a data type or one sensitive attribute accidentally not marked as such possibly leading to a data breach.
- Scrubbing not only removes sensitive data, but it also changes data distribution, which greatly affects performance of migrations and queries.
- Scrubbing heavily changes the database contents, potentially updating a lot of data, which leads to different data storage details (think MVC bloat), affecting performance of migrations and queries.
-
-## Who
-
-<!-- vale gitlab.Spelling = NO -->
-
-This effort is owned and driven by the [GitLab Database Team](https://about.gitlab.com/handbook/engineering/development/enablement/data_stores/database/) with support from the [GitLab.com Reliability Datastores](https://about.gitlab.com/handbook/engineering/infrastructure/team/reliability/) team.
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Andreas Brandl |
-| Architecture Evolution Coach | Gerardo Lopez-Fernandez |
-| Engineering Leader | Craig Gomes |
-| Domain Expert | Yannis Roussos |
-| Domain Expert | Pat Bair |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Product | Fabian Zimmer |
-| Engineering | Andreas Brandl |
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/feature_flags_development/index.md b/doc/architecture/blueprints/feature_flags_development/index.md
index 866be9d8a70..730daf56f0d 100644
--- a/doc/architecture/blueprints/feature_flags_development/index.md
+++ b/doc/architecture/blueprints/feature_flags_development/index.md
@@ -1,9 +1,11 @@
---
-stage: none
-group: unassigned
-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
-comments: false
-description: 'Internal usage of Feature Flags for GitLab development'
+status: accepted
+creation-date: "2020-06-10"
+authors: [ "@kamil" ]
+coach: "@glopezfernandez"
+approvers: [ "@kencjohnston", "@craig-gomes" ]
+owning-stage: "~devops::non_devops"
+participating-stages: []
---
# Architectural discussion of feature flags
@@ -118,26 +120,3 @@ These are reason why these changes are needed:
This work is being done as part of dedicated epic:
[Improve internal usage of Feature Flags](https://gitlab.com/groups/gitlab-org/-/epics/3551).
This epic describes a meta reasons for making these changes.
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Kamil Trzciński |
-| Architecture Evolution Coach | Gerardo Lopez-Fernandez |
-| Engineering Leader | Kamil Trzciński |
-| Domain Expert | Shinya Maeda |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Product | Kenny Johnston |
-| Leadership | Craig Gomes |
-| Engineering | Kamil Trzciński |
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/gitlab_to_kubernetes_communication/index.md b/doc/architecture/blueprints/gitlab_to_kubernetes_communication/index.md
index 19fd995bead..6ac67dd0f18 100644
--- a/doc/architecture/blueprints/gitlab_to_kubernetes_communication/index.md
+++ b/doc/architecture/blueprints/gitlab_to_kubernetes_communication/index.md
@@ -1,9 +1,11 @@
---
-stage: Configure
-group: Configure
-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
-comments: false
-description: 'GitLab to Kubernetes communication'
+status: implemented
+creation-date: "2020-12-03"
+authors: [ "@ash2k" ]
+coach: "@andrewn"
+approvers: [ "@nicholasklick", "@nagyv-gitlab" ]
+owning-stage: "~devops::configure"
+participating-stages: []
---
# GitLab to Kubernetes communication **(FREE)**
@@ -137,28 +139,3 @@ flowchart LR
### Iterations
Iterations are tracked in [the dedicated epic](https://gitlab.com/groups/gitlab-org/-/epics/4591).
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Mikhail Mazurskiy |
-| Architecture Evolution Coach | Andrew Newdigate |
-| Engineering Leader | Nicholas Klick |
-| Domain Expert | Thong Kuah |
-| Domain Expert | Graeme Gillies |
-| Security Expert | Vitor Meireles De Sousa |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Product Lead | Viktor Nagy |
-| Engineering Leader | Nicholas Klick |
-| Domain Expert | Mikhail Mazurskiy |
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/graphql_api/index.md b/doc/architecture/blueprints/graphql_api/index.md
index 1ee322c412b..baa926c5847 100644
--- a/doc/architecture/blueprints/graphql_api/index.md
+++ b/doc/architecture/blueprints/graphql_api/index.md
@@ -1,8 +1,11 @@
---
-stage: none
-group: unassigned
-comments: false
-description: 'GraphQL API architecture foundation'
+status: accepted
+creation-date: "2021-01-07"
+authors: [ "@grzesiek" ]
+coach: "@kamil"
+approvers: [ "@dsatcher", "@deuley" ]
+owning-stage: "~devops::ecosystem"
+participating-stages: []
---
# GraphQL API
@@ -155,43 +158,3 @@ state synchronization mechanisms and hooking into existing ones.
1. [Build a scalable state synchronization for GraphQL](https://gitlab.com/groups/gitlab-org/-/epics/5319)
1. [Add support for direct uploads for GraphQL](https://gitlab.com/gitlab-org/gitlab/-/issues/280819)
1. [Review GraphQL design choices related to security](https://gitlab.com/gitlab-org/security/gitlab/-/issues/339)
-
-## Status
-
-Current status: in progress.
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Grzegorz Bizon |
-| Architecture Evolution Coach | Kamil Trzciński |
-| Engineering Leader | Darva Satcher |
-| Product Manager | Patrick Deuley |
-| Domain Expert / GraphQL | Charlie Ablett |
-| Domain Expert / GraphQL | Alex Kalderimis |
-| Domain Expert / GraphQL | Natalia Tepluhina |
-| Domain Expert / Scalability | Bob Van Landuyt |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Leadership | Darva Satcher |
-| Product | Patrick Deuley |
-| Engineering | Paul Slaughter |
-
-Domain Experts:
-
-| Area | Who
-|------------------------------|------------------------|
-| Domain Expert / GraphQL | Charlie Ablett |
-| Domain Expert / GraphQL | Alex Kalderimis |
-| Domain Expert / GraphQL | Natalia Tepluhina |
-| Domain Expert / Scalability | Bob Van Landuyt |
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/image_resizing/index.md b/doc/architecture/blueprints/image_resizing/index.md
index dd7ce27f459..948378d8834 100644
--- a/doc/architecture/blueprints/image_resizing/index.md
+++ b/doc/architecture/blueprints/image_resizing/index.md
@@ -1,9 +1,11 @@
---
-stage: none
-group: unassigned
-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
-comments: false
-description: 'Image Resizing'
+status: implemented
+creation-date: "2020-10-21"
+authors: [ "@craig-gomes" ]
+coach: "@kamil"
+approvers: [ "@timzallmann", "@joshlambert" ]
+owning-stage: "~devops::non_devops"
+participating-stages: []
---
# Image resizing for avatars and content images
diff --git a/doc/architecture/blueprints/object_storage/index.md b/doc/architecture/blueprints/object_storage/index.md
index 7a4ecd0e5a8..61dc37d7706 100644
--- a/doc/architecture/blueprints/object_storage/index.md
+++ b/doc/architecture/blueprints/object_storage/index.md
@@ -1,8 +1,11 @@
---
-stage: none
-group: unassigned
-comments: false
-description: 'Object storage: direct_upload consolidation - architecture blueprint.'
+status: ready
+creation-date: "2021-11-18"
+authors: [ "@nolith" ]
+coach: "@glopezfernandez"
+approvers: [ "@marin" ]
+owning-stage: "~devops::data_stores"
+participating-stages: []
---
# Object storage: `direct_upload` consolidation
@@ -197,24 +200,3 @@ require one bucket.
- [Speed up the monolith, building a smart reverse proxy in Go](https://archive.fosdem.org/2020/schedule/event/speedupmonolith/): a presentation explaining a bit of workhorse history and the challenge we faced in releasing the first cloud-native installation.
- [Object Storage improvements epic](https://gitlab.com/groups/gitlab-org/-/epics/483).
- We are moving to GraphQL API, but [we do not support direct upload](https://gitlab.com/gitlab-org/gitlab/-/issues/280819).
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who |
-|--------------------------------|-------------------------|
-| Author | Alessio Caiazza |
-| Architecture Evolution Coach | Gerardo Lopez-Fernandez |
-| Engineering Leader | Marin Jankovski |
-| Domain Expert / Object storage | Stan Hu |
-| Domain Expert / Security | Joern Schneeweisz |
-
-DRIs:
-
-The DRI for this blueprint is the
-[Object Storage Working Group](https://about.gitlab.com/company/team/structure/working-groups/object-storage/).
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/pods/index.md b/doc/architecture/blueprints/pods/index.md
index 5129ae3a046..bfe95d91cbc 100644
--- a/doc/architecture/blueprints/pods/index.md
+++ b/doc/architecture/blueprints/pods/index.md
@@ -1,15 +1,15 @@
---
-stage: enablement
-group: pods
-comments: false
-description: 'Pods'
+status: accepted
+creation-date: "2022-09-07"
+authors: [ "@fzimmer", "@DylanGriffith" ]
+coach: "@kamil"
+approvers: [ "@fzimmer" ]
+owning-stage: "~devops::enablement"
+participating-stages: []
---
# Pods
-DISCLAIMER:
-This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.
-
This document is a work-in-progress and represents a very early state of the Pods design. Significant aspects are not documented, though we expect to add them in the future.
## Summary
@@ -265,21 +265,3 @@ This section links all different technical proposals that are being evaluated.
- [Database Group investigation](https://about.gitlab.com/handbook/engineering/development/enablement/data_stores/database/doc/root-namespace-sharding.html)
- [Shopify Pods architecture](https://shopify.engineering/a-pods-architecture-to-allow-shopify-to-scale)
- [Opstrace architecture](https://gitlab.com/gitlab-org/opstrace/opstrace/-/blob/main/docs/architecture/overview.md)
-
-## Who
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Fabian Zimmer |
-| Architecture Evolution Coach | Kamil Trzciński |
-| Engineering Leader | TBD |
-| Product Manager | Fabian Zimmer |
-| Domain Expert / Database | TBD |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Leadership | TBD |
-| Product | Fabian Zimmer |
-| Engineering | Thong Kuah |
diff --git a/doc/architecture/blueprints/rate_limiting/index.md b/doc/architecture/blueprints/rate_limiting/index.md
index ec99f48c986..e38635be8ca 100644
--- a/doc/architecture/blueprints/rate_limiting/index.md
+++ b/doc/architecture/blueprints/rate_limiting/index.md
@@ -1,8 +1,11 @@
---
-stage: none
-group: unassigned
-comments: false
-description: 'Next Rate Limiting Architecture'
+status: ready
+creation-date: "2022-09-08"
+authors: [ "@grzesiek", "@marshall007", "@fabiopitino", "@hswimelar" ]
+coach: "@andrewn"
+approvers: [ "@sgoldstein" ]
+owning-stage:
+participating-stages: []
---
# Next Rate Limiting Architecture
@@ -398,40 +401,3 @@ Request For Comments.
- 2022-07-06: A fourth, [consolidated proposal](https://gitlab.com/gitlab-org/gitlab/-/issues/364524#note_1017640650), has been submitted.
- 2022-07-12: Started working on the design document following [Architecture Evolution Workflow](https://about.gitlab.com/handbook/engineering/architecture/workflow/).
- 2022-09-08: The initial version of the blueprint has been merged.
-- 2022-09-21: Plan for phases and iterations has been established.
-
-## Who
-
-Proposal:
-
-<!-- vale gitlab.Spelling = NO -->
-
-| Role | Who
-|------------------------------|-------------------------|
-| Author | Grzegorz Bizon |
-| Author | Fabio Pitino |
-| Author | Marshall Cottrell |
-| Author | Hayley Swimelar |
-| Engineering Leader | Sam Goldstein |
-| Product Manager | |
-| Architecture Evolution Coach | Andrew Newdigate |
-| Recommender | |
-| Recommender | |
-| Recommender | |
-| Recommender | |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Leadership | |
-| Product | |
-| Engineering | |
-
-Domain experts:
-
-| Area | Who
-|------------------------------|------------------------|
-| | |
-
-<!-- vale gitlab.Spelling = YES -->
diff --git a/doc/architecture/blueprints/runner_scaling/index.md b/doc/architecture/blueprints/runner_scaling/index.md
index 415884449ed..eafa187dbd1 100644
--- a/doc/architecture/blueprints/runner_scaling/index.md
+++ b/doc/architecture/blueprints/runner_scaling/index.md
@@ -1,8 +1,11 @@
---
-stage: none
-group: unassigned
-comments: false
-description: 'Next Runner Auto-scaling Architecture'
+status: accepted
+creation-date: "2022-01-19"
+authors: [ "@grzesiek", "@tmaczukin", "@josephburnett" ]
+coach: "@kamil"
+approvers: [ "@DarrenEastman" ]
+owning-stage: "~devops::verify"
+participating-stages: []
---
# Next Runner Auto-scaling Architecture
diff --git a/doc/architecture/blueprints/work_items/index.md b/doc/architecture/blueprints/work_items/index.md
index 42864e7112e..ee9688eeb39 100644
--- a/doc/architecture/blueprints/work_items/index.md
+++ b/doc/architecture/blueprints/work_items/index.md
@@ -1,8 +1,11 @@
---
-stage: Plan
-group: Project Management
-comments: false
-description: 'Work Items'
+status: accepted
+creation-date: "2022-09-28"
+authors: [ "@ntepluhina" ]
+coach: "@kamil"
+approvers: [ "@gweaver" ]
+owning-stage: "~devops::plan"
+participating-stages: []
---
# Work Items
@@ -107,24 +110,3 @@ Work Item architecture is designed with making all the features for all the type
- [Tasks roadmap](https://gitlab.com/groups/gitlab-org/-/epics/7103?_gl=1*zqatx*_ga*NzUyOTc3NTc1LjE2NjEzNDcwMDQ.*_ga_ENFH3X7M5Y*MTY2MjU0MDQ0MC43LjEuMTY2MjU0MDc2MC4wLjAuMA..)
- [Work Item "Vision" Prototype](https://gitlab.com/gitlab-org/gitlab/-/issues/368607)
- [Work Item Discussions](https://gitlab.com/groups/gitlab-org/-/epics/7060)
-
-### Who
-
-| Role | Who
-|------------------------------|-----------------------------|
-| Author | Natalia Tepluhina |
-| Architecture Evolution Coach | Kamil Trzciński |
-| Engineering Leader | TBD |
-| Product Manager | Gabe Weaver |
-| Domain Expert / Frontend | Natalia Tepluhina |
-| Domain Expert / Backend | Heinrich Lee Yu |
-| Domain Expert / Backend | Jan Provaznik |
-| Domain Expert / Backend | Mario Celi |
-
-DRIs:
-
-| Role | Who
-|------------------------------|------------------------|
-| Leadership | TBD |
-| Product | Gabe Weaver |
-| Engineering | TBD |
diff --git a/doc/architecture/index.md b/doc/architecture/index.md
index 643f5766b0a..689ff2afaa0 100644
--- a/doc/architecture/index.md
+++ b/doc/architecture/index.md
@@ -1,9 +1,7 @@
---
-stage: none
-group: unassigned
-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
+feedback: false
comments: false
-description: 'Architecture Practice at GitLab'
+toc: false
---
# Architecture at GitLab
diff --git a/doc/ci/variables/where_variables_can_be_used.md b/doc/ci/variables/where_variables_can_be_used.md
index 25ce4259883..beb35645492 100644
--- a/doc/ci/variables/where_variables_can_be_used.md
+++ b/doc/ci/variables/where_variables_can_be_used.md
@@ -43,6 +43,7 @@ There are two places defined variables can be used. On the:
| [`tags`](../yaml/index.md#tags) | yes | GitLab | The variable expansion is made by the [internal variable expansion mechanism](#gitlab-internal-variable-expansion-mechanism) in GitLab. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/35742) in GitLab 14.1. |
| [`trigger` and `trigger:project`](../yaml/index.md#trigger) | yes | GitLab | The variable expansion is made by the [internal variable expansion mechanism](#gitlab-internal-variable-expansion-mechanism) in GitLab. Variable expansion for `trigger:project` [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/367660) in GitLab 15.3. |
| [`variables`](../yaml/index.md#variables) | yes | GitLab/Runner | The variable expansion is first made by the [internal variable expansion mechanism](#gitlab-internal-variable-expansion-mechanism) in GitLab, and then any unrecognized or unavailable variables are expanded by GitLab Runner's [internal variable expansion mechanism](#gitlab-runner-internal-variable-expansion-mechanism). |
+| [`workflow:name`](../yaml/index.md#workflowname) | yes | GitLab | The variable expansion is made by the [internal variable expansion mechanism](#gitlab-internal-variable-expansion-mechanism) in GitLab.<br/><br/>Supported are all variables available in `workflow`:<br/>- Project/Group variables.<br/>- Global `variables` and `workflow:rules:variables` (when matching the rule).<br/>- Variables inherited from parent pipelines.<br/>- Variables from triggers.<br/>- Variables from pipeline schedules.<br/><br/>Not supported are variables defined in the GitLab Runner `config.toml`, variables defined in jobs, or [Persisted variables](#persisted-variables). |
### `config.toml` file
diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md
index 3882bc67199..cdb6dc88446 100644
--- a/doc/ci/yaml/index.md
+++ b/doc/ci/yaml/index.md
@@ -414,12 +414,33 @@ All pipelines are assigned the defined name. Any leading or trailing spaces in t
**Possible inputs**:
- A string.
+- [CI/CD variables](../variables/where_variables_can_be_used.md#gitlab-ciyml-file).
+- A combination of both.
+
+**Examples of `workflow:name`**:
+
+A simple pipeline name with a predefined variable:
+
+```yaml
+workflow:
+ name: 'Pipeline for branch: $CI_COMMIT_BRANCH'
+```
-**Example of `workflow:name`**:
+A configuration with different pipeline names depending on the pipeline conditions:
```yaml
+variables:
+ PIPELINE_NAME: 'Default pipeline name'
+
workflow:
- name: 'Pipeline name'
+ name: '$PIPELINE_NAME'
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ variables:
+ PIPELINE_NAME: 'MR pipeline: $CI_COMMIT_BRANCH'
+ - if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3/'
+ variables:
+ PIPELINE_NAME: 'Ruby 3 pipeline'
```
#### `workflow:rules`
diff --git a/doc/development/documentation/styleguide/word_list.md b/doc/development/documentation/styleguide/word_list.md
index 96f7a59b6b6..e1780a24dbe 100644
--- a/doc/development/documentation/styleguide/word_list.md
+++ b/doc/development/documentation/styleguide/word_list.md
@@ -477,6 +477,10 @@ Do not use **foo** in product documentation. You can use it in our API and contr
When possible, use present tense instead of future tense. For example, use **after you execute this command, GitLab displays the result** instead of **after you execute this command, GitLab will display the result**. ([Vale](../testing.md#vale) rule: [`FutureTense.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/FutureTense.yml))
+## GB, gigabytes
+
+For **GB** and **MB**, follow the [Microsoft guidance](https://learn.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/bits-bytes-terms).
+
## Geo
Use title case for **Geo**.
@@ -718,6 +722,10 @@ Do not use `master`. Use `main` when you need a sample [default branch name](#de
**Might** means something has the probability of occurring. **May** gives permission to do something. Consider **can** instead of **may**.
+## MB, megabytes
+
+For **MB** and **GB**, follow the [Microsoft guidance](https://learn.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/bits-bytes-terms).
+
## me, myself, mine
Do not use first-person singular. Use **you**, **we**, or **us** instead. ([Vale](../testing.md#vale) rule: [`FirstPerson.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/FirstPerson.yml))
diff --git a/doc/user/clusters/agent/install/index.md b/doc/user/clusters/agent/install/index.md
index b8dfc777551..2030052e3b0 100644
--- a/doc/user/clusters/agent/install/index.md
+++ b/doc/user/clusters/agent/install/index.md
@@ -92,7 +92,7 @@ You must register an agent before you can install the agent in your cluster. To
- If you already have an [agent configuration file](#create-an-agent-configuration-file), select it from the list.
1. Select **Register an agent**.
1. GitLab generates an access token for the agent. You need this token to install the agent
- in your cluster and to [update the agent](#update-the-agent-version) to another version.
+ in your cluster.
WARNING:
Securely store the agent access token. A bad actor can use this token to access source code in the agent's configuration project, access source code in any public project on the GitLab instance, or even, under very specific conditions, obtain a Kubernetes manifest.
diff --git a/lib/api/api.rb b/lib/api/api.rb
index 089278ab383..fda0e2fdf4e 100644
--- a/lib/api/api.rb
+++ b/lib/api/api.rb
@@ -171,6 +171,7 @@ module API
namespace do
mount ::API::AccessRequests
mount ::API::Metadata
+ mount ::API::UserCounts
add_open_api_documentation!
end
@@ -322,7 +323,6 @@ module API
mount ::API::UsageData
mount ::API::UsageDataNonSqlMetrics
mount ::API::UsageDataQueries
- mount ::API::UserCounts
mount ::API::Users
mount ::API::Wikis
mount ::API::Ml::Mlflow
diff --git a/lib/api/ci/triggers.rb b/lib/api/ci/triggers.rb
index c49f1c9e9e1..0531b17cf97 100644
--- a/lib/api/ci/triggers.rb
+++ b/lib/api/ci/triggers.rb
@@ -20,7 +20,8 @@ module API
params do
requires :ref, type: String, desc: 'The commit sha or name of a branch or tag', allow_blank: false
requires :token, type: String, desc: 'The unique token of trigger or job token'
- optional :variables, type: Hash, desc: 'The list of variables to be injected into build'
+ optional :variables, type: Hash, desc: 'The list of variables to be injected into build',
+ documentation: { type: Object, additional_properties: String }
end
post ":id/(ref/:ref/)trigger/pipeline", requirements: { ref: /.+/ } do
Gitlab::QueryLimiting.disable!('https://gitlab.com/gitlab-org/gitlab/-/issues/20758')
diff --git a/lib/gitlab/ci/pipeline/chain/populate.rb b/lib/gitlab/ci/pipeline/chain/populate.rb
index d1f57ca68e7..3f8745b4ab1 100644
--- a/lib/gitlab/ci/pipeline/chain/populate.rb
+++ b/lib/gitlab/ci/pipeline/chain/populate.rb
@@ -41,10 +41,16 @@ module Gitlab
@command.yaml_processor_result.workflow_name.blank?
name = @command.yaml_processor_result.workflow_name
+ name = ExpandVariables.expand(name, -> { global_context.variables.sort_and_expand_all })
pipeline.build_pipeline_metadata(project: pipeline.project, name: name)
end
+ def global_context
+ Gitlab::Ci::Build::Context::Global.new(
+ pipeline, yaml_variables: @command.pipeline_seed.root_variables)
+ end
+
def stage_names
# We filter out `.pre/.post` stages, as they alone are not considered
# a complete pipeline:
diff --git a/lib/gitlab/ci/pipeline/seed/pipeline.rb b/lib/gitlab/ci/pipeline/seed/pipeline.rb
index e1a15fb8d5b..9e609debeed 100644
--- a/lib/gitlab/ci/pipeline/seed/pipeline.rb
+++ b/lib/gitlab/ci/pipeline/seed/pipeline.rb
@@ -32,6 +32,10 @@ module Gitlab
end
end
+ def root_variables
+ @context.root_variables
+ end
+
private
def stage_seeds
diff --git a/lib/gitlab/database/tables_truncate.rb b/lib/gitlab/database/tables_truncate.rb
index 164520fbab3..8380bf23899 100644
--- a/lib/gitlab/database/tables_truncate.rb
+++ b/lib/gitlab/database/tables_truncate.rb
@@ -14,7 +14,7 @@ module Gitlab
end
def execute
- raise "Cannot truncate legacy tables in single-db setup" unless Gitlab::Database.has_config?(:ci)
+ raise "Cannot truncate legacy tables in single-db setup" if single_database_setup?
raise "database is not supported" unless %w[main ci].include?(database_name)
logger&.info "DRY RUN:" if dry_run
@@ -91,6 +91,13 @@ module Gitlab
end
end
end
+
+ def single_database_setup?
+ return true unless Gitlab::Database.has_config?(:ci)
+
+ ci_base_model = Gitlab::Database.database_base_models[:ci]
+ !!Gitlab::Database.db_config_share_with(ci_base_model.connection_db_config)
+ end
end
end
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 9b8a5311130..77a95032c31 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -4674,7 +4674,7 @@ msgstr ""
msgid "ApplicationSettings|After sign-up text"
msgstr ""
-msgid "ApplicationSettings|After the instance reaches the user cap, any user who is added or requests access must be approved by an administrator. Leave blank for unlimited."
+msgid "ApplicationSettings|After the instance reaches the user cap, any user who is added or requests access must be approved by an administrator. Leave blank for an unlimited user cap. If you change the user cap to unlimited, you must re-enable %{projectSharingLinkStart}project sharing%{projectSharingLinkEnd} and %{groupSharingLinkStart}group sharing%{groupSharingLinkEnd}."
msgstr ""
msgid "ApplicationSettings|Allowed domains for sign-ups"
@@ -7661,6 +7661,9 @@ msgstr ""
msgid "Cannot delete %{profile_name} referenced in security policy"
msgstr ""
+msgid "Cannot delete the default framework"
+msgstr ""
+
msgid "Cannot have multiple Jira imports running at the same time"
msgstr ""
diff --git a/spec/contracts/contracts/project/pipeline/index/pipelines#index-get_list_project_pipelines.json b/spec/contracts/contracts/project/pipeline/index/pipelines#index-get_list_project_pipelines.json
index b725ae400a7..2a01d85c0ee 100644
--- a/spec/contracts/contracts/project/pipeline/index/pipelines#index-get_list_project_pipelines.json
+++ b/spec/contracts/contracts/project/pipeline/index/pipelines#index-get_list_project_pipelines.json
@@ -335,6 +335,9 @@
"$.body.pipelines[*].details.name": {
"match": "type"
},
+ "$.body.pipelines[*].details.event_type_name": {
+ "match": "type"
+ },
"$.body.pipelines[*].details.manual_actions": {
"min": 1
},
diff --git a/spec/finders/autocomplete/users_finder_spec.rb b/spec/finders/autocomplete/users_finder_spec.rb
index de031041e18..57f804e471f 100644
--- a/spec/finders/autocomplete/users_finder_spec.rb
+++ b/spec/finders/autocomplete/users_finder_spec.rb
@@ -8,7 +8,8 @@ RSpec.describe Autocomplete::UsersFinder do
describe '#execute' do
let_it_be(:user1) { create(:user, name: 'zzzzzname', username: 'johndoe') }
- let_it_be(:user2) { create(:user, :blocked, username: 'notsorandom') }
+ let_it_be(:blocked_user) { create(:user, :blocked, username: 'blocked_user') }
+ let_it_be(:banned_user) { create(:user, :banned, username: 'banned_user') }
let_it_be(:external_user) { create(:user, :external) }
let_it_be(:omniauth_user) { create(:omniauth_user, provider: 'twitter', extern_uid: '123456') }
@@ -39,7 +40,13 @@ RSpec.describe Autocomplete::UsersFinder do
end
context 'and author is blocked' do
- let(:params) { { author_id: user2.id } }
+ let(:params) { { author_id: blocked_user.id } }
+
+ it { is_expected.to match_array([project.first_owner]) }
+ end
+
+ context 'and author is banned' do
+ let(:params) { { author_id: banned_user.id } }
it { is_expected.to match_array([project.first_owner]) }
end
@@ -108,7 +115,7 @@ RSpec.describe Autocomplete::UsersFinder do
end
context 'when filtered by skip_users' do
- let(:params) { { skip_users: [omniauth_user.id, current_user.id] } }
+ let(:params) { { skip_users: [omniauth_user.id, current_user.id, blocked_user] } }
it { is_expected.to match_array([user1, external_user]) }
end
@@ -139,10 +146,10 @@ RSpec.describe Autocomplete::UsersFinder do
end
context 'when filtered by current_user' do
- let(:current_user) { user2 }
+ let(:current_user) { blocked_user }
let(:params) { { current_user: true } }
- it { is_expected.to match_array([user2, user1, external_user, omniauth_user]) }
+ it { is_expected.to match_array([blocked_user, user1, external_user, omniauth_user]) }
end
context 'when filtered by author_id' do
@@ -155,5 +162,37 @@ RSpec.describe Autocomplete::UsersFinder do
associations = subject.map { |user| user.association(:status) }
expect(associations).to all(be_loaded)
end
+
+ context 'when filtered by state' do
+ context "searching without states" do
+ let(:params) { { states: nil } }
+
+ it { is_expected.to match_array([user1, external_user, omniauth_user, current_user]) }
+ end
+
+ context "searching with states=active" do
+ let(:params) { { states: %w[active] } }
+
+ it { is_expected.to match_array([user1, external_user, omniauth_user, current_user]) }
+ end
+
+ context "searching with states=blocked" do
+ let(:params) { { states: %w[blocked] } }
+
+ it { is_expected.to match_array([blocked_user]) }
+ end
+
+ context "searching with states=banned" do
+ let(:params) { { states: %w[banned] } }
+
+ it { is_expected.to match_array([banned_user]) }
+ end
+
+ context "searching with states=blocked,banned" do
+ let(:params) { { states: %w[blocked banned] } }
+
+ it { is_expected.to match_array([blocked_user, banned_user]) }
+ end
+ end
end
end
diff --git a/spec/frontend/admin/signup_restrictions/components/signup_form_spec.js b/spec/frontend/admin/signup_restrictions/components/signup_form_spec.js
index 411126d0c89..e6718f62b91 100644
--- a/spec/frontend/admin/signup_restrictions/components/signup_form_spec.js
+++ b/spec/frontend/admin/signup_restrictions/components/signup_form_spec.js
@@ -1,4 +1,4 @@
-import { GlButton, GlModal } from '@gitlab/ui';
+import { GlButton, GlModal, GlLink } from '@gitlab/ui';
import { within } from '@testing-library/dom';
import { shallowMount, mount, createWrapper } from '@vue/test-utils';
import { stubComponent } from 'helpers/stub_component';
@@ -36,6 +36,7 @@ describe('Signup Form', () => {
const findDenyListRawInputGroup = () => wrapper.findByTestId('domain-denylist-raw-input-group');
const findDenyListFileInputGroup = () => wrapper.findByTestId('domain-denylist-file-input-group');
const findUserCapInput = () => wrapper.findByTestId('user-cap-input');
+ const findUserCapFormGroup = () => wrapper.findByTestId('user-cap-form-group');
const findModal = () => wrapper.findComponent(GlModal);
afterEach(() => {
@@ -214,4 +215,19 @@ describe('Signup Form', () => {
});
});
});
+
+ describe('rendering help links within user cap description', () => {
+ beforeEach(() => {
+ mountComponent({ mountFn: mount });
+ });
+
+ it('renders projectSharingHelpLink and groupSharingHelpLink', () => {
+ const [projectSharingLink, groupSharingLink] = findUserCapFormGroup().findAllComponents(
+ GlLink,
+ ).wrappers;
+
+ expect(projectSharingLink.attributes('href')).toBe(mockData.projectSharingHelpLink);
+ expect(groupSharingLink.attributes('href')).toBe(mockData.groupSharingHelpLink);
+ });
+ });
});
diff --git a/spec/frontend/admin/signup_restrictions/mock_data.js b/spec/frontend/admin/signup_restrictions/mock_data.js
index 62e931d9163..dd1ed317497 100644
--- a/spec/frontend/admin/signup_restrictions/mock_data.js
+++ b/spec/frontend/admin/signup_restrictions/mock_data.js
@@ -23,6 +23,8 @@ export const rawMockData = {
passwordLowercaseRequired: 'true',
passwordUppercaseRequired: 'true',
passwordSymbolRequired: 'true',
+ projectSharingHelpLink: 'project-sharing/help/link',
+ groupSharingHelpLink: 'group-sharing/help/link',
};
export const mockData = {
@@ -50,4 +52,6 @@ export const mockData = {
passwordLowercaseRequired: true,
passwordUppercaseRequired: true,
passwordSymbolRequired: true,
+ projectSharingHelpLink: 'project-sharing/help/link',
+ groupSharingHelpLink: 'group-sharing/help/link',
};
diff --git a/spec/frontend/filtered_search/droplab/plugins/ajax_filter_spec.js b/spec/frontend/filtered_search/droplab/plugins/ajax_filter_spec.js
index 212b9ffc8f9..c958f669f9a 100644
--- a/spec/frontend/filtered_search/droplab/plugins/ajax_filter_spec.js
+++ b/spec/frontend/filtered_search/droplab/plugins/ajax_filter_spec.js
@@ -10,6 +10,9 @@ describe('AjaxFilter', () => {
dummyConfig = {
endpoint: 'dummy endpoint',
searchKey: 'dummy search key',
+ searchValueFunction() {
+ return 'test';
+ },
};
dummyList = {
data: [],
@@ -40,7 +43,7 @@ describe('AjaxFilter', () => {
it('calls onLoadingFinished after loading data', async () => {
ajaxSpy = (url) => {
- expect(url).toBe('dummy endpoint?dummy search key=');
+ expect(url).toBe('dummy endpoint?dummy%20search%20key=test');
return Promise.resolve(dummyData);
};
@@ -51,7 +54,7 @@ describe('AjaxFilter', () => {
it('does not call onLoadingFinished if Ajax call fails', async () => {
const dummyError = new Error('My dummy is sick! :-(');
ajaxSpy = (url) => {
- expect(url).toBe('dummy endpoint?dummy search key=');
+ expect(url).toBe('dummy endpoint?dummy%20search%20key=test');
return Promise.reject(dummyError);
};
diff --git a/spec/frontend/jobs/components/job/sidebar_spec.js b/spec/frontend/jobs/components/job/sidebar_spec.js
index dc1aa67489d..27911eb76eb 100644
--- a/spec/frontend/jobs/components/job/sidebar_spec.js
+++ b/spec/frontend/jobs/components/job/sidebar_spec.js
@@ -1,6 +1,9 @@
import { shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue';
+import MockAdapter from 'axios-mock-adapter';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
+import axios from '~/lib/utils/axios_utils';
+import httpStatus from '~/lib/utils/http_status';
import ArtifactsBlock from '~/jobs/components/job/sidebar/artifacts_block.vue';
import JobRetryForwardDeploymentModal from '~/jobs/components/job/sidebar/job_retry_forward_deployment_modal.vue';
import JobsContainer from '~/jobs/components/job/sidebar/jobs_container.vue';
@@ -10,6 +13,7 @@ import createStore from '~/jobs/store';
import job, { jobsInStage } from '../../mock_data';
describe('Sidebar details block', () => {
+ let mock;
let store;
let wrapper;
@@ -18,6 +22,8 @@ describe('Sidebar details block', () => {
const findArtifactsBlock = () => wrapper.findComponent(ArtifactsBlock);
const findNewIssueButton = () => wrapper.findByTestId('job-new-issue');
const findTerminalLink = () => wrapper.findByTestId('terminal-link');
+ const findJobStagesDropdown = () => wrapper.findComponent(StagesDropdown);
+ const findJobsContainer = () => wrapper.findComponent(JobsContainer);
const createWrapper = (props) => {
store = createStore();
@@ -35,6 +41,13 @@ describe('Sidebar details block', () => {
);
};
+ beforeEach(() => {
+ mock = new MockAdapter(axios);
+ mock.onGet().reply(httpStatus.OK, {
+ name: job.stage,
+ });
+ });
+
afterEach(() => {
wrapper.destroy();
});
@@ -110,31 +123,72 @@ describe('Sidebar details block', () => {
describe('stages dropdown', () => {
beforeEach(() => {
createWrapper();
- return store.dispatch('receiveJobSuccess', { ...job, stage: 'aStage' });
+ return store.dispatch('receiveJobSuccess', job);
});
describe('with stages', () => {
it('renders value provided as selectedStage as selected', () => {
- expect(wrapper.findComponent(StagesDropdown).props('selectedStage')).toBe('aStage');
+ expect(findJobStagesDropdown().props('selectedStage')).toBe(job.stage);
});
});
describe('without jobs for stages', () => {
- beforeEach(() => store.dispatch('receiveJobSuccess', job));
-
it('does not render jobs container', () => {
- expect(wrapper.findComponent(JobsContainer).exists()).toBe(false);
+ expect(findJobsContainer().exists()).toBe(false);
});
});
describe('with jobs for stages', () => {
+ beforeEach(() => {
+ return store.dispatch('receiveJobsForStageSuccess', jobsInStage.latest_statuses);
+ });
+
+ it('renders list of jobs', async () => {
+ expect(findJobsContainer().exists()).toBe(true);
+ });
+ });
+
+ describe('when job data changes', () => {
+ const stageArg = job.pipeline.details.stages.find((stage) => stage.name === job.stage);
+
beforeEach(async () => {
- await store.dispatch('receiveJobSuccess', job);
- await store.dispatch('receiveJobsForStageSuccess', jobsInStage.latest_statuses);
+ jest.spyOn(store, 'dispatch');
});
- it('renders list of jobs', () => {
- expect(wrapper.findComponent(JobsContainer).exists()).toBe(true);
+ describe('and the job stage is currently selected', () => {
+ describe('when the status changed', () => {
+ it('refetch the jobs list for the stage', async () => {
+ await store.dispatch('receiveJobSuccess', { ...job, status: 'new' });
+
+ expect(store.dispatch).toHaveBeenNthCalledWith(2, 'fetchJobsForStage', { ...stageArg });
+ });
+ });
+
+ describe('when the status did not change', () => {
+ it('does not refetch the jobs list for the stage', async () => {
+ await store.dispatch('receiveJobSuccess', { ...job });
+
+ expect(store.dispatch).toHaveBeenCalledTimes(1);
+ expect(store.dispatch).toHaveBeenNthCalledWith(1, 'receiveJobSuccess', {
+ ...job,
+ });
+ });
+ });
+ });
+
+ describe('and the job stage is not currently selected', () => {
+ it('does not refetch the jobs list for the stage', async () => {
+ // Setting stage to `random` on the job means that we are looking
+ // at `build` stage currently, but the job we are seeing in the logs
+ // belong to `random`, so we shouldn't have to refetch
+ await store.dispatch('receiveJobSuccess', { ...job, stage: 'random' });
+
+ expect(store.dispatch).toHaveBeenCalledTimes(1);
+ expect(store.dispatch).toHaveBeenNthCalledWith(1, 'receiveJobSuccess', {
+ ...job,
+ stage: 'random',
+ });
+ });
});
});
});
diff --git a/spec/frontend/jobs/mock_data.js b/spec/frontend/jobs/mock_data.js
index bf238b2e39a..1dfd43ad21a 100644
--- a/spec/frontend/jobs/mock_data.js
+++ b/spec/frontend/jobs/mock_data.js
@@ -925,6 +925,7 @@ export default {
locked: false,
},
name: 'test',
+ stage: 'build',
build_path: '/root/ci-mock/-/jobs/4757',
retry_path: '/root/ci-mock/-/jobs/4757/retry',
cancel_path: '/root/ci-mock/-/jobs/4757/cancel',
diff --git a/spec/frontend/notes/mixins/discussion_navigation_spec.js b/spec/frontend/notes/mixins/discussion_navigation_spec.js
index 45625d0a23f..81e4ed3ebe7 100644
--- a/spec/frontend/notes/mixins/discussion_navigation_spec.js
+++ b/spec/frontend/notes/mixins/discussion_navigation_spec.js
@@ -34,7 +34,7 @@ describe('Discussion navigation mixin', () => {
beforeEach(() => {
setHTMLFixture(
- `<div class="notes">
+ `<div class="tab-pane notes">
${[...'abcde']
.map(
(id) =>
diff --git a/spec/frontend/pipelines/mock_data.js b/spec/frontend/pipelines/mock_data.js
index 57d1511d859..26e04903163 100644
--- a/spec/frontend/pipelines/mock_data.js
+++ b/spec/frontend/pipelines/mock_data.js
@@ -835,6 +835,7 @@ export const mockPipelineTag = () => {
],
duration: 93,
finished_at: '2022-02-02T15:40:59.384Z',
+ event_type_name: 'Pipeline',
name: 'Pipeline',
manual_actions: [],
scheduled_actions: [],
@@ -1041,6 +1042,7 @@ export const mockPipelineBranch = () => {
],
duration: 75,
finished_at: '2022-01-14T18:02:35.842Z',
+ event_type_name: 'Pipeline',
name: 'Pipeline',
manual_actions: [],
scheduled_actions: [],
diff --git a/spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_spec.js b/spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_spec.js
index 7f0173b7445..144e176b0f0 100644
--- a/spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_spec.js
+++ b/spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_spec.js
@@ -222,6 +222,7 @@ describe('MRWidgetPipeline', () => {
beforeEach(() => {
({ pipeline } = JSON.parse(JSON.stringify(mockData)));
+ pipeline.details.event_type_name = 'Pipeline';
pipeline.details.name = 'Pipeline';
pipeline.merge_request_event_type = undefined;
pipeline.ref.tag = false;
@@ -263,6 +264,7 @@ describe('MRWidgetPipeline', () => {
describe('for a detached merge request pipeline', () => {
it('renders a pipeline widget that reads "Merge request pipeline <ID> <status> for <SHA>"', () => {
+ pipeline.details.event_type_name = 'Merge request pipeline';
pipeline.details.name = 'Merge request pipeline';
pipeline.merge_request_event_type = 'detached';
diff --git a/spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
index 4161e92dfe2..67b2498488f 100644
--- a/spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
@@ -277,6 +277,25 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Populate do
expect(pipeline.pipeline_metadata).to be_nil
end
end
+
+ context 'with variables' do
+ let(:config) do
+ {
+ variables: { ROOT_VAR: 'value $WORKFLOW_VAR1' },
+ workflow: {
+ name: 'Pipeline $ROOT_VAR $WORKFLOW_VAR2 $UNKNOWN_VAR',
+ rules: [{ variables: { WORKFLOW_VAR1: 'value1', WORKFLOW_VAR2: 'value2' } }]
+ },
+ rspec: { script: 'rspec' }
+ }
+ end
+
+ it 'substitutes variables' do
+ run_chain
+
+ expect(pipeline.pipeline_metadata.name).to eq('Pipeline value value1 value2 ')
+ end
+ end
end
end
end
diff --git a/spec/lib/gitlab/ci/pipeline/seed/pipeline_spec.rb b/spec/lib/gitlab/ci/pipeline/seed/pipeline_spec.rb
index a76b4874eca..55980ae72a0 100644
--- a/spec/lib/gitlab/ci/pipeline/seed/pipeline_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/seed/pipeline_spec.rb
@@ -6,7 +6,9 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Pipeline do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
- let(:seed_context) { Gitlab::Ci::Pipeline::Seed::Context.new(pipeline, root_variables: []) }
+ let(:root_variables) { [] }
+
+ let(:seed_context) { Gitlab::Ci::Pipeline::Seed::Context.new(pipeline, root_variables: root_variables) }
let(:stages_attributes) do
[
@@ -75,4 +77,12 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Pipeline do
expect(seed.deployments_count).to eq(2)
end
end
+
+ describe '#root_variables' do
+ let(:root_variables) { %w[var1 value1] }
+
+ it 'returns root_variables' do
+ expect(seed.root_variables).to eq(root_variables)
+ end
+ end
end
diff --git a/spec/lib/gitlab/conflict/file_spec.rb b/spec/lib/gitlab/conflict/file_spec.rb
index 1fa6eee9813..165305476d2 100644
--- a/spec/lib/gitlab/conflict/file_spec.rb
+++ b/spec/lib/gitlab/conflict/file_spec.rb
@@ -3,18 +3,15 @@
require 'spec_helper'
RSpec.describe Gitlab::Conflict::File do
- include GitHelpers
-
let(:project) { create(:project, :repository) }
let(:repository) { project.repository }
- let(:rugged) { rugged_repo(repository) }
- let(:their_commit) { rugged.branches['conflict-start'].target }
- let(:our_commit) { rugged.branches['conflict-resolvable'].target }
+ let(:their_commit) { TestEnv::BRANCH_SHA['conflict-start'] }
+ let(:our_commit) { TestEnv::BRANCH_SHA['conflict-resolvable'] }
let(:merge_request) { create(:merge_request, source_branch: 'conflict-resolvable', target_branch: 'conflict-start', source_project: project) }
- let(:index) { rugged.merge_commits(our_commit, their_commit) }
- let(:rugged_conflict) { index.conflicts.last }
- let(:raw_conflict_content) { index.merge_file('files/ruby/regex.rb')[:data] }
- let(:raw_conflict_file) { Gitlab::Git::Conflict::File.new(repository, our_commit.oid, rugged_conflict, raw_conflict_content) }
+ let(:conflicts_client) { repository.gitaly_conflicts_client(our_commit, their_commit) }
+ let(:raw_conflict_files) { conflicts_client.list_conflict_files }
+ let(:conflict_file_name) { 'files/ruby/regex.rb' }
+ let(:raw_conflict_file) { raw_conflict_files.find { |conflict| conflict.our_path == conflict_file_name } }
let(:conflict_file) { described_class.new(raw_conflict_file, merge_request: merge_request) }
describe 'delegates' do
@@ -137,8 +134,7 @@ RSpec.describe Gitlab::Conflict::File do
end
context 'when there are unchanged trailing lines' do
- let(:rugged_conflict) { index.conflicts.first }
- let(:raw_conflict_content) { index.merge_file('files/ruby/popen.rb')[:data] }
+ let(:conflict_file_name) { 'files/ruby/popen.rb' }
it 'assign conflict types and adds match line to the end of the section' do
expect(diff_line_types).to eq(
@@ -294,6 +290,8 @@ RSpec.describe Gitlab::Conflict::File do
FILE
end
+ let(:conflict) { { ancestor: { path: '' }, theirs: { path: conflict_file_name }, ours: { path: conflict_file_name } } }
+ let(:raw_conflict_file) { Gitlab::Git::Conflict::File.new(repository, our_commit, conflict, raw_conflict_content) }
let(:sections) { conflict_file.sections }
it 'sets the correct match line headers' do
@@ -324,7 +322,7 @@ RSpec.describe Gitlab::Conflict::File do
describe '#as_json' do
it 'includes the blob path for the file' do
expect(conflict_file.as_json[:blob_path])
- .to eq("/#{project.full_path}/-/blob/#{our_commit.oid}/files/ruby/regex.rb")
+ .to eq("/#{project.full_path}/-/blob/#{our_commit}/files/ruby/regex.rb")
end
it 'includes the blob icon for the file' do
@@ -341,7 +339,8 @@ RSpec.describe Gitlab::Conflict::File do
describe '#conflict_type' do
using RSpec::Parameterized::TableSyntax
- let(:rugged_conflict) { { ancestor: { path: ancestor_path }, theirs: { path: their_path }, ours: { path: our_path } } }
+ let(:conflict) { { ancestor: { path: ancestor_path }, theirs: { path: their_path }, ours: { path: our_path } } }
+ let(:raw_conflict_file) { Gitlab::Git::Conflict::File.new(repository, our_commit, conflict, '') }
let(:diff_file) { double(renamed_file?: renamed_file?) }
subject(:conflict_type) { conflict_file.conflict_type(diff_file) }
diff --git a/spec/lib/gitlab/database/tables_truncate_spec.rb b/spec/lib/gitlab/database/tables_truncate_spec.rb
index 01af9efd782..4f68cd93a8e 100644
--- a/spec/lib/gitlab/database/tables_truncate_spec.rb
+++ b/spec/lib/gitlab/database/tables_truncate_spec.rb
@@ -233,6 +233,26 @@ RSpec.describe Gitlab::Database::TablesTruncate, :reestablished_active_record_ba
it_behaves_like 'truncating legacy tables on a database'
end
+ context 'when running with multiple shared databases' do
+ before do
+ skip_if_multiple_databases_not_setup
+ ci_db_config = Ci::ApplicationRecord.connection_db_config
+ allow(::Gitlab::Database).to receive(:db_config_share_with).with(ci_db_config).and_return('main')
+ end
+
+ it 'raises an error when truncating the main database that it is a single database setup' do
+ expect do
+ described_class.new(database_name: 'main', min_batch_size: min_batch_size).execute
+ end.to raise_error(/Cannot truncate legacy tables in single-db setup/)
+ end
+
+ it 'raises an error when truncating the ci database that it is a single database setup' do
+ expect do
+ described_class.new(database_name: 'ci', min_batch_size: min_batch_size).execute
+ end.to raise_error(/Cannot truncate legacy tables in single-db setup/)
+ end
+ end
+
context 'when running in a single database mode' do
before do
skip_if_multiple_databases_are_setup
diff --git a/spec/models/ci/build_trace_chunk_spec.rb b/spec/models/ci/build_trace_chunk_spec.rb
index e08fe196d65..3328ed62f15 100644
--- a/spec/models/ci/build_trace_chunk_spec.rb
+++ b/spec/models/ci/build_trace_chunk_spec.rb
@@ -29,6 +29,11 @@ RSpec.describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state, :clean_git
}[data_store]
end
+ describe 'default attributes' do
+ it { expect(described_class.new.data_store).to eq('redis_trace_chunks') }
+ it { expect(described_class.new(data_store: :fog).data_store).to eq('fog') }
+ end
+
describe 'chunk creation' do
let(:metrics) { spy('metrics') }
diff --git a/spec/models/ci/secure_file_spec.rb b/spec/models/ci/secure_file_spec.rb
index 2445babb5f2..4413bd8e98b 100644
--- a/spec/models/ci/secure_file_spec.rb
+++ b/spec/models/ci/secure_file_spec.rb
@@ -21,6 +21,15 @@ RSpec.describe Ci::SecureFile do
subject { build(:ci_secure_file, project: create(:project)) }
end
+ describe 'default attributes' do
+ before do
+ allow(Ci::SecureFileUploader).to receive(:default_store).and_return(5)
+ end
+
+ it { expect(described_class.new.file_store).to eq(5) }
+ it { expect(described_class.new(file_store: 3).file_store).to eq(3) }
+ end
+
describe 'validations' do
it { is_expected.to validate_presence_of(:checksum) }
it { is_expected.to validate_presence_of(:file_store) }
diff --git a/spec/presenters/ci/pipeline_presenter_spec.rb b/spec/presenters/ci/pipeline_presenter_spec.rb
index 4539c3d06f6..7f4c8120e17 100644
--- a/spec/presenters/ci/pipeline_presenter_spec.rb
+++ b/spec/presenters/ci/pipeline_presenter_spec.rb
@@ -90,12 +90,12 @@ RSpec.describe Ci::PipelinePresenter do
end
end
- describe '#name' do
+ describe '#event_type_name' do
before do
allow(pipeline).to receive(:merge_request_event_type) { event_type }
end
- subject { presenter.name }
+ subject { presenter.event_type_name }
context 'for a detached merge request pipeline' do
let(:event_type) { :detached }
diff --git a/spec/requests/api/ci/triggers_spec.rb b/spec/requests/api/ci/triggers_spec.rb
index 953dcb8a483..f9b7880a4c4 100644
--- a/spec/requests/api/ci/triggers_spec.rb
+++ b/spec/requests/api/ci/triggers_spec.rb
@@ -81,7 +81,7 @@ RSpec.describe API::Ci::Triggers do
end
it 'validates variables needs to be a map of key-valued strings' do
- post api("/projects/#{project.id}/trigger/pipeline"), params: options.merge(variables: { key: %w(1 2) }, ref: 'master')
+ post api("/projects/#{project.id}/trigger/pipeline"), params: options.merge(variables: { 'TRIGGER_KEY' => %w(1 2) }, ref: 'master')
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['message']).to eq('variables needs to be a map of key-valued strings')
diff --git a/spec/serializers/ci/pipeline_entity_spec.rb b/spec/serializers/ci/pipeline_entity_spec.rb
index 808dc38f653..7889ac03f8f 100644
--- a/spec/serializers/ci/pipeline_entity_spec.rb
+++ b/spec/serializers/ci/pipeline_entity_spec.rb
@@ -31,10 +31,15 @@ RSpec.describe Ci::PipelineEntity do
end
it 'contains details' do
+ allow(pipeline).to receive(:merge_request_event_type).and_return(:merged_result)
+
expect(subject).to include :details
expect(subject[:details])
- .to include :duration, :finished_at, :name
+ .to include :duration, :finished_at, :name, :event_type_name
expect(subject[:details][:status]).to include :icon, :favicon, :text, :label, :tooltip
+
+ expect(subject[:details][:event_type_name]).to eq('Merged result pipeline')
+ expect(subject[:details][:name]).to eq('Merged result pipeline')
end
it 'contains flags' do
diff --git a/spec/serializers/merge_requests/pipeline_entity_spec.rb b/spec/serializers/merge_requests/pipeline_entity_spec.rb
index ee99ab2e7dd..31ebe738743 100644
--- a/spec/serializers/merge_requests/pipeline_entity_spec.rb
+++ b/spec/serializers/merge_requests/pipeline_entity_spec.rb
@@ -25,15 +25,20 @@ RSpec.describe MergeRequests::PipelineEntity do
describe '#as_json' do
it 'contains required fields' do
+ allow(pipeline).to receive(:merge_request_event_type).and_return(:merged_result)
+
is_expected.to include(
:id, :path, :active, :coverage, :ref, :commit, :details,
:flags, :triggered, :triggered_by
)
expect(subject[:commit]).to include(:short_id, :commit_path)
expect(subject[:ref]).to include(:branch)
- expect(subject[:details]).to include(:artifacts, :name, :status, :stages, :finished_at)
+ expect(subject[:details]).to include(:artifacts, :name, :event_type_name, :status, :stages, :finished_at)
expect(subject[:details][:status]).to include(:icon, :favicon, :text, :label, :tooltip)
expect(subject[:flags]).to include(:merge_request_pipeline)
+
+ expect(subject[:details][:event_type_name]).to eq('Merged result pipeline')
+ expect(subject[:details][:name]).to eq('Merged result pipeline')
end
it 'returns presented coverage' do
diff --git a/spec/services/ci/create_pipeline_service/rules_spec.rb b/spec/services/ci/create_pipeline_service/rules_spec.rb
index c737b8cc329..5fdefb2b306 100644
--- a/spec/services/ci/create_pipeline_service/rules_spec.rb
+++ b/spec/services/ci/create_pipeline_service/rules_spec.rb
@@ -1425,5 +1425,43 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes
it_behaves_like 'comparing file changes with workflow rules'
end
end
+
+ context 'workflow name with rules' do
+ let(:ref) { 'refs/heads/feature' }
+
+ let(:variables) do
+ [{ key: 'SOME_VARIABLE', secret_value: 'SOME_VAL' }]
+ end
+
+ let(:pipeline) do
+ execute_service do |pipeline|
+ pipeline.variables.build(variables)
+ end.payload
+ end
+
+ let(:config) do
+ <<-EOY
+ workflow:
+ name: '$PIPELINE_NAME $SOME_VARIABLE'
+ rules:
+ - if: $CI_COMMIT_REF_NAME =~ /master/
+ variables:
+ PIPELINE_NAME: 'Name 1'
+ - if: $CI_COMMIT_REF_NAME =~ /feature/
+ variables:
+ PIPELINE_NAME: 'Name 2'
+
+ job:
+ stage: test
+ script: echo 'hello'
+ EOY
+ end
+
+ it 'substitutes variables in pipeline name' do
+ expect(response).not_to be_error
+ expect(pipeline).to be_persisted
+ expect(pipeline.name).to eq('Name 2 SOME_VAL')
+ end
+ end
end
end
diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb
index c58353558df..f6e90d8b3cc 100644
--- a/spec/support/helpers/test_env.rb
+++ b/spec/support/helpers/test_env.rb
@@ -43,7 +43,7 @@ module TestEnv
'video' => '8879059',
'crlf-diff' => '5938907',
'conflict-start' => '824be60',
- 'conflict-resolvable' => '1450cd6',
+ 'conflict-resolvable' => '1450cd639e0bc6721eb02800169e464f212cde06',
'conflict-binary-file' => '259a6fb',
'conflict-contains-conflict-markers' => '78a3086',
'conflict-missing-side' => 'eb227b3',