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:
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/assets/javascripts/blob/file_template_selector.js2
-rw-r--r--app/assets/javascripts/blob/template_selectors/license_selector.js1
-rw-r--r--app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js1
-rw-r--r--app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue1
-rw-r--r--app/assets/javascripts/ide/index.js4
-rw-r--r--app/assets/javascripts/ide/stores/actions/project.js3
-rw-r--r--app/assets/javascripts/ide/stores/modules/commit/actions.js31
-rw-r--r--app/assets/javascripts/incidents_settings/constants.js2
-rw-r--r--app/assets/javascripts/issue_show/components/app.vue7
-rw-r--r--app/assets/javascripts/issue_show/components/fields/description_template.vue11
-rw-r--r--app/assets/javascripts/issue_show/components/form.vue11
-rw-r--r--app/assets/javascripts/issue_show/issue.js1
-rw-r--r--app/assets/javascripts/issue_show/stores/index.js2
-rw-r--r--app/assets/javascripts/reports/components/grouped_test_reports_app.vue5
-rw-r--r--app/assets/javascripts/reports/components/test_issue_body.vue8
-rw-r--r--app/assets/javascripts/templates/issuable_template_selector.js23
-rw-r--r--app/assets/stylesheets/themes/_dark.scss14
-rw-r--r--app/controllers/projects/merge_requests_controller.rb1
-rw-r--r--app/controllers/projects/templates_controller.rb6
-rw-r--r--app/experiments/application_experiment.rb6
-rw-r--r--app/finders/license_template_finder.rb1
-rw-r--r--app/helpers/blob_helper.rb2
-rw-r--r--app/helpers/issuables_description_templates_helper.rb66
-rw-r--r--app/helpers/issuables_helper.rb48
-rw-r--r--app/models/license_template.rb21
-rw-r--r--app/services/ci/test_failure_history_service.rb1
-rw-r--r--app/services/merge_requests/mergeability_check_service.rb11
-rw-r--r--app/views/shared/issuable/form/_template_selector.html.haml4
-rw-r--r--app/views/shared/issuable/form/_title.html.haml2
-rw-r--r--app/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker.rb15
-rw-r--r--changelogs/unreleased/233423-fix-ide-commit-to-new-branch-errors.yml5
-rw-r--r--changelogs/unreleased/eb-remove-test-failure-history-flag.yml5
-rw-r--r--changelogs/unreleased/override-mix-blend-mode-tertiary-buttons-dark-mode.yml5
-rw-r--r--config/feature_flags/development/github_import_pull_request_reviews.yml8
-rw-r--r--config/feature_flags/development/merge_ref_auto_sync.yml8
-rw-r--r--config/feature_flags/development/test_failure_history.yml8
-rw-r--r--doc/ci/merge_request_pipelines/pipelines_for_merged_results/index.md2
-rw-r--r--doc/ci/merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md2
-rw-r--r--doc/ci/unit_test_reports.md27
-rw-r--r--doc/development/features_inside_dot_gitlab.md4
-rw-r--r--doc/operations/incident_management/incidents.md2
-rw-r--r--doc/user/group/index.md3
-rw-r--r--doc/user/project/description_templates.md100
-rw-r--r--doc/user/project/issues/index.md2
-rw-r--r--doc/user/project/static_site_editor/index.md2
-rw-r--r--lib/api/project_templates.rb7
-rw-r--r--lib/gitlab/ci/reports/test_failure_history.rb2
-rw-r--r--lib/gitlab/template/base_template.rb21
-rw-r--r--lib/gitlab/template/issue_template.rb4
-rw-r--r--lib/gitlab/template/merge_request_template.rb4
-rw-r--r--locale/gitlab.pot3
-rw-r--r--spec/controllers/projects/templates_controller_spec.rb6
-rw-r--r--spec/frontend/ide/stores/modules/commit/actions_spec.js39
-rw-r--r--spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap2
-rw-r--r--spec/frontend/issue_show/components/app_spec.js4
-rw-r--r--spec/frontend/issue_show/components/fields/description_template_spec.js7
-rw-r--r--spec/frontend/issue_show/components/form_spec.js7
-rw-r--r--spec/frontend/issue_show/mock_data.js1
-rw-r--r--spec/frontend/reports/components/grouped_test_reports_app_spec.js60
-rw-r--r--spec/frontend_integration/ide/helpers/ide_helper.js31
-rw-r--r--spec/frontend_integration/ide/helpers/start.js14
-rw-r--r--spec/frontend_integration/ide/ide_integration_spec.js19
-rw-r--r--spec/frontend_integration/test_helpers/mock_server/routes/repository.js14
-rw-r--r--spec/helpers/issuables_description_templates_helper_spec.rb43
-rw-r--r--spec/helpers/issuables_helper_spec.rb1
-rw-r--r--spec/lib/gitlab/ci/reports/test_failure_history_spec.rb13
-rw-r--r--spec/models/license_template_spec.rb2
-rw-r--r--spec/services/ci/test_failure_history_service_spec.rb21
-rw-r--r--spec/services/merge_requests/mergeability_check_service_spec.rb41
-rw-r--r--spec/support/shared_examples/helpers/issuable_description_templates_shared_examples.rb49
-rw-r--r--spec/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker_spec.rb16
73 files changed, 303 insertions, 628 deletions
diff --git a/Gemfile b/Gemfile
index d091e51f931..5c55b3ab4d2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -478,7 +478,7 @@ gem 'flipper', '~> 0.17.1'
gem 'flipper-active_record', '~> 0.17.1'
gem 'flipper-active_support_cache_store', '~> 0.17.1'
gem 'unleash', '~> 0.1.5'
-gem 'gitlab-experiment', '~> 0.4.4'
+gem 'gitlab-experiment', '~> 0.4.5'
# Structured logging
gem 'lograge', '~> 0.5'
diff --git a/Gemfile.lock b/Gemfile.lock
index af8c1d5b50f..dc458a2f7c7 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -422,7 +422,7 @@ GEM
github-markup (1.7.0)
gitlab-chronic (0.10.5)
numerizer (~> 0.2)
- gitlab-experiment (0.4.4)
+ gitlab-experiment (0.4.5)
activesupport (>= 3.0)
scientist (~> 1.5, >= 1.5.0)
gitlab-fog-azure-rm (1.0.0)
@@ -1361,7 +1361,7 @@ DEPENDENCIES
gitaly (~> 13.7.0.pre.rc1)
github-markup (~> 1.7.0)
gitlab-chronic (~> 0.10.5)
- gitlab-experiment (~> 0.4.4)
+ gitlab-experiment (~> 0.4.5)
gitlab-fog-azure-rm (~> 1.0)
gitlab-labkit (= 0.14.0)
gitlab-license (~> 1.0)
diff --git a/app/assets/javascripts/blob/file_template_selector.js b/app/assets/javascripts/blob/file_template_selector.js
index a5c8050b772..2532aeea989 100644
--- a/app/assets/javascripts/blob/file_template_selector.js
+++ b/app/assets/javascripts/blob/file_template_selector.js
@@ -66,8 +66,6 @@ export default class FileTemplateSelector {
reportSelectionName(options) {
const opts = options;
opts.query = options.selectedObj.name;
- opts.data = options.selectedObj;
- opts.data.source_template_project_id = options.selectedObj.project_id;
this.reportSelection(opts);
}
diff --git a/app/assets/javascripts/blob/template_selectors/license_selector.js b/app/assets/javascripts/blob/template_selectors/license_selector.js
index 7e32ede96df..affa20997e9 100644
--- a/app/assets/javascripts/blob/template_selectors/license_selector.js
+++ b/app/assets/javascripts/blob/template_selectors/license_selector.js
@@ -30,7 +30,6 @@ export default class BlobLicenseSelector extends FileTemplateSelector {
const data = {
project: this.$dropdown.data('project'),
fullname: this.$dropdown.data('fullname'),
- source_template_project_id: query.project_id,
};
this.reportSelection({
diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js
index 98858f20518..99351231520 100644
--- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js
+++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js
@@ -437,7 +437,6 @@ export class GitLabDropdown {
groupName = el.data('group');
if (groupName) {
selectedIndex = el.data('index');
- this.selectedIndex = selectedIndex;
selectedObject = this.renderedData[groupName][selectedIndex];
} else {
selectedIndex = el.closest('li').index();
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue b/app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue
index aed7b792902..91cce44382c 100644
--- a/app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue
+++ b/app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue
@@ -74,6 +74,7 @@ export default {
<input
:placeholder="placeholderBranchName"
:value="newBranchName"
+ data-testid="ide-new-branch-name"
type="text"
class="form-control monospace"
@input="updateBranchName($event.target.value)"
diff --git a/app/assets/javascripts/ide/index.js b/app/assets/javascripts/ide/index.js
index 62f49ba56b1..af408c06556 100644
--- a/app/assets/javascripts/ide/index.js
+++ b/app/assets/javascripts/ide/index.js
@@ -63,6 +63,10 @@ export function initIde(el, options = {}) {
codesandboxBundlerUrl: el.dataset.codesandboxBundlerUrl,
});
},
+ beforeDestroy() {
+ // This helps tests do Singleton cleanups which we don't really have responsibility to know about here.
+ this.$emit('destroy');
+ },
methods: {
...mapActions(['setEmptyStateSvgs', 'setLinks', 'setInitialData']),
},
diff --git a/app/assets/javascripts/ide/stores/actions/project.js b/app/assets/javascripts/ide/stores/actions/project.js
index c5549c096c7..27f6848f1d6 100644
--- a/app/assets/javascripts/ide/stores/actions/project.js
+++ b/app/assets/javascripts/ide/stores/actions/project.js
@@ -44,8 +44,9 @@ export const refreshLastCommitData = ({ commit }, { projectId, branchId } = {})
commit: data.commit,
});
})
- .catch(() => {
+ .catch((e) => {
flash(__('Error loading last commit.'), 'alert', document, null, false, true);
+ throw e;
});
export const createNewBranchFromDefault = ({ state, dispatch, getters }, branch) =>
diff --git a/app/assets/javascripts/ide/stores/modules/commit/actions.js b/app/assets/javascripts/ide/stores/modules/commit/actions.js
index 3434ec873d5..29b9a8a9521 100644
--- a/app/assets/javascripts/ide/stores/modules/commit/actions.js
+++ b/app/assets/javascripts/ide/stores/modules/commit/actions.js
@@ -204,26 +204,25 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState, roo
} else {
dispatch('updateActivityBarView', leftSidebarViews.edit.name, { root: true });
dispatch('updateViewer', 'editor', { root: true });
-
- if (rootGetters.activeFile) {
- dispatch(
- 'router/push',
- `/project/${rootState.currentProjectId}/blob/${branchName}/-/${rootGetters.activeFile.path}`,
- { root: true },
- );
- }
}
})
.then(() => dispatch('updateCommitAction', consts.COMMIT_TO_CURRENT_BRANCH))
- .then(() =>
- dispatch(
+ .then(() => {
+ if (newBranch) {
+ const path = rootGetters.activeFile ? rootGetters.activeFile.path : '';
+
+ return dispatch(
+ 'router/push',
+ `/project/${rootState.currentProjectId}/blob/${branchName}/-/${path}`,
+ { root: true },
+ );
+ }
+
+ return dispatch(
'refreshLastCommitData',
- {
- projectId: rootState.currentProjectId,
- branchId: rootState.currentBranchId,
- },
+ { projectId: rootState.currentProjectId, branchId: branchName },
{ root: true },
- ),
- );
+ );
+ });
});
};
diff --git a/app/assets/javascripts/incidents_settings/constants.js b/app/assets/javascripts/incidents_settings/constants.js
index 818af4ecb90..fcac9c519c2 100644
--- a/app/assets/javascripts/incidents_settings/constants.js
+++ b/app/assets/javascripts/incidents_settings/constants.js
@@ -51,7 +51,7 @@ export const NO_ISSUE_TEMPLATE_SELECTED = { key: '', name: __('No template selec
export const TAKING_INCIDENT_ACTION_DOCS_LINK =
'/help/operations/metrics/alerts#trigger-actions-from-alerts';
export const ISSUE_TEMPLATES_DOCS_LINK =
- '/help/user/project/description_templates#create-an-issue-template';
+ '/help/user/project/description_templates#creating-issue-templates';
/* PagerDuty integration settings constants */
diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue
index 87dc31e6292..d569ad573a2 100644
--- a/app/assets/javascripts/issue_show/components/app.vue
+++ b/app/assets/javascripts/issue_show/components/app.vue
@@ -132,10 +132,6 @@ export default {
type: String,
required: true,
},
- projectId: {
- type: Number,
- required: true,
- },
projectNamespace: {
type: String,
required: true,
@@ -307,7 +303,7 @@ export default {
});
},
- updateAndShowForm(templates = {}) {
+ updateAndShowForm(templates = []) {
if (!this.showForm) {
this.showForm = true;
this.store.setFormState({
@@ -423,7 +419,6 @@ export default {
:markdown-docs-path="markdownDocsPath"
:markdown-preview-path="markdownPreviewPath"
:project-path="projectPath"
- :project-id="projectId"
:project-namespace="projectNamespace"
:show-delete-button="showDeleteButton"
:can-attach-file="canAttachFile"
diff --git a/app/assets/javascripts/issue_show/components/fields/description_template.vue b/app/assets/javascripts/issue_show/components/fields/description_template.vue
index f23bb394683..71299381aae 100644
--- a/app/assets/javascripts/issue_show/components/fields/description_template.vue
+++ b/app/assets/javascripts/issue_show/components/fields/description_template.vue
@@ -13,18 +13,14 @@ export default {
required: true,
},
issuableTemplates: {
- type: Object,
+ type: Array,
required: false,
- default: () => {},
+ default: () => [],
},
projectPath: {
type: String,
required: true,
},
- projectId: {
- type: Number,
- required: true,
- },
projectNamespace: {
type: String,
required: true,
@@ -52,12 +48,11 @@ export default {
</script>
<template>
- <div class="dropdown js-issuable-selector-wrap" data-issuable-type="issues">
+ <div class="dropdown js-issuable-selector-wrap" data-issuable-type="issue">
<button
ref="toggle"
:data-namespace-path="projectNamespace"
:data-project-path="projectPath"
- :data-project-id="projectId"
:data-data="issuableTemplatesJson"
class="dropdown-menu-toggle js-issuable-selector"
type="button"
diff --git a/app/assets/javascripts/issue_show/components/form.vue b/app/assets/javascripts/issue_show/components/form.vue
index 9d1ce01116b..d48bf1fe7a9 100644
--- a/app/assets/javascripts/issue_show/components/form.vue
+++ b/app/assets/javascripts/issue_show/components/form.vue
@@ -26,9 +26,9 @@ export default {
required: true,
},
issuableTemplates: {
- type: Object,
+ type: Array,
required: false,
- default: () => {},
+ default: () => [],
},
issuableType: {
type: String,
@@ -46,10 +46,6 @@ export default {
type: String,
required: true,
},
- projectId: {
- type: Number,
- required: true,
- },
projectNamespace: {
type: String,
required: true,
@@ -72,7 +68,7 @@ export default {
},
computed: {
hasIssuableTemplates() {
- return Object.values(Object(this.issuableTemplates)).length;
+ return this.issuableTemplates.length;
},
showLockedWarning() {
return this.formState.lockedWarningVisible && !this.formState.updateLoading;
@@ -131,7 +127,6 @@ export default {
:form-state="formState"
:issuable-templates="issuableTemplates"
:project-path="projectPath"
- :project-id="projectId"
:project-namespace="projectNamespace"
/>
</div>
diff --git a/app/assets/javascripts/issue_show/issue.js b/app/assets/javascripts/issue_show/issue.js
index a93abbf64df..83fd1355f26 100644
--- a/app/assets/javascripts/issue_show/issue.js
+++ b/app/assets/javascripts/issue_show/issue.js
@@ -54,7 +54,6 @@ export function initIssueHeaderActions(store) {
issueType: el.dataset.issueType,
newIssuePath: el.dataset.newIssuePath,
projectPath: el.dataset.projectPath,
- projectId: el.dataset.projectId,
reportAbusePath: el.dataset.reportAbusePath,
submitAsSpamPath: el.dataset.submitAsSpamPath,
},
diff --git a/app/assets/javascripts/issue_show/stores/index.js b/app/assets/javascripts/issue_show/stores/index.js
index a50913d3455..06bbd406e3a 100644
--- a/app/assets/javascripts/issue_show/stores/index.js
+++ b/app/assets/javascripts/issue_show/stores/index.js
@@ -11,7 +11,7 @@ export default class Store {
lockedWarningVisible: false,
updateLoading: false,
lock_version: 0,
- issuableTemplates: {},
+ issuableTemplates: [],
};
}
diff --git a/app/assets/javascripts/reports/components/grouped_test_reports_app.vue b/app/assets/javascripts/reports/components/grouped_test_reports_app.vue
index 6ac6dbfcb27..24c7a8dadaf 100644
--- a/app/assets/javascripts/reports/components/grouped_test_reports_app.vue
+++ b/app/assets/javascripts/reports/components/grouped_test_reports_app.vue
@@ -10,7 +10,6 @@ import IssuesList from './issues_list.vue';
import Modal from './modal.vue';
import createStore from '../store';
import Tracking from '~/tracking';
-import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import {
summaryTextBuilder,
reportTextBuilder,
@@ -28,7 +27,7 @@ export default {
Modal,
GlButton,
},
- mixins: [glFeatureFlagsMixin(), Tracking.mixin()],
+ mixins: [Tracking.mixin()],
props: {
endpoint: {
type: String,
@@ -92,7 +91,7 @@ export default {
return reportTextBuilder(name, summary);
},
hasRecentFailures(summary) {
- return this.glFeatures.testFailureHistory && summary?.recentlyFailed > 0;
+ return summary?.recentlyFailed > 0;
},
recentFailuresText(summary) {
return recentFailuresTextBuilder(summary);
diff --git a/app/assets/javascripts/reports/components/test_issue_body.vue b/app/assets/javascripts/reports/components/test_issue_body.vue
index 69b0dcf881d..ad980b334bb 100644
--- a/app/assets/javascripts/reports/components/test_issue_body.vue
+++ b/app/assets/javascripts/reports/components/test_issue_body.vue
@@ -1,7 +1,6 @@
<script>
import { mapActions } from 'vuex';
import { GlBadge, GlSprintf } from '@gitlab/ui';
-import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
export default {
name: 'TestIssueBody',
@@ -9,7 +8,6 @@ export default {
GlBadge,
GlSprintf,
},
- mixins: [glFeatureFlagsMixin()],
props: {
issue: {
type: Object,
@@ -28,11 +26,7 @@ export default {
},
computed: {
showRecentFailures() {
- return (
- this.glFeatures.testFailureHistory &&
- this.issue.recent_failures?.count &&
- this.issue.recent_failures?.base_branch
- );
+ return this.issue.recent_failures?.count && this.issue.recent_failures?.base_branch;
},
},
methods: {
diff --git a/app/assets/javascripts/templates/issuable_template_selector.js b/app/assets/javascripts/templates/issuable_template_selector.js
index bcae79c9679..22bbd083a5d 100644
--- a/app/assets/javascripts/templates/issuable_template_selector.js
+++ b/app/assets/javascripts/templates/issuable_template_selector.js
@@ -9,7 +9,6 @@ export default class IssuableTemplateSelector extends TemplateSelector {
constructor(...args) {
super(...args);
- this.projectId = this.dropdown.data('projectId');
this.projectPath = this.dropdown.data('projectPath');
this.namespacePath = this.dropdown.data('namespacePath');
this.issuableType = this.$dropdownContainer.data('issuableType');
@@ -82,21 +81,21 @@ export default class IssuableTemplateSelector extends TemplateSelector {
}
requestFile(query) {
- const callback = (currentTemplate) => {
- this.currentTemplate = currentTemplate;
- this.stopLoadingSpinner();
- this.setInputValueToTemplateContent();
- };
-
this.startLoadingSpinner();
- Api.projectTemplate(
- this.projectId,
- this.issuableType,
+ Api.issueTemplate(
+ this.namespacePath,
+ this.projectPath,
query.name,
- { source_template_project_id: query.project_id },
- callback,
+ this.issuableType,
+ (err, currentTemplate) => {
+ this.currentTemplate = currentTemplate;
+ this.stopLoadingSpinner();
+ if (err) return; // Error handled by global AJAX error handler
+ this.setInputValueToTemplateContent();
+ },
);
+ return;
}
setInputValueToTemplateContent() {
diff --git a/app/assets/stylesheets/themes/_dark.scss b/app/assets/stylesheets/themes/_dark.scss
index 7f2bea9bf26..d8f74a2913e 100644
--- a/app/assets/stylesheets/themes/_dark.scss
+++ b/app/assets/stylesheets/themes/_dark.scss
@@ -168,6 +168,20 @@ body.gl-dark {
--black: #{$black};
--svg-status-bg: #{$white};
+
+ .gl-button.gl-button,
+ .gl-button.gl-button.btn-block {
+ &.btn-default,
+ &.btn-dashed,
+ &.btn-info,
+ &.btn-success,
+ &.btn-danger,
+ &.btn-warning {
+ &-tertiary {
+ mix-blend-mode: screen;
+ }
+ }
+ }
}
$border-white-light: $gray-900;
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 0d796ed1b4a..8ded9c2313f 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -39,7 +39,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag(:core_security_mr_widget_counts, @project)
push_frontend_feature_flag(:core_security_mr_widget_downloads, @project, default_enabled: true)
push_frontend_feature_flag(:remove_resolve_note, @project, default_enabled: true)
- push_frontend_feature_flag(:test_failure_history, @project)
push_frontend_feature_flag(:diffs_gradual_load, @project, default_enabled: true)
push_frontend_feature_flag(:codequality_mr_diff, @project)
diff --git a/app/controllers/projects/templates_controller.rb b/app/controllers/projects/templates_controller.rb
index 71f426a68ab..f4726638777 100644
--- a/app/controllers/projects/templates_controller.rb
+++ b/app/controllers/projects/templates_controller.rb
@@ -1,8 +1,6 @@
# frozen_string_literal: true
class Projects::TemplatesController < Projects::ApplicationController
- include IssuablesDescriptionTemplatesHelper
-
before_action :authenticate_user!
before_action :authorize_can_read_issuable!
before_action :get_template_class
@@ -26,8 +24,10 @@ class Projects::TemplatesController < Projects::ApplicationController
end
def names
+ templates = @template_type.dropdown_names(project)
+
respond_to do |format|
- format.json { render json: issuable_templates(project, params[:template_type]) }
+ format.json { render json: templates }
end
end
diff --git a/app/experiments/application_experiment.rb b/app/experiments/application_experiment.rb
index e8f7d22bf77..7a8851d11ce 100644
--- a/app/experiments/application_experiment.rb
+++ b/app/experiments/application_experiment.rb
@@ -19,7 +19,9 @@ class ApplicationExperiment < Gitlab::Experiment
private
def resolve_variant_name
- variant_names.first if Feature.enabled?(name, self, type: :experiment)
+ return variant_names.first if Feature.enabled?(name, self, type: :experiment)
+
+ nil # Returning nil vs. :control is important for not caching and rollouts.
end
# Cache is an implementation on top of Gitlab::Redis::SharedState that also
@@ -61,7 +63,7 @@ class ApplicationExperiment < Gitlab::Experiment
end
def hkey(key)
- key.split(':') # this assumes the default strategy in gitlab-experiment
+ key.to_s.split(':') # this assumes the default strategy in gitlab-experiment
end
def read_entry(key, **options)
diff --git a/app/finders/license_template_finder.rb b/app/finders/license_template_finder.rb
index 2419141f260..4d68b963dc3 100644
--- a/app/finders/license_template_finder.rb
+++ b/app/finders/license_template_finder.rb
@@ -36,7 +36,6 @@ class LicenseTemplateFinder
LicenseTemplate.new(
key: license.key,
name: license.name,
- project: project,
nickname: license.nickname,
category: (license.featured? ? :Popular : :Other),
content: license.content,
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 7a4913748e8..254af62f47a 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -199,7 +199,7 @@ module BlobHelper
categories.each_with_object({}) do |category, hash|
hash[category] = grouped[category].map do |item|
- { name: item.name, id: item.key, project_id: item.project_id }
+ { name: item.name, id: item.key }
end
end
end
diff --git a/app/helpers/issuables_description_templates_helper.rb b/app/helpers/issuables_description_templates_helper.rb
deleted file mode 100644
index ffb20db65d0..00000000000
--- a/app/helpers/issuables_description_templates_helper.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# frozen_string_literal: true
-
-module IssuablesDescriptionTemplatesHelper
- include Gitlab::Utils::StrongMemoize
- include GitlabRoutingHelper
-
- def template_dropdown_tag(issuable, &block)
- title = selected_template(issuable) || "Choose a template"
- options = {
- toggle_class: 'js-issuable-selector',
- title: title,
- filter: true,
- placeholder: 'Filter',
- footer_content: true,
- data: {
- data: issuable_templates(ref_project, issuable.to_ability_name),
- field_name: 'issuable_template',
- selected: selected_template(issuable),
- project_id: ref_project.id,
- project_path: ref_project.path,
- namespace_path: ref_project.namespace.full_path
- }
- }
-
- dropdown_tag(title, options: options) do
- capture(&block)
- end
- end
-
- def issuable_templates(project, issuable_type)
- strong_memoize(:issuable_templates) do
- supported_issuable_types = %w[issue merge_request]
-
- next [] unless supported_issuable_types.include?(issuable_type)
-
- template_dropdown_names(TemplateFinder.build(issuable_type.pluralize.to_sym, project).execute)
- end
- end
-
- private
-
- def issuable_templates_names(issuable)
- issuable_templates(ref_project, issuable.to_ability_name).map { |template| template[:name] }
- end
-
- def selected_template(issuable)
- params[:issuable_template] if issuable_templates(ref_project, issuable.to_ability_name).values.flatten.any? { |template| template[:name] == params[:issuable_template] }
- end
-
- def template_names_path(parent, issuable)
- return '' unless parent.is_a?(Project)
-
- project_template_names_path(parent, template_type: issuable.to_ability_name)
- end
-
- def template_dropdown_names(items)
- grouped = items.group_by(&:category)
- categories = grouped.keys
-
- categories.each_with_object({}) do |category, hash|
- hash[category] = grouped[category].map do |item|
- { name: item.name, id: item.key, project_id: item.try(:project_id) }
- end
- end
- end
-end
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb
index de5cae2e9e2..da142cbed0e 100644
--- a/app/helpers/issuables_helper.rb
+++ b/app/helpers/issuables_helper.rb
@@ -2,7 +2,6 @@
module IssuablesHelper
include GitlabRoutingHelper
- include IssuablesDescriptionTemplatesHelper
def sidebar_gutter_toggle_icon
content_tag(:span, class: 'js-sidebar-toggle-container', data: { is_expanded: !sidebar_gutter_collapsed? }) do
@@ -76,6 +75,28 @@ module IssuablesHelper
.to_json
end
+ def template_dropdown_tag(issuable, &block)
+ title = selected_template(issuable) || "Choose a template"
+ options = {
+ toggle_class: 'js-issuable-selector',
+ title: title,
+ filter: true,
+ placeholder: 'Filter',
+ footer_content: true,
+ data: {
+ data: issuable_templates(issuable),
+ field_name: 'issuable_template',
+ selected: selected_template(issuable),
+ project_path: ref_project.path,
+ namespace_path: ref_project.namespace.full_path
+ }
+ }
+
+ dropdown_tag(title, options: options) do
+ capture(&block)
+ end
+ end
+
def users_dropdown_label(selected_users)
case selected_users.length
when 0
@@ -273,7 +294,6 @@ module IssuablesHelper
{
projectPath: ref_project.path,
- projectId: ref_project.id,
projectNamespace: ref_project.namespace.full_path
}
end
@@ -349,6 +369,24 @@ module IssuablesHelper
cookies[:collapsed_gutter] == 'true'
end
+ def issuable_templates(issuable)
+ @issuable_templates ||=
+ case issuable
+ when Issue
+ ref_project.repository.issue_template_names
+ when MergeRequest
+ ref_project.repository.merge_request_template_names
+ end
+ end
+
+ def issuable_templates_names(issuable)
+ issuable_templates(issuable).map { |template| template[:name] }
+ end
+
+ def selected_template(issuable)
+ params[:issuable_template] if issuable_templates(issuable).any? { |template| template[:name] == params[:issuable_template] }
+ end
+
def issuable_todo_button_data(issuable, is_collapsed)
{
todo_text: _('Add a to do'),
@@ -386,6 +424,12 @@ module IssuablesHelper
end
end
+ def template_names_path(parent, issuable)
+ return '' unless parent.is_a?(Project)
+
+ project_template_names_path(parent, template_type: issuable.class.name.underscore)
+ end
+
def issuable_sidebar_options(issuable)
{
endpoint: "#{issuable[:issuable_json_path]}?serializer=sidebar_extras",
diff --git a/app/models/license_template.rb b/app/models/license_template.rb
index f6961da6d33..bd24259984b 100644
--- a/app/models/license_template.rb
+++ b/app/models/license_template.rb
@@ -12,12 +12,11 @@ class LicenseTemplate
(fullname|name\sof\s(author|copyright\sowner))
[\>\}\]]}xi.freeze
- attr_reader :key, :name, :project, :category, :nickname, :url, :meta
+ attr_reader :key, :name, :category, :nickname, :url, :meta
- def initialize(key:, name:, project:, category:, content:, nickname: nil, url: nil, meta: {})
+ def initialize(key:, name:, category:, content:, nickname: nil, url: nil, meta: {})
@key = key
@name = name
- @project = project
@category = category
@content = content
@nickname = nickname
@@ -25,22 +24,6 @@ class LicenseTemplate
@meta = meta
end
- def project_id
- project&.id
- end
-
- def project_path
- project&.path
- end
-
- def namespace_id
- project&.namespace&.id
- end
-
- def namespace_path
- project&.namespace&.full_path
- end
-
def popular?
category == :Popular
end
diff --git a/app/services/ci/test_failure_history_service.rb b/app/services/ci/test_failure_history_service.rb
index 99a2592ec06..61fda79a4a2 100644
--- a/app/services/ci/test_failure_history_service.rb
+++ b/app/services/ci/test_failure_history_service.rb
@@ -30,7 +30,6 @@ module Ci
end
def should_track_failures?
- return false unless Feature.enabled?(:test_failure_history, project)
return false unless project.default_branch_or_master == pipeline.ref
# We fetch for up to MAX_TRACKABLE_FAILURES + 1 builds. So if ever we get
diff --git a/app/services/merge_requests/mergeability_check_service.rb b/app/services/merge_requests/mergeability_check_service.rb
index 627c747203c..15f66a02010 100644
--- a/app/services/merge_requests/mergeability_check_service.rb
+++ b/app/services/merge_requests/mergeability_check_service.rb
@@ -64,10 +64,6 @@ module MergeRequests
return ServiceResponse.error(message: 'Merge request is not mergeable')
end
- unless merge_ref_auto_sync_enabled?
- return ServiceResponse.error(message: 'Merge ref is outdated due to disabled feature')
- end
-
unless payload.fetch(:merge_ref_head)
return ServiceResponse.error(message: 'Merge ref cannot be updated')
end
@@ -142,7 +138,6 @@ module MergeRequests
#
# Returns true if the merge-ref does not exists or is out of sync.
def outdated_merge_ref?
- return false unless merge_ref_auto_sync_enabled?
return false unless merge_request.open?
return true unless ref_head = merge_request.merge_ref_head
@@ -157,17 +152,11 @@ module MergeRequests
end
def merge_to_ref
- return true unless merge_ref_auto_sync_enabled?
-
params = { allow_conflicts: Feature.enabled?(:display_merge_conflicts_in_diff, project) }
result = MergeRequests::MergeToRefService.new(project, merge_request.author, params).execute(merge_request)
result[:status] == :success
end
- def merge_ref_auto_sync_enabled?
- Feature.enabled?(:merge_ref_auto_sync, project, default_enabled: true)
- end
-
def merge_ref_auto_sync_lock_enabled?
Feature.enabled?(:merge_ref_auto_sync_lock, project, default_enabled: true)
end
diff --git a/app/views/shared/issuable/form/_template_selector.html.haml b/app/views/shared/issuable/form/_template_selector.html.haml
index a58bde5aa9e..bf34ea4a1b2 100644
--- a/app/views/shared/issuable/form/_template_selector.html.haml
+++ b/app/views/shared/issuable/form/_template_selector.html.haml
@@ -1,9 +1,9 @@
- issuable = local_assigns.fetch(:issuable, nil)
-- return unless issuable && issuable_templates(ref_project, issuable.class.name.underscore).any?
+- return unless issuable && issuable_templates(issuable).any?
.issuable-form-select-holder.selectbox.form-group
- .js-issuable-selector-wrap{ data: { issuable_type: issuable.to_ability_name.pluralize } }
+ .js-issuable-selector-wrap{ data: { issuable_type: issuable.to_ability_name } }
= template_dropdown_tag(issuable) do
%ul.dropdown-footer-list
%li
diff --git a/app/views/shared/issuable/form/_title.html.haml b/app/views/shared/issuable/form/_title.html.haml
index cb4b712ffbe..98c9f73fa3a 100644
--- a/app/views/shared/issuable/form/_title.html.haml
+++ b/app/views/shared/issuable/form/_title.html.haml
@@ -1,7 +1,7 @@
- issuable = local_assigns.fetch(:issuable)
- has_wip_commits = local_assigns.fetch(:has_wip_commits)
- form = local_assigns.fetch(:form)
-- no_issuable_templates = issuable_templates(ref_project, issuable.class.name.underscore).empty?
+- no_issuable_templates = issuable_templates(issuable).empty?
- div_class = no_issuable_templates ? 'col-sm-10' : 'col-sm-7 col-lg-8'
- toggle_wip_link_start = '<a href="" class="js-toggle-wip">'
- toggle_wip_link_end = '</a>'
diff --git a/app/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker.rb b/app/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker.rb
index 0809d0b7c29..790e8b0eccf 100644
--- a/app/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker.rb
+++ b/app/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker.rb
@@ -11,18 +11,11 @@ module Gitlab
# client - An instance of Gitlab::GithubImport::Client.
# project - An instance of Project.
def import(client, project)
- waiter =
- if Feature.enabled?(:github_import_pull_request_reviews, project, default_enabled: true)
- waiter = Importer::PullRequestsReviewsImporter
- .new(project, client)
- .execute
+ waiter = Importer::PullRequestsReviewsImporter
+ .new(project, client)
+ .execute
- project.import_state.refresh_jid_expiration
-
- waiter
- else
- JobWaiter.new
- end
+ project.import_state.refresh_jid_expiration
AdvanceStageWorker.perform_async(
project.id,
diff --git a/changelogs/unreleased/233423-fix-ide-commit-to-new-branch-errors.yml b/changelogs/unreleased/233423-fix-ide-commit-to-new-branch-errors.yml
new file mode 100644
index 00000000000..9ed40f1b7a1
--- /dev/null
+++ b/changelogs/unreleased/233423-fix-ide-commit-to-new-branch-errors.yml
@@ -0,0 +1,5 @@
+---
+title: Fix issues when Web IDE commits to new branch
+merge_request: 51654
+author:
+type: fixed
diff --git a/changelogs/unreleased/eb-remove-test-failure-history-flag.yml b/changelogs/unreleased/eb-remove-test-failure-history-flag.yml
new file mode 100644
index 00000000000..c91888d0177
--- /dev/null
+++ b/changelogs/unreleased/eb-remove-test-failure-history-flag.yml
@@ -0,0 +1,5 @@
+---
+title: Remove test_failure_history flag
+merge_request: 51464
+author:
+type: changed
diff --git a/changelogs/unreleased/override-mix-blend-mode-tertiary-buttons-dark-mode.yml b/changelogs/unreleased/override-mix-blend-mode-tertiary-buttons-dark-mode.yml
new file mode 100644
index 00000000000..f55f523f96c
--- /dev/null
+++ b/changelogs/unreleased/override-mix-blend-mode-tertiary-buttons-dark-mode.yml
@@ -0,0 +1,5 @@
+---
+title: Fix tertiary button color in dark mode
+merge_request: 51349
+author:
+type: fixed
diff --git a/config/feature_flags/development/github_import_pull_request_reviews.yml b/config/feature_flags/development/github_import_pull_request_reviews.yml
deleted file mode 100644
index 38ff6b65eaa..00000000000
--- a/config/feature_flags/development/github_import_pull_request_reviews.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: github_import_pull_request_reviews
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48632
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/289153
-milestone: '13.7'
-type: development
-group: group::import
-default_enabled: true
diff --git a/config/feature_flags/development/merge_ref_auto_sync.yml b/config/feature_flags/development/merge_ref_auto_sync.yml
deleted file mode 100644
index 9fd1eecbe5a..00000000000
--- a/config/feature_flags/development/merge_ref_auto_sync.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: merge_ref_auto_sync
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/29569
-rollout_issue_url:
-milestone: '12.1'
-type: development
-group: group::code review
-default_enabled: true
diff --git a/config/feature_flags/development/test_failure_history.yml b/config/feature_flags/development/test_failure_history.yml
deleted file mode 100644
index 4a0424aae9e..00000000000
--- a/config/feature_flags/development/test_failure_history.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: test_failure_history
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45027
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/268249
-milestone: '13.6'
-type: development
-group: group::testing
-default_enabled: false
diff --git a/doc/ci/merge_request_pipelines/pipelines_for_merged_results/index.md b/doc/ci/merge_request_pipelines/pipelines_for_merged_results/index.md
index 28bb94bfb8f..e83789efdbf 100644
--- a/doc/ci/merge_request_pipelines/pipelines_for_merged_results/index.md
+++ b/doc/ci/merge_request_pipelines/pipelines_for_merged_results/index.md
@@ -50,6 +50,8 @@ To enable pipelines for merge results:
- You must not be using
[fast forward merges](../../../user/project/merge_requests/fast_forward_merge.md) yet.
To follow progress, see [#58226](https://gitlab.com/gitlab-org/gitlab/-/issues/26996).
+- Your repository must be a GitLab repository, not an
+ [external repository](../../ci_cd_for_external_repos/index.md).
## Enable pipelines for merged results
diff --git a/doc/ci/merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md b/doc/ci/merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md
index aaa130612c7..e5b9ad030d0 100644
--- a/doc/ci/merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md
+++ b/doc/ci/merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md
@@ -74,6 +74,8 @@ To enable merge trains:
- You must have maintainer [permissions](../../../../user/permissions.md).
- You must be using [GitLab Runner](https://gitlab.com/gitlab-org/gitlab-runner) 11.9 or later.
- In GitLab 12.0 and later, you need [Redis](https://redis.io/) 3.2 or later.
+- Your repository must be a GitLab repository, not an
+ [external repository](../../../ci_cd_for_external_repos/index.md).
## Enable merge trains
diff --git a/doc/ci/unit_test_reports.md b/doc/ci/unit_test_reports.md
index 2505e56356d..1fec1f77bc3 100644
--- a/doc/ci/unit_test_reports.md
+++ b/doc/ci/unit_test_reports.md
@@ -68,36 +68,11 @@ execution time and the error output.
### Number of recent failures
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/241759) in GitLab 13.7.
-> - It's [deployed behind a feature flag](../user/feature_flags.md), disabled by default.
-> - It's disabled on GitLab.com.
-> - It's not recommended for production use.
-> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-the-number-of-recent-failures). **(CORE ONLY)**
-
-WARNING:
-This feature might not be available to you. Check the **version history** note above for details.
+> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/268249) in GitLab 13.8.
If a test failed in the project's default branch in the last 14 days, a message like
`Failed {n} time(s) in {default_branch} in the last 14 days` is displayed for that test.
-#### Enable or disable the number of recent failures **(CORE ONLY)**
-
-Displaying the number of failures in the last 14 days is under development and not
-ready for production use. It is deployed behind a feature flag that is **disabled by default**.
-[GitLab administrators with access to the GitLab Rails console](../administration/feature_flags.md)
-can enable it.
-
-To enable it:
-
-```ruby
-Feature.enable(:test_failure_history)
-```
-
-To disable it:
-
-```ruby
-Feature.disable(:test_failure_history)
-```
-
## How to set it up
To enable the Unit test reports in merge requests, you need to add
diff --git a/doc/development/features_inside_dot_gitlab.md b/doc/development/features_inside_dot_gitlab.md
index 36b9064bbc4..08adb7faeb2 100644
--- a/doc/development/features_inside_dot_gitlab.md
+++ b/doc/development/features_inside_dot_gitlab.md
@@ -10,8 +10,8 @@ We have implemented standard features that depend on configuration files in the
When implementing new features, please refer to these existing features to avoid conflicts:
- [Custom Dashboards](../operations/metrics/dashboards/index.md#add-a-new-dashboard-to-your-project): `.gitlab/dashboards/`.
-- [Issue Templates](../user/project/description_templates.md#create-an-issue-template): `.gitlab/issue_templates/`.
-- [Merge Request Templates](../user/project/description_templates.md#create-a-merge-request-template): `.gitlab/merge_request_templates/`.
+- [Issue Templates](../user/project/description_templates.md#creating-issue-templates): `.gitlab/issue_templates/`.
+- [Merge Request Templates](../user/project/description_templates.md#creating-merge-request-templates): `.gitlab/merge_request_templates/`.
- [GitLab Kubernetes Agents](https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/blob/master/doc/configuration_repository.md#layout): `.gitlab/agents/`.
- [CODEOWNERS](../user/project/code_owners.md#how-to-set-up-code-owners): `.gitlab/CODEOWNERS`.
- [Route Maps](../ci/review_apps/#route-maps): `.gitlab/route-map.yml`.
diff --git a/doc/operations/incident_management/incidents.md b/doc/operations/incident_management/incidents.md
index 78e90d5f1c4..450ee6620a4 100644
--- a/doc/operations/incident_management/incidents.md
+++ b/doc/operations/incident_management/incidents.md
@@ -52,7 +52,7 @@ With Maintainer or higher [permissions](../../user/permissions.md), you can enab
1. Navigate to **Settings > Operations > Incidents** and expand **Incidents**.
1. Check the **Create an incident** checkbox.
1. To customize the incident, select an
- [issue template](../../user/project/description_templates.md#create-an-issue-template).
+ [issue template](../../user/project/description_templates.md#creating-issue-templates).
1. To send [an email notification](alert_notifications.md#email-notifications) to users
with [Developer permissions](../../user/permissions.md), select
**Send a separate email notification to Developers**. Email notifications are
diff --git a/doc/user/group/index.md b/doc/user/group/index.md
index 36410f2e1a7..74406d3e5cf 100644
--- a/doc/user/group/index.md
+++ b/doc/user/group/index.md
@@ -726,9 +726,6 @@ To enable this feature, navigate to the group settings page, expand the
![Group file template settings](img/group_file_template_settings.png)
-To learn how to create templates for issues and merge requests, visit
-[Description templates](../project/description_templates.md).
-
#### Group-level project templates **(PREMIUM)**
Define project templates at a group level by setting a group as the template source.
diff --git a/doc/user/project/description_templates.md b/doc/user/project/description_templates.md
index fe1ab292d44..3108bdda7a0 100644
--- a/doc/user/project/description_templates.md
+++ b/doc/user/project/description_templates.md
@@ -6,13 +6,16 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Description templates
-> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/4981) in GitLab 8.11.
+>[Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/4981) in GitLab 8.11.
We all know that a properly submitted issue is more likely to be addressed in
a timely manner by the developers of a project.
-With description templates, you can define context-specific templates for issue and merge request
-description fields for your project, and filter out a lot of unnecessary noise from issues.
+Description templates allow you to define context-specific templates for issue
+and merge request description fields for your project, as well as help filter
+out a lot of unnecessary noise from issues.
+
+## Overview
By using the description templates, users that create a new issue or merge
request can select a description template to help them communicate with other
@@ -25,10 +28,7 @@ Description templates must be written in [Markdown](../markdown.md) and stored
in your project's repository under a directory named `.gitlab`. Only the
templates of the default branch are taken into account.
-To learn how to create templates for various file types in groups, visit
-[Group file templates](../group/index.md#group-file-templates).
-
-## Use cases
+## Use-cases
- Add a template to be used in every issue for a specific project,
giving instructions and guidelines, requiring for information specific to that subject.
@@ -40,7 +40,7 @@ To learn how to create templates for various file types in groups, visit
- You can also create issues and merge request templates for different
stages of your workflow, for example, feature proposal, feature improvement, or a bug report.
-## Create an issue template
+## Creating issue templates
Create a new Markdown (`.md`) file inside the `.gitlab/issue_templates/`
directory in your repository. Commit and push to your default branch.
@@ -65,13 +65,13 @@ To create the `.gitlab/issue_templates` directory:
To check if this has worked correctly, [create a new issue](issues/managing_issues.md#create-a-new-issue)
and see if you can choose a description template.
-## Create a merge request template
+## Creating merge request templates
Similarly to issue templates, create a new Markdown (`.md`) file inside the
`.gitlab/merge_request_templates/` directory in your repository. Commit and
push to your default branch.
-## Use the templates
+## Using the templates
Let's take for example that you've created the file `.gitlab/issue_templates/Bug.md`.
This enables the `Bug` dropdown option when creating or editing issues. When
@@ -80,46 +80,15 @@ to the issue description field. The **Reset template** button discards any
changes you made after picking the template and returns it to its initial status.
NOTE:
-You can create shortcut links to create an issue using a designated template.
-For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Feature%20proposal`.
+You can create short-cut links to create an issue using a designated template. For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Feature%20proposal`.
![Description templates](img/description_templates.png)
-### Set an issue and merge request description template at group level **(PREMIUM)**
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46222) in GitLab 13.8.
-
-Templates are most useful, because you can create a template once and use it multiple times.
-To re-use templates [you've created](../project/description_templates.md#create-an-issue-template):
-
-1. Go to your project's `Settings > General > Templates`.
-1. From the dropdown, select your template project as the template repository at group level.
-
-![Group template settings](../group/img/group_file_template_settings.png)
-
-### Set an issue and merge request description template at instance level **(PREMIUM ONLY)**
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46222) in GitLab 13.8.
-
-Similar to group templates, issue and merge request templates can also be set up at the instance level.
-This results in those templates being available in all projects within the instance.
-Only instance administrators can set instance-level templates.
-
-To set the instance-level description template repository:
-
-1. Select the **Admin Area** icon (**{admin}**).
-1. Select **Templates**.
-1. From the dropdown, select your template project as the template repository at instance level.
+## Setting a default template for merge requests and issues **(STARTER)**
-Learn more about [instance template repository](../admin_area/settings/instance_template_repository.md).
-
-![Setting templates in the Admin Area](../admin_area/settings/img/file_template_admin_area.png)
-
-### Set a default template for merge requests and issues **(STARTER)**
-
-> - This feature was introduced before [description templates](#description-templates) and is available in [GitLab Starter](https://about.gitlab.com/pricing/). It can be enabled in the project's settings.
-> - Templates for issues [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28) in GitLab EE 8.1.
-> - Templates for merge requests [introduced](https://gitlab.com/gitlab-org/gitlab/commit/7478ece8b48e80782b5465b96c79f85cc91d391b) in GitLab EE 6.9.
+> - This feature was introduced before [description templates](#overview) and is available in [GitLab Starter](https://about.gitlab.com/pricing/). It can be enabled in the project's settings.
+> - Templates for issues were [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28) in GitLab EE 8.1.
+> - Templates for merge requests were [introduced](https://gitlab.com/gitlab-org/gitlab/commit/7478ece8b48e80782b5465b96c79f85cc91d391b) in GitLab EE 6.9.
The visibility of issues and/or merge requests should be set to either "Everyone
with access" or "Only Project Members" in your project's **Settings / Visibility, project features, permissions** section, otherwise the
@@ -144,47 +113,52 @@ pre-filled with the text you entered in the template(s).
## Description template example
-We make use of description templates for issues and merge requests in the GitLab project.
-Please refer to the [`.gitlab` folder](https://gitlab.com/gitlab-org/gitlab/tree/master/.gitlab)
+We make use of Description Templates for Issues and Merge Requests within the GitLab Community
+Edition project. Please refer to the [`.gitlab` folder](https://gitlab.com/gitlab-org/gitlab/tree/master/.gitlab)
for some examples.
NOTE:
-It's possible to use [quick actions](quick_actions.md) in description templates to quickly add
+It's possible to use [quick actions](quick_actions.md) within description templates to quickly add
labels, assignees, and milestones. The quick actions are only executed if the user submitting
the issue or merge request has the permissions to perform the relevant actions.
Here is an example of a Bug report template:
-```markdown
-## Summary
+```plaintext
+Summary
(Summarize the bug encountered concisely)
-## Steps to reproduce
+
+Steps to reproduce
(How one can reproduce the issue - this is very important)
-## Example Project
-(If possible, please create an example project here on GitLab.com that exhibits the problematic
-behaviour, and link to it here in the bug report.
-If you are using an older version of GitLab, this will also determine whether the bug has been fixed
-in a more recent version)
+Example Project
+
+(If possible, please create an example project here on GitLab.com that exhibits the problematic behaviour, and link to it here in the bug report)
-## What is the current bug behavior?
+(If you are using an older version of GitLab, this will also determine whether the bug has been fixed in a more recent version)
+
+
+What is the current bug behavior?
(What actually happens)
-## What is the expected correct behavior?
+
+What is the expected correct behavior?
(What you should see instead)
-## Relevant logs and/or screenshots
-(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as
-it's very hard to read otherwise.)
+Relevant logs and/or screenshots
+
+(Paste any relevant logs - please use code blocks (```) to format console output,
+logs, and code as it's very hard to read otherwise.)
+
-## Possible fixes
+Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
diff --git a/doc/user/project/issues/index.md b/doc/user/project/issues/index.md
index 014e903a012..74311eefd83 100644
--- a/doc/user/project/issues/index.md
+++ b/doc/user/project/issues/index.md
@@ -217,7 +217,7 @@ You can then see issue statuses in the [issue list](#issues-list) and the
## Other Issue actions
-- [Create an issue from a template](../../project/description_templates.md#use-the-templates)
+- [Create an issue from a template](../../project/description_templates.md#using-the-templates)
- [Set a due date](due_dates.md)
- [Bulk edit issues](../bulk_editing.md) - From the Issues List, select multiple issues
in order to change their status, assignee, milestone, or labels in bulk.
diff --git a/doc/user/project/static_site_editor/index.md b/doc/user/project/static_site_editor/index.md
index f7ccbf8a565..07f122a7828 100644
--- a/doc/user/project/static_site_editor/index.md
+++ b/doc/user/project/static_site_editor/index.md
@@ -102,7 +102,7 @@ To edit a file:
in the bottom-right corner.
1. When you're done, click **Submit changes...**.
1. (Optional) Adjust the default title and description of the merge request that will be submitted
- with your changes. Alternatively, select a [merge request template](../../../user/project/description_templates.md#create-a-merge-request-template)
+ with your changes. Alternatively, select a [merge request template](../../../user/project/description_templates.md#creating-merge-request-templates)
from the dropdown menu and edit it accordingly.
1. Click **Submit changes**.
1. A new merge request is automatically created and you can assign a colleague for review.
diff --git a/lib/api/project_templates.rb b/lib/api/project_templates.rb
index 95bb35e0dd9..19244ed697f 100644
--- a/lib/api/project_templates.rb
+++ b/lib/api/project_templates.rb
@@ -45,10 +45,9 @@ module API
get ':id/templates/:type/:name', requirements: TEMPLATE_NAMES_ENDPOINT_REQUIREMENTS do
begin
- template = TemplateFinder.build(
- params[:type], user_project, name: params[:name],
- source_template_project_id: params[:source_template_project_id]
- ).execute
+ template = TemplateFinder
+ .build(params[:type], user_project, name: params[:name])
+ .execute
rescue ::Gitlab::Template::Finders::RepoTemplateFinder::FileNotFoundError
not_found!('Template')
end
diff --git a/lib/gitlab/ci/reports/test_failure_history.rb b/lib/gitlab/ci/reports/test_failure_history.rb
index beceac5423a..c024e794ad5 100644
--- a/lib/gitlab/ci/reports/test_failure_history.rb
+++ b/lib/gitlab/ci/reports/test_failure_history.rb
@@ -12,8 +12,6 @@ module Gitlab
end
def load!
- return unless Feature.enabled?(:test_failure_history, project)
-
recent_failures_count.each do |key_hash, count|
failed_test_cases[key_hash].set_recent_failures(count, project.default_branch_or_master)
end
diff --git a/lib/gitlab/template/base_template.rb b/lib/gitlab/template/base_template.rb
index c5c4277719c..b659bff52ad 100644
--- a/lib/gitlab/template/base_template.rb
+++ b/lib/gitlab/template/base_template.rb
@@ -8,7 +8,6 @@ module Gitlab
def initialize(path, project = nil, category: nil)
@path = path
@category = category
- @project = project
@finder = self.class.finder(project)
end
@@ -32,22 +31,6 @@ module Gitlab
# override with a comment to be placed at the top of the blob.
end
- def project_id
- @project&.id
- end
-
- def project_path
- @project&.path
- end
-
- def namespace_id
- @project&.namespace&.id
- end
-
- def namespace_path
- @project&.namespace&.full_path
- end
-
# Present for compatibility with license templates, which can replace text
# like `[fullname]` with a user-specified string. This is a no-op for
# other templates
@@ -99,11 +82,11 @@ module Gitlab
raise NotImplementedError
end
- def by_category(category, project = nil, empty_category_title: nil)
+ def by_category(category, project = nil)
directory = category_directory(category)
files = finder(project).list_files_for(directory)
- files.map { |f| new(f, project, category: category.presence || empty_category_title) }.sort
+ files.map { |f| new(f, project, category: category) }.sort
end
def category_directory(category)
diff --git a/lib/gitlab/template/issue_template.rb b/lib/gitlab/template/issue_template.rb
index 244231acb65..01b191733d4 100644
--- a/lib/gitlab/template/issue_template.rb
+++ b/lib/gitlab/template/issue_template.rb
@@ -15,10 +15,6 @@ module Gitlab
def finder(project)
Gitlab::Template::Finders::RepoTemplateFinder.new(project, self.base_dir, self.extension, self.categories)
end
-
- def by_category(category, project = nil, empty_category_title: nil)
- super(category, project, empty_category_title: _('Project Templates'))
- end
end
end
end
diff --git a/lib/gitlab/template/merge_request_template.rb b/lib/gitlab/template/merge_request_template.rb
index 5a29d770f53..357b31cd82e 100644
--- a/lib/gitlab/template/merge_request_template.rb
+++ b/lib/gitlab/template/merge_request_template.rb
@@ -15,10 +15,6 @@ module Gitlab
def finder(project)
Gitlab::Template::Finders::RepoTemplateFinder.new(project, self.base_dir, self.extension, self.categories)
end
-
- def by_category(category, project = nil, empty_category_title: nil)
- super(category, project, empty_category_title: _('Project Templates'))
- end
end
end
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 5151459920f..10a7b59cde0 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -21906,9 +21906,6 @@ msgstr ""
msgid "Project ID"
msgstr ""
-msgid "Project Templates"
-msgstr ""
-
msgid "Project URL"
msgstr ""
diff --git a/spec/controllers/projects/templates_controller_spec.rb b/spec/controllers/projects/templates_controller_spec.rb
index 13f329cb0b6..01593f4133c 100644
--- a/spec/controllers/projects/templates_controller_spec.rb
+++ b/spec/controllers/projects/templates_controller_spec.rb
@@ -160,12 +160,12 @@ RSpec.describe Projects::TemplatesController do
end
shared_examples 'template names request' do
- it 'returns the template names', :aggregate_failures do
+ it 'returns the template names' do
get(:names, params: { namespace_id: project.namespace, template_type: template_type, project_id: project }, format: :json)
expect(response).to have_gitlab_http_status(:ok)
- expect(json_response['Project Templates'].size).to eq(2)
- expect(json_response['Project Templates'].map { |x| { "name" => x['name'] } }).to match(expected_template_names)
+ expect(json_response.size).to eq(2)
+ expect(json_response).to match(expected_template_names)
end
it 'fails for user with no access' do
diff --git a/spec/frontend/ide/stores/modules/commit/actions_spec.js b/spec/frontend/ide/stores/modules/commit/actions_spec.js
index 020bcac8c70..f9a961fc4a1 100644
--- a/spec/frontend/ide/stores/modules/commit/actions_spec.js
+++ b/spec/frontend/ide/stores/modules/commit/actions_spec.js
@@ -19,6 +19,17 @@ jest.mock('~/lib/utils/url_utility', () => ({
}));
const TEST_COMMIT_SHA = '123456789';
+const COMMIT_RESPONSE = {
+ id: '123456',
+ short_id: '123',
+ message: 'test message',
+ committed_date: 'date',
+ parent_ids: [],
+ stats: {
+ additions: '1',
+ deletions: '2',
+ },
+};
describe('IDE commit module actions', () => {
let mock;
@@ -32,7 +43,9 @@ describe('IDE commit module actions', () => {
mock = new MockAdapter(axios);
jest.spyOn(router, 'push').mockImplementation();
- mock.onGet('/api/v1/projects/abcproject/repository/branches/master').reply(200);
+ mock
+ .onGet('/api/v1/projects/abcproject/repository/branches/master')
+ .reply(200, { commit: COMMIT_RESPONSE });
});
afterEach(() => {
@@ -329,18 +342,6 @@ describe('IDE commit module actions', () => {
});
describe('success', () => {
- const COMMIT_RESPONSE = {
- id: '123456',
- short_id: '123',
- message: 'test message',
- committed_date: 'date',
- parent_ids: '321',
- stats: {
- additions: '1',
- deletions: '2',
- },
- };
-
beforeEach(() => {
jest.spyOn(service, 'commit').mockResolvedValue({ data: COMMIT_RESPONSE });
});
@@ -544,18 +545,6 @@ describe('IDE commit module actions', () => {
});
describe('first commit of a branch', () => {
- const COMMIT_RESPONSE = {
- id: '123456',
- short_id: '123',
- message: 'test message',
- committed_date: 'date',
- parent_ids: [],
- stats: {
- additions: '1',
- deletions: '2',
- },
- };
-
it('commits TOGGLE_EMPTY_STATE mutation on empty repo', (done) => {
jest.spyOn(service, 'commit').mockResolvedValue({ data: COMMIT_RESPONSE });
jest.spyOn(store, 'commit');
diff --git a/spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap b/spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap
index 1d34ed3c9ba..c3fd4a9bab2 100644
--- a/spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap
+++ b/spec/frontend/incidents_settings/components/__snapshots__/alerts_form_spec.js.snap
@@ -35,7 +35,7 @@ exports[`Alert integration settings form default state should match the default
Incident template (optional)
<gl-link-stub
- href="/help/user/project/description_templates#create-an-issue-template"
+ href="/help/user/project/description_templates#creating-issue-templates"
target="_blank"
>
<gl-icon-stub
diff --git a/spec/frontend/issue_show/components/app_spec.js b/spec/frontend/issue_show/components/app_spec.js
index 74d195e1eb2..ec2055ca7d1 100644
--- a/spec/frontend/issue_show/components/app_spec.js
+++ b/spec/frontend/issue_show/components/app_spec.js
@@ -423,9 +423,7 @@ describe('Issuable output', () => {
});
it('shows the form if template names request is successful', () => {
- const mockData = {
- test: [{ name: 'test', id: 'test', project_path: '/', namespace_path: '/' }],
- };
+ const mockData = [{ name: 'Bug' }];
mock.onGet('/issuable-templates-path').reply(() => Promise.resolve([200, mockData]));
return wrapper.vm.requestTemplatesAndShowForm().then(() => {
diff --git a/spec/frontend/issue_show/components/fields/description_template_spec.js b/spec/frontend/issue_show/components/fields/description_template_spec.js
index 446c03f70e1..9ebab31f1ad 100644
--- a/spec/frontend/issue_show/components/fields/description_template_spec.js
+++ b/spec/frontend/issue_show/components/fields/description_template_spec.js
@@ -14,10 +14,7 @@ describe('Issue description template component', () => {
vm = new Component({
propsData: {
formState,
- issuableTemplates: {
- test: [{ name: 'test', id: 'test', project_path: '/', namespace_path: '/' }],
- },
- projectId: 1,
+ issuableTemplates: [{ name: 'test' }],
projectPath: '/',
projectNamespace: '/',
},
@@ -26,7 +23,7 @@ describe('Issue description template component', () => {
it('renders templates as JSON array in data attribute', () => {
expect(vm.$el.querySelector('.js-issuable-selector').getAttribute('data-data')).toBe(
- '{"test":[{"name":"test","id":"test","project_path":"/","namespace_path":"/"}]}',
+ '[{"name":"test"}]',
);
});
diff --git a/spec/frontend/issue_show/components/form_spec.js b/spec/frontend/issue_show/components/form_spec.js
index 3a38883d1ec..4e123f606f6 100644
--- a/spec/frontend/issue_show/components/form_spec.js
+++ b/spec/frontend/issue_show/components/form_spec.js
@@ -19,7 +19,6 @@ describe('Inline edit form component', () => {
markdownPreviewPath: '/',
markdownDocsPath: '/',
projectPath: '/',
- projectId: 1,
projectNamespace: '/',
};
@@ -43,11 +42,7 @@ describe('Inline edit form component', () => {
});
it('renders template selector when templates exists', () => {
- createComponent({
- issuableTemplates: {
- test: [{ name: 'test', id: 'test', project_path: 'test', namespace_path: 'test' }],
- },
- });
+ createComponent({ issuableTemplates: ['test'] });
expect(vm.$el.querySelector('.js-issuable-selector-wrap')).not.toBeNull();
});
diff --git a/spec/frontend/issue_show/mock_data.js b/spec/frontend/issue_show/mock_data.js
index fd08c95b454..5a31a550088 100644
--- a/spec/frontend/issue_show/mock_data.js
+++ b/spec/frontend/issue_show/mock_data.js
@@ -52,7 +52,6 @@ export const appProps = {
markdownDocsPath: '/',
projectNamespace: '/',
projectPath: '/',
- projectId: 1,
issuableTemplateNamesPath: '/issuable-templates-path',
zoomMeetingUrl,
publishedIncidentUrl,
diff --git a/spec/frontend/reports/components/grouped_test_reports_app_spec.js b/spec/frontend/reports/components/grouped_test_reports_app_spec.js
index 55901665719..492192988fb 100644
--- a/spec/frontend/reports/components/grouped_test_reports_app_spec.js
+++ b/spec/frontend/reports/components/grouped_test_reports_app_spec.js
@@ -22,7 +22,7 @@ describe('Grouped test reports app', () => {
let wrapper;
let mockStore;
- const mountComponent = ({ props = { pipelinePath }, testFailureHistory = false } = {}) => {
+ const mountComponent = ({ props = { pipelinePath } } = {}) => {
wrapper = mount(Component, {
store: mockStore,
localVue,
@@ -31,11 +31,6 @@ describe('Grouped test reports app', () => {
pipelinePath,
...props,
},
- provide: {
- glFeatures: {
- testFailureHistory,
- },
- },
});
};
@@ -242,50 +237,25 @@ describe('Grouped test reports app', () => {
describe('with recent failures counts', () => {
beforeEach(() => {
setReports(recentFailuresTestReports);
+ mountComponent();
});
- describe('with feature flag enabled', () => {
- beforeEach(() => {
- mountComponent({ testFailureHistory: true });
- });
-
- it('renders the recently failed tests summary', () => {
- expect(findHeader().text()).toContain(
- '2 out of 3 failed tests have failed more than once in the last 14 days',
- );
- });
-
- it('renders the recently failed count on the test suite', () => {
- expect(findSummaryDescription().text()).toContain(
- '1 out of 2 failed tests has failed more than once in the last 14 days',
- );
- });
-
- it('renders the recent failures count on the test case', () => {
- expect(findIssueDescription().text()).toContain(
- 'Failed 8 times in master in the last 14 days',
- );
- });
+ it('renders the recently failed tests summary', () => {
+ expect(findHeader().text()).toContain(
+ '2 out of 3 failed tests have failed more than once in the last 14 days',
+ );
});
- describe('with feature flag disabled', () => {
- beforeEach(() => {
- mountComponent({ testFailureHistory: false });
- });
-
- it('does not render the recently failed tests summary', () => {
- expect(findHeader().text()).not.toContain('failed more than once in the last 14 days');
- });
-
- it('does not render the recently failed count on the test suite', () => {
- expect(findSummaryDescription().text()).not.toContain(
- 'failed more than once in the last 14 days',
- );
- });
+ it('renders the recently failed count on the test suite', () => {
+ expect(findSummaryDescription().text()).toContain(
+ '1 out of 2 failed tests has failed more than once in the last 14 days',
+ );
+ });
- it('renders the recent failures count on the test case', () => {
- expect(findIssueDescription().text()).not.toContain('in the last 14 days');
- });
+ it('renders the recent failures count on the test case', () => {
+ expect(findIssueDescription().text()).toContain(
+ 'Failed 8 times in master in the last 14 days',
+ );
});
});
diff --git a/spec/frontend_integration/ide/helpers/ide_helper.js b/spec/frontend_integration/ide/helpers/ide_helper.js
index 7516523fe1d..8d5d047b146 100644
--- a/spec/frontend_integration/ide/helpers/ide_helper.js
+++ b/spec/frontend_integration/ide/helpers/ide_helper.js
@@ -138,6 +138,11 @@ export const createFile = async (path, content) => {
await findAndSetEditorValue(content);
};
+export const updateFile = async (path, content) => {
+ await openFile(path);
+ await findAndSetEditorValue(content);
+};
+
export const getFilesList = () => {
return screen.getAllByTestId('file-row-name-container').map((e) => e.textContent.trim());
};
@@ -162,11 +167,33 @@ export const closeFile = async (path) => {
button.click();
};
-export const commit = async () => {
+/**
+ * Fill out and submit the commit form in the Web IDE
+ *
+ * @param {Object} options - Used to fill out the commit form in the IDE
+ * @param {Boolean} options.newBranch - Flag for the "Create a new branch" radio.
+ * @param {Boolean} options.newMR - Flag for the "Start a new merge request" checkbox.
+ * @param {String} options.newBranchName - Value to put in the new branch name input field. The Web IDE supports leaving this field blank.
+ */
+export const commit = async ({ newBranch = false, newMR = false, newBranchName = '' } = {}) => {
switchLeftSidebarTab('Commit');
screen.getByTestId('begin-commit-button').click();
- await screen.findByLabelText(/Commit to .+ branch/).then((x) => x.click());
+ if (!newBranch) {
+ const option = await screen.findByLabelText(/Commit to .+ branch/);
+ option.click();
+ } else {
+ const option = await screen.findByLabelText('Create a new branch');
+ option.click();
+
+ const branchNameInput = await screen.findByTestId('ide-new-branch-name');
+ fireEvent.input(branchNameInput, { target: { value: newBranchName } });
+
+ const mrCheck = await screen.findByLabelText('Start a new merge request');
+ if (Boolean(mrCheck.checked) !== newMR) {
+ mrCheck.click();
+ }
+ }
screen.getByText('Commit').click();
};
diff --git a/spec/frontend_integration/ide/helpers/start.js b/spec/frontend_integration/ide/helpers/start.js
index 9dc9649e1bf..43a996286e7 100644
--- a/spec/frontend_integration/ide/helpers/start.js
+++ b/spec/frontend_integration/ide/helpers/start.js
@@ -2,6 +2,7 @@ import { TEST_HOST } from 'helpers/test_constants';
import extendStore from '~/ide/stores/extend';
import { IDE_DATASET } from './mock_data';
import { initIde } from '~/ide';
+import Editor from '~/ide/lib/editor';
export default (container, { isRepoEmpty = false, path = '' } = {}) => {
global.jsdom.reconfigure({
@@ -13,5 +14,16 @@ export default (container, { isRepoEmpty = false, path = '' } = {}) => {
const el = document.createElement('div');
Object.assign(el.dataset, IDE_DATASET);
container.appendChild(el);
- return initIde(el, { extendStore });
+ const vm = initIde(el, { extendStore });
+
+ // We need to dispose of editor Singleton things or tests will bump into eachother
+ vm.$on('destroy', () => {
+ if (Editor.editorInstance) {
+ Editor.editorInstance.modelManager.dispose();
+ Editor.editorInstance.dispose();
+ Editor.editorInstance = null;
+ }
+ });
+
+ return vm;
};
diff --git a/spec/frontend_integration/ide/ide_integration_spec.js b/spec/frontend_integration/ide/ide_integration_spec.js
index 1d4dfd4a930..3dcf3a2cc15 100644
--- a/spec/frontend_integration/ide/ide_integration_spec.js
+++ b/spec/frontend_integration/ide/ide_integration_spec.js
@@ -55,6 +55,25 @@ describe('WebIDE', () => {
});
});
+ it('user commits changes to new branch', async () => {
+ vm = startWebIDE(container);
+
+ expect(window.location.pathname).toBe('/-/ide/project/gitlab-test/lorem-ipsum/tree/master/-/');
+
+ await ideHelper.updateFile('README.md', 'Lorem dolar si amit\n');
+ await ideHelper.commit({ newBranch: true, newMR: false, newBranchName: 'test-hello-world' });
+
+ await waitForText('All changes are committed');
+
+ // Wait for IDE to load new commit
+ await waitForText('10000000', document.querySelector('.ide-status-bar'));
+
+ // It's important that the new branch is now in the route
+ expect(window.location.pathname).toBe(
+ '/-/ide/project/gitlab-test/lorem-ipsum/blob/test-hello-world/-/README.md',
+ );
+ });
+
it('user adds file that starts with +', async () => {
vm = startWebIDE(container);
diff --git a/spec/frontend_integration/test_helpers/mock_server/routes/repository.js b/spec/frontend_integration/test_helpers/mock_server/routes/repository.js
index bff9f20096a..ba36463cad8 100644
--- a/spec/frontend_integration/test_helpers/mock_server/routes/repository.js
+++ b/spec/frontend_integration/test_helpers/mock_server/routes/repository.js
@@ -37,13 +37,23 @@ export default (server) => {
);
const branch = schema.branches.findBy({ name: branchName });
+ const prevCommit = branch
+ ? branch.attrs.commit
+ : schema.branches.findBy({ name: 'master' }).attrs.commit;
const commit = {
- ...createNewCommit({ id: commitIdGenerator.next(), message }, branch.attrs.commit),
+ ...createNewCommit({ id: commitIdGenerator.next(), message }, prevCommit),
__actions: actions,
};
- branch.update({ commit });
+ if (branch) {
+ branch.update({ commit });
+ } else {
+ schema.branches.create({
+ name: branchName,
+ commit,
+ });
+ }
return commit;
});
diff --git a/spec/helpers/issuables_description_templates_helper_spec.rb b/spec/helpers/issuables_description_templates_helper_spec.rb
deleted file mode 100644
index 199b43c2131..00000000000
--- a/spec/helpers/issuables_description_templates_helper_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe IssuablesDescriptionTemplatesHelper do
- include_context 'project issuable templates context'
-
- describe '#issuable_templates' do
- let_it_be(:inherited_from) { nil }
- let_it_be(:user) { create(:user) }
- let_it_be(:parent_group) { create(:group) }
- let_it_be(:project) { create(:project, :custom_repo, files: issuable_template_files) }
- let_it_be(:group_member) { create(:group_member, :developer, group: parent_group, user: user) }
- let_it_be(:project_member) { create(:project_member, :developer, user: user, project: project) }
-
- context 'when project has no parent group' do
- it_behaves_like 'project issuable templates'
- end
-
- context 'when project has parent group' do
- before do
- project.update!(group: parent_group)
- end
-
- context 'when project parent group does not have a file template project' do
- it_behaves_like 'project issuable templates'
- end
-
- context 'when project parent group has a file template project' do
- let_it_be(:file_template_project) { create(:project, :custom_repo, group: parent_group, files: issuable_template_files) }
- let_it_be(:group) { create(:group, parent: parent_group) }
- let_it_be(:project) { create(:project, :custom_repo, group: group, files: issuable_template_files) }
-
- before do
- project.update!(group: group)
- parent_group.update_columns(file_template_project_id: file_template_project.id)
- end
-
- it_behaves_like 'project issuable templates'
- end
- end
- end
-end
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb
index a9ac98fa65b..57845904d32 100644
--- a/spec/helpers/issuables_helper_spec.rb
+++ b/spec/helpers/issuables_helper_spec.rb
@@ -199,7 +199,6 @@ RSpec.describe IssuablesHelper do
markdownDocsPath: '/help/user/markdown',
lockVersion: issue.lock_version,
projectPath: @project.path,
- projectId: @project.id,
projectNamespace: @project.namespace.path,
initialTitleHtml: issue.title,
initialTitleText: issue.title,
diff --git a/spec/lib/gitlab/ci/reports/test_failure_history_spec.rb b/spec/lib/gitlab/ci/reports/test_failure_history_spec.rb
index 8df34eddffd..831bc5e9f37 100644
--- a/spec/lib/gitlab/ci/reports/test_failure_history_spec.rb
+++ b/spec/lib/gitlab/ci/reports/test_failure_history_spec.rb
@@ -28,18 +28,5 @@ RSpec.describe Gitlab::Ci::Reports::TestFailureHistory, :aggregate_failures do
expect(failed_rspec.recent_failures).to eq(count: 2, base_branch: 'master')
expect(failed_java.recent_failures).to eq(count: 1, base_branch: 'master')
end
-
- context 'when feature flag is disabled' do
- before do
- stub_feature_flags(test_failure_history: false)
- end
-
- it 'does not set recent failures' do
- load_history
-
- expect(failed_rspec.recent_failures).to be_nil
- expect(failed_java.recent_failures).to be_nil
- end
- end
end
end
diff --git a/spec/models/license_template_spec.rb b/spec/models/license_template_spec.rb
index fe06d1a357c..515f728f515 100644
--- a/spec/models/license_template_spec.rb
+++ b/spec/models/license_template_spec.rb
@@ -57,6 +57,6 @@ RSpec.describe LicenseTemplate do
end
def build_template(content)
- described_class.new(key: 'foo', name: 'foo', project: nil, category: :Other, content: content)
+ described_class.new(key: 'foo', name: 'foo', category: :Other, content: content)
end
end
diff --git a/spec/services/ci/test_failure_history_service_spec.rb b/spec/services/ci/test_failure_history_service_spec.rb
index e858c85490d..d9c1c8dc3fa 100644
--- a/spec/services/ci/test_failure_history_service_spec.rb
+++ b/spec/services/ci/test_failure_history_service_spec.rb
@@ -22,19 +22,6 @@ RSpec.describe Ci::TestFailureHistoryService, :aggregate_failures do
expect(Ci::TestCaseFailure.count).to eq(2)
end
- context 'when feature flag for test failure history is disabled' do
- before do
- stub_feature_flags(test_failure_history: false)
- end
-
- it 'does not persist data' do
- execute_service
-
- expect(Ci::TestCase.count).to eq(0)
- expect(Ci::TestCaseFailure.count).to eq(0)
- end
- end
-
context 'when pipeline is not for the default branch' do
before do
pipeline.update_column(:ref, 'new-feature')
@@ -136,14 +123,6 @@ RSpec.describe Ci::TestFailureHistoryService, :aggregate_failures do
it { is_expected.to eq(true) }
end
- context 'when feature flag is disabled' do
- before do
- stub_feature_flags(test_failure_history: false)
- end
-
- it { is_expected.to eq(false) }
- end
-
context 'when pipeline is not equal to the project default branch' do
before do
pipeline.update_column(:ref, 'some-other-branch')
diff --git a/spec/services/merge_requests/mergeability_check_service_spec.rb b/spec/services/merge_requests/mergeability_check_service_spec.rb
index 725fc16fa7c..5f335b3250b 100644
--- a/spec/services/merge_requests/mergeability_check_service_spec.rb
+++ b/spec/services/merge_requests/mergeability_check_service_spec.rb
@@ -167,25 +167,6 @@ RSpec.describe MergeRequests::MergeabilityCheckService, :clean_gitlab_redis_shar
end
end
- context 'disabled merge ref sync feature flag' do
- before do
- stub_feature_flags(merge_ref_auto_sync: false)
- end
-
- it 'returns error and no payload' do
- result = subject
-
- expect(result).to be_a(ServiceResponse)
- expect(result.error?).to be(true)
- expect(result.message).to eq('Merge ref is outdated due to disabled feature')
- expect(result.payload).to be_empty
- end
-
- it 'ignores merge-ref and updates merge status' do
- expect { subject }.to change(merge_request, :merge_status).from('unchecked').to('can_be_merged')
- end
- end
-
context 'when broken' do
before do
expect(merge_request).to receive(:broken?) { true }
@@ -305,28 +286,6 @@ RSpec.describe MergeRequests::MergeabilityCheckService, :clean_gitlab_redis_shar
context 'recheck enforced' do
subject { described_class.new(merge_request).execute(recheck: true) }
- context 'when MR is mergeable and merge-ref auto-sync is disabled' do
- before do
- stub_feature_flags(merge_ref_auto_sync: false)
- merge_request.mark_as_mergeable!
- end
-
- it 'returns ServiceResponse.error' do
- result = subject
-
- expect(result).to be_a(ServiceResponse)
- expect(result.error?).to be(true)
- expect(result.message).to eq('Merge ref is outdated due to disabled feature')
- expect(result.payload).to be_empty
- end
-
- it 'merge status is not changed' do
- subject
-
- expect(merge_request.merge_status).to eq('can_be_merged')
- end
- end
-
context 'when MR is marked as mergeable, but repo is not mergeable and MR is not opened' do
before do
# Making sure that we don't touch the merge-status after
diff --git a/spec/support/shared_examples/helpers/issuable_description_templates_shared_examples.rb b/spec/support/shared_examples/helpers/issuable_description_templates_shared_examples.rb
deleted file mode 100644
index dbd4f1927e3..00000000000
--- a/spec/support/shared_examples/helpers/issuable_description_templates_shared_examples.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-# frozen_string_literal: true
-
-RSpec.shared_context 'project issuable templates context' do
- let_it_be(:issuable_template_files) do
- {
- '.gitlab/issue_templates/issue-bar.md' => 'Issue Template Bar',
- '.gitlab/issue_templates/issue-foo.md' => 'Issue Template Foo',
- '.gitlab/issue_templates/issue-bad.txt' => 'Issue Template Bad',
- '.gitlab/issue_templates/issue-baz.xyz' => 'Issue Template Baz',
-
- '.gitlab/merge_request_templates/merge_request-bar.md' => 'Merge Request Template Bar',
- '.gitlab/merge_request_templates/merge_request-foo.md' => 'Merge Request Template Foo',
- '.gitlab/merge_request_templates/merge_request-bad.txt' => 'Merge Request Template Bad',
- '.gitlab/merge_request_templates/merge_request-baz.xyz' => 'Merge Request Template Baz'
- }
- end
-end
-
-RSpec.shared_examples 'project issuable templates' do
- context 'issuable templates' do
- before do
- allow(helper).to receive(:current_user).and_return(user)
- end
-
- it 'returns only md files as issue templates' do
- expect(helper.issuable_templates(project, 'issue')).to eq(expected_templates('issue'))
- end
-
- it 'returns only md files as merge_request templates' do
- expect(helper.issuable_templates(project, 'merge_request')).to eq(expected_templates('merge_request'))
- end
- end
-
- def expected_templates(issuable_type)
- expectation = {}
-
- expectation["Project Templates"] = templates(issuable_type, project)
- expectation["Group #{inherited_from.namespace.full_name}"] = templates(issuable_type, inherited_from) if inherited_from.present?
-
- expectation
- end
-
- def templates(issuable_type, inherited_from)
- [
- { id: "#{issuable_type}-bar", name: "#{issuable_type}-bar", project_id: inherited_from.id },
- { id: "#{issuable_type}-foo", name: "#{issuable_type}-foo", project_id: inherited_from.id }
- ]
- end
-end
diff --git a/spec/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker_spec.rb b/spec/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker_spec.rb
index 7acf1a338d3..75d4d2dff2e 100644
--- a/spec/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker_spec.rb
+++ b/spec/workers/gitlab/github_import/stage/import_pull_requests_reviews_worker_spec.rb
@@ -9,23 +9,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportPullRequestsReviewsWorker do
let(:client) { double(:client) }
describe '#import' do
- it 'does not import with the feature disabled' do
- stub_feature_flags(github_import_pull_request_reviews: false)
-
- expect(Gitlab::JobWaiter)
- .to receive(:new)
- .and_return(double(key: '123', jobs_remaining: 0))
-
- expect(Gitlab::GithubImport::AdvanceStageWorker)
- .to receive(:perform_async)
- .with(project.id, { '123' => 0 }, :issues_and_diff_notes)
-
- worker.import(client, project)
- end
-
it 'imports all the pull request reviews' do
- stub_feature_flags(github_import_pull_request_reviews: true)
-
importer = double(:importer)
waiter = Gitlab::JobWaiter.new(2, '123')