Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
ddd268b0
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ddd268b0
编写于
2月 07, 2020
作者:
G
GitLab Bot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add latest changes from gitlab-org/gitlab@master
上级
61687210
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
104 addition
and
2 deletion
+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
未找到文件。
app/controllers/registrations_controller.rb
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录