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
Jérome Perrin
gitlab-ce
Commits
b2dcfc4d
Commit
b2dcfc4d
authored
Feb 24, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rs-crowd-form-view-spec' into avatar-cropping
parents
b9156669
b95ef77e
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
103 additions
and
44 deletions
+103
-44
.gitlab-ci.yml
.gitlab-ci.yml
+41
-0
app/helpers/auth_helper.rb
app/helpers/auth_helper.rb
+4
-0
app/views/devise/sessions/new.html.haml
app/views/devise/sessions/new.html.haml
+2
-2
app/views/projects/issues/_discussion.html.haml
app/views/projects/issues/_discussion.html.haml
+2
-2
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+4
-4
features/login_form.feature
features/login_form.feature
+0
-11
features/steps/login_form.rb
features/steps/login_form.rb
+0
-25
scripts/notify_slack.sh
scripts/notify_slack.sh
+13
-0
spec/views/devise/shared/_signin_box.html.haml_spec.rb
spec/views/devise/shared/_signin_box.html.haml_spec.rb
+37
-0
No files found.
.gitlab-ci.yml
View file @
b2dcfc4d
...
@@ -24,7 +24,12 @@ before_script:
...
@@ -24,7 +24,12 @@ before_script:
-
bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"
-
bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"
-
RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load db:migrate
-
RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load db:migrate
stages
:
-
test
-
notifications
spec:feature:
spec:feature:
stage
:
test
script
:
script
:
-
RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
-
RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:feature
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:feature
...
@@ -33,6 +38,7 @@ spec:feature:
...
@@ -33,6 +38,7 @@ spec:feature:
-
mysql
-
mysql
spec:api:
spec:api:
stage
:
test
script
:
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:api
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:api
tags
:
tags
:
...
@@ -40,6 +46,7 @@ spec:api:
...
@@ -40,6 +46,7 @@ spec:api:
-
mysql
-
mysql
spec:models:
spec:models:
stage
:
test
script
:
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models
tags
:
tags
:
...
@@ -47,6 +54,7 @@ spec:models:
...
@@ -47,6 +54,7 @@ spec:models:
-
mysql
-
mysql
spec:lib:
spec:lib:
stage
:
test
script
:
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:lib
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:lib
tags
:
tags
:
...
@@ -54,6 +62,7 @@ spec:lib:
...
@@ -54,6 +62,7 @@ spec:lib:
-
mysql
-
mysql
spec:services:
spec:services:
stage
:
test
script
:
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:services
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:services
tags
:
tags
:
...
@@ -61,6 +70,7 @@ spec:services:
...
@@ -61,6 +70,7 @@ spec:services:
-
mysql
-
mysql
spec:benchmark:
spec:benchmark:
stage
:
test
script
:
script
:
-
RAILS_ENV=test bundle exec rake spec:benchmark
-
RAILS_ENV=test bundle exec rake spec:benchmark
tags
:
tags
:
...
@@ -69,6 +79,7 @@ spec:benchmark:
...
@@ -69,6 +79,7 @@ spec:benchmark:
allow_failure
:
true
allow_failure
:
true
spec:other:
spec:other:
stage
:
test
script
:
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:other
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:other
tags
:
tags
:
...
@@ -76,6 +87,7 @@ spec:other:
...
@@ -76,6 +87,7 @@ spec:other:
-
mysql
-
mysql
spinach:project:half:
spinach:project:half:
stage
:
test
script
:
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half
tags
:
tags
:
...
@@ -83,6 +95,7 @@ spinach:project:half:
...
@@ -83,6 +95,7 @@ spinach:project:half:
-
mysql
-
mysql
spinach:project:rest:
spinach:project:rest:
stage
:
test
script
:
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest
tags
:
tags
:
...
@@ -90,6 +103,7 @@ spinach:project:rest:
...
@@ -90,6 +103,7 @@ spinach:project:rest:
-
mysql
-
mysql
spinach:other:
spinach:other:
stage
:
test
script
:
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other
tags
:
tags
:
...
@@ -97,6 +111,7 @@ spinach:other:
...
@@ -97,6 +111,7 @@ spinach:other:
-
mysql
-
mysql
teaspoon
:
teaspoon
:
stage
:
test
script
:
script
:
-
RAILS_ENV=test bundle exec teaspoon
-
RAILS_ENV=test bundle exec teaspoon
tags
:
tags
:
...
@@ -104,6 +119,7 @@ teaspoon:
...
@@ -104,6 +119,7 @@ teaspoon:
-
mysql
-
mysql
rubocop
:
rubocop
:
stage
:
test
script
:
script
:
-
bundle exec rubocop
-
bundle exec rubocop
tags
:
tags
:
...
@@ -111,6 +127,7 @@ rubocop:
...
@@ -111,6 +127,7 @@ rubocop:
-
mysql
-
mysql
brakeman
:
brakeman
:
stage
:
test
script
:
script
:
-
bundle exec rake brakeman
-
bundle exec rake brakeman
tags
:
tags
:
...
@@ -118,6 +135,7 @@ brakeman:
...
@@ -118,6 +135,7 @@ brakeman:
-
mysql
-
mysql
flog
:
flog
:
stage
:
test
script
:
script
:
-
bundle exec rake flog
-
bundle exec rake flog
tags
:
tags
:
...
@@ -125,6 +143,7 @@ flog:
...
@@ -125,6 +143,7 @@ flog:
-
mysql
-
mysql
flay
:
flay
:
stage
:
test
script
:
script
:
-
bundle exec rake flay
-
bundle exec rake flay
tags
:
tags
:
...
@@ -132,6 +151,7 @@ flay:
...
@@ -132,6 +151,7 @@ flay:
-
mysql
-
mysql
bundler:audit:
bundler:audit:
stage
:
test
script
:
script
:
-
"
bundle
exec
bundle-audit
update"
-
"
bundle
exec
bundle-audit
update"
-
"
bundle
exec
bundle-audit
check"
-
"
bundle
exec
bundle-audit
check"
...
@@ -143,6 +163,7 @@ bundler:audit:
...
@@ -143,6 +163,7 @@ bundler:audit:
# Ruby 2.2 jobs
# Ruby 2.2 jobs
spec:feature:ruby22:
spec:feature:ruby22:
stage
:
test
image
:
ruby:2.2
image
:
ruby:2.2
only
:
only
:
-
master
-
master
...
@@ -158,6 +179,7 @@ spec:feature:ruby22:
...
@@ -158,6 +179,7 @@ spec:feature:ruby22:
-
mysql
-
mysql
spec:api:ruby22:
spec:api:ruby22:
stage
:
test
image
:
ruby:2.2
image
:
ruby:2.2
only
:
only
:
-
master
-
master
...
@@ -172,6 +194,7 @@ spec:api:ruby22:
...
@@ -172,6 +194,7 @@ spec:api:ruby22:
-
mysql
-
mysql
spec:models:ruby22:
spec:models:ruby22:
stage
:
test
image
:
ruby:2.2
image
:
ruby:2.2
only
:
only
:
-
master
-
master
...
@@ -186,6 +209,7 @@ spec:models:ruby22:
...
@@ -186,6 +209,7 @@ spec:models:ruby22:
-
mysql
-
mysql
spec:lib:ruby22:
spec:lib:ruby22:
stage
:
test
image
:
ruby:2.2
image
:
ruby:2.2
only
:
only
:
-
master
-
master
...
@@ -200,6 +224,7 @@ spec:lib:ruby22:
...
@@ -200,6 +224,7 @@ spec:lib:ruby22:
-
mysql
-
mysql
spec:services:ruby22:
spec:services:ruby22:
stage
:
test
image
:
ruby:2.2
image
:
ruby:2.2
only
:
only
:
-
master
-
master
...
@@ -214,6 +239,7 @@ spec:services:ruby22:
...
@@ -214,6 +239,7 @@ spec:services:ruby22:
-
mysql
-
mysql
spec:benchmark:ruby22:
spec:benchmark:ruby22:
stage
:
test
image
:
ruby:2.2
image
:
ruby:2.2
only
:
only
:
-
master
-
master
...
@@ -229,6 +255,7 @@ spec:benchmark:ruby22:
...
@@ -229,6 +255,7 @@ spec:benchmark:ruby22:
allow_failure
:
true
allow_failure
:
true
spec:other:ruby22:
spec:other:ruby22:
stage
:
test
image
:
ruby:2.2
image
:
ruby:2.2
only
:
only
:
-
master
-
master
...
@@ -243,6 +270,7 @@ spec:other:ruby22:
...
@@ -243,6 +270,7 @@ spec:other:ruby22:
-
mysql
-
mysql
spinach:project:half:ruby22:
spinach:project:half:ruby22:
stage
:
test
image
:
ruby:2.2
image
:
ruby:2.2
only
:
only
:
-
master
-
master
...
@@ -257,6 +285,7 @@ spinach:project:half:ruby22:
...
@@ -257,6 +285,7 @@ spinach:project:half:ruby22:
-
mysql
-
mysql
spinach:project:rest:ruby22:
spinach:project:rest:ruby22:
stage
:
test
image
:
ruby:2.2
image
:
ruby:2.2
only
:
only
:
-
master
-
master
...
@@ -271,6 +300,7 @@ spinach:project:rest:ruby22:
...
@@ -271,6 +300,7 @@ spinach:project:rest:ruby22:
-
mysql
-
mysql
spinach:other:ruby22:
spinach:other:ruby22:
stage
:
test
image
:
ruby:2.2
image
:
ruby:2.2
only
:
only
:
-
master
-
master
...
@@ -284,3 +314,14 @@ spinach:other:ruby22:
...
@@ -284,3 +314,14 @@ spinach:other:ruby22:
-
ruby
-
ruby
-
mysql
-
mysql
notify:slack:
stage
:
notifications
script
:
-
./scripts/notify_slack.sh "#builds" "Build failed for master/tags!"
when
:
on_failure
only
:
-
master@gitlab-org/gitlab-ce
-
tags@gitlab-org/gitlab-ce
-
master@gitlab-org/gitlab-ee
-
tags@gitlab-org/gitlab-ee
\ No newline at end of file
app/helpers/auth_helper.rb
View file @
b2dcfc4d
...
@@ -6,6 +6,10 @@ module AuthHelper
...
@@ -6,6 +6,10 @@ module AuthHelper
Gitlab
.
config
.
ldap
.
enabled
Gitlab
.
config
.
ldap
.
enabled
end
end
def
omniauth_enabled?
Gitlab
.
config
.
omniauth
.
enabled
end
def
provider_has_icon?
(
name
)
def
provider_has_icon?
(
name
)
PROVIDERS_WITH_ICONS
.
include?
(
name
.
to_s
)
PROVIDERS_WITH_ICONS
.
include?
(
name
.
to_s
)
end
end
...
...
app/views/devise/sessions/new.html.haml
View file @
b2dcfc4d
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
=
render
'devise/shared/signin_box'
=
render
'devise/shared/signin_box'
-# Omniauth fits between signin/ldap signin and signup and does not have a surrounding box
-# Omniauth fits between signin/ldap signin and signup and does not have a surrounding box
-
if
Gitlab
.
config
.
omniauth
.
enabled
&&
devise_mapping
.
omniauthable?
-
if
omniauth_enabled?
&&
devise_mapping
.
omniauthable?
.clearfix.prepend-top-20
.clearfix.prepend-top-20
=
render
'devise/shared/omniauth_box'
=
render
'devise/shared/omniauth_box'
...
@@ -14,6 +14,6 @@
...
@@ -14,6 +14,6 @@
=
render
'devise/shared/signup_box'
=
render
'devise/shared/signup_box'
-# Show a message if none of the mechanisms above are enabled
-# Show a message if none of the mechanisms above are enabled
-
if
!
signin_enabled?
&&
!
ldap_enabled?
&&
!
(
Gitlab
.
config
.
omniauth
.
enabled
&&
devise_mapping
.
omniauthable?
)
-
if
!
signin_enabled?
&&
!
ldap_enabled?
&&
!
(
omniauth_enabled?
&&
devise_mapping
.
omniauthable?
)
%div
%div
No authentication methods configured.
No authentication methods configured.
app/views/projects/issues/_discussion.html.haml
View file @
b2dcfc4d
-
content_for
:note_actions
do
-
content_for
:note_actions
do
-
if
can?
(
current_user
,
:update_issue
,
@issue
)
-
if
can?
(
current_user
,
:update_issue
,
@issue
)
=
link_to
'Reopen
Issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
,
format:
'json'
),
data:
{
no_turbolink:
true
},
class:
"btn btn-nr btn-grouped btn-reopen btn-comment js-note-target-reopen
#{
issue_button_visibility
(
@issue
,
false
)
}
"
,
title:
'Reopen I
ssue'
=
link_to
'Reopen
issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
,
format:
'json'
),
data:
{
no_turbolink:
true
},
class:
"btn btn-nr btn-grouped btn-reopen btn-comment js-note-target-reopen
#{
issue_button_visibility
(
@issue
,
false
)
}
"
,
title:
'Reopen i
ssue'
=
link_to
'Close
Issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :close
},
status_only:
true
,
format:
'json'
),
data:
{
no_turbolink:
true
},
class:
"btn btn-nr btn-grouped btn-close btn-comment js-note-target-close
#{
issue_button_visibility
(
@issue
,
true
)
}
"
,
title:
'Close I
ssue'
=
link_to
'Close
issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :close
},
status_only:
true
,
format:
'json'
),
data:
{
no_turbolink:
true
},
class:
"btn btn-nr btn-grouped btn-close btn-comment js-note-target-close
#{
issue_button_visibility
(
@issue
,
true
)
}
"
,
title:
'Close i
ssue'
#notes
#notes
=
render
'projects/notes/notes_with_form'
=
render
'projects/notes/notes_with_form'
app/views/projects/issues/show.html.haml
View file @
b2dcfc4d
...
@@ -8,12 +8,12 @@
...
@@ -8,12 +8,12 @@
.detail-page-header
.detail-page-header
.pull-right
.pull-right
-
if
can?
(
current_user
,
:create_issue
,
@project
)
-
if
can?
(
current_user
,
:create_issue
,
@project
)
=
link_to
new_namespace_project_issue_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-nr btn-grouped new-issue-link btn-success'
,
title:
'New
I
ssue'
,
id:
'new_issue_link'
do
=
link_to
new_namespace_project_issue_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-nr btn-grouped new-issue-link btn-success'
,
title:
'New
i
ssue'
,
id:
'new_issue_link'
do
=
icon
(
'plus'
)
=
icon
(
'plus'
)
New
I
ssue
New
i
ssue
-
if
can?
(
current_user
,
:update_issue
,
@issue
)
-
if
can?
(
current_user
,
:update_issue
,
@issue
)
=
link_to
'Reopen
'
,
issue_path
(
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
,
format:
'json'
),
data:
{
no_turbolink:
true
},
class:
"btn btn-nr btn-grouped btn-reopen
#{
issue_button_visibility
(
@issue
,
false
)
}
"
,
title:
'Reopen I
ssue'
=
link_to
'Reopen
issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
,
format:
'json'
),
data:
{
no_turbolink:
true
},
class:
"btn btn-nr btn-grouped btn-reopen
#{
issue_button_visibility
(
@issue
,
false
)
}
"
,
title:
'Reopen i
ssue'
=
link_to
'Close
'
,
issue_path
(
@issue
,
issue:
{
state_event: :close
},
status_only:
true
,
format:
'json'
),
data:
{
no_turbolink:
true
},
class:
"btn btn-nr btn-grouped btn-close
#{
issue_button_visibility
(
@issue
,
true
)
}
"
,
title:
'Close I
ssue'
=
link_to
'Close
issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :close
},
status_only:
true
,
format:
'json'
),
data:
{
no_turbolink:
true
},
class:
"btn btn-nr btn-grouped btn-close
#{
issue_button_visibility
(
@issue
,
true
)
}
"
,
title:
'Close i
ssue'
=
link_to
edit_namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
),
class:
'btn btn-nr btn-grouped issuable-edit'
do
=
link_to
edit_namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
),
class:
'btn btn-nr btn-grouped issuable-edit'
do
=
icon
(
'pencil-square-o'
)
=
icon
(
'pencil-square-o'
)
...
...
features/login_form.feature
deleted
100644 → 0
View file @
b9156669
Feature
:
Login form
Scenario
:
I
see Crowd form
Given
Crowd integration enabled
When
I visit sign in page
Then
I should see Crowd login form
Scenario
:
I
see Crowd form when sign-in is disabled
Given
Crowd integration enabled
And
Sign-in is disabled
When
I visit sign in page
Then
I should see Crowd login form
features/steps/login_form.rb
deleted
100644 → 0
View file @
b9156669
class
Spinach::Features::LoginForm
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedSnippet
include
SharedUser
include
SharedSearch
step
'Sign-in is disabled'
do
allow_any_instance_of
(
ApplicationHelper
).
to
receive
(
:signin_enabled?
).
and_return
(
false
)
end
step
'Crowd integration enabled'
do
expect
(
Gitlab
::
OAuth
::
Provider
).
to
receive
(
:providers
).
and_return
([
:crowd
])
expect
(
Gitlab
.
config
.
omniauth
).
to
receive
(
:enabled
).
and_return
(
true
)
allow_any_instance_of
(
ApplicationHelper
).
to
receive
(
:user_omniauth_authorize_path
).
and_return
(
root_path
)
end
step
'I should see Crowd login form'
do
expect
(
page
).
to
have_selector
'#tab-crowd form'
end
step
'I visit sign in page'
do
visit
new_user_session_path
end
end
scripts/notify_slack.sh
0 → 100755
View file @
b2dcfc4d
#!/bin/bash
# Sends Slack notification ERROR_MSG to CHANNEL
# An env. variable CI_SLACK_WEBHOOK_URL needs to be set.
CHANNEL
=
$1
ERROR_MSG
=
$2
if
[
-z
"
$CHANNEL
"
]
||
[
-z
"
$ERROR_MSG
"
]
||
[
-z
"
$CI_SLACK_WEBHOOK_URL
"
]
;
then
echo
"Missing argument(s) - Use:
$0
channel message"
echo
"and set CI_SLACK_WEBHOOK_URL environment variable."
else
curl
-X
POST
--data-urlencode
'payload={"channel": "'
"
$CHANNEL
"
'", "username": "gitlab-ci", "text": "'
"
$ERROR_MSG
"
'", "icon_emoji": ":gitlab:"}'
"
$CI_SLACK_WEBHOOK_URL
"
fi
\ No newline at end of file
spec/views/devise/shared/_signin_box.html.haml_spec.rb
0 → 100644
View file @
b2dcfc4d
require
'rails_helper'
describe
'devise/shared/_signin_box'
do
describe
'Crowd form'
do
before
do
stub_devise
assign
(
:ldap_servers
,
[])
end
it
'is shown when Crowd is enabled'
do
enable_crowd
render
expect
(
rendered
).
to
have_selector
(
'#tab-crowd form'
)
end
it
'is not shown when Crowd is disabled'
do
render
expect
(
rendered
).
not_to
have_selector
(
'#tab-crowd'
)
end
end
def
stub_devise
allow
(
view
).
to
receive
(
:devise_mapping
).
and_return
(
Devise
.
mappings
[
:user
])
allow
(
view
).
to
receive
(
:resource
).
and_return
(
spy
)
allow
(
view
).
to
receive
(
:resource_name
).
and_return
(
:user
)
end
def
enable_crowd
allow
(
view
).
to
receive
(
:form_based_providers
).
and_return
([
:crowd
])
allow
(
view
).
to
receive
(
:crowd_enabled?
).
and_return
(
true
)
allow
(
view
).
to
receive
(
:user_omniauth_authorize_path
).
with
(
'crowd'
).
and_return
(
'/crowd'
)
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