Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ddd268b0
Commit
ddd268b0
authored
Feb 07, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
61687210
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
2 deletions
+104
-2
app/controllers/registrations_controller.rb
app/controllers/registrations_controller.rb
+5
-0
doc/.linting/vale/styles/gitlab/Substitutions.yml
doc/.linting/vale/styles/gitlab/Substitutions.yml
+36
-0
doc/user/clusters/management_project.md
doc/user/clusters/management_project.md
+2
-2
doc/user/project/service_desk.md
doc/user/project/service_desk.md
+5
-0
spec/services/spam/ham_service_spec.rb
spec/services/spam/ham_service_spec.rb
+56
-0
No files found.
app/controllers/registrations_controller.rb
View file @
ddd268b0
...
...
@@ -13,6 +13,7 @@ class RegistrationsController < Devise::RegistrationsController
before_action
:whitelist_query_limiting
,
only:
[
:destroy
]
before_action
:ensure_terms_accepted
,
if:
->
{
action_name
==
'create'
&&
Gitlab
::
CurrentSettings
.
current_application_settings
.
enforce_terms?
}
before_action
:load_recaptcha
,
only: :new
def
new
if
experiment_enabled?
(
:signup_flow
)
...
...
@@ -183,6 +184,10 @@ class RegistrationsController < Devise::RegistrationsController
stored_location_for
(
user
)
||
dashboard_projects_path
end
def
load_recaptcha
Gitlab
::
Recaptcha
.
load_configurations!
end
# Part of an experiment to build a new sign up flow. Will be resolved
# with https://gitlab.com/gitlab-org/growth/engineering/issues/64
def
choose_layout
...
...
doc/.linting/vale/styles/gitlab/Substitutions.yml
0 → 100644
View file @
ddd268b0
---
# `extends` indicates the Vale extension point being used.
# Full list of styles: https://errata-ai.github.io/vale/styles/
extends
:
substitution
# Substitution rules can display the matched and suggested strings in the
# message shown to the user. The first use of %s prints the suggested option,
# and the second use of %s displays what was found in the text.
message
:
Use "%s" instead of "%s."
# Should a result be flagged as a suggestion, warning, or error?
# Results that fall below the MinAlertLevel set in
# https://gitlab.com/gitlab-org/gitlab/blob/master/.vale.ini won't be shown.
level
:
warning
# Should a match be case-insensitive or case-sensitive?
# Acceptable values are 'true' or 'false'
ignorecase
:
true
# Should this rule be limited to a specific scope? If yes, uncomment the line.
# Possible scopes: https://errata-ai.github.io/vale/formats/#available-scopes
# scope: heading
# Should this rule ignore normal word boundaries, such as \b ?
# Acceptable values are 'true' or 'false'
nonword
:
true
# What is the source for this rule?
link
:
https://about.gitlab.com/handbook/communication/#top-misused-terms
# The 'swap' section provides a list of values, one per line, in the form of
# $bad: $good
swap
:
GitLabber
:
GitLab team member
self hosted
:
self-managed
self-hosted
:
self-managed
doc/user/clusters/management_project.md
View file @
ddd268b0
...
...
@@ -24,9 +24,9 @@ other projects will continue to receive [namespace scoped `edit` level privilege
Management projects are restricted to the following:
-
For project-level clusters, the management project must in the same
-
For project-level clusters, the management project must
be
in the same
namespace (or descendants) as the cluster's project.
-
For group-level clusters, the management project must in the same
-
For group-level clusters, the management project must
be
in the same
group (or descendants) as as the cluster's group.
-
For instance-level clusters, there are no such restrictions.
...
...
doc/user/project/service_desk.md
View file @
ddd268b0
...
...
@@ -108,6 +108,11 @@ You can use `%{ISSUE_ID}` placeholder which will be replaced by an issue iid
in the email,
`%{ISSUE_PATH}`
placeholder which will be replaced by
project path and the issue iid and
`%{NOTE_TEXT}`
placeholder which will be replaced by the note text.
### Using custom email display name
You can customize the email display name. Emails sent from Service Desk will have
this name in the
`From`
header. The default display name is
`GitLab Support Bot`
.
## Using Service Desk
### As an end user (issue creator)
...
...
spec/services/spam/ham_service_spec.rb
0 → 100644
View file @
ddd268b0
# frozen_string_literal: true
require
'spec_helper'
describe
Spam
::
HamService
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let!
(
:spam_log
)
{
create
(
:spam_log
,
user:
user
,
submitted_as_ham:
false
)
}
let
(
:fake_akismet_service
)
{
double
(
:akismet_service
)
}
subject
{
described_class
.
new
(
spam_log
)
}
before
do
allow
(
Spam
::
AkismetService
).
to
receive
(
:new
).
and_return
fake_akismet_service
end
describe
'#mark_as_ham!'
do
context
'AkismetService returns false (Akismet cannot be reached, etc)'
do
before
do
allow
(
fake_akismet_service
).
to
receive
(
:submit_ham
).
and_return
false
end
it
'returns false'
do
expect
(
subject
.
mark_as_ham!
).
to
be_falsey
end
it
'does not update the record'
do
expect
{
subject
.
mark_as_ham!
}.
not_to
change
{
spam_log
.
submitted_as_ham
}
end
context
'if spam log record has already been marked as spam'
do
before
do
spam_log
.
update_attribute
(
:submitted_as_ham
,
true
)
end
it
'does not update the record'
do
expect
{
subject
.
mark_as_ham!
}.
not_to
change
{
spam_log
.
submitted_as_ham
}
end
end
end
context
'Akismet ham submission is successful'
do
before
do
spam_log
.
update_attribute
(
:submitted_as_ham
,
false
)
allow
(
fake_akismet_service
).
to
receive
(
:submit_ham
).
and_return
true
end
it
'returns true'
do
expect
(
subject
.
mark_as_ham!
).
to
be_truthy
end
it
'updates the record'
do
expect
{
subject
.
mark_as_ham!
}.
to
change
{
spam_log
.
submitted_as_ham
}.
from
(
false
).
to
(
true
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment