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
734dd474
Commit
734dd474
authored
Sep 11, 2019
by
Marius Bobin
Committed by
Mayra Cabrera
Sep 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use static status check name on GitHub integration
default GitHubService#static_context to true for new integrations
parent
b6311d52
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
6 deletions
+71
-6
doc/user/project/integrations/github.md
doc/user/project/integrations/github.md
+4
-5
ee/app/models/project_services/github_service.rb
ee/app/models/project_services/github_service.rb
+4
-0
ee/app/services/ci_cd/github_integration_setup_service.rb
ee/app/services/ci_cd/github_integration_setup_service.rb
+2
-1
ee/changelogs/unreleased/9931-github-integration-default-static-status-check-names.yml
...-github-integration-default-static-status-check-names.yml
+5
-0
ee/spec/models/project_services/github_service_spec.rb
ee/spec/models/project_services/github_service_spec.rb
+52
-0
ee/spec/services/ci_cd/github_integration_setup_service_spec.rb
...c/services/ci_cd/github_integration_setup_service_spec.rb
+4
-0
No files found.
doc/user/project/integrations/github.md
View file @
734dd474
...
@@ -30,19 +30,18 @@ with `repo:status` access granted:
...
@@ -30,19 +30,18 @@ with `repo:status` access granted:
1.
Select the "Active" checkbox.
1.
Select the "Active" checkbox.
1.
Paste the token you've generated on GitHub
1.
Paste the token you've generated on GitHub
1.
Enter the path to your project on GitHub, such as
`https://github.com/username/repository`
1.
Enter the path to your project on GitHub, such as
`https://github.com/username/repository`
1.
Optionally
check "Static status check names" checkbox to en
able static status check names.
1.
Optionally
uncheck
**Static status check names**
checkbox to dis
able static status check names.
1.
Save or optionally click "Test Settings".
1.
Save or optionally click "Test Settings".
#### Static / dynamic status check names
#### Static / dynamic status check names
Since GitLab 11.5 it is possible to opt-in to using static status check names.
> - Introduced in GitLab 11.5: using static status check names as opt-in option.
> - [In GitLab 12.4](https://gitlab.com/gitlab-org/gitlab-ee/issues/9931), static status check names is default behavior for new projects.
This makes it possible to mark these status checks as _Required_ on GitHub.
This makes it possible to mark these status checks as _Required_ on GitHub.
If you check "Static status check names" checkbox
on the integration page, your
With
**Static status check names**
enabled
on the integration page, your
GitLab instance host name is going to be appended to a status check name,
GitLab instance host name is going to be appended to a status check name,
whereas in case of dynamic status check names, a branch name is going to be
whereas in case of dynamic status check names, a branch name is going to be
appended.
appended.
Dynamic status check name is a default behavior.
![
Configure GitHub Project Integration
](
img/github_configuration.png
)
![
Configure GitHub Project Integration
](
img/github_configuration.png
)
ee/app/models/project_services/github_service.rb
View file @
734dd474
...
@@ -14,6 +14,10 @@ class GithubService < Service
...
@@ -14,6 +14,10 @@ class GithubService < Service
default_value_for
:pipeline_events
,
true
default_value_for
:pipeline_events
,
true
def
initialize_properties
self
.
properties
||=
{
static_context:
true
}
end
def
title
def
title
'GitHub'
'GitHub'
end
end
...
...
ee/app/services/ci_cd/github_integration_setup_service.rb
View file @
734dd474
...
@@ -35,7 +35,8 @@ module CiCd
...
@@ -35,7 +35,8 @@ module CiCd
{
{
active:
true
,
active:
true
,
repository_url:
repository_url
,
repository_url:
repository_url
,
token:
github_access_token
token:
github_access_token
,
static_context:
true
}
}
end
end
...
...
ee/changelogs/unreleased/9931-github-integration-default-static-status-check-names.yml
0 → 100644
View file @
734dd474
---
title
:
Use static status check names on GitHub integrations
merge_request
:
15737
author
:
type
:
changed
ee/spec/models/project_services/github_service_spec.rb
View file @
734dd474
...
@@ -76,6 +76,58 @@ describe GithubService do
...
@@ -76,6 +76,58 @@ describe GithubService do
end
end
end
end
describe
'#properties'
do
let
(
:properties
)
{
subject
.
reload
.
properties
.
symbolize_keys
}
it
'does not overwrite existing integrations'
do
subject
.
update
(
service_params
.
slice
(
:properties
))
expect
(
properties
).
to
match
(
service_params
[
:properties
])
expect
(
subject
.
static_context
).
to
be_nil
end
context
'when initialized without properties'
do
let
(
:service_params
)
do
{
active:
false
,
project:
project
}
end
it
'static_context defaults to true'
do
expect
(
properties
).
to
match
(
static_context:
true
)
end
end
context
'when initialized with static_context as false'
do
let
(
:service_params
)
do
{
active:
false
,
project:
project
,
static_context:
false
}
end
it
'static_context remains false'
do
expect
(
properties
).
to
match
(
static_context:
false
)
end
end
context
'when initialized with static_context as false'
do
let
(
:service_params
)
do
{
active:
false
,
project:
project
,
properties:
{
static_context:
false
}
}
end
it
'static_context remains false'
do
expect
(
properties
).
to
match
(
static_context:
false
)
end
end
end
describe
'#execute'
do
describe
'#execute'
do
let
(
:remote_repo_path
)
{
"
#{
owner
}
/
#{
repository_name
}
"
}
let
(
:remote_repo_path
)
{
"
#{
owner
}
/
#{
repository_name
}
"
}
let
(
:sha
)
{
pipeline
.
sha
}
let
(
:sha
)
{
pipeline
.
sha
}
...
...
ee/spec/services/ci_cd/github_integration_setup_service_spec.rb
View file @
734dd474
...
@@ -27,5 +27,9 @@ describe CiCd::GithubIntegrationSetupService do
...
@@ -27,5 +27,9 @@ describe CiCd::GithubIntegrationSetupService do
specify
'with repo URL'
do
specify
'with repo URL'
do
expect
(
integration
.
repository_url
).
to
eq
'https://github.com/MyUser/my-project'
expect
(
integration
.
repository_url
).
to
eq
'https://github.com/MyUser/my-project'
end
end
specify
'with static_context'
do
expect
(
integration
.
static_context
).
to
eq
true
end
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