summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-27 21:09:12 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-27 21:09:12 +0000
commit10eb15fe07b89755e82dbe2798651795aebd6614 (patch)
treea05c3db0856ccad42b8bf9a57df3629f8aa88e46
parent874d5e8019150bfb2428cac3089c1dac1d6f9ed9 (diff)
downloadgitlab-ce-10eb15fe07b89755e82dbe2798651795aebd6614.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/ide/components/preview/clientside.vue2
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/states/pipeline_failed.vue26
-rw-r--r--app/models/service.rb8
-rw-r--r--app/views/admin/application_settings/ci/_header.html.haml15
-rw-r--r--app/views/admin/application_settings/ci_cd.html.haml2
-rw-r--r--app/views/admin/applications/show.html.haml4
-rw-r--r--app/views/admin/projects/index.html.haml2
-rw-r--r--app/views/admin/projects/show.html.haml4
-rw-r--r--app/views/ci/group_variables/_content.html.haml2
-rw-r--r--app/views/ci/group_variables/_variable_header.html.haml2
-rw-r--r--app/views/ci/variables/_content.html.haml12
-rw-r--r--app/views/ci/variables/_header.html.haml1
-rw-r--r--app/views/ci/variables/_index.html.haml2
-rw-r--r--app/views/devise/passwords/edit.html.haml2
-rw-r--r--app/views/devise/passwords/new.html.haml2
-rw-r--r--app/views/doorkeeper/applications/show.html.haml4
-rw-r--r--app/views/profiles/show.html.haml6
-rw-r--r--app/views/projects/buttons/_download_links.html.haml2
-rw-r--r--app/views/projects/merge_requests/_commits.html.haml2
-rw-r--r--app/views/sent_notifications/unsubscribe.html.haml2
-rw-r--r--changelogs/unreleased/207385-simplify-service-uniqueness-validations.yml5
-rw-r--r--changelogs/unreleased/299828-okr-ci-cd-variables-review-and-revise-settings-related-ui-text.yml5
-rw-r--r--changelogs/unreleased/pb-change-mr-pipeline-failed-message.yml5
-rw-r--r--changelogs/unreleased/yo-btn-info-fix.yml5
-rw-r--r--doc/.vale/gitlab/Admin.yml2
-rw-r--r--doc/administration/index.md1
-rw-r--r--doc/administration/maintenance_mode/index.md137
-rw-r--r--doc/ci/examples/deployment/README.md10
-rw-r--r--doc/ci/troubleshooting.md23
-rw-r--r--doc/development/packages.md2
-rw-r--r--doc/development/testing_guide/end_to_end/rspec_metadata_tests.md33
-rw-r--r--doc/topics/git/git_rebase.md25
-rw-r--r--doc/topics/git/lfs/index.md61
-rw-r--r--doc/topics/git/lfs/migrate_from_git_annex_to_git_lfs.md28
-rw-r--r--doc/topics/git/numerous_undo_possibilities_in_git/index.md154
-rw-r--r--doc/topics/git/useful_git_commands.md6
-rw-r--r--doc/update/README.md2
-rw-r--r--doc/user/group/epics/manage_epics.md11
-rw-r--r--doc/user/packages/dependency_proxy/index.md14
-rw-r--r--locale/gitlab.pot33
-rw-r--r--qa/qa/resource/merge_request.rb2
-rw-r--r--qa/qa/runtime/env.rb4
-rw-r--r--qa/qa/specs/runner.rb2
-rw-r--r--qa/spec/specs/runner_spec.rb28
-rw-r--r--spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb4
-rw-r--r--spec/frontend/vue_mr_widget/components/states/__snapshots__/mr_widget_pipeline_failed_spec.js.snap24
-rw-r--r--spec/frontend/vue_mr_widget/components/states/mr_widget_pipeline_failed_spec.js39
-rw-r--r--spec/frontend_integration/test_helpers/fixtures.js8
-rw-r--r--spec/models/service_spec.rb32
-rw-r--r--spec/support/matchers/pushed_frontend_feature_flags_matcher.rb23
50 files changed, 555 insertions, 275 deletions
diff --git a/app/assets/javascripts/ide/components/preview/clientside.vue b/app/assets/javascripts/ide/components/preview/clientside.vue
index 4c2a369226e..368a6248201 100644
--- a/app/assets/javascripts/ide/components/preview/clientside.vue
+++ b/app/assets/javascripts/ide/components/preview/clientside.vue
@@ -165,7 +165,7 @@ export default {
</p>
<a
:href="links.webIDEHelpPagePath"
- class="btn btn-primary"
+ class="btn gl-button btn-confirm"
target="_blank"
rel="noopener noreferrer"
>
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/pipeline_failed.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/pipeline_failed.vue
index 5f56157cb89..89c7a27b1bc 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/states/pipeline_failed.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/states/pipeline_failed.vue
@@ -1,11 +1,26 @@
<script>
+import { GlLink, GlSprintf } from '@gitlab/ui';
+import { s__ } from '~/locale';
+import { helpPagePath } from '~/helpers/help_page_helper';
import statusIcon from '../mr_widget_status_icon.vue';
export default {
name: 'PipelineFailed',
components: {
+ GlLink,
+ GlSprintf,
statusIcon,
},
+ computed: {
+ troubleshootingDocsPath() {
+ return helpPagePath('ci/troubleshooting', { anchor: 'merge-request-status-messages' });
+ },
+ },
+ i18n: {
+ failedMessage: s__(
+ `mrWidget|The pipeline for this merge request did not complete. Push a new commit to fix the failure or check the %{linkStart}troubleshooting documentation%{linkEnd} to see other possible actions.`,
+ ),
+ },
};
</script>
@@ -14,10 +29,13 @@ export default {
<status-icon :show-disabled-button="true" status="warning" />
<div class="media-body space-children">
<span class="bold">
- {{
- s__(`mrWidget|The pipeline for this merge request failed.
-Please retry the job or push a new commit to fix the failure`)
- }}
+ <gl-sprintf :message="$options.i18n.failedMessage">
+ <template #link="{ content }">
+ <gl-link :href="troubleshootingDocsPath" target="_blank">
+ {{ content }}
+ </gl-link>
+ </template>
+ </gl-sprintf>
</span>
</div>
</div>
diff --git a/app/models/service.rb b/app/models/service.rb
index 2b92b2cd7d8..c49e0869b21 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -54,11 +54,11 @@ class Service < ApplicationRecord
validates :project_id, presence: true, unless: -> { template? || instance? || group_id }
validates :group_id, presence: true, unless: -> { template? || instance? || project_id }
validates :project_id, :group_id, absence: true, if: -> { template? || instance? }
- validates :type, uniqueness: { scope: :project_id }, unless: -> { template? || instance? || group_id }, on: :create
- validates :type, uniqueness: { scope: :group_id }, unless: -> { template? || instance? || project_id }
validates :type, presence: true
- validates :template, uniqueness: { scope: :type }, if: -> { template? }
- validates :instance, uniqueness: { scope: :type }, if: -> { instance? }
+ validates :type, uniqueness: { scope: :template }, if: :template?
+ validates :type, uniqueness: { scope: :instance }, if: :instance?
+ validates :type, uniqueness: { scope: :project_id }, if: :project_id?
+ validates :type, uniqueness: { scope: :group_id }, if: :group_id?
validate :validate_is_instance_or_template
validate :validate_belongs_to_project_or_group
diff --git a/app/views/admin/application_settings/ci/_header.html.haml b/app/views/admin/application_settings/ci/_header.html.haml
index 0a0f8aaf032..a54d8ff61e0 100644
--- a/app/views/admin/application_settings/ci/_header.html.haml
+++ b/app/views/admin/application_settings/ci/_header.html.haml
@@ -2,19 +2,18 @@
%h4
= _('Variables')
- = link_to sprite_icon('question-o', css_class: 'gl-vertical-align-baseline!'), help_page_path('ci/variables/README', anchor: 'custom-environment-variables'), target: '_blank', rel: 'noopener noreferrer'
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
- = html_escape(_('Environment variables are applied to environments via the Runner. You can use environment variables for passwords, secret keys, etc. Make variables available to the running application by prepending the variable key with %{code_open}K8S_SECRET_%{code_close}. You can set variables to be:')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
-
+ = _('Variables store information, like passwords and secret keys, that you can use in job scripts. All projects on the instance can use these variables.')
+ = link_to s_('Learn more.'), help_page_path('ci/variables/README', anchor: 'instance-level-cicd-environment-variables'), target: '_blank', rel: 'noopener noreferrer'
+%p
+ = _('Variables can be:')
%ul
%li
- = html_escape(_('%{code_open}Protected%{code_close} variables are only exposed to protected branches or tags.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
+ = html_escape(_('%{code_open}Protected:%{code_close} Only exposed to protected branches or tags.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
%li
- = html_escape(_('%{code_open}Masked%{code_close} variables are hidden in job logs (though they must match certain regexp requirements to do so).')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
-
-%p
- = link_to _('More information'), help_page_path('ci/variables/README', anchor: 'instance-level-cicd-environment-variables')
+ = html_escape(_('%{code_open}Masked:%{code_close} Hidden in job logs. Must match masking requirements.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
+ = link_to _('Learn more.'), help_page_path('ci/variables/README', anchor: 'masked-variable-requirements'), target: '_blank', rel: 'noopener noreferrer'
diff --git a/app/views/admin/application_settings/ci_cd.html.haml b/app/views/admin/application_settings/ci_cd.html.haml
index b05e8621d07..485fb71d111 100644
--- a/app/views/admin/application_settings/ci_cd.html.haml
+++ b/app/views/admin/application_settings/ci_cd.html.haml
@@ -10,7 +10,7 @@
- if ci_variable_protected_by_default?
%p.settings-message.text-center
- link_start = '<a href="%{url}">'.html_safe % { url: help_page_path('ci/variables/README', anchor: 'protect-a-custom-variable') }
- = s_('Environment variables on this GitLab instance are configured to be %{link_start}protected%{link_end} by default').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
+ = s_('Environment variables on this GitLab instance are configured to be %{link_start}protected%{link_end} by default.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
#js-instance-variables{ data: { endpoint: admin_ci_variables_path, group: 'true', maskable_regex: ci_variable_maskable_regex, protected_by_default: ci_variable_protected_by_default?.to_s} }
%section.settings.as-ci-cd.no-animate#js-ci-cd-settings{ class: ('expanded' if expanded_by_default?) }
diff --git a/app/views/admin/applications/show.html.haml b/app/views/admin/applications/show.html.haml
index f029da6b3af..8d643a7a4bc 100644
--- a/app/views/admin/applications/show.html.haml
+++ b/app/views/admin/applications/show.html.haml
@@ -45,5 +45,5 @@
= render "shared/tokens/scopes_list", token: @application
.form-actions
- = link_to 'Edit', edit_admin_application_path(@application), class: 'gl-button btn btn-primary wide float-left'
- = render 'delete_form', application: @application, submit_btn_css: 'btn btn-danger gl-ml-3'
+ = link_to 'Edit', edit_admin_application_path(@application), class: 'gl-button btn btn-confirm wide float-left'
+ = render 'delete_form', application: @application, submit_btn_css: 'gl-button btn btn-danger gl-ml-3'
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index bcf09dfc0d2..d9ff4404519 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -32,6 +32,6 @@
= render 'shared/projects/dropdown'
= link_to new_project_path, class: 'gl-button btn btn-success' do
New Project
- = button_tag "Search", class: "gl-button btn btn-primary btn-search hide"
+ = button_tag "Search", class: "gl-button btn btn-confirm btn-search hide"
= render 'projects'
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index aae1d5b6a4e..2085515e349 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -150,7 +150,7 @@
.form-group.row
.offset-sm-3.col-sm-9
- = f.submit _('Transfer'), class: 'gl-button btn btn-primary'
+ = f.submit _('Transfer'), class: 'gl-button btn btn-confirm'
.card.repository-check
.card-header
@@ -170,7 +170,7 @@
= link_to sprite_icon('question-o'), help_page_path('administration/repository_checks')
.form-group
- = f.submit _('Trigger repository check'), class: 'gl-button btn btn-primary'
+ = f.submit _('Trigger repository check'), class: 'gl-button btn btn-confirm'
.col-md-6
- if @group
diff --git a/app/views/ci/group_variables/_content.html.haml b/app/views/ci/group_variables/_content.html.haml
index db5f1021f57..fe8155cd9f7 100644
--- a/app/views/ci/group_variables/_content.html.haml
+++ b/app/views/ci/group_variables/_content.html.haml
@@ -1 +1 @@
-= _("These variables are configured in the parent group settings, and will be active in the current project in addition to the project variables.")
+= _("These variables are inherited from the parent group.")
diff --git a/app/views/ci/group_variables/_variable_header.html.haml b/app/views/ci/group_variables/_variable_header.html.haml
index a8d533da0e0..2759a3f6f4a 100644
--- a/app/views/ci/group_variables/_variable_header.html.haml
+++ b/app/views/ci/group_variables/_variable_header.html.haml
@@ -2,4 +2,4 @@
.bold.table-section.section-40.gl-mr-3
= s_('Key')
.bold.table-section.section-40.gl-mr-3
- = s_('Origin')
+ = s_('Group')
diff --git a/app/views/ci/variables/_content.html.haml b/app/views/ci/variables/_content.html.haml
index bf695d871f8..fd4b546e150 100644
--- a/app/views/ci/variables/_content.html.haml
+++ b/app/views/ci/variables/_content.html.haml
@@ -1,8 +1,10 @@
-= html_escape(_('Environment variables are applied to environments via the Runner. You can use environment variables for passwords, secret keys, etc. Make variables available to the running application by prepending the variable key with %{code_open}K8S_SECRET_%{code_close}. You can set variables to be:')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
+= _('Variables store information, like passwords and secret keys, that you can use in job scripts.')
+= link_to s_('Learn more.'), help_page_path('ci/variables/README'), target: '_blank', rel: 'noopener noreferrer'
+%p
+ = _('Variables can be:')
%ul
%li
- = html_escape(_('%{code_open}Protected%{code_close} variables are only exposed to protected branches or tags.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
+ = html_escape(_('%{code_open}Protected:%{code_close} Only exposed to protected branches or tags.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
%li
- = html_escape(_('%{code_open}Masked%{code_close} variables are hidden in job logs (though they must match certain regexp requirements to do so).')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
-
-= link_to _('More information'), help_page_path('ci/variables/README', anchor: 'custom-environment-variables')
+ = html_escape(_('%{code_open}Masked:%{code_close} Hidden in job logs. Must match masking requirements.')) % { code_open: '<code>'.html_safe, code_close: '</code>'.html_safe }
+ = link_to _('Learn more.'), help_page_path('ci/variables/README', anchor: 'masked-variable-requirements'), target: '_blank', rel: 'noopener noreferrer'
diff --git a/app/views/ci/variables/_header.html.haml b/app/views/ci/variables/_header.html.haml
index f4e2a8584d8..d882a96dd42 100644
--- a/app/views/ci/variables/_header.html.haml
+++ b/app/views/ci/variables/_header.html.haml
@@ -2,7 +2,6 @@
%h4
= _('Variables')
- = link_to sprite_icon('question-o', css_class: 'gl-vertical-align-baseline!'), help_page_path('ci/variables/README', anchor: 'custom-environment-variables'), target: '_blank', rel: 'noopener noreferrer'
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
diff --git a/app/views/ci/variables/_index.html.haml b/app/views/ci/variables/_index.html.haml
index 3f6d60c2620..fc0e3488e57 100644
--- a/app/views/ci/variables/_index.html.haml
+++ b/app/views/ci/variables/_index.html.haml
@@ -3,7 +3,7 @@
- if ci_variable_protected_by_default?
%p.settings-message.text-center
- link_start = '<a href="%{url}">'.html_safe % { url: help_page_path('ci/variables/README', anchor: 'protect-a-custom-variable') }
- = s_('Environment variables are configured by your administrator to be %{link_start}protected%{link_end} by default').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
+ = s_('Environment variables are configured by your administrator to be %{link_start}protected%{link_end} by default.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
- is_group = !@group.nil?
diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml
index 058c5e630c8..7876aed2c0a 100644
--- a/app/views/devise/passwords/edit.html.haml
+++ b/app/views/devise/passwords/edit.html.haml
@@ -12,7 +12,7 @@
= f.label 'Confirm new password', for: "user_password_confirmation"
= f.password_field :password_confirmation, class: "form-control gl-form-input bottom", title: 'This field is required', data: { qa_selector: 'password_confirmation_field' }, required: true
.clearfix
- = f.submit "Change your password", class: "gl-button btn btn-info", data: { qa_selector: 'change_password_button' }
+ = f.submit "Change your password", class: "gl-button btn btn-confirm", data: { qa_selector: 'change_password_button' }
.clearfix.prepend-top-20
%p
diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml
index 3b1cba59b58..c4672a5b25e 100644
--- a/app/views/devise/passwords/new.html.haml
+++ b/app/views/devise/passwords/new.html.haml
@@ -7,7 +7,7 @@
= f.label :email
= f.email_field :email, class: "form-control gl-form-input", required: true, value: params[:user_email], autofocus: true, title: 'Please provide a valid email address.'
.clearfix
- = f.submit "Reset password", class: "gl-button btn-info btn"
+ = f.submit "Reset password", class: "gl-button btn-confirm btn"
.clearfix.prepend-top-20
= render 'devise/shared/sign_in_link'
diff --git a/app/views/doorkeeper/applications/show.html.haml b/app/views/doorkeeper/applications/show.html.haml
index 0a091aa7586..046d44bc47f 100644
--- a/app/views/doorkeeper/applications/show.html.haml
+++ b/app/views/doorkeeper/applications/show.html.haml
@@ -43,5 +43,5 @@
= render "shared/tokens/scopes_list", token: @application
.form-actions
- = link_to _('Edit'), edit_oauth_application_path(@application), class: 'gl-button btn btn-primary wide float-left'
- = render 'delete_form', application: @application, submit_btn_css: 'btn btn-danger gl-ml-3'
+ = link_to _('Edit'), edit_oauth_application_path(@application), class: 'gl-button btn btn-confirm wide float-left'
+ = render 'delete_form', application: @application, submit_btn_css: 'gl-button btn btn-danger gl-ml-3'
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index ae22df1ff19..435ff763a2b 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -141,12 +141,12 @@
%img.modal-profile-crop-image{ alt: s_("Profiles|Avatar cropper") }
.crop-controls
.btn-group
- %button.btn.btn-primary{ data: { method: 'zoom', option: '-0.1' } }
+ %button.btn.gl-button.btn-confirm{ data: { method: 'zoom', option: '-0.1' } }
%span
= sprite_icon('search-minus')
- %button.btn.btn-primary{ data: { method: 'zoom', option: '0.1' } }
+ %button.btn.gl-button.btn-confirm{ data: { method: 'zoom', option: '0.1' } }
%span
= sprite_icon('search-plus')
.modal-footer
- %button.btn.btn-primary.js-upload-user-avatar{ type: 'button' }
+ %button.btn.gl-button.btn-confirm.js-upload-user-avatar{ type: 'button' }
= s_("Profiles|Set new profile picture")
diff --git a/app/views/projects/buttons/_download_links.html.haml b/app/views/projects/buttons/_download_links.html.haml
index c997df578c0..99febfcead0 100644
--- a/app/views/projects/buttons/_download_links.html.haml
+++ b/app/views/projects/buttons/_download_links.html.haml
@@ -1,4 +1,4 @@
.btn-group.ml-0.w-100
- Gitlab::Workhorse::ARCHIVE_FORMATS.each_with_index do |fmt, index|
- archive_path = project_archive_path(project, id: tree_join(ref, archive_prefix), path: path, format: fmt)
- = link_to fmt, external_storage_url_or_path(archive_path), rel: 'nofollow', download: '', class: "gl-button btn btn-xs #{"btn-primary" if index == 0}"
+ = link_to fmt, external_storage_url_or_path(archive_path), rel: 'nofollow', download: '', class: "gl-button btn btn-xs #{"btn-confirm" if index == 0}"
diff --git a/app/views/projects/merge_requests/_commits.html.haml b/app/views/projects/merge_requests/_commits.html.haml
index 178e57b08b3..ecf5df5d3b4 100644
--- a/app/views/projects/merge_requests/_commits.html.haml
+++ b/app/views/projects/merge_requests/_commits.html.haml
@@ -8,7 +8,7 @@
- if @project&.context_commits_enabled? && can_update_merge_request
%p
= _('Push commits to the source branch or add previously merged commits to review them.')
- %button.btn.btn-primary.add-review-item-modal-trigger{ type: "button", data: { commits_empty: 'true', context_commits_empty: 'true' } }
+ %button.btn.gl-button.btn-confirm.add-review-item-modal-trigger{ type: "button", data: { commits_empty: 'true', context_commits_empty: 'true' } }
= _('Add previously merged commits')
- else
%ol#commits-list.list-unstyled
diff --git a/app/views/sent_notifications/unsubscribe.html.haml b/app/views/sent_notifications/unsubscribe.html.haml
index a286693e2b6..cacfd601d4d 100644
--- a/app/views/sent_notifications/unsubscribe.html.haml
+++ b/app/views/sent_notifications/unsubscribe.html.haml
@@ -15,5 +15,5 @@
%p
= link_to _('Unsubscribe'), unsubscribe_sent_notification_path(@sent_notification, force: true),
- class: 'gl-button btn btn-primary gl-mr-3'
+ class: 'gl-button btn btn-confirm gl-mr-3'
= link_to _('Cancel'), new_user_session_path, class: 'gl-button btn gl-mr-3'
diff --git a/changelogs/unreleased/207385-simplify-service-uniqueness-validations.yml b/changelogs/unreleased/207385-simplify-service-uniqueness-validations.yml
new file mode 100644
index 00000000000..2d637499608
--- /dev/null
+++ b/changelogs/unreleased/207385-simplify-service-uniqueness-validations.yml
@@ -0,0 +1,5 @@
+---
+title: Clean up uniqueness validations for service type
+merge_request: 52565
+author:
+type: changed
diff --git a/changelogs/unreleased/299828-okr-ci-cd-variables-review-and-revise-settings-related-ui-text.yml b/changelogs/unreleased/299828-okr-ci-cd-variables-review-and-revise-settings-related-ui-text.yml
new file mode 100644
index 00000000000..04f2904aebb
--- /dev/null
+++ b/changelogs/unreleased/299828-okr-ci-cd-variables-review-and-revise-settings-related-ui-text.yml
@@ -0,0 +1,5 @@
+---
+title: Improve variable settings ui text
+merge_request: 52462
+author:
+type: other
diff --git a/changelogs/unreleased/pb-change-mr-pipeline-failed-message.yml b/changelogs/unreleased/pb-change-mr-pipeline-failed-message.yml
new file mode 100644
index 00000000000..3fc0e14cd79
--- /dev/null
+++ b/changelogs/unreleased/pb-change-mr-pipeline-failed-message.yml
@@ -0,0 +1,5 @@
+---
+title: Change UI text for failed pipeline on an MR
+merge_request: 52023
+author:
+type: changed
diff --git a/changelogs/unreleased/yo-btn-info-fix.yml b/changelogs/unreleased/yo-btn-info-fix.yml
new file mode 100644
index 00000000000..893107094ee
--- /dev/null
+++ b/changelogs/unreleased/yo-btn-info-fix.yml
@@ -0,0 +1,5 @@
+---
+title: Move btn-primary to btn-confirm class as a part of Pajamas migration
+merge_request: 52090
+author: Yogi (@yo)
+type: changed
diff --git a/doc/.vale/gitlab/Admin.yml b/doc/.vale/gitlab/Admin.yml
index 2300fa38e77..dbbdb34a8e7 100644
--- a/doc/.vale/gitlab/Admin.yml
+++ b/doc/.vale/gitlab/Admin.yml
@@ -11,4 +11,4 @@ link: https://docs.gitlab.com/ee/development/documentation/styleguide.html
level: warning
ignorecase: true
swap:
- 'admin ?\w*': '(?:Admin Area|[Aa]dminist(ration|rator|er|rative))'
+ 'admin ?\w*': '(?:Admin Area|[Aa]dminist(ration|rator|rators|er|rative))'
diff --git a/doc/administration/index.md b/doc/administration/index.md
index cc6994ef540..331d80b7038 100644
--- a/doc/administration/index.md
+++ b/doc/administration/index.md
@@ -102,6 +102,7 @@ Learn how to install, configure, update, and maintain your GitLab instance.
#### Updating GitLab
- [GitLab versions and maintenance policy](../policy/maintenance.md): Understand GitLab versions and releases (Major, Minor, Patch, Security), as well as update recommendations.
+- [GitLab in maintenance mode](maintenance_mode/index.md): Put GitLab in maintenance mode.
- [Update GitLab](../update/README.md): Update guides to upgrade your installation to a new version.
- [Upgrading without downtime](../update/README.md#upgrading-without-downtime): Upgrade to a newer major, minor, or patch version of GitLab without taking your GitLab instance offline.
- [Migrate your GitLab CI/CD data to another version of GitLab](../migrate_ci_to_ce/README.md): If you have an old GitLab installation (older than 8.0), follow this guide to migrate your existing GitLab CI/CD data to another version of GitLab.
diff --git a/doc/administration/maintenance_mode/index.md b/doc/administration/maintenance_mode/index.md
new file mode 100644
index 00000000000..b601ccf8d00
--- /dev/null
+++ b/doc/administration/maintenance_mode/index.md
@@ -0,0 +1,137 @@
+---
+stage: Enablement
+group: Geo
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
+---
+
+# GitLab in maintenance mode **PREMIUM SELF**
+
+> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/2149) in GitLab Premium 13.9.
+
+In maintenance mode, most write operations are disabled at the application level.
+This means that GitLab is effectively in a read-only mode for all non-administrative
+users (administrators are still able to edit application settings). Regular users
+are able to log in to GitLab, view the interface and perform other read-only
+operations, such as `git clone` or `git pull`.
+
+## Enable maintenance mode
+
+There are three ways to enable maintenance mode as an administrator:
+
+- **Web UI**:
+ 1. Navigate to the **Admin Area > Application settings > General** and toggle
+ the maintenance mode. You can optionally add a message for the banner as well.
+ 1. Click **Save** for the changes to take effect.
+
+- **API**:
+
+ ```shell
+ curl --request PUT --header "PRIVATE-TOKEN:$ADMIN_TOKEN" "<gitlab-url>/api/v4/application/settings?maintenance_mode=true"
+ ```
+
+- [**Rails console**](../operations/rails_console.md#starting-a-rails-console-session):
+
+ ```ruby
+ ::Gitlab::CurrentSettings.update_attributes!(maintenance_mode: true)
+ ::Gitlab::CurrentSettings.update_attributes!(maintenance_mode_message: "New message")
+ ```
+
+## Disable maintenance mode
+
+There are three ways to disable maintenance mode:
+
+- **Web UI**:
+ 1. Navigate to the **Admin Area > Application settings > General** and toggle
+ the maintenance mode. You can optionally add a message for the banner as well.
+ 1. Click **Save** for the changes to take effect.
+
+- **API**:
+
+ ```shell
+ curl --request PUT --header "PRIVATE-TOKEN:$ADMIN_TOKEN" "<gitlab-url>/api/v4/application/settings?maintenance_mode=false"
+ ```
+
+- [**Rails console**](../operations/rails_console.md#starting-a-rails-console-session):
+
+ ```ruby
+ ::Gitlab::CurrentSettings.update_attributes!(maintenance_mode: false)
+ ```
+
+## Behavior in maintenance mode
+
+When maintenance mode is enabled, a banner is displayed at the top of the page.
+The banner can be customized with a specific message.
+
+An error is displayed when a user tries to perform a write operation that isn't allowed.
+The API will return a 403 or 503 error for failed write requests.
+
+NOTE:
+In some cases, the visual feedback from an action could be misleading, for example
+when starring a project, the **Star** button changes to show the **Unstar** action,
+however, this is only the frontend update, and it doesn't take into account the
+failed status of the POST request. These visual bugs are to be fixed
+[in follow-up iterations](https://gitlab.com/gitlab-org/gitlab/-/issues/295197).
+
+### Application settings
+
+In maintenance mode, admins can edit the application settings. This will allow
+them to disable maintenance mode after it's been enabled.
+
+### Logging in/out
+
+All users can log in and out of the GitLab instance.
+
+### CI/CD
+
+In maintenance mode:
+
+- No new jobs are started. Already running jobs stay in 'running'
+ status but their logs are no longer updated.
+- If the job has been in 'running' state for longer than the project's time limit,
+ it will **not** time out.
+- Pipelines cannot be started, retried or canceled in maintenance mode.
+ No new jobs can be created either.
+
+Once maintenance mode is disabled, new jobs are picked up again. The jobs that were
+in the running state before enabling maintenance mode, will resume, and their logs
+will start getting updated again.
+
+### Git actions
+
+All read-only Git operations will continue to work in maintenance mode, for example
+`git clone` and `git pull`, but all write operations will fail, both through the CLI
+and Web IDE.
+
+Geo secondaries are read-only instances that allow Git pushes because they are
+proxied to the primary instance. However, in maintenance mode, Git pushes to
+both primary and secondaries will fail.
+
+### Merge requests, issues, epics
+
+All write actions except those mentioned above will fail. So, in maintenace mode, a user cannot update merge requests, issues, etc.
+
+### Container Registry
+
+In maintenance mode, `docker push` is blocked, but `docker pull` is available.
+
+### Auto Deploys
+
+It is recommended to disable auto deploys during maintenance mode, and enable
+them once maintenance mode is disabled.
+
+### Background jobs
+
+Background jobs (cron jobs, Sidekiq) will continue running as is, because maintenance
+mode does not disable any background jobs.
+
+[During a planned Geo failover](../geo/disaster_recovery/planned_failover.md#prevent-updates-to-the-primary-node),
+it is recommended that you disable all cron jobs except for those related to Geo.
+
+You can monitor queues and disable jobs in **Admin Area > Monitoring > Background Jobs**.
+
+### Geo secondaries
+
+The maintenance mode setting will be propagated to the secondary as they sync up.
+It is important that you do not disable replication before enabling maintenance mode.
+
+Replication and verification will continue to work in maintenance mode.
diff --git a/doc/ci/examples/deployment/README.md b/doc/ci/examples/deployment/README.md
index 4199144e789..779ca98084f 100644
--- a/doc/ci/examples/deployment/README.md
+++ b/doc/ci/examples/deployment/README.md
@@ -38,7 +38,7 @@ apt-get install ruby-dev
The Dpl provides support for vast number of services, including: Heroku, Cloud Foundry, AWS/S3, and more.
To use it simply define provider and any additional parameters required by the provider.
-For example if you want to use it to deploy your application to Heroku, you need to specify `heroku` as provider, specify `api-key` and `app`.
+For example if you want to use it to deploy your application to Heroku, you need to specify `heroku` as provider, specify `api_key` and `app`.
All possible parameters can be found in the [Heroku API section](https://github.com/travis-ci/dpl#heroku-api).
```yaml
@@ -46,7 +46,7 @@ staging:
stage: deploy
script:
- gem install dpl
- - dpl --provider=heroku --app=my-app-staging --api-key=$HEROKU_STAGING_API_KEY
+ - dpl --provider=heroku --app=my-app-staging --api_key=$HEROKU_STAGING_API_KEY
```
In the above example we use Dpl to deploy `my-app-staging` to Heroku server with API key stored in `HEROKU_STAGING_API_KEY` secure variable.
@@ -67,7 +67,7 @@ staging:
- apt-get update -yq
- apt-get install -y ruby-dev
- gem install dpl
- - dpl --provider=heroku --app=my-app-staging --api-key=$HEROKU_STAGING_API_KEY
+ - dpl --provider=heroku --app=my-app-staging --api_key=$HEROKU_STAGING_API_KEY
only:
- master
```
@@ -90,7 +90,7 @@ staging:
stage: deploy
script:
- gem install dpl
- - dpl --provider=heroku --app=my-app-staging --api-key=$HEROKU_STAGING_API_KEY
+ - dpl --provider=heroku --app=my-app-staging --api_key=$HEROKU_STAGING_API_KEY
only:
- master
@@ -98,7 +98,7 @@ production:
stage: deploy
script:
- gem install dpl
- - dpl --provider=heroku --app=my-app-production --api-key=$HEROKU_PRODUCTION_API_KEY
+ - dpl --provider=heroku --app=my-app-production --api_key=$HEROKU_PRODUCTION_API_KEY
only:
- tags
```
diff --git a/doc/ci/troubleshooting.md b/doc/ci/troubleshooting.md
index 9cda1f14b01..2ff685ba6e9 100644
--- a/doc/ci/troubleshooting.md
+++ b/doc/ci/troubleshooting.md
@@ -222,6 +222,29 @@ This also applies if the pipeline has not been created yet, or if you are waitin
for an external CI service. If you don't use pipelines for your project, then you
should disable **Pipelines must succeed** so you can accept merge requests.
+### "The pipeline for this merge request did not complete. Push a new commit to fix the failure or check the troubleshooting documentation to see other possible actions." message
+
+This message is shown if the [merge request pipeline](merge_request_pipelines/index.md),
+[merged results pipeline](merge_request_pipelines/pipelines_for_merged_results/index.md),
+or [merge train pipeline](merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md)
+has failed or been canceled.
+
+If a merge request pipeline or merged result pipeline was canceled or failed, you can:
+
+- Re-run the entire pipeline by clicking **Run pipeline** in the pipeline tab in the merge request.
+- [Retry only the jobs that failed](pipelines/index.md#view-pipelines). If you re-run the entire pipeline, this is not necessary.
+- Push a new commit to fix the failure.
+
+If the merge train pipeline has failed, you can:
+
+- Check the failure and determine if you can use the [`/merge` quick action](../user/project/quick_actions.md) to immediately add the merge request to the train again.
+- Re-run the entire pipeline by clicking **Run pipeline** in the pipeline tab in the merge request, then add the merge request to the train again.
+- Push a commit to fix the failure, then add the merge request to the train again.
+
+If the merge train pipeline was canceled before the merge request was merged, without a failure, you can:
+
+- Add it to the train again.
+
## Pipeline warnings
Pipeline configuration warnings are shown when you:
diff --git a/doc/development/packages.md b/doc/development/packages.md
index aadd71c9ffa..6740a3ae141 100644
--- a/doc/development/packages.md
+++ b/doc/development/packages.md
@@ -70,7 +70,7 @@ The current state of existing package registries availability is:
| Maven | Yes | Yes | Yes |
| Conan | Yes | No - [open issue](https://gitlab.com/gitlab-org/gitlab/-/issues/11679) | Yes |
| NPM | No - [open issue](https://gitlab.com/gitlab-org/gitlab/-/issues/36853) | Yes | No - [open issue](https://gitlab.com/gitlab-org/gitlab/-/issues/36853) |
-| NuGet | Yes | No - [open issue](https://gitlab.com/gitlab-org/gitlab/-/issues/36423) | No |
+| NuGet | Yes | Yes | No - [open issue](https://gitlab.com/gitlab-org/gitlab/-/issues/36425) |
| PyPI | Yes | No | No |
| Go | Yes | No - [open issue](https://gitlab.com/gitlab-org/gitlab/-/issues/213900) | No - [open-issue](https://gitlab.com/gitlab-org/gitlab/-/issues/213902) |
| Composer | Yes | Yes | No |
diff --git a/doc/development/testing_guide/end_to_end/rspec_metadata_tests.md b/doc/development/testing_guide/end_to_end/rspec_metadata_tests.md
index 6d6f7fbcf8d..50dabfaaec4 100644
--- a/doc/development/testing_guide/end_to_end/rspec_metadata_tests.md
+++ b/doc/development/testing_guide/end_to_end/rspec_metadata_tests.md
@@ -14,31 +14,32 @@ This is a partial list of the [RSpec metadata](https://relishapp.com/rspec/rspec
| Tag | Description |
|-----|-------------|
| `:elasticsearch` | The test requires an Elasticsearch service. It is used by the [instance-level scenario](https://gitlab.com/gitlab-org/gitlab-qa#definitions) [`Test::Integration::Elasticsearch`](https://gitlab.com/gitlab-org/gitlab/-/blob/72b62b51bdf513e2936301cb6c7c91ec27c35b4d/qa/qa/ee/scenario/test/integration/elasticsearch.rb) to include only tests that require Elasticsearch. |
+| `:geo` | The test requires two GitLab Geo instances - a primary and a secondary - to be spun up. |
| `:gitaly_cluster` | The test runs against a GitLab instance where repositories are stored on redundant Gitaly nodes behind a Praefect node. All nodes are [separate containers](../../../administration/gitaly/praefect.md#requirements-for-configuring-a-gitaly-cluster). Tests that use this tag have a longer setup time since there are three additional containers that need to be started. |
+| `:github` | The test requires a GitHub personal access token. |
+| `:group_saml` | The test requires a GitLab instance that has SAML SSO enabled at the group level. Interacts with an external SAML identity provider. Paired with the `:orchestrated` tag. |
+| `:instance_saml` | The test requires a GitLab instance that has SAML SSO enabled at the instance level. Interacts with an external SAML identity provider. Paired with the `:orchestrated` tag. |
| `:jira` | The test requires a Jira Server. [GitLab-QA](https://gitlab.com/gitlab-org/gitlab-qa) provisions the Jira Server in a Docker container when the `Test::Integration::Jira` test scenario is run.
| `:kubernetes` | The test includes a GitLab instance that is configured to be run behind an SSH tunnel, allowing a TLS-accessible GitLab. This test also includes provisioning of at least one Kubernetes cluster to test against. _This tag is often be paired with `:orchestrated`._ |
+| `:ldap_no_server` | The test requires a GitLab instance to be configured to use LDAP. To be used with the `:orchestrated` tag. It does not spin up an LDAP server at orchestration time. Instead, it creates the LDAP server at runtime. |
+| `:ldap_no_tls` | The test requires a GitLab instance to be configured to use an external LDAP server with TLS not enabled. |
+| `:ldap_tls` | The test requires a GitLab instance to be configured to use an external LDAP server with TLS enabled. |
+| `:mattermost` | The test requires a GitLab Mattermost service on the GitLab instance. |
+| `:object_storage` | The test requires a GitLab instance to be configured to use multiple [object storage types](../../../administration/object_storage.md). Uses MinIO as the object storage server. |
| `:only` | The test is only to be run against specific environments or pipelines. See [Environment selection](environment_selection.md) for more information. |
| `:orchestrated` | The GitLab instance under test may be [configured by `gitlab-qa`](https://gitlab.com/gitlab-org/gitlab-qa/-/blob/master/docs/what_tests_can_be_run.md#orchestrated-tests) to be different to the default GitLab configuration, or `gitlab-qa` may launch additional services in separate Docker containers, or both. Tests tagged with `:orchestrated` are excluded when testing environments where we can't dynamically modify the GitLab configuration (for example, Staging). |
+| `:packages` | The test requires a GitLab instance that has the [Package Registry](../../../administration/packages/#gitlab-package-registry-administration) enabled. |
| `:quarantine` | The test has been [quarantined](https://about.gitlab.com/handbook/engineering/quality/guidelines/debugging-qa-test-failures/#quarantining-tests), runs in a separate job that only includes quarantined tests, and is allowed to fail. The test is skipped in its regular job so that if it fails it doesn't hold up the pipeline. Note that you can also [quarantine a test only when it runs against specific environment](environment_selection.md#quarantining-a-test-for-a-specific-environment). |
+| `:relative_url` | The test requires a GitLab instance to be installed under a [relative URL](../../../install/relative_url.md). |
| `:reliable` | The test has been [promoted to a reliable test](https://about.gitlab.com/handbook/engineering/quality/guidelines/reliable-tests/#promoting-an-existing-test-to-reliable) meaning it passes consistently in all pipelines, including merge requests. |
+| `:repository_storage` | The test requires a GitLab instance to be configured to use multiple [repository storage paths](../../../administration/repository_storage_paths.md). Paired with the `:orchestrated` tag. |
| `:requires_admin` | The test requires an admin account. Tests with the tag are excluded when run against Canary and Production environments. |
+| `:requires_git_protocol_v2` | The test requires that Git protocol version 2 is enabled on the server. It's assumed to be enabled by default but if not the test can be skipped by setting `QA_CAN_TEST_GIT_PROTOCOL_V2` to `false`. |
+| `:requires_praefect` | The test requires that the GitLab instance uses [Gitaly Cluster](../../../administration/gitaly/praefect.md) (a.k.a. Praefect) as the repository storage . It's assumed to be used by default but if not the test can be skipped by setting `QA_CAN_TEST_PRAEFECT` to `false`. |
| `:runner` | The test depends on and sets up a GitLab Runner instance, typically to run a pipeline. |
| `:skip_live_env` | The test is excluded when run against live deployed environments such as Staging, Canary, and Production. |
-| `:testcase` | The link to the test case issue in the [Quality Testcases project](https://gitlab.com/gitlab-org/quality/testcases/). |
-| `:mattermost` | The test requires a GitLab Mattermost service on the GitLab instance. |
-| `:ldap_no_server` | The test requires a GitLab instance to be configured to use LDAP. To be used with the `:orchestrated` tag. It does not spin up an LDAP server at orchestration time. Instead, it creates the LDAP server at runtime. |
-| `:ldap_no_tls` | The test requires a GitLab instance to be configured to use an external LDAP server with TLS not enabled. |
-| `:ldap_tls` | The test requires a GitLab instance to be configured to use an external LDAP server with TLS enabled. |
-| `:object_storage` | The test requires a GitLab instance to be configured to use multiple [object storage types](../../../administration/object_storage.md). Uses MinIO as the object storage server. |
-| `:smtp` | The test requires a GitLab instance to be configured to use an SMTP server. Tests SMTP notification email delivery from GitLab by using MailHog. |
-| `:group_saml` | The test requires a GitLab instance that has SAML SSO enabled at the group level. Interacts with an external SAML identity provider. Paired with the `:orchestrated` tag. |
-| `:instance_saml` | The test requires a GitLab instance that has SAML SSO enabled at the instance level. Interacts with an external SAML identity provider. Paired with the `:orchestrated` tag. |
| `:skip_signup_disabled` | The test uses UI to sign up a new user and is skipped in any environment that does not allow new user registration via the UI. |
| `:smoke` | The test belongs to the test suite which verifies basic functionality of a GitLab instance.|
-| `:github` | The test requires a GitHub personal access token. |
-| `:repository_storage` | The test requires a GitLab instance to be configured to use multiple [repository storage paths](../../../administration/repository_storage_paths.md). Paired with the `:orchestrated` tag. |
-| `:geo` | The test requires two GitLab Geo instances - a primary and a secondary - to be spun up. |
-| `:relative_url` | The test requires a GitLab instance to be installed under a [relative URL](../../../install/relative_url.md). |
-| `:requires_git_protocol_v2` | The test requires that Git protocol version 2 is enabled on the server. It's assumed to be enabled by default but if not the test can be skipped by setting `QA_CAN_TEST_GIT_PROTOCOL_V2` to `false`. |
-| `:requires_praefect` | The test requires that the GitLab instance uses [Gitaly Cluster](../../../administration/gitaly/praefect.md) (a.k.a. Praefect) as the repository storage . It's assumed to be used by default but if not the test can be skipped by setting `QA_CAN_TEST_PRAEFECT` to `false`. |
-| `:packages` | The test requires a GitLab instance that has the [Package Registry](../../../administration/packages/#gitlab-package-registry-administration) enabled. |
+| `:smtp` | The test requires a GitLab instance to be configured to use an SMTP server. Tests SMTP notification email delivery from GitLab by using MailHog. |
+| `:testcase` | The link to the test case issue in the [Quality Testcases project](https://gitlab.com/gitlab-org/quality/testcases/). |
+| `:transient` | The test tests transient bugs. It is excluded by default. |
diff --git a/doc/topics/git/git_rebase.md b/doc/topics/git/git_rebase.md
index 48ac80ba514..607d9affc22 100644
--- a/doc/topics/git/git_rebase.md
+++ b/doc/topics/git/git_rebase.md
@@ -69,7 +69,7 @@ changes by resetting `my-feature-branch` against `my-feature-branch-backup`:
```
Note that if you added changes to `my-feature-branch` after creating the backup branch,
-you will lose them when resetting.
+you lose them when resetting.
### Regular rebase
@@ -116,7 +116,7 @@ example, `release-10-3`. You can also replace `origin` with other remote
repositories, for example, `upstream`. To check what remotes you have linked to your local
repository, you can run `git remote -v`.
-If there are [merge conflicts](#merge-conflicts), Git will prompt you to fix
+If there are [merge conflicts](#merge-conflicts), Git prompts you to fix
them before continuing the rebase.
To learn more, check Git's documentation on [rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)
@@ -126,13 +126,13 @@ and [rebasing strategies](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)
You can use interactive rebase to modify commits. For example, amend a commit
message, squash (join multiple commits into one), edit, or delete
-commits. It is handy for changing past commit messages,
-as well as for organizing the commit history of your branch to keep it clean.
+commits. Use a rebase for changing past commit messages,
+and organizing the commit history of your branch to keep it clean.
NOTE:
If you want to keep the default branch commit history clean, you don't need to
-manually squash all your commits before merging every merge request;
-with [Squash and Merge](../../user/project/merge_requests/squash_and_merge.md)
+manually squash all your commits before merging every merge request.
+With [Squash and Merge](../../user/project/merge_requests/squash_and_merge.md),
GitLab does it automatically.
When you want to change anything in recent commits, use interactive
@@ -155,7 +155,8 @@ For example, if you're using [Vim](https://www.vim.org/) as the text editor in
a macOS's `ZSH` shell, and you want to **squash** all the three commits
(join them into one):
-1. Press <kbd>i</kbd> on your keyboard to switch to Vim's editing mode.
+1. Press <!-- vale gitlab.FirstPerson = NO --> <kbd>i</kbd> <!-- vale gitlab.FirstPerson = YES -->
+ on your keyboard to switch to Vim's editing mode.
1. Navigate with your keyboard arrows to edit the **second** commit keyword
from `pick` to `squash` (or `s`). Do the same to the **third** commit.
The first commit should be left **unchanged** (`pick`) as we want to squash
@@ -163,8 +164,8 @@ a macOS's `ZSH` shell, and you want to **squash** all the three commits
1. Press <kbd>Escape</kbd> to leave the editing mode.
1. Type `:wq` to "write" (save) and "quit".
1. Git outputs the commit message so you have a chance to edit it:
- - All lines starting with `#` will be ignored and not included in the commit
- message. Everything else will be included.
+ - All lines starting with `#` are ignored and not included in the commit
+ message. Everything else is included.
- To leave it as it is, type `:wq`. To edit the commit message: switch to the
editing mode, edit the commit message, and save it as you just did.
1. If you haven't pushed your commits to the remote branch before rebasing,
@@ -180,8 +181,8 @@ for a deeper look into interactive rebase.
## Force-push
When you perform more complex operations, for example, squash commits, reset or
-rebase your branch, you'll have to _force_ an update to the remote branch,
-since these operations imply rewriting the commit history of the branch.
+rebase your branch, you must _force_ an update to the remote branch.
+These operations imply rewriting the commit history of the branch.
To force an update, pass the flag `--force` or `-f` to the `push` command. For
example:
@@ -267,6 +268,6 @@ To fix conflicts locally, you can use the following method:
Up to this point, you can run `git rebase --abort` to stop the process.
Git aborts the rebase and rolls back the branch to the state you had before
running `git rebase`.
- Once you run `git rebase --continue` the rebase **cannot** be aborted.
+ After you run `git rebase --continue` the rebase **cannot** be aborted.
1. [Force-push](#force-push) to your remote branch.
diff --git a/doc/topics/git/lfs/index.md b/doc/topics/git/lfs/index.md
index 6179175b4cd..f4ea884563c 100644
--- a/doc/topics/git/lfs/index.md
+++ b/doc/topics/git/lfs/index.md
@@ -14,13 +14,13 @@ larger than 1GB to preserve performance.
![Git LFS tracking status](img/lfs-icon.png)
-An LFS icon is shown on files tracked by Git LFS to denote if a file is stored
-as a blob or as an LFS pointer.
+Files tracked by Git LFS display an icon to indicate if the file is stored as a
+blob or an LFS pointer.
## How it works
Git LFS client talks with the GitLab server over HTTPS. It uses HTTP Basic Authentication
-to authorize client requests. Once the request is authorized, Git LFS client receives
+to authorize client requests. After the request is authorized, Git LFS client receives
instructions from where to fetch or where to push the large file.
## GitLab server configuration
@@ -35,18 +35,18 @@ Documentation for GitLab instance administrators is under [LFS administration do
## Known limitations
-- Git LFS v1 original API is not supported since it was deprecated early in LFS
- development
-- When SSH is set as a remote, Git LFS objects still go through HTTPS
-- Any Git LFS request will ask for HTTPS credentials to be provided so a good Git
- credentials store is recommended
-- Git LFS always assumes HTTPS so if you have GitLab server on HTTP you will have
- to add the URL to Git configuration manually (see [troubleshooting](#troubleshooting))
+- Git LFS v1 original API is not supported, because it was deprecated early in LFS
+ development.
+- When SSH is set as a remote, Git LFS objects still go through HTTPS.
+- Any Git LFS request asks for HTTPS credentials to be provided so a good Git
+ credentials store is recommended.
+- Git LFS always assumes HTTPS so if you have GitLab server on HTTP you must
+ [add the URL to Git configuration manually](#troubleshooting).
NOTE:
With 8.12 GitLab added LFS support to SSH. The Git LFS communication
still goes over HTTP, but now the SSH client passes the correct credentials
-to the Git LFS client, so no action is required by the user.
+to the Git LFS client. No action is required by the user.
## Using Git LFS
@@ -60,8 +60,8 @@ git lfs install # initialize the Git LFS project
git lfs track "*.iso" # select the file extensions that you want to treat as large files
```
-Once a certain file extension is marked for tracking as a LFS object you can use
-Git as usual without having to redo the command to track a file with the same extension:
+After you mark a file extension for tracking as a LFS object you can use
+Git as usual without redoing the command to track a file with the same extension:
```shell
cp ~/tmp/debian.iso ./ # copy a large file into the current directory
@@ -71,7 +71,7 @@ git push origin master # sync the git repo and large file to the
```
**Make sure** that `.gitattributes` is tracked by Git. Otherwise Git
-LFS will not be working properly for people cloning the project:
+LFS doesn't work properly for people cloning the project:
```shell
git add .gitattributes
@@ -93,8 +93,8 @@ that are on the remote repository, such as for a branch from origin:
git lfs fetch origin master
```
-Make sure your files aren't listed in `.gitignore`, otherwise, they will be ignored by Git thus will not
-be pushed to the remote repository.
+Make sure your files aren't listed in `.gitignore`, otherwise, they are ignored by Git
+and are not pushed to the remote repository.
### Migrate an existing repository to Git LFS
@@ -178,7 +178,7 @@ available to the project anymore. Probably the object was removed from the serve
### Invalid status for `<url>` : 501
-Git LFS will log the failures into a log file.
+Git LFS logs the failures into a log file.
To view this log file, while in project directory:
```shell
@@ -201,12 +201,19 @@ If the status `error 501` is shown, it is because:
remove the line and try to update your Git LFS client. Only version 1.0.1 and
newer are supported.
+<!-- vale gitlab.Spelling = NO -->
+
### getsockopt: connection refused
-If you push a LFS object to a project and you receive an error similar to:
-`Post <URL>/info/lfs/objects/batch: dial tcp IP: getsockopt: connection refused`,
+<!-- vale gitlab.Spelling = YES -->
+
+If you push an LFS object to a project and receive an error like this,
the LFS client is trying to reach GitLab through HTTPS. However, your GitLab
-instance is being served on HTTP.
+instance is being served on HTTP:
+
+```plaintext
+Post <URL>/info/lfs/objects/batch: dial tcp IP: getsockopt: connection refused
+```
This behavior is caused by Git LFS using HTTPS connections by default when a
`lfsurl` is not set in the Git configuration.
@@ -222,10 +229,10 @@ git config --add lfs.url "http://gitlab.example.com/group/project.git/info/lfs"
NOTE:
With 8.12 GitLab added LFS support to SSH. The Git LFS communication
still goes over HTTP, but now the SSH client passes the correct credentials
-to the Git LFS client, so no action is required by the user.
+to the Git LFS client. No action is required by the user.
-Given that Git LFS uses HTTP Basic Authentication to authenticate the user pushing
-the LFS object on every push for every object, user HTTPS credentials are required.
+Git LFS authenticates the user with HTTP Basic Authentication on every push for
+every object, so user HTTPS credentials are required.
By default, Git has support for remembering the credentials for each repository
you use. This is described in [Git credentials man pages](https://git-scm.com/docs/gitcredentials).
@@ -237,7 +244,7 @@ which you expect to push the objects:
git config --global credential.helper 'cache --timeout=3600'
```
-This will remember the credentials for an hour after which Git operations will
+This remembers the credentials for an hour, after which Git operations
require re-authentication.
If you are using OS X you can use `osxkeychain` to store and encrypt your credentials.
@@ -258,7 +265,7 @@ If you are storing LFS files outside of GitLab you can disable LFS on the projec
It is possible to host LFS objects externally by setting a custom LFS URL with `git config -f .lfsconfig lfs.url https://example.com/<project>.git/info/lfs`.
-You might choose to do this if you are using an appliance like a Sonatype Nexus to store LFS data. If you choose to use an external LFS store,
-GitLab will not be able to verify LFS objects which means that pushes will fail if you have GitLab LFS support enabled.
+You might choose to do this if you are using an appliance like a <!-- vale gitlab.Spelling = NO --> Sonatype Nexus <!-- vale gitlab.Spelling = YES --> to store LFS data. If you choose to use an external LFS store,
+GitLab can't verify LFS objects. Pushes then fail if you have GitLab LFS support enabled.
-To stop push failure, LFS support can be disabled in the [Project settings](../../../user/project/settings/index.md). This means you will lose GitLab LFS value-adds (Verifying LFS objects, UI integration for LFS).
+To stop push failure, LFS support can be disabled in the [Project settings](../../../user/project/settings/index.md), which also disables GitLab LFS value-adds (Verifying LFS objects, UI integration for LFS).
diff --git a/doc/topics/git/lfs/migrate_from_git_annex_to_git_lfs.md b/doc/topics/git/lfs/migrate_from_git_annex_to_git_lfs.md
index 3bd754aabfb..771b0a465ec 100644
--- a/doc/topics/git/lfs/migrate_from_git_annex_to_git_lfs.md
+++ b/doc/topics/git/lfs/migrate_from_git_annex_to_git_lfs.md
@@ -37,9 +37,9 @@ ones that GitLab developed.
## Migration steps
-Since Git Annex files are stored in a sub-directory of the normal repositories
-(`.git/annex/objects`) and LFS files are stored outside of the repositories,
-they are not compatible as they are using a different scheme. Therefore, the
+Git Annex files are stored in a sub-directory of the normal repositories
+(`.git/annex/objects`) and LFS files are stored outside of the repositories.
+The two aren't compatible as they are using a different scheme. Therefore, the
migration has to be done manually per repository.
There are basically two steps you need to take in order to migrate from Git
@@ -74,17 +74,17 @@ Fire up a terminal, navigate to your Git repository and:
### Disabling Git Annex in your repository
Before changing anything, make sure you have a backup of your repository first.
-There are a couple of ways to do that, but you can simply clone it to another
+There are a couple of ways to do that, but you can clone it to another
local path and maybe push it to GitLab if you want a remote backup as well.
-Here you'll find a guide on
-[how to back up a **git-annex** repository to an external hard drive](https://www.thomas-krenn.com/en/wiki/Git-annex_Repository_on_an_External_Hard_Drive).
+A guide on
+[how to back up a **git-annex** repository to an external hard drive](https://www.thomas-krenn.com/en/wiki/Git-annex_Repository_on_an_External_Hard_Drive) is also available.
-Since Annex files are stored as objects with symlinks and cannot be directly
+Because Annex files are stored as objects with symlinks and cannot be directly
modified, we need to first remove those symlinks.
NOTE:
Make sure the you read about the [`direct` mode](https://git-annex.branchable.com/direct_mode/) as it contains
-useful information that may fit in your use case. Note that `annex direct` is
+information that may fit in your use case. The `annex direct` command is
deprecated in Git Annex version 6, so you may need to upgrade your repository
if the server also has Git Annex 6 installed. Read more in the
[Git Annex troubleshooting tips](../../../administration/git_annex.md#troubleshooting-tips) section.
@@ -133,7 +133,7 @@ if the server also has Git Annex 6 installed. Read more in the
Deleted branch git-annex (was 2534d2c).
```
- This will `unannex` every file in the repository, leaving the original files.
+ This command runs `unannex` on every file in the repository, leaving the original files.
1. Switch back to `indirect` mode:
@@ -161,7 +161,7 @@ if the server also has Git Annex 6 installed. Read more in the
---
At this point, you have two options. Either add, commit and push the files
-directly back to GitLab or switch to Git LFS. We will tackle the LFS switch in
+directly back to GitLab or switch to Git LFS. The LFS switch is described in
the next section.
### Enabling Git LFS in your repository
@@ -194,7 +194,7 @@ GitLab.com), therefore, you don't need to do anything server-side.
git lfs track images/ # per directory
```
- Once you do that, run `git status` and you'll see `.gitattributes` added
+ After this, run `git status` to see the `.gitattributes` added
to your repository. It collects all file patterns that you chose to track via
`git-lfs`.
@@ -206,7 +206,7 @@ GitLab.com), therefore, you don't need to do anything server-side.
git push
```
- If your remote is set up with HTTP, you will be asked to enter your login
+ If your remote is set up with HTTP, you are asked to enter your login
credentials. If you have [2FA enabled](../../../user/profile/account/two_factor_authentication.md), make sure to use a
[personal access token](../../../user/profile/account/two_factor_authentication.md#personal-access-tokens)
instead of your password.
@@ -244,5 +244,5 @@ git annex uninit
- (Blog Post) [Getting Started with Git FLS](https://about.gitlab.com/blog/2017/01/30/getting-started-with-git-lfs-tutorial/)
- (Blog Post) [Announcing LFS Support in GitLab](https://about.gitlab.com/blog/2015/11/23/announcing-git-lfs-support-in-gitlab/)
- (Blog Post) [GitLab Annex Solves the Problem of Versioning Large Binaries with Git](https://about.gitlab.com/blog/2015/02/17/gitlab-annex-solves-the-problem-of-versioning-large-binaries-with-git/)
-- (GitLab Docs) [Git Annex](../../../administration/git_annex.md)
-- (GitLab Docs) [Git LFS](index.md)
+- [Git Annex](../../../administration/git_annex.md)
+- [Git LFS](index.md)
diff --git a/doc/topics/git/numerous_undo_possibilities_in_git/index.md b/doc/topics/git/numerous_undo_possibilities_in_git/index.md
index f6571c7b277..6edbd29c236 100644
--- a/doc/topics/git/numerous_undo_possibilities_in_git/index.md
+++ b/doc/topics/git/numerous_undo_possibilities_in_git/index.md
@@ -7,21 +7,19 @@ type: howto
# Numerous undo possibilities in Git
-In this tutorial, we will show you different ways of undoing your work in Git, for which
-we will assume you have a basic working knowledge of. Check the GitLab
+This tutorial shows you different ways of undoing your work in Git.
+We assume you have a basic working knowledge of Git. Check the GitLab
[Git documentation](../index.md) for reference.
-Also, we will only provide some general information of the commands, which is enough
-to get you started for the easy cases/examples, but for anything more advanced
-please refer to the [Git book](https://git-scm.com/book/en/v2).
+We only provide some general information about the commands to get you started.
+For more advanced examples, refer to the [Git book](https://git-scm.com/book/en/v2).
-We will explain a few different techniques to undo your changes based on the stage
-of the change in your current development. Also, keep in mind that [nothing in
-Git is really deleted](https://git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery).
-
-This means that until Git automatically cleans detached commits (which cannot be
-accessed by branch or tag) it will be possible to view them with `git reflog` command
-and access them with direct commit ID. Read more about _[redoing the undo](#redoing-the-undo)_ in the section below.
+A few different techniques exist to undo your changes, based on the stage
+of the change in your current development. Remember that
+[nothing in Git is really deleted](https://git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery).
+Until Git cleans detached commits - commits that cannot be accessed by branch or tag -
+you can view them with `git reflog` command, and access them with direct commit ID.
+Read more about [redoing the undo](#redoing-the-undo) in the section below.
> For more information about working with Git and GitLab:
>
@@ -30,13 +28,16 @@ and access them with direct commit ID. Read more about _[redoing the undo](#redo
## Introduction
-This guide is organized depending on the [stage of development](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository)
-where you want to undo your changes from and if they were shared with other developers
-or not. Because Git is tracking changes a created or edited file is in the unstaged state
+This guide is organized depending on the [stage of development](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository):
+
+- Where do you want to undo your changes from?
+- Were they shared with other developers?
+
+Because Git tracks changes, a created or edited file is in the unstaged state
(if created it is untracked by Git). After you add it to a repository (`git add`) you put
a file into the **staged** state, which is then committed (`git commit`) to your
local repository. After that, file can be shared with other developers (`git push`).
-Here's what we'll cover in this tutorial:
+This tutorial covers:
- [Undo local changes](#undo-local-changes) which were not pushed to a remote repository:
@@ -54,38 +55,38 @@ Here's what we'll cover in this tutorial:
### Branching strategy
-[Git](https://git-scm.com/) is a de-centralized version control system, which means that beside regular
+[Git](https://git-scm.com/) is a de-centralized version control system. Beside regular
versioning of the whole repository, it has possibilities to exchange changes
with other repositories.
To avoid chaos with
[multiple sources of truth](https://git-scm.com/about/distributed), various
-development workflows have to be followed, and it depends on your internal
+development workflows have to be followed. It depends on your internal
workflow how certain changes or commits can be undone or changed.
[GitLab Flow](https://about.gitlab.com/blog/2014/09/29/gitlab-flow/) provides a good
balance between developers clashing with each other while
-developing the same feature and cooperating seamlessly, but it does not enable
+developing the same feature and cooperating seamlessly. However, it does not enable
joined development of the same feature by multiple developers by default.
When multiple developers develop the same feature on the same branch, clashing
-with every synchronization is unavoidable, but a proper or chosen Git Workflow will
-prevent that anything is lost or out of sync when the feature is complete.
+with every synchronization is unavoidable. However, a proper or chosen Git Workflow
+prevents lost or out-of-sync data when the feature is complete.
You can also
read through this blog post on [Git Tips & Tricks](https://about.gitlab.com/blog/2016/12/08/git-tips-and-tricks/)
-to learn how to easily **do** things in Git.
+to learn how to do things in Git.
## Undo local changes
-Until you push your changes to any remote repository, they will only affect you.
+Until you push your changes to any remote repository, they only affect you.
That broadens your options on how to handle undoing them. Still, local changes
can be on various stages and each stage has a different approach on how to tackle them.
### Unstaged local changes (before you commit)
-When a change is made, but it is not added to the staged tree, Git itself
-proposes a solution to discard changes to a certain file.
+When a change is made, but not added to the staged tree, Git
+proposes a solution to discard changes to the file.
Suppose you edited a file to change the content using your favorite editor:
@@ -93,7 +94,7 @@ Suppose you edited a file to change the content using your favorite editor:
vim <file>
```
-Since you did not `git add <file>` to staging, it should be under unstaged files (or
+Because you did not `git add <file>` to staging, it should be under unstaged files (or
untracked if file was created). You can confirm that with:
```shell
@@ -136,32 +137,37 @@ you would like to apply them at some later time. You can read more about it in
### Quickly save local changes
-You are working on a feature when a boss drops by with an urgent task. Since your
+You are working on a feature when a boss drops by with an urgent task. Because your
feature is not complete, but you need to swap to another branch, you can use
-`git stash` to save what you had done, swap to another branch, commit, push,
-test, then get back to previous feature branch, do `git stash pop` and continue
-where you left.
+`git stash` to:
+
+- Save what you have done.
+- Swap to another branch.
+- Commit, push, and test.
+- Return to the feature branch.
+- Run `git stash pop`.
+- Resume your work.
-The example above shows that discarding all changes is not always a preferred option,
-but Git provides a way to save them for later, while resetting the repository to state without
+The example above shows that discarding all changes is not always a preferred option.
+However, Git provides a way to save them for later, while resetting the repository to state without
them. This is achieved by Git stashing command `git stash`, which in fact saves your
current work and runs `git reset --hard`, but it also has various
additional options like:
-- `git stash save`, which enables including temporary commit message, which will help you identify changes, among with other options
+- `git stash save`, which enables including temporary commit message, which helps you identify changes, among with other options
- `git stash list`, which lists all previously stashed commits (yes, there can be more) that were not `pop`ed
- `git stash pop`, which redoes previously stashed changes and removes them from stashed list
- `git stash apply`, which redoes previously stashed changes, but keeps them on stashed list
### Staged local changes (before you commit)
-Let's say you have added some files to staging, but you want to remove them from the
-current commit, yet you want to retain those changes - just move them outside
-of the staging tree. You also have an option to discard all changes with
+If you add some files to staging, but you want to remove them from the
+current commit while retaining those changes, move them outside
+of the staging tree. You can also discard all changes with
`git reset --hard` or think about `git stash` [as described earlier.](#quickly-save-local-changes)
-Lets start the example by editing a file, with your favorite editor, to change the
-content and add it to staging
+Lets start the example by editing a file with your favorite editor to change the
+content and add it to staging:
```shell
vim <file>
@@ -208,17 +214,17 @@ Now you have 4 options to undo your changes:
## Committed local changes
-Once you commit, your changes are recorded by the version control system.
+After you commit, your changes are recorded by the version control system.
Because you haven't pushed to your remote repository yet, your changes are
still not public (or shared with other developers). At this point, undoing
-things is a lot easier, we have quite some workaround options. Once you push
-your code, you'll have less options to troubleshoot your work.
+things is a lot easier, we have quite some workaround options. After you push
+your code, you have fewer options to troubleshoot your work.
### Without modifying history
Through the development process some of the previously committed changes do not
-fit anymore in the end solution, or are source of the bugs. Once you find the
-commit which triggered bug, or once you have a faulty commit, you can simply
+fit anymore in the end solution, or are source of the bugs. After you find the
+commit which triggered bug, or identify a faulty commit, you can
revert it with `git revert commit-id`.
This command inverts (swaps) the additions and
@@ -226,19 +232,19 @@ deletions in that commit, so that it does not modify history. Retaining history
can be helpful in future to notice that some changes have been tried
unsuccessfully in the past.
-In our example we will assume there are commits `A`,`B`,`C`,`D`,`E` committed in this order: `A-B-C-D-E`,
+In our example we assume there are commits `A`,`B`,`C`,`D`,`E` committed in this order: `A-B-C-D-E`,
and `B` is the commit you want to undo. There are many different ways to identify commit
-`B` as bad, one of them is to pass a range to `git bisect` command. The provided range includes
-last known good commit (we assume `A`) and first known bad commit (where bug was detected - we will assume `E`).
+`B` as bad. One of them is to pass a range to `git bisect` command. The provided range includes
+last known good commit (we assume `A`) and first known bad commit where the bug was detected (we assume `E`).
```shell
git bisect A..E
```
-Bisect will provide us with commit ID of the middle commit to test, and then guide us
-through simple bisection process. You can read more about it [in official Git Tools](https://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git)
-In our example we will end up with commit `B`, that introduced the bug/error. We have
-4 options on how to remove it (or part of it) from our repository.
+Bisect provides us with commit ID of the middle commit to test, and then guide us
+through the bisection process. You can read more about it [in official Git Tools](https://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git)
+Our example results in commit `B`, which introduced the bug/error. We have
+these options to remove all or part of it from our repository:
- Undo (swap additions and deletions) changes introduced by commit `B`:
@@ -260,13 +266,13 @@ In our example we will end up with commit `B`, that introduced the bug/error. We
- There is one command we also must not forget: **creating a new branch**
from the point where changes are not applicable or where the development has hit a
- dead end. For example you have done commits `A-B-C-D` on your feature-branch
+ dead end. For example you have done commits `A-B-C-D` on your feature branch
and then you figure `C` and `D` are wrong.
At this point you either reset to `B`
- and do commit `F` (which will cause problems with pushing and if forced pushed also with other developers)
- since branch now looks `A-B-F`, which clashes with what other developers have locally (you will
- [change history](#with-history-modification)), or you simply checkout commit `B` create
+ and do commit `F` (which causes problems with pushing and if forced pushed also with other developers)
+ because the branch now looks `A-B-F`, which clashes with what other developers have locally (you will
+ [change history](#with-history-modification)), or you checkout commit `B` create
a new branch and do commit `F`. In the last case, everyone else can still do their work while you
have your new way to get it right and merge it back in later. Alternatively, with GitLab,
you can [cherry-pick](../../../user/project/merge_requests/cherry_pick_changes.md#cherry-picking-a-commit)
@@ -291,7 +297,7 @@ provides interactive mode (`-i` flag) which enables you to:
- **edit** the commit content (changes introduced by commit) and message.
- **squash** multiple commits into a single one, and have a custom or aggregated
commit message.
-- **drop** commits - simply delete them.
+- **drop** commits - delete them.
- and few more options.
Let us check few examples. Again there are commits `A-B-C-D` where you want to
@@ -326,8 +332,8 @@ In case you want to modify something introduced in commit `B`.
git commit -a
```
-You can find some more examples in [below section where we explain how to modify
-history](#how-modifying-history-is-done)
+You can find some more examples in the section explaining
+[how to modify history](#how-modifying-history-is-done).
### Redoing the Undo
@@ -391,12 +397,12 @@ git checkout -b new-path-of-feature
## Undo remote changes with modifying history
This is useful when you want to *hide* certain things - like secret keys,
-passwords, SSH keys, etc. It is and should not be used to hide mistakes, as
-it will make it harder to debug in case there are some other bugs. The main
-reason for this is that you loose the real development progress. **Also keep in
+passwords, and SSH keys. It is and should not be used to hide mistakes, as
+it makes it harder to debug in case there are some other bugs. The main
+reason for this is that you loose the real development progress. Keep in
mind that, even with modified history, commits are just detached and can still be
-accessed through commit ID** - at least until all repositories perform
-the cleanup of detached commits (happens automatically).
+accessed through commit ID - at least until all repositories perform
+the automated cleanup of detached commits.
![Modifying history causes problems on remote branch](img/rebase_reset.png)
@@ -404,16 +410,16 @@ the cleanup of detached commits (happens automatically).
Modified history breaks the development chain of other developers, as changed
history does not have matching commit IDs. For that reason it should not be
-used on any public branch or on branch that *might* be used by other developers.
+used on any public branch or on branch that might be used by other developers.
When contributing to big open source repositories (for example, [GitLab](https://gitlab.com/gitlab-org/gitlab/blob/master/CONTRIBUTING.md#contribution-acceptance-criteria)
-itself), it is acceptable to *squash* commits into a single one, to present a
+itself), it is acceptable to squash commits into a single one, to present a
nicer history of your contribution.
Keep in mind that this also removes the comments attached to certain commits
in merge requests, so if you need to retain traceability in GitLab, then
modifying history is not acceptable.
-A feature-branch of a merge request is a public branch and might be used by
+A feature branch of a merge request is a public branch and might be used by
other developers, but project process and rules might allow or require
you to use `git rebase` (command that changes history) to reduce number of
displayed commits on target branch after reviews are done (for example
@@ -427,7 +433,7 @@ Never modify the commit history of `master` or shared branch.
### How modifying history is done
After you know what you want to modify (how far in history or how which range of
-old commits), use `git rebase -i commit-id`. This command will then display all the commits from
+old commits), use `git rebase -i commit-id`. This command displays all the commits from
current version to chosen commit ID and allow modification, squashing, deletion
of that commits.
@@ -458,12 +464,12 @@ pick <commit3-id> <commit3-commit-message>
```
NOTE:
-It is important to notice that comment from the output clearly states that, if
-you decide to abort, then do not just close your editor (as that will in-fact
-modify history), but remove all uncommented lines and save.
+The comment from the output clearly states that, if
+you decide to abort, don't just close your editor (as that
+modifies history), but remove all uncommented lines and save.
-That is one of the reasons why `git rebase` should be used carefully on
-shared and remote branches. But don't worry, there will be nothing broken until
+Use `git rebase` carefully on
+shared and remote branches, but rest assured: nothing is broken until
you push back to the remote repository (so you can freely explore the
different outcomes locally).
@@ -486,7 +492,7 @@ file from history altogether use:
git filter-branch --tree-filter 'rm filename' HEAD
```
-Since `git filter-branch` command might be slow on big repositories, there are
+Because `git filter-branch` command might be slow on big repositories, there are
tools that can use some of Git specifics to enable faster execution of common
tasks (which is exactly what removing sensitive information file is about).
An alternative is the open source community-maintained tool [BFG](https://rtyley.github.io/bfg-repo-cleaner/).
@@ -497,8 +503,8 @@ Refer [Reduce repository size](../../../user/project/repository/reducing_the_rep
## Conclusion
-There are various options of undoing your work with any version control system, but
-because of de-centralized nature of Git, these options are multiplied (or limited)
+Various options exist for undoing your work with any version control system, but
+because of the de-centralized nature of Git, these options are multiplied (or limited)
depending on the stage of your process. Git also enables rewriting history, but that
should be avoided as it might cause problems when multiple developers are
contributing to the same codebase.
diff --git a/doc/topics/git/useful_git_commands.md b/doc/topics/git/useful_git_commands.md
index 6b4d1e06c2c..cef95746bb1 100644
--- a/doc/topics/git/useful_git_commands.md
+++ b/doc/topics/git/useful_git_commands.md
@@ -7,8 +7,8 @@ type: reference
# Useful Git commands
-Here are some useful Git commands collected by the GitLab support team. You may not
-need to use often, but they can come in handy when needed.
+The GitLab support team has collected these commands to help you. You may not
+need to use them often.
## Remotes
@@ -182,7 +182,7 @@ Git includes a complete set of [traces for debugging Git commands](https://git-s
### Rebase your branch onto master
-The -i flag stands for 'interactive':
+The `-i` flag stands for 'interactive':
```shell
git rebase -i master
diff --git a/doc/update/README.md b/doc/update/README.md
index 958beeeb321..b0b690c876d 100644
--- a/doc/update/README.md
+++ b/doc/update/README.md
@@ -147,7 +147,7 @@ Find where your version sits in the upgrade path below, and upgrade GitLab
accordingly, while also consulting the
[version-specific upgrade instructions](#version-specific-upgrading-instructions):
-`8.11.x` -> `8.12.0` -> `8.17.7` -> `9.5.10` -> `10.8.7` -> `11.11.8` -> `12.0.12` -> `12.1.17` -> `12.10.14` -> `13.0.14` -> `13.1.11` - > `13.5.3`
+`8.11.x` -> `8.12.0` -> `8.17.7` -> `9.5.10` -> `10.8.7` -> `11.11.8` -> `12.0.12` -> `12.1.17` -> `12.10.14` -> `13.0.14` -> `13.1.11` - > `13.x (latest)`
The following table, while not exhaustive, shows some examples of the supported
upgrade paths.
diff --git a/doc/user/group/epics/manage_epics.md b/doc/user/group/epics/manage_epics.md
index 42761138037..d4c1a5fc768 100644
--- a/doc/user/group/epics/manage_epics.md
+++ b/doc/user/group/epics/manage_epics.md
@@ -16,13 +16,15 @@ to them.
> - The New Epic form [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/211533) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.2.
> - In [GitLab 13.7](https://gitlab.com/gitlab-org/gitlab/-/issues/229621) and later, the New Epic button on the Epics list opens the New Epic form.
+> - In [GitLab 13.9](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45948) and later, you can create a new epic from an empty Roadmap.
To create an epic in the group you're in:
1. Get to the New Epic form:
- - From the **Epics** list in your group, select the **New Epic** button.
- - From an epic in your group, select the **New Epic** button.
+ - From the **Epics** list in your group, select **New epic**.
+ - From an epic in your group, select **New epic**.
- From anywhere, in the top menu, select **New...** (**{plus-square}**) **> New epic**.
+ - In an empty [roadmap](../roadmap/index.md), select **New epic**.
![New epic from an open epic](img/new_epic_from_groups_v13.7.png)
@@ -39,7 +41,7 @@ To create an epic in the group you're in:
## Edit an epic
-After you create an epic, you can edit change the following details:
+After you create an epic, you can edit the following details:
- Title
- Description
@@ -152,6 +154,9 @@ To make an epic confidential:
## Manage issues assigned to an epic
+This section collects instructions for all the things you can do with [issues](../../project/issues/index.md)
+in relation to epics.
+
### Add a new issue to an epic
You can add an existing issue to an epic, or create a new issue that's
diff --git a/doc/user/packages/dependency_proxy/index.md b/doc/user/packages/dependency_proxy/index.md
index 9d5945786ff..61f14c91902 100644
--- a/doc/user/packages/dependency_proxy/index.md
+++ b/doc/user/packages/dependency_proxy/index.md
@@ -92,10 +92,10 @@ You can authenticate using:
#### Authenticate within CI/CD
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/280582) in GitLab 13.7.
-> - Automatic runner authentication [added](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27302) in GitLab 13.9
+> - Automatic runner authentication [added](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27302) in GitLab 13.9.
-Runners will log into the Dependency Proxy automatically. We can pull through
-the dependency proxy using the `CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX`
+Runners log in to the Dependency Proxy automatically. To pull through
+the Dependency Proxy, use the `CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX`
environment variable:
```yaml
@@ -103,7 +103,7 @@ environment variable:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/node:latest
```
-There are other additional predefined environment variables we can also use:
+There are other additional predefined environment variables you can also use:
- `CI_DEPENDENCY_PROXY_USER`: A CI user for logging in to the Dependency Proxy.
- `CI_DEPENDENCY_PROXY_PASSWORD`: A CI password for logging in to the Dependency Proxy.
@@ -111,9 +111,9 @@ There are other additional predefined environment variables we can also use:
- `CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX`: The image prefix for pulling images through the Dependency Proxy.
`CI_DEPENDENCY_PROXY_SERVER` and `CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX`
-include the server port. So if you explicitly include the Dependency Proxy
-path, the port must be included unless you have logged into the dependency
-proxy manually without including the port:
+include the server port. If you explicitly include the Dependency Proxy
+path, the port must be included, unless you have logged into the Dependency
+Proxy manually without including the port:
```shell
docker pull gitlab.example.com:443/my-group/dependency_proxy/containers/alpine:latest
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 870fbe08edf..34eab44e088 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -374,10 +374,10 @@ msgstr ""
msgid "%{board_target} not found"
msgstr ""
-msgid "%{code_open}Masked%{code_close} variables are hidden in job logs (though they must match certain regexp requirements to do so)."
+msgid "%{code_open}Masked:%{code_close} Hidden in job logs. Must match masking requirements."
msgstr ""
-msgid "%{code_open}Protected%{code_close} variables are only exposed to protected branches or tags."
+msgid "%{code_open}Protected:%{code_close} Only exposed to protected branches or tags."
msgstr ""
msgid "%{commit_author_link} authored %{commit_timeago}"
@@ -11025,13 +11025,10 @@ msgstr ""
msgid "Environment scope"
msgstr ""
-msgid "Environment variables are applied to environments via the Runner. You can use environment variables for passwords, secret keys, etc. Make variables available to the running application by prepending the variable key with %{code_open}K8S_SECRET_%{code_close}. You can set variables to be:"
+msgid "Environment variables are configured by your administrator to be %{link_start}protected%{link_end} by default."
msgstr ""
-msgid "Environment variables are configured by your administrator to be %{link_start}protected%{link_end} by default"
-msgstr ""
-
-msgid "Environment variables on this GitLab instance are configured to be %{link_start}protected%{link_end} by default"
+msgid "Environment variables on this GitLab instance are configured to be %{link_start}protected%{link_end} by default."
msgstr ""
msgid "Environment:"
@@ -17223,9 +17220,6 @@ msgstr ""
msgid "Make sure you save it - you won't be able to access it again."
msgstr ""
-msgid "Make this epic confidential"
-msgstr ""
-
msgid "Makes this issue confidential."
msgstr ""
@@ -20205,9 +20199,6 @@ msgstr ""
msgid "Or you can choose one of the suggested colors below"
msgstr ""
-msgid "Origin"
-msgstr ""
-
msgid "Orphaned member"
msgstr ""
@@ -28865,7 +28856,7 @@ msgstr ""
msgid "These runners are specific to this project."
msgstr ""
-msgid "These variables are configured in the parent group settings, and will be active in the current project in addition to the project variables."
+msgid "These variables are inherited from the parent group."
msgstr ""
msgid "Third Party Advisory Link"
@@ -29039,9 +29030,6 @@ msgstr ""
msgid "This epic already has the maximum number of child epics."
msgstr ""
-msgid "This epic and its child elements will only be visible to team members with at minimum Reporter access."
-msgstr ""
-
msgid "This epic does not exist or you don't have sufficient permission."
msgstr ""
@@ -31310,6 +31298,15 @@ msgstr ""
msgid "Variables"
msgstr ""
+msgid "Variables can be:"
+msgstr ""
+
+msgid "Variables store information, like passwords and secret keys, that you can use in job scripts."
+msgstr ""
+
+msgid "Variables store information, like passwords and secret keys, that you can use in job scripts. All projects on the instance can use these variables."
+msgstr ""
+
msgid "Various container registry settings."
msgstr ""
@@ -34179,7 +34176,7 @@ msgstr ""
msgid "mrWidget|The changes will be merged into"
msgstr ""
-msgid "mrWidget|The pipeline for this merge request failed. Please retry the job or push a new commit to fix the failure"
+msgid "mrWidget|The pipeline for this merge request did not complete. Push a new commit to fix the failure or check the %{linkStart}troubleshooting documentation%{linkEnd} to see other possible actions."
msgstr ""
msgid "mrWidget|The source branch HEAD has recently changed. Please reload the page and review the changes before merging"
diff --git a/qa/qa/resource/merge_request.rb b/qa/qa/resource/merge_request.rb
index ecf25b797a8..3f1a20a1b15 100644
--- a/qa/qa/resource/merge_request.rb
+++ b/qa/qa/resource/merge_request.rb
@@ -86,6 +86,8 @@ module QA
end
def fabricate_via_api!
+ raise ResourceNotFoundError unless id
+
resource_web_url(api_get)
rescue ResourceNotFoundError
populate_target_and_source_if_required
diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb
index 1c637db5385..6c4139da83f 100644
--- a/qa/qa/runtime/env.rb
+++ b/qa/qa/runtime/env.rb
@@ -411,6 +411,10 @@ module QA
ENV.fetch('GITLAB_AGENTK_VERSION', 'v13.7.0')
end
+ def transient_trials
+ ENV.fetch('GITLAB_QA_TRANSIENT_TRIALS', 10).to_i
+ end
+
private
def remote_grid_credentials
diff --git a/qa/qa/specs/runner.rb b/qa/qa/specs/runner.rb
index 9027f17678d..04eaa02bda5 100644
--- a/qa/qa/specs/runner.rb
+++ b/qa/qa/specs/runner.rb
@@ -37,7 +37,7 @@ module QA
if tags.any?
tags.each { |tag| tags_for_rspec.push(['--tag', tag.to_s]) }
else
- tags_for_rspec.push(%w[--tag ~orchestrated]) unless (%w[-t --tag] & options).any?
+ tags_for_rspec.push(%w[--tag ~orchestrated --tag ~transient]) unless (%w[-t --tag] & options).any?
end
tags_for_rspec.push(%w[--tag ~geo]) unless QA::Runtime::Env.geo_environment?
diff --git a/qa/spec/specs/runner_spec.rb b/qa/spec/specs/runner_spec.rb
index b11054f0bd9..642d9e0745b 100644
--- a/qa/spec/specs/runner_spec.rb
+++ b/qa/spec/specs/runner_spec.rb
@@ -3,9 +3,9 @@
require 'active_support/core_ext/hash'
RSpec.describe QA::Specs::Runner do
- shared_examples 'excludes orchestrated and geo' do
- it 'excludes the orchestrated and geo tags and includes default args' do
- expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~geo', *described_class::DEFAULT_TEST_PATH_ARGS])
+ shared_examples 'excludes orchestrated, transient, and geo' do
+ it 'excludes the orchestrated, transient, and geo tags, and includes default args' do
+ expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', *described_class::DEFAULT_TEST_PATH_ARGS])
subject.perform
end
@@ -18,13 +18,13 @@ RSpec.describe QA::Specs::Runner do
QA::Runtime::Scenario.define(:gitlab_address, "http://gitlab.test")
end
- it_behaves_like 'excludes orchestrated and geo'
+ it_behaves_like 'excludes orchestrated, transient, and geo'
context 'when tty is set' do
subject { described_class.new.tap { |runner| runner.tty = true } }
it 'sets the `--tty` flag' do
- expect_rspec_runner_arguments(['--tty', '--tag', '~orchestrated', '--tag', '~geo', *described_class::DEFAULT_TEST_PATH_ARGS])
+ expect_rspec_runner_arguments(['--tty', '--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', *described_class::DEFAULT_TEST_PATH_ARGS])
subject.perform
end
@@ -43,7 +43,7 @@ RSpec.describe QA::Specs::Runner do
context 'when "--tag smoke" is set as options' do
subject { described_class.new.tap { |runner| runner.options = %w[--tag smoke] } }
- it 'focuses on the given tag without excluded the orchestrated tag' do
+ it 'focuses on the given tag without excluded tags' do
expect_rspec_runner_arguments(['--tag', '~geo', '--tag', 'smoke', *described_class::DEFAULT_TEST_PATH_ARGS])
subject.perform
@@ -53,8 +53,8 @@ RSpec.describe QA::Specs::Runner do
context 'when "qa/specs/features/foo" is set as options' do
subject { described_class.new.tap { |runner| runner.options = %w[qa/specs/features/foo] } }
- it 'passes the given tests path and excludes the orchestrated and geo tags' do
- expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~geo', 'qa/specs/features/foo'])
+ it 'passes the given tests path and excludes the orchestrated, transient, and geo tags' do
+ expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', 'qa/specs/features/foo'])
subject.perform
end
@@ -63,7 +63,7 @@ RSpec.describe QA::Specs::Runner do
context 'when "--tag smoke" and "qa/specs/features/foo" are set as options' do
subject { described_class.new.tap { |runner| runner.options = %w[--tag smoke qa/specs/features/foo] } }
- it 'focuses on the given tag and includes the path without excluding the orchestrated tag' do
+ it 'focuses on the given tag and includes the path without excluding the orchestrated or transient tags' do
expect_rspec_runner_arguments(['--tag', '~geo', '--tag', 'smoke', 'qa/specs/features/foo'])
subject.perform
@@ -76,7 +76,7 @@ RSpec.describe QA::Specs::Runner do
end
it 'includes default args and excludes the skip_signup_disabled tag' do
- expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~geo', '--tag', '~skip_signup_disabled', *described_class::DEFAULT_TEST_PATH_ARGS])
+ expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', '--tag', '~skip_signup_disabled', *described_class::DEFAULT_TEST_PATH_ARGS])
subject.perform
end
@@ -88,7 +88,7 @@ RSpec.describe QA::Specs::Runner do
end
it 'includes default args and excludes the skip_live_env tag' do
- expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~geo', '--tag', '~skip_live_env', *described_class::DEFAULT_TEST_PATH_ARGS])
+ expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', '--tag', '~skip_live_env', *described_class::DEFAULT_TEST_PATH_ARGS])
subject.perform
end
end
@@ -121,7 +121,7 @@ RSpec.describe QA::Specs::Runner do
end
it 'includes default args and excludes all unsupported tags' do
- expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~geo', *excluded_feature_tags_except(feature), *described_class::DEFAULT_TEST_PATH_ARGS])
+ expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~transient', '--tag', '~geo', *excluded_feature_tags_except(feature), *described_class::DEFAULT_TEST_PATH_ARGS])
subject.perform
end
@@ -146,11 +146,11 @@ RSpec.describe QA::Specs::Runner do
end
end
- it_behaves_like 'excludes orchestrated and geo'
+ it_behaves_like 'excludes orchestrated, transient, and geo'
end
context 'when features are not specified' do
- it_behaves_like 'excludes orchestrated and geo'
+ it_behaves_like 'excludes orchestrated, transient, and geo'
end
end
diff --git a/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb b/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb
index ea3e90a4508..05873d8655e 100644
--- a/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb
+++ b/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb
@@ -57,7 +57,7 @@ RSpec.describe 'Merge request > User merges only if pipeline succeeds', :js do
wait_for_requests
expect(page).to have_css('button[disabled="disabled"]', text: 'Merge')
- expect(page).to have_content('Please retry the job or push a new commit to fix the failure')
+ expect(page).to have_content('The pipeline for this merge request did not complete. Push a new commit to fix the failure or check the troubleshooting documentation to see other possible actions.')
end
end
@@ -70,7 +70,7 @@ RSpec.describe 'Merge request > User merges only if pipeline succeeds', :js do
wait_for_requests
expect(page).not_to have_button 'Merge'
- expect(page).to have_content('Please retry the job or push a new commit to fix the failure')
+ expect(page).to have_content('The pipeline for this merge request did not complete. Push a new commit to fix the failure or check the troubleshooting documentation to see other possible actions.')
end
end
diff --git a/spec/frontend/vue_mr_widget/components/states/__snapshots__/mr_widget_pipeline_failed_spec.js.snap b/spec/frontend/vue_mr_widget/components/states/__snapshots__/mr_widget_pipeline_failed_spec.js.snap
new file mode 100644
index 00000000000..4c3c7fbea36
--- /dev/null
+++ b/spec/frontend/vue_mr_widget/components/states/__snapshots__/mr_widget_pipeline_failed_spec.js.snap
@@ -0,0 +1,24 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`PipelineFailed should render error message with a disabled merge button 1`] = `
+<div
+ class="mr-widget-body media"
+>
+ <status-icon-stub
+ showdisabledbutton="true"
+ status="warning"
+ />
+
+ <div
+ class="media-body space-children"
+ >
+ <span
+ class="bold"
+ >
+ <gl-sprintf-stub
+ message="The pipeline for this merge request did not complete. Push a new commit to fix the failure or check the %{linkStart}troubleshooting documentation%{linkEnd} to see other possible actions."
+ />
+ </span>
+ </div>
+</div>
+`;
diff --git a/spec/frontend/vue_mr_widget/components/states/mr_widget_pipeline_failed_spec.js b/spec/frontend/vue_mr_widget/components/states/mr_widget_pipeline_failed_spec.js
index 179adef12d9..ed3e7d9c0eb 100644
--- a/spec/frontend/vue_mr_widget/components/states/mr_widget_pipeline_failed_spec.js
+++ b/spec/frontend/vue_mr_widget/components/states/mr_widget_pipeline_failed_spec.js
@@ -1,19 +1,30 @@
-import Vue from 'vue';
-import { removeBreakLine } from 'helpers/text_helper';
+import { shallowMount } from '@vue/test-utils';
import PipelineFailed from '~/vue_merge_request_widget/components/states/pipeline_failed.vue';
+import statusIcon from '~/vue_merge_request_widget/components/mr_widget_status_icon.vue';
describe('PipelineFailed', () => {
- describe('template', () => {
- const Component = Vue.extend(PipelineFailed);
- const vm = new Component({
- el: document.createElement('div'),
- });
- it('should have correct elements', () => {
- expect(vm.$el.classList.contains('mr-widget-body')).toBeTruthy();
- expect(vm.$el.querySelector('button').getAttribute('disabled')).toBeTruthy();
- expect(removeBreakLine(vm.$el.innerText).trim()).toContain(
- 'The pipeline for this merge request failed. Please retry the job or push a new commit to fix the failure',
- );
- });
+ let wrapper;
+
+ const createComponent = () => {
+ wrapper = shallowMount(PipelineFailed);
+ };
+
+ const findStatusIcon = () => wrapper.find(statusIcon);
+
+ beforeEach(() => {
+ createComponent();
+ });
+
+ afterEach(() => {
+ wrapper.destroy();
+ wrapper = null;
+ });
+
+ it('should render error message with a disabled merge button', () => {
+ expect(wrapper.element).toMatchSnapshot();
+ });
+
+ it('merge button should be disabled', () => {
+ expect(findStatusIcon().props('showDisabledButton')).toBe(true);
});
});
diff --git a/spec/frontend_integration/test_helpers/fixtures.js b/spec/frontend_integration/test_helpers/fixtures.js
index fde3fd8cb63..4c0143534c5 100644
--- a/spec/frontend_integration/test_helpers/fixtures.js
+++ b/spec/frontend_integration/test_helpers/fixtures.js
@@ -1,4 +1,10 @@
-/* eslint-disable global-require, import/no-unresolved */
+/* eslint-disable global-require */
+// We use "require" rather than `fs` so that this works in a browser environment.
+
+/* eslint "import/no-unresolved": 0 */
+// We don't want to require *all* fixtures to be generated (especailly in a local environment).
+// We use `eslint` instead of `eslint-disable`, so that we also don't trigger an `Unused eslint-disable directive` when all fixtures are present.
+
import { memoize } from 'lodash';
const createFactoryWithDefault = (fn, defaultValue) => () => {
diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb
index 25e947b6222..9ffefd4bbf7 100644
--- a/spec/models/service_spec.rb
+++ b/spec/models/service_spec.rb
@@ -39,35 +39,29 @@ RSpec.describe Service do
end
end
- context 'with an existing service template' do
- before do
+ context 'with existing services' do
+ before_all do
create(:service, :template)
+ create(:service, :instance)
+ create(:service, project: project)
+ create(:service, group: group, project: nil)
end
- it 'validates only one service template per type' do
+ it 'allows only one service template per type' do
expect(build(:service, :template)).to be_invalid
end
- end
- context 'with an existing instance service' do
- before do
- create(:service, :instance)
- end
-
- it 'validates only one service instance per type' do
+ it 'allows only one instance service per type' do
expect(build(:service, :instance)).to be_invalid
end
- end
- it 'validates uniqueness of type and project_id on create' do
- expect(create(:service, project: project, type: 'Service')).to be_valid
- expect(build(:service, project: project, type: 'Service').valid?(:create)).to eq(false)
- expect(build(:service, project: project, type: 'Service').valid?(:update)).to eq(true)
- end
+ it 'allows only one project service per type' do
+ expect(build(:service, project: project)).to be_invalid
+ end
- it 'validates uniqueness of type and group_id' do
- expect(create(:service, group_id: group.id, project_id: nil, type: 'Service')).to be_valid
- expect(build(:service, group_id: group.id, project_id: nil, type: 'Service')).to be_invalid
+ it 'allows only one group service per type' do
+ expect(build(:service, group: group, project: nil)).to be_invalid
+ end
end
end
diff --git a/spec/support/matchers/pushed_frontend_feature_flags_matcher.rb b/spec/support/matchers/pushed_frontend_feature_flags_matcher.rb
new file mode 100644
index 00000000000..b49d4da8cda
--- /dev/null
+++ b/spec/support/matchers/pushed_frontend_feature_flags_matcher.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+RSpec::Matchers.define :have_pushed_frontend_feature_flags do |expected|
+ def to_js(key, value)
+ "\"#{key}\":#{value}"
+ end
+
+ match do |actual|
+ expected.all? do |feature_flag_name, enabled|
+ page.html.include?(to_js(feature_flag_name, enabled))
+ end
+ end
+
+ failure_message do |actual|
+ missing = expected.select do |feature_flag_name, enabled|
+ !page.html.include?(to_js(feature_flag_name, enabled))
+ end
+
+ formatted_missing_flags = missing.map { |feature_flag_name, enabled| to_js(feature_flag_name, enabled) }.join("\n")
+
+ "The following feature flag(s) cannot be found in the frontend HTML source: #{formatted_missing_flags}"
+ end
+end