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
Kazuhiko Shiozaki
gitlab-ce
Commits
78568b56
Commit
78568b56
authored
Jul 28, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'update_stable-7-13' into '7-13-stable'
Update stable for 7.13.2 See merge request !1056
parents
6cb800a0
ab213276
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
116 additions
and
131 deletions
+116
-131
CHANGELOG
CHANGELOG
+11
-0
app/assets/javascripts/merge_request.js.coffee
app/assets/javascripts/merge_request.js.coffee
+9
-3
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+2
-1
app/models/ability.rb
app/models/ability.rb
+2
-1
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+10
-0
app/services/issuable_base_service.rb
app/services/issuable_base_service.rb
+4
-2
app/services/issues/base_service.rb
app/services/issues/base_service.rb
+4
-0
app/services/merge_requests/base_service.rb
app/services/merge_requests/base_service.rb
+6
-0
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+2
-0
app/views/layouts/notify.html.haml
app/views/layouts/notify.html.haml
+1
-1
app/views/projects/notes/_edit_form.html.haml
app/views/projects/notes/_edit_form.html.haml
+1
-4
app/views/projects/notes/_form.html.haml
app/views/projects/notes/_form.html.haml
+2
-12
app/views/projects/notes/_hints.html.haml
app/views/projects/notes/_hints.html.haml
+9
-0
app/views/shared/issuable/_context.html.haml
app/views/shared/issuable/_context.html.haml
+2
-2
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+1
-1
doc/integration/gitlab_actions.png
doc/integration/gitlab_actions.png
+0
-0
doc/integration/gitlab_buttons_in_gmail.md
doc/integration/gitlab_buttons_in_gmail.md
+0
-28
doc/permissions/permissions.md
doc/permissions/permissions.md
+1
-0
lib/tasks/gitlab/mail_google_schema_whitelisting.rake
lib/tasks/gitlab/mail_google_schema_whitelisting.rake
+0
-73
lib/tasks/gitlab/update_commit_count.rake
lib/tasks/gitlab/update_commit_count.rake
+20
-0
spec/helpers/projects_helper_spec.rb
spec/helpers/projects_helper_spec.rb
+19
-1
spec/services/projects/create_service_spec.rb
spec/services/projects/create_service_spec.rb
+10
-2
No files found.
CHANGELOG
View file @
78568b56
Please view this file on the master branch, on stable branches it's out of date.
v 7.13.2
- Fix randomly failed spec
- Create project services on Project creation
- Add admin_merge_request ability to Developer level and up
- Fix Error 500 when browsing projects with no HEAD (Stan Hu)
- Fix labels / assignee / milestone for the merge requests when issues are disabled
- Show the first tab automatically on MergeRequests#new
- Add rake task 'gitlab:update_commit_count' (Daniel Gerhardt)
- Fix Gmail Actions
v 7.13.1
- Fix: Label modifications are not reflected in existing notes and in the issue list
- Fix: Label not shown in the Issue list, although it's set through web interface
...
...
@@ -9,6 +19,7 @@ v 7.13.1
- Fix: ActionView::Template::Error
- Fix: "Create Merge Request" isn't always shown in event for newly pushed branch
- Fix bug causing "Remove source-branch" option not to work for merge requests from the same project.
- Render Note field hints consistently for "new" and "edit" forms
v 7.13.0
- Remove repository graph log to fix slow cache updates after push event (Stan Hu)
...
...
app/assets/javascripts/merge_request.js.coffee
View file @
78568b56
...
...
@@ -15,9 +15,7 @@ class @MergeRequest
this
.
$
(
'.show-all-commits'
).
on
'click'
,
=>
this
.
showAllCommits
()
# `MergeRequests#new` has no tab-persisting or lazy-loading behavior
unless
@
opts
.
action
==
'new'
new
MergeRequestTabs
(
@
opts
)
@
initTabs
()
# Prevent duplicate event bindings
@
disableTaskList
()
...
...
@@ -29,6 +27,14 @@ class @MergeRequest
$
:
(
selector
)
->
this
.
$el
.
find
(
selector
)
initTabs
:
->
if
@
opts
.
action
!=
'new'
# `MergeRequests#new` has no tab-persisting or lazy-loading behavior
new
MergeRequestTabs
(
@
opts
)
else
# Show the first tab (Commits)
$
(
'.merge-request-tabs a[data-toggle="tab"]:first'
).
tab
(
'show'
)
showAllCommits
:
->
this
.
$
(
'.first-commits'
).
remove
()
this
.
$
(
'.all-commits'
).
removeClass
'hide'
...
...
app/helpers/projects_helper.rb
View file @
78568b56
...
...
@@ -274,7 +274,8 @@ module ProjectsHelper
end
def
readme_cache_key
[
@project
.
id
,
@project
.
commit
.
sha
,
"readme"
].
join
(
'-'
)
sha
=
@project
.
commit
.
try
(
:sha
)
||
'nil'
[
@project
.
id
,
sha
,
"readme"
].
join
(
'-'
)
end
def
round_commit_count
(
project
)
...
...
app/models/ability.rb
View file @
78568b56
...
...
@@ -158,12 +158,13 @@ class Ability
:create_project_snippet
,
:update_issue
,
:admin_issue
,
:admin_label
,
:admin_label
]
end
def
project_dev_rules
project_report_rules
+
[
:admin_merge_request
,
:create_merge_request
,
:create_wiki
,
:push_code
...
...
app/models/concerns/issuable.rb
View file @
78568b56
...
...
@@ -159,6 +159,16 @@ module Issuable
end
end
# Convert this Issuable class name to a format usable by Ability definitions
#
# Examples:
#
# issuable.class # => MergeRequest
# issuable.to_ability_name # => "merge_request"
def
to_ability_name
self
.
class
.
to_s
.
underscore
end
private
def
filter_superceded_votes
(
votes
,
notes
)
...
...
app/services/issuable_base_service.rb
View file @
78568b56
...
...
@@ -27,8 +27,10 @@ class IssuableBaseService < BaseService
old_branch
,
new_branch
)
end
def
filter_params
unless
can?
(
current_user
,
:admin_issue
,
project
)
def
filter_params
(
issuable_ability_name
=
:issue
)
ability
=
:"admin_
#{
issuable_ability_name
}
"
unless
can?
(
current_user
,
ability
,
project
)
params
.
delete
(
:milestone_id
)
params
.
delete
(
:label_ids
)
params
.
delete
(
:assignee_id
)
...
...
app/services/issues/base_service.rb
View file @
78568b56
...
...
@@ -10,6 +10,10 @@ module Issues
private
def
filter_params
super
(
:issue
)
end
def
execute_hooks
(
issue
,
action
=
'open'
)
issue_data
=
hook_data
(
issue
,
action
)
issue
.
project
.
execute_hooks
(
issue_data
,
:issue_hooks
)
...
...
app/services/merge_requests/base_service.rb
View file @
78568b56
...
...
@@ -20,5 +20,11 @@ module MergeRequests
merge_request
.
project
.
execute_services
(
merge_data
,
:merge_request_hooks
)
end
end
private
def
filter_params
super
(
:merge_request
)
end
end
end
app/services/projects/create_service.rb
View file @
78568b56
...
...
@@ -85,6 +85,8 @@ module Projects
@project
.
create_wiki
if
@project
.
wiki_enabled?
@project
.
build_missing_services
event_service
.
create_project
(
@project
,
current_user
)
system_hook_service
.
execute_hooks_for
(
@project
,
:create
)
...
...
app/views/layouts/notify.html.haml
View file @
78568b56
...
...
@@ -33,7 +33,7 @@
=
yield
%div
.footer
{
style:
"margin-top: 10px;"
}
%p
\—
—
%br
-
if
@target_url
#{
link_to
"View it on GitLab"
,
@target_url
}
...
...
app/views/projects/notes/_edit_form.html.haml
View file @
78568b56
...
...
@@ -3,10 +3,7 @@
=
note_target_fields
(
note
)
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
'note-text'
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :note
,
classes:
'note_text js-note-text js-task-list-field'
.comment-hints.clearfix
.pull-left
#{
link_to
'Markdown '
,
help_page_path
(
'markdown'
,
'markdown'
),{
target:
'_blank'
,
tabindex:
-
1
}
}
.pull-right
#{
link_to
'Attach a file'
,
'#'
,
class:
'markdown-selector'
,
tabindex:
-
1
}
=
render
'projects/notes/hints'
.note-form-actions
.buttons
...
...
app/views/projects/notes/_form.html.haml
View file @
78568b56
...
...
@@ -8,18 +8,8 @@
=
f
.
hidden_field
:noteable_type
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"note-text"
,
referenced_users:
true
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :note
,
classes:
'note_text js-note-text'
.comment-hints.clearfix
.pull-left
=
link_to
"Markdown "
,
help_page_path
(
"markdown"
,
"markdown"
),{
target:
'_blank'
,
tabindex:
-
1
}
tip:
=
random_markdown_tip
.pull-right
=
link_to
'#'
,
class:
'markdown-selector'
,
tabindex:
-
1
do
Attach a file
=
icon
(
'paperclip'
)
=
render
'projects/zen'
,
f:
f
,
attr: :note
,
classes:
'note_text js-note-text'
=
render
'projects/notes/hints'
.error-alert
.note-form-actions
...
...
app/views/projects/notes/_hints.html.haml
0 → 100644
View file @
78568b56
.comment-hints.clearfix
.pull-left
=
link_to
'Markdown'
,
help_page_path
(
'markdown'
,
'markdown'
),
target:
'_blank'
,
tabindex:
-
1
tip:
=
random_markdown_tip
.pull-right
=
link_to
'#'
,
class:
'markdown-selector'
,
tabindex:
-
1
do
=
icon
(
'paperclip'
)
Attach a file
app/views/shared/issuable/_context.html.haml
View file @
78568b56
...
...
@@ -8,7 +8,7 @@
-
else
none
.issuable-context-selectbox
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
class
.
to_s
.
underscor
e
}
"
,
@project
)
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_nam
e
}
"
,
@project
)
=
users_select_tag
(
"
#{
issuable
.
class
.
table_name
.
singularize
}
[assignee_id]"
,
placeholder:
'Select assignee'
,
class:
'custom-form-control js-select2 js-assignee'
,
selected:
issuable
.
assignee_id
,
project:
@target_project
,
null_user:
true
)
%div
.prepend-top-20.clearfix
...
...
@@ -24,7 +24,7 @@
-
else
none
.issuable-context-selectbox
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
class
.
to_s
.
underscor
e
}
"
,
@project
)
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_nam
e
}
"
,
@project
)
=
f
.
select
(
:milestone_id
,
milestone_options
(
issuable
),
{
include_blank:
'Select milestone'
},
{
class:
'select2 select2-compact js-select2 js-milestone'
})
=
hidden_field_tag
:issuable_context
=
f
.
submit
class:
'btn hide'
...
...
app/views/shared/issuable/_form.html.haml
View file @
78568b56
...
...
@@ -38,7 +38,7 @@
.clearfix
.error-alert
%hr
-
if
can?
(
current_user
,
:
admin_issue
,
@project
)
-
if
can?
(
current_user
,
:
"admin_
#{
issuable
.
to_ability_name
}
"
,
@project
)
.form-group
.issue-assignee
=
f
.
label
:assignee_id
,
class:
'control-label'
do
...
...
doc/integration/gitlab_actions.png
deleted
100644 → 0
View file @
6cb800a0
16.9 KB
doc/integration/gitlab_buttons_in_gmail.md
deleted
100644 → 0
View file @
6cb800a0
# GitLab buttons in Gmail
GitLab supports
[
Google actions in email
](
https://developers.google.com/gmail/markup/actions/actions-overview
)
.
If correctly setup, emails that require an action will be marked in Gmail.
![
gitlab_actions
](
gitlab_actions.png
)
To get this functioning, you need to be registered with Google.
[
See how to register with Google in this document.
](
https://developers.google.com/gmail/markup/registering-with-google
)
To aid the registering with Google, GitLab offers a rake task that will send an email to Google whitelisting email address from your GitLab server.
To check what would be sent to the Google email address, run the rake task:
```
bash
bundle
exec
rake gitlab:mail_google_schema_whitelisting
RAILS_ENV
=
production
```
**This will not send the email but give you the output of how the mail will look.**
Copy the output of the rake task to
[
Google email markup tester
](
https://www.google.com/webmasters/markup-tester/u/0/
)
and press "Validate".
If you receive "No errors detected" message from the tester you can send the email using:
```
bash
bundle
exec
rake gitlab:mail_google_schema_whitelisting
RAILS_ENV
=
production
SEND
=
true
```
doc/permissions/permissions.md
View file @
78568b56
...
...
@@ -17,6 +17,7 @@ If a user is a GitLab administrator they receive all permissions.
| Create code snippets | | ✓ | ✓ | ✓ | ✓ |
| Manage issue tracker | | ✓ | ✓ | ✓ | ✓ |
| Manage labels | | ✓ | ✓ | ✓ | ✓ |
| Manage merge requests | | | ✓ | ✓ | ✓ |
| Create new merge request | | | ✓ | ✓ | ✓ |
| Create new branches | | | ✓ | ✓ | ✓ |
| Push to non-protected branches | | | ✓ | ✓ | ✓ |
...
...
lib/tasks/gitlab/mail_google_schema_whitelisting.rake
deleted
100644 → 0
View file @
6cb800a0
require
"
#{
Rails
.
root
}
/app/helpers/emails_helper"
require
'action_view/helpers'
extend
ActionView
::
Helpers
include
ActionView
::
Context
include
EmailsHelper
namespace
:gitlab
do
desc
"Email google whitelisting email with example email for actions in inbox"
task
mail_google_schema_whitelisting: :environment
do
subject
=
"Rails | Implemented feature"
url
=
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/base/rails-project/issues/
#{
rand
(
1
..
100
)
}
#note_
#{
rand
(
10
..
1000
)
}
"
schema
=
email_action
(
url
)
body
=
email_template
(
schema
,
url
)
mail
=
Notify
.
test_email
(
"schema.whitelisting+sample@gmail.com"
,
subject
,
body
.
html_safe
)
if
send_now
mail
.
deliver
else
puts
"WOULD SEND:"
end
puts
mail
end
def
email_template
(
schema
,
url
)
"<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
</style>
<body>
<div class='content'>
<div>
<p>I like it :+1: </p>
</div>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
<br>
<a href=
\"
#{
url
}
\"
>View it on GitLab</a>
You're receiving this notification because you are a member of the Base / Rails Project project team.
#{
schema
}
</p>
</div>
</body>
</html>"
end
def
send_now
if
ENV
[
'SEND'
]
==
"true"
true
else
false
end
end
end
lib/tasks/gitlab/update_commit_count.rake
0 → 100644
View file @
78568b56
namespace
:gitlab
do
desc
"GitLab | Update commit count for projects"
task
update_commit_count: :environment
do
projects
=
Project
.
where
(
commit_count:
0
)
puts
"
#{
projects
.
size
}
projects need to be updated. This might take a while."
ask_to_continue
unless
ENV
[
'force'
]
==
'yes'
projects
.
find_each
(
batch_size:
100
)
do
|
project
|
print
"
#{
project
.
name_with_namespace
.
yellow
}
... "
unless
project
.
repo_exists?
puts
"skipping, because the repo is empty"
.
magenta
next
end
project
.
update_commit_count
puts
project
.
commit_count
.
to_s
.
green
end
end
end
spec/helpers/projects_helper_spec.rb
View file @
78568b56
...
...
@@ -22,7 +22,7 @@ describe ProjectsHelper do
let
(
:user
)
{
create
(
:user
)
}
it
"returns false if there are no appro
i
priate permissions"
do
it
"returns false if there are no appropriate permissions"
do
allow
(
helper
).
to
receive
(
:can?
)
{
false
}
expect
(
helper
.
can_change_visibility_level?
(
project
,
user
)).
to
be_falsey
...
...
@@ -52,4 +52,22 @@ describe ProjectsHelper do
end
end
end
describe
"readme_cache_key"
do
let
(
:project
)
{
create
(
:project
)
}
before
do
helper
.
instance_variable_set
(
:@project
,
project
)
end
it
"returns a valid cach key"
do
expect
(
helper
.
send
(
:readme_cache_key
)).
to
eq
(
"
#{
project
.
id
}
-
#{
project
.
commit
.
id
}
-readme"
)
end
it
"returns a valid cache key if HEAD does not exist"
do
allow
(
project
).
to
receive
(
:commit
)
{
nil
}
expect
(
helper
.
send
(
:readme_cache_key
)).
to
eq
(
"
#{
project
.
id
}
-nil-readme"
)
end
end
end
spec/services/projects/create_service_spec.rb
View file @
78568b56
...
...
@@ -4,13 +4,19 @@ describe Projects::CreateService do
describe
:create_by_user
do
before
do
@user
=
create
:user
@admin
=
create
:user
,
admin:
true
@opts
=
{
name:
"GitLab"
,
namespace:
@user
.
namespace
}
end
it
'creates services on Project creation'
do
project
=
create_project
(
@user
,
@opts
)
project
.
reload
expect
(
project
.
services
).
not_to
be_empty
end
context
'user namespace'
do
before
do
@project
=
create_project
(
@user
,
@opts
)
...
...
@@ -75,7 +81,9 @@ describe Projects::CreateService do
end
it
'should allow a restricted visibility level for admins'
do
project
=
create_project
(
@admin
,
@opts
)
admin
=
create
(
:admin
)
project
=
create_project
(
admin
,
@opts
)
expect
(
project
.
errors
.
any?
).
to
be
(
false
)
expect
(
project
.
saved?
).
to
be
(
true
)
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