_form.html.haml 4.15 KB
Newer Older
1
= render 'shared/push_rules/commit_committer_check_setting', form: f, push_rule: f.object, context: context
2

3
= render 'shared/push_rules/reject_unsigned_commits_setting', form: f, push_rule: f.object, context: context
4

5
.form-check
6
  = f.check_box :deny_delete_tag, class: "form-check-input", data: { qa_selector: 'deny_delete_tag_checkbox' }
7
  = f.label :deny_delete_tag, class: "label-bold form-check-label" do
8 9 10 11
    Do not allow users to remove git tags with
    %code git push
  %p.text-muted
    Tags can still be deleted through the web UI.
Valery Sizov's avatar
Valery Sizov committed
12

13
.form-check
14
  = f.check_box :member_check, class: "form-check-input", data: { qa_selector: 'restrict_author_checkbox' }
15
  = f.label :member_check, "Check whether author is a GitLab user", class: "label-bold form-check-label"
16 17
  %p.text-muted
    Restrict commits by author (email) to existing GitLab users
Valery Sizov's avatar
Valery Sizov committed
18

19

20
.form-check
21
  = f.check_box :prevent_secrets, class: "form-check-input", data: { qa_selector: 'prevent_secrets_checkbox' }
22
  = f.label :prevent_secrets, "Prevent committing secrets to Git", class: "label-bold form-check-label"
23 24 25
  %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')}.
26

Valery Sizov's avatar
Valery Sizov committed
27
.form-group
28
  = f.label :commit_message_regex, "Commit message", class: "label-bold"
29
  = f.text_field :commit_message_regex, class: "form-control", placeholder: 'Example: Fixes \d+\..*', data: { qa_selector: 'commit_message_field' }
Clement Ho's avatar
Clement Ho committed
30
  .form-text.text-muted
Phil Hughes's avatar
Phil Hughes committed
31
    All commit messages must match this
32
    = link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax'
Phil Hughes's avatar
Phil Hughes committed
33 34 35
    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.
Valery Sizov's avatar
Valery Sizov committed
36

37
.form-group
38
  = f.label :commit_message_negative_regex, "Commit message negative match", class: 'label-bold'
39
  = f.text_field :commit_message_negative_regex, class: "form-control", placeholder: 'Example: ssh\:\/\/', data: { qa_selector: 'deny_commit_message_field' }
40 41
  .form-text.text-muted
    No commit message is allowed to match this
42
    = link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax'
43 44 45 46
    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.

47
.form-group
48
  = f.label :branch_name_regex, "Branch name", class: "label-bold"
49
  = f.text_field :branch_name_regex, class: "form-control", placeholder: 'Example: (feature|hotfix)\/*', data: { qa_selector: 'branch_name_field' }
Clement Ho's avatar
Clement Ho committed
50
  .form-text.text-muted
51
    All branch names must match this
52
    = link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax'
53 54 55
    to be pushed.
    If this field is empty it allows any branch name.

Valery Sizov's avatar
Valery Sizov committed
56
.form-group
57
  = f.label :author_email_regex, "Commit author's email", class: "label-bold"
58
  = f.text_field :author_email_regex, class: "form-control", placeholder: _('Example: @sub\.company\.com$'), data: { qa_selector: 'author_email_field' }
Clement Ho's avatar
Clement Ho committed
59
  .form-text.text-muted
Phil Hughes's avatar
Phil Hughes committed
60
    All commit author's email must match this
61
    = link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax'
Phil Hughes's avatar
Phil Hughes committed
62 63
    to be pushed.
    If this field is empty it allows any email.
Valery Sizov's avatar
Valery Sizov committed
64 65

.form-group
66
  = f.label :file_name_regex, "Prohibited file names", class: "label-bold"
67
  = f.text_field :file_name_regex, class: "form-control", placeholder: 'Example: (jar|exe)$', data: { qa_selector: 'file_name_field' }
Clement Ho's avatar
Clement Ho committed
68
  .form-text.text-muted
69
    All committed filenames must not match this
70
    = link_to 'regular expression', 'https://github.com/google/re2/wiki/Syntax'
Phil Hughes's avatar
Phil Hughes committed
71 72
    to be pushed.
    If this field is empty it allows any filenames.
Valery Sizov's avatar
Valery Sizov committed
73

74
.form-group
75
  = f.label :max_file_size, "Maximum file size (MB)", class: "label-bold"
76
  = f.number_field :max_file_size, class: "form-control", min: 0, data: { qa_selector: 'file_size_field' }
Clement Ho's avatar
Clement Ho committed
77
  .form-text.text-muted
Phil Hughes's avatar
Phil Hughes committed
78 79
    Pushes that contain added or updated files that exceed this file size are rejected.
    Set to 0 to allow files of any size.
80
    Files tracked by Git LFS are exempted.
81

82
= f.submit _("Save Push Rules"), class: "btn btn-success", data: { qa_selector: 'submit_settings_button' }