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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
dd8102f2
Commit
dd8102f2
authored
Dec 11, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
513d551c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
12 deletions
+15
-12
app/models/project.rb
app/models/project.rb
+4
-2
app/views/projects/commit/_builds.html.haml
app/views/projects/commit/_builds.html.haml
+4
-4
app/views/projects/triggers/index.html.haml
app/views/projects/triggers/index.html.haml
+1
-1
lib/gitlab/backend/grack_auth.rb
lib/gitlab/backend/grack_auth.rb
+1
-1
spec/models/build_spec.rb
spec/models/build_spec.rb
+1
-1
spec/models/commit_status_spec.rb
spec/models/commit_status_spec.rb
+2
-1
spec/services/create_commit_builds_service_spec.rb
spec/services/create_commit_builds_service_spec.rb
+2
-2
No files found.
app/models/project.rb
View file @
dd8102f2
...
@@ -830,11 +830,13 @@ class Project < ActiveRecord::Base
...
@@ -830,11 +830,13 @@ class Project < ActiveRecord::Base
end
end
def
valid_runners_token?
token
def
valid_runners_token?
token
self
.
token
&&
self
.
token
==
token
self
.
runners_token
&&
self
.
runners_
token
==
token
end
end
# TODO (ayufan): For now we use runners_token (backward compatibility)
# In 8.4 every build will have its own individual token valid for time of build
def
valid_build_token?
token
def
valid_build_token?
token
self
.
token
&&
self
.
token
==
token
self
.
builds_enabled?
&&
self
.
runners_token
&&
self
.
runners_
token
==
token
end
end
def
build_coverage_enabled?
def
build_coverage_enabled?
...
...
app/views/projects/commit/_builds.html.haml
View file @
dd8102f2
...
@@ -39,12 +39,12 @@
...
@@ -39,12 +39,12 @@
%th
Name
%th
Name
%th
Duration
%th
Duration
%th
Finished at
%th
Finished at
-
if
@ci_commit
.
project
.
coverage_enabled?
-
if
@ci_commit
.
project
.
build_
coverage_enabled?
%th
Coverage
%th
Coverage
%th
%th
-
@ci_commit
.
refs
.
each
do
|
ref
|
-
@ci_commit
.
refs
.
each
do
|
ref
|
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
statuses
.
for_ref
(
ref
).
latest
.
ordered
,
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
statuses
.
for_ref
(
ref
).
latest
.
ordered
,
locals:
{
coverage:
@ci_commit
.
project
.
coverage_enabled?
,
stage:
true
,
allow_retry:
true
}
locals:
{
coverage:
@ci_commit
.
project
.
build_
coverage_enabled?
,
stage:
true
,
allow_retry:
true
}
-
if
@ci_commit
.
retried
.
any?
-
if
@ci_commit
.
retried
.
any?
.gray-content-block.second-block
.gray-content-block.second-block
...
@@ -61,8 +61,8 @@
...
@@ -61,8 +61,8 @@
%th
Name
%th
Name
%th
Duration
%th
Duration
%th
Finished at
%th
Finished at
-
if
@ci_commit
.
project
.
coverage_enabled?
-
if
@ci_commit
.
project
.
build_
coverage_enabled?
%th
Coverage
%th
Coverage
%th
%th
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
retried
,
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
retried
,
locals:
{
coverage:
@ci_commit
.
project
.
coverage_enabled?
,
stage:
true
}
locals:
{
coverage:
@ci_commit
.
project
.
build_
coverage_enabled?
,
stage:
true
}
app/views/projects/triggers/index.html.haml
View file @
dd8102f2
...
@@ -68,4 +68,4 @@
...
@@ -68,4 +68,4 @@
-F token=TOKEN \
-F token=TOKEN \
-F "ref=REF_NAME" \
-F "ref=REF_NAME" \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
#{
builds_trigger_url
(
@project
.
id
,
'TOKEN'
)
}
#{
builds_trigger_url
(
@project
.
id
)
}
lib/gitlab/backend/grack_auth.rb
View file @
dd8102f2
...
@@ -78,7 +78,7 @@ module Grack
...
@@ -78,7 +78,7 @@ module Grack
underscored_service
=
matched_login
[
's'
].
underscore
underscored_service
=
matched_login
[
's'
].
underscore
if
underscored_service
==
'gitlab_ci'
if
underscored_service
==
'gitlab_ci'
return
project
&&
project
.
builds_enabled?
&&
project
.
valid_build_token?
(
password
)
return
project
&&
project
.
valid_build_token?
(
password
)
elsif
Service
.
available_services_names
.
include?
(
underscored_service
)
elsif
Service
.
available_services_names
.
include?
(
underscored_service
)
service_method
=
"
#{
underscored_service
}
_service"
service_method
=
"
#{
underscored_service
}
_service"
service
=
project
.
send
(
service_method
)
service
=
project
.
send
(
service_method
)
...
...
spec/models/build_spec.rb
View file @
dd8102f2
...
@@ -386,7 +386,7 @@ describe Ci::Build, models: true do
...
@@ -386,7 +386,7 @@ describe Ci::Build, models: true do
it
{
is_expected
.
to
be_a
(
String
)
}
it
{
is_expected
.
to
be_a
(
String
)
}
it
{
is_expected
.
to
end_with
(
".git"
)
}
it
{
is_expected
.
to
end_with
(
".git"
)
}
it
{
is_expected
.
to
start_with
(
project
.
web_url
[
0
..
6
])
}
it
{
is_expected
.
to
start_with
(
project
.
web_url
[
0
..
6
])
}
it
{
is_expected
.
to
include
(
project
.
token
)
}
it
{
is_expected
.
to
include
(
build
.
token
)
}
it
{
is_expected
.
to
include
(
'gitlab-ci-token'
)
}
it
{
is_expected
.
to
include
(
'gitlab-ci-token'
)
}
it
{
is_expected
.
to
include
(
project
.
web_url
[
7
..-
1
])
}
it
{
is_expected
.
to
include
(
project
.
web_url
[
7
..-
1
])
}
end
end
...
...
spec/models/commit_status_spec.rb
View file @
dd8102f2
...
@@ -39,12 +39,13 @@ describe CommitStatus, models: true do
...
@@ -39,12 +39,13 @@ describe CommitStatus, models: true do
it
{
is_expected
.
to
belong_to
(
:commit
)
}
it
{
is_expected
.
to
belong_to
(
:commit
)
}
it
{
is_expected
.
to
belong_to
(
:user
)
}
it
{
is_expected
.
to
belong_to
(
:user
)
}
it
{
is_expected
.
to
belong_to
(
:project
)
}
it
{
is_expected
.
to
validate_presence_of
(
:name
)
}
it
{
is_expected
.
to
validate_presence_of
(
:name
)
}
it
{
is_expected
.
to
validate_inclusion_of
(
:status
).
in_array
(
%w(pending running failed success canceled)
)
}
it
{
is_expected
.
to
validate_inclusion_of
(
:status
).
in_array
(
%w(pending running failed success canceled)
)
}
it
{
is_expected
.
to
delegate_method
(
:sha
).
to
(
:commit
)
}
it
{
is_expected
.
to
delegate_method
(
:sha
).
to
(
:commit
)
}
it
{
is_expected
.
to
delegate_method
(
:short_sha
).
to
(
:commit
)
}
it
{
is_expected
.
to
delegate_method
(
:short_sha
).
to
(
:commit
)
}
it
{
is_expected
.
to
delegate_method
(
:project
).
to
(
:commit
)
}
it
{
is_expected
.
to
respond_to
:success?
}
it
{
is_expected
.
to
respond_to
:success?
}
it
{
is_expected
.
to
respond_to
:failed?
}
it
{
is_expected
.
to
respond_to
:failed?
}
...
...
spec/services/create_commit_builds_service_spec.rb
View file @
dd8102f2
...
@@ -20,11 +20,11 @@ describe CreateCommitBuildsService, services: true do
...
@@ -20,11 +20,11 @@ describe CreateCommitBuildsService, services: true do
)
)
end
end
it
{
expect
(
commit
).
to
be_kind_of
(
Commit
)
}
it
{
expect
(
commit
).
to
be_kind_of
(
C
i
::
C
ommit
)
}
it
{
expect
(
commit
).
to
be_valid
}
it
{
expect
(
commit
).
to
be_valid
}
it
{
expect
(
commit
).
to
be_persisted
}
it
{
expect
(
commit
).
to
be_persisted
}
it
{
expect
(
commit
).
to
eq
(
project
.
ci_commits
.
last
)
}
it
{
expect
(
commit
).
to
eq
(
project
.
ci_commits
.
last
)
}
it
{
expect
(
commit
.
builds
.
first
).
to
be_kind_of
(
Build
)
}
it
{
expect
(
commit
.
builds
.
first
).
to
be_kind_of
(
Ci
::
Build
)
}
end
end
context
"skip tag if there is no build for it"
do
context
"skip tag if there is no build for it"
do
...
...
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