Commit 171fff01 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'docs-ui-text-settings-push-rules' into 'master'

UI text - Repo settings - push rules

See merge request gitlab-org/gitlab!52797
parents 8126cd5f 873ba667
......@@ -89,12 +89,12 @@ The following options are available:
| Push rule | Description |
|---------------------------------|-------------|
| Removal of tags with `git push` | Forbid users to remove Git tags with `git push`. Tags can be deleted through the web UI. |
| Check whether author is a GitLab user | Restrict commits by author (email) to existing GitLab users. |
| Committer restriction **(PREMIUM)** | GitLab rejects any commit that was not committed by the current authenticated user. |
| Check whether the commit author is a GitLab user | Restrict commits to existing GitLab users (checked against their emails). |
| Reject unverified users **(PREMIUM)** | GitLab rejects any commit that was not committed by an authenticated user. |
| Check whether commit is signed through GPG **(PREMIUM)** | Reject commit when it is not signed through GPG. Read [signing commits with GPG](../user/project/repository/gpg_signed_commits/index.md). |
| Prevent committing secrets to Git | GitLab rejects any files that are likely to contain secrets. Read [what files are forbidden](#prevent-pushing-secrets-to-the-repository). |
| Restrict by commit message | Only commit messages that match this regular expression are allowed to be pushed. Leave empty to allow any commit message. Uses multiline mode, which can be disabled using `(?-m)`. |
| Restrict by commit message (negative match) | Only commit messages that do not match this regular expression are allowed to be pushed. Leave empty to allow any commit message. Uses multiline mode, which can be disabled using `(?-m)`. |
| Prevent pushing secret files | GitLab rejects any files that are likely to contain secrets. See the [forbiden file names](#prevent-pushing-secrets-to-the-repository). |
| Require expression in commit messages | Only commit messages that match this regular expression are allowed to be pushed. Leave empty to allow any commit message. Uses multiline mode, which can be disabled using `(?-m)`. |
| Reject expression in commit messages | Only commit messages that do not match this regular expression are allowed to be pushed. Leave empty to allow any commit message. Uses multiline mode, which can be disabled using `(?-m)`. |
| Restrict by branch name | Only branch names that match this regular expression are allowed to be pushed. Leave empty to allow any branch name. |
| Restrict by commit author's email | Only commit author's email that match this regular expression are allowed to be pushed. Leave empty to allow any email. |
| Prohibited file names | Any committed filenames that match this regular expression and do not already exist in the repository are not allowed to be pushed. Leave empty to allow any filenames. See [common examples](#prohibited-file-names). |
......
......@@ -8,10 +8,11 @@
%button.gl-button.btn.btn-default.js-settings-toggle
= expanded ? 'Collapse' : 'Expand'
%p
Push Rules outline what is accepted for this project.
Restrict push operations for this project.
= link_to _('Learn more.'), help_page_path('push_rules/push_rules'), target: '_blank', rel: 'noopener noreferrer'
.settings-content
%h5
Add new push rule
Select push rules
= form_for [@project, @push_rule] do |f|
= form_errors(@push_rule)
......
......@@ -8,6 +8,6 @@
.form-check
= form.check_box :commit_committer_check, class: "form-check-input", disabled: !can_change_push_rule?(form.object, :commit_committer_check, context), data: { qa_selector: 'committer_restriction_checkbox' }
= form.label :commit_committer_check, class: "label-bold form-check-label" do
= s_("PushRule|Committer restriction")
= s_("PushRule|Reject unverified users")
%p.text-muted
= commit_committer_check_description(push_rule)
......@@ -5,78 +5,65 @@
.form-check
= f.check_box :deny_delete_tag, class: "form-check-input", data: { qa_selector: 'deny_delete_tag_checkbox' }
= f.label :deny_delete_tag, class: "label-bold form-check-label" do
Do not allow users to remove git tags with
Do not allow users to remove Git tags with
%code git push
%p.text-muted
Tags can still be deleted through the web UI.
Users can still delete tags through the GitLab UI.
.form-check
= f.check_box :member_check, class: "form-check-input", data: { qa_selector: 'restrict_author_checkbox' }
= f.label :member_check, "Check whether author is a GitLab user", class: "label-bold form-check-label"
= f.label :member_check, "Check whether the commit author is a GitLab user", class: "label-bold form-check-label"
%p.text-muted
Restrict commits by author (email) to existing GitLab users
Restrict commits to existing GitLab users.
.form-check
= f.check_box :prevent_secrets, class: "form-check-input", data: { qa_selector: 'prevent_secrets_checkbox' }
= f.label :prevent_secrets, "Prevent committing secrets to Git", class: "label-bold form-check-label"
= f.label :prevent_secrets, "Prevent pushing secret files", class: "label-bold form-check-label"
%p.text-muted
GitLab will reject any files that are likely to contain secrets.
The list of file names we reject is available in the #{link_to "documentation", help_page_path('push_rules/push_rules')}.
Reject any files likely to contain secrets.
= link_to "What secret files are rejected?", help_page_path('push_rules/push_rules', anchor: 'prevent-pushing-secrets-to-the-repository'), target: '_blank', rel: 'noopener noreferrer'
.form-group
= f.label :commit_message_regex, "Commit message", class: "label-bold"
= f.label :commit_message_regex, "Require expression in commit messages", class: "label-bold"
= f.text_field :commit_message_regex, class: "form-control", placeholder: 'Example: Fixes \d+\..*', data: { qa_selector: 'commit_message_field' }
.form-text.text-muted
All commit messages must match this
= link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax'
to be pushed.
If this field is empty it allows any commit message.
For example you can require that an issue number is always mentioned in the commit message.
All commit messages must match this #{link_to "regular expression", 'https://github.com/google/re2/wiki/Syntax'}.
If empty, commit messages are not required to match any expression.
.form-group
= f.label :commit_message_negative_regex, "Commit message negative match", class: 'label-bold'
= f.label :commit_message_negative_regex, "Reject expression in commit messages", class: 'label-bold'
= f.text_field :commit_message_negative_regex, class: "form-control", placeholder: 'Example: ssh\:\/\/', data: { qa_selector: 'deny_commit_message_field' }
.form-text.text-muted
No commit message is allowed to match this
= link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax'
to be pushed.
If this field is empty it allows any commit message.
For example you can require that no commit message contains any links.
Commit messages cannot match this #{link_to "regular expression", 'https://github.com/google/re2/wiki/Syntax'}.
If empty, commit messages are not rejected based on any expression.
.form-group
= f.label :branch_name_regex, "Branch name", class: "label-bold"
= f.text_field :branch_name_regex, class: "form-control", placeholder: 'Example: (feature|hotfix)\/*', data: { qa_selector: 'branch_name_field' }
.form-text.text-muted
All branch names must match this
= link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax'
to be pushed.
If this field is empty it allows any branch name.
All branch names must match this #{link_to "regular expression", 'https://github.com/google/re2/wiki/Syntax'}.
If empty, any branch name is allowed.
.form-group
= f.label :author_email_regex, "Commit author's email", class: "label-bold"
= f.text_field :author_email_regex, class: "form-control", placeholder: _('Example: @sub\.company\.com$'), data: { qa_selector: 'author_email_field' }
.form-text.text-muted
All commit author's email must match this
= link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax'
to be pushed.
If this field is empty it allows any email.
All commit author's email must match this #{link_to "regular expression", 'https://github.com/google/re2/wiki/Syntax'}.
If empty, any email is allowed.
.form-group
= f.label :file_name_regex, "Prohibited file names", class: "label-bold"
= f.text_field :file_name_regex, class: "form-control", placeholder: 'Example: (jar|exe)$', data: { qa_selector: 'file_name_field' }
.form-text.text-muted
All committed filenames must not match this
= link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax'
to be pushed.
If this field is empty it allows any filenames.
All committed filenames cannot match this #{link_to "regular expression", 'https://github.com/google/re2/wiki/Syntax'}.
If empty, any filename is allowed.
.form-group
= f.label :max_file_size, "Maximum file size (MB)", class: "label-bold"
= f.number_field :max_file_size, class: "form-control", min: 0, data: { qa_selector: 'file_size_field' }
.form-text.text-muted
Pushes that contain added or updated files that exceed this file size are rejected.
Set to 0 to allow files of any size.
Files tracked by Git LFS are exempted.
Reject file sizes equal to or greater than this size.
If set to 0, files of any size are allowed.
This rule does not apply to files tracked by Git LFS.
= f.submit _("Save Push Rules"), class: "btn btn-success", data: { qa_selector: 'submit_settings_button' }
---
title: Review UI text - repo push rules settings
merge_request: 52797
author:
type: other
......@@ -15,7 +15,7 @@ RSpec.describe "Admin interacts with push rules" do
push_rules_with_titles = {
reject_unsigned_commits: "Reject unsigned commits",
commit_committer_check: "Committer restriction"
commit_committer_check: "Reject unverified users"
}
push_rules_with_titles.each do |rule_attr, title|
......@@ -46,7 +46,7 @@ RSpec.describe "Admin interacts with push rules" do
end
it "creates new rule" do
fill_in("Commit message", with: "my_string")
fill_in("Require expression in commit messages", with: "my_string")
click_button("Save Push Rules")
expect(page).to have_selector("input[value='my_string']")
......
......@@ -14,7 +14,7 @@ RSpec.describe 'Groups > Push Rules', :js do
push_rules_with_titles = {
reject_unsigned_commits: 'Reject unsigned commits',
commit_committer_check: 'Committer restriction'
commit_committer_check: 'Reject unverified users'
}
push_rules_with_titles.each do |rule_attr, title|
......
......@@ -14,7 +14,7 @@ RSpec.describe 'Projects > Push Rules', :js do
push_rules_with_titles = {
reject_unsigned_commits: 'Reject unsigned commits',
commit_committer_check: 'Committer restriction'
commit_committer_check: 'Reject unverified users'
}
push_rules_with_titles.each do |rule_attr, title|
......
......@@ -23777,7 +23777,7 @@ msgstr ""
msgid "Push to create a project"
msgstr ""
msgid "PushRule|Committer restriction"
msgid "PushRule|Reject unverified users"
msgstr ""
msgid "Pushed"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment