Commit 873ba667 authored by Marcia Ramos's avatar Marcia Ramos Committed by Ezekiel Kigbo

UI text - Repo settings - push rules

parent 5c731d5a
...@@ -89,12 +89,12 @@ The following options are available: ...@@ -89,12 +89,12 @@ The following options are available:
| Push rule | Description | | 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. | | 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. | | Check whether the commit author is a GitLab user | Restrict commits to existing GitLab users (checked against their emails). |
| Committer restriction **(PREMIUM)** | GitLab rejects any commit that was not committed by the current authenticated user. | | 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). | | 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). | | 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). |
| 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)`. | | 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)`. |
| 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)`. | | 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 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. | | 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). | | 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 @@ ...@@ -8,10 +8,11 @@
%button.gl-button.btn.btn-default.js-settings-toggle %button.gl-button.btn.btn-default.js-settings-toggle
= expanded ? 'Collapse' : 'Expand' = expanded ? 'Collapse' : 'Expand'
%p %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 .settings-content
%h5 %h5
Add new push rule Select push rules
= form_for [@project, @push_rule] do |f| = form_for [@project, @push_rule] do |f|
= form_errors(@push_rule) = form_errors(@push_rule)
......
...@@ -8,6 +8,6 @@ ...@@ -8,6 +8,6 @@
.form-check .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.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 = form.label :commit_committer_check, class: "label-bold form-check-label" do
= s_("PushRule|Committer restriction") = s_("PushRule|Reject unverified users")
%p.text-muted %p.text-muted
= commit_committer_check_description(push_rule) = commit_committer_check_description(push_rule)
...@@ -5,78 +5,65 @@ ...@@ -5,78 +5,65 @@
.form-check .form-check
= f.check_box :deny_delete_tag, class: "form-check-input", data: { qa_selector: 'deny_delete_tag_checkbox' } = 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 = 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 %code git push
%p.text-muted %p.text-muted
Tags can still be deleted through the web UI. Users can still delete tags through the GitLab UI.
.form-check .form-check
= f.check_box :member_check, class: "form-check-input", data: { qa_selector: 'restrict_author_checkbox' } = 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 %p.text-muted
Restrict commits by author (email) to existing GitLab users Restrict commits to existing GitLab users.
.form-check .form-check
= f.check_box :prevent_secrets, class: "form-check-input", data: { qa_selector: 'prevent_secrets_checkbox' } = 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 %p.text-muted
GitLab will reject any files that are likely to contain secrets. Reject any files 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')}. = 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 .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' } = f.text_field :commit_message_regex, class: "form-control", placeholder: 'Example: Fixes \d+\..*', data: { qa_selector: 'commit_message_field' }
.form-text.text-muted .form-text.text-muted
All commit messages must match this All commit messages must match this #{link_to "regular expression", 'https://github.com/google/re2/wiki/Syntax'}.
= link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax' If empty, commit messages are not required to match any expression.
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.
.form-group .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' } = f.text_field :commit_message_negative_regex, class: "form-control", placeholder: 'Example: ssh\:\/\/', data: { qa_selector: 'deny_commit_message_field' }
.form-text.text-muted .form-text.text-muted
No commit message is allowed to match this Commit messages cannot match this #{link_to "regular expression", 'https://github.com/google/re2/wiki/Syntax'}.
= link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax' If empty, commit messages are not rejected based on any expression.
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.
.form-group .form-group
= f.label :branch_name_regex, "Branch name", class: "label-bold" = 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' } = f.text_field :branch_name_regex, class: "form-control", placeholder: 'Example: (feature|hotfix)\/*', data: { qa_selector: 'branch_name_field' }
.form-text.text-muted .form-text.text-muted
All branch names must match this All branch names must match this #{link_to "regular expression", 'https://github.com/google/re2/wiki/Syntax'}.
= link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax' If empty, any branch name is allowed.
to be pushed.
If this field is empty it allows any branch name.
.form-group .form-group
= f.label :author_email_regex, "Commit author's email", class: "label-bold" = 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' } = f.text_field :author_email_regex, class: "form-control", placeholder: _('Example: @sub\.company\.com$'), data: { qa_selector: 'author_email_field' }
.form-text.text-muted .form-text.text-muted
All commit author's email must match this All commit author's email must match this #{link_to "regular expression", 'https://github.com/google/re2/wiki/Syntax'}.
= link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax' If empty, any email is allowed.
to be pushed.
If this field is empty it allows any email.
.form-group .form-group
= f.label :file_name_regex, "Prohibited file names", class: "label-bold" = 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' } = f.text_field :file_name_regex, class: "form-control", placeholder: 'Example: (jar|exe)$', data: { qa_selector: 'file_name_field' }
.form-text.text-muted .form-text.text-muted
All committed filenames must not match this All committed filenames cannot match this #{link_to "regular expression", 'https://github.com/google/re2/wiki/Syntax'}.
= link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax' If empty, any filename is allowed.
to be pushed.
If this field is empty it allows any filenames.
.form-group .form-group
= f.label :max_file_size, "Maximum file size (MB)", class: "label-bold" = 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' } = f.number_field :max_file_size, class: "form-control", min: 0, data: { qa_selector: 'file_size_field' }
.form-text.text-muted .form-text.text-muted
Pushes that contain added or updated files that exceed this file size are rejected. Reject file sizes equal to or greater than this size.
Set to 0 to allow files of any size. If set to 0, files of any size are allowed.
Files tracked by Git LFS are exempted. 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' } = 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 ...@@ -15,7 +15,7 @@ RSpec.describe "Admin interacts with push rules" do
push_rules_with_titles = { push_rules_with_titles = {
reject_unsigned_commits: "Reject unsigned commits", 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| push_rules_with_titles.each do |rule_attr, title|
...@@ -46,7 +46,7 @@ RSpec.describe "Admin interacts with push rules" do ...@@ -46,7 +46,7 @@ RSpec.describe "Admin interacts with push rules" do
end end
it "creates new rule" do 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") click_button("Save Push Rules")
expect(page).to have_selector("input[value='my_string']") expect(page).to have_selector("input[value='my_string']")
......
...@@ -14,7 +14,7 @@ RSpec.describe 'Groups > Push Rules', :js do ...@@ -14,7 +14,7 @@ RSpec.describe 'Groups > Push Rules', :js do
push_rules_with_titles = { push_rules_with_titles = {
reject_unsigned_commits: 'Reject unsigned commits', 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| push_rules_with_titles.each do |rule_attr, title|
......
...@@ -14,7 +14,7 @@ RSpec.describe 'Projects > Push Rules', :js do ...@@ -14,7 +14,7 @@ RSpec.describe 'Projects > Push Rules', :js do
push_rules_with_titles = { push_rules_with_titles = {
reject_unsigned_commits: 'Reject unsigned commits', 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| push_rules_with_titles.each do |rule_attr, title|
......
...@@ -23735,7 +23735,7 @@ msgstr "" ...@@ -23735,7 +23735,7 @@ msgstr ""
msgid "Push to create a project" msgid "Push to create a project"
msgstr "" msgstr ""
msgid "PushRule|Committer restriction" msgid "PushRule|Reject unverified users"
msgstr "" msgstr ""
msgid "Pushed" 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