Fix random failing test
Make sure we wait till page reloads after request was merged. Otherwise
we get request running which fails next test
Improvement for !1897
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
See merge request !2004
Fix#3758: Serious performance issues due to timeago()
being called n*(n+1)/2 times instead of n
See bug #3758 for a description. This merge request alters
`time_ago_with_tooltip` to invoke the `timeago()` javascript on the
current timestamp only, instead of each one defined on the page so far.
See merge request !1977
Dont use cached collection for Repository find_branch and find_tag methods
Fix for #3816
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
See merge request !2003
Make sure we wait till page reloads after request was merged. Otherwise
we get request running which fails next test
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Filter current user to top of assignee list in issues/merge requests
### What does this MR do?
Fixes#2076
Filter the current user to the top of the assignee list in issues and merge requests. This makes it fast/easy for a user to assign themselves without compromising the UI. This is the same thing we do in the filter select boxes in other places.
### Are there points in the code the reviewer needs to double check?
No.
### Why was this MR needed?
Users requested the feature in #2076
See merge request !1493
Fix API setting of 'public' attribute to false will make a project private
There is a bug in the projects API where setting `public` to `false` of would not change `visibility_level` even if `visiblity_level` were not present.
Closes#3864
See merge request !1996
Update Docker Syntax
I think this documentation is using an out-of-date docker client. I guess that `-n` means `--name` (there is no `-n` in up-to-date docker) and `-l` means `--link` (`-l` is short for `--label` now).
See merge request !2001
Fix problems with award-emoji-only comment
This fixes a conflict between note with only a single emoji in content
and award-emojis mechanisms.
Closes#3734
cc @vsizov
See merge request !1936
Fix Error 500 when creating global milestones with Unicode characters
Two issues:
1. The constraints in the resources were incorrect. Here's what it was before:
```
group_milestone GET /groups/:group_id/milestones/:id(.:format) groups/milestones#show {:id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/, :group_id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/}
```
In this case, id is actually the title of the milestone, which can be anything at the moment.
After:
```
group_milestone GET /groups/:group_id/milestones/:id(.:format) groups/milestones#show {:id=>/[^\/]+/, :group_id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/}
```
2. `parameterize` would strip all Unicode characters, leaving a blank string. Rails would report something like:
```
ActionView::Template::Error (No route matches {:action=>"show", :controller=>"groups/milestones", :group_id=>#<Group id: 48, name: "ops-dev", path: "ops-dev", owner_id: nil, created_at: "2015-11-15 08:55:30", updated_at: "2015-12-02 06:23:26", type: "Group", description: "", avatar: "sha1.c71e73d51af1865c1bbbf6208e10044d46c9bb93.png", public: false>, :id=>"", :title=>"肯定不是中文的问题"} missing required keys: [:id]):
```
This change uses the babosa library to create a better slug, which surprisingly
isn't actually used by the global milestone controllers. Instead, they use the
title passed as a query string for some reason.
Closes https://github.com/gitlabhq/gitlabhq/issues/9881
See merge request !1983
Style warning about mentioning many people in a comment
Fixes#2885
* Create issue:
Before:

After:

* New merge request:
Before:

After:

* New comment in a merge request:
Before:

After:

* New diff comment:
Before:

After:

See merge request !1971
Fixed duplicated issue note email notifications.
Fixes#2560
See issue for the details.
Without `uniq` modified tests were failing with:
```
Failure/Error: notification.new_note(note)
(Notify (class)).note_issue_email(21, 1)
expected: 1 time with arguments: (21, 1)
received: 2 times with arguments: (21, 1)
# /home/bak1an/.rvm/gems/ruby-2.1.6@gitlab/gems/sidekiq-3.3.0/lib/sidekiq/extensions/action_mailer.rb:17:in `public_send'
# /home/bak1an/.rvm/gems/ruby-2.1.6@gitlab/gems/sidekiq-3.3.0/lib/sidekiq/extensions/action_mailer.rb:17:in `perform'
# /home/bak1an/.rvm/gems/ruby-2.1.6@gitlab/gems/sidekiq-3.3.0/lib/sidekiq/testing.rb:74:in `block in raw_push'
# /home/bak1an/.rvm/gems/ruby-2.1.6@gitlab/gems/sidekiq-3.3.0/lib/sidekiq/testing.rb:69:in `each'
# /home/bak1an/.rvm/gems/ruby-2.1.6@gitlab/gems/sidekiq-3.3.0/lib/sidekiq/testing.rb:69:in `raw_push'
# /home/bak1an/.rvm/gems/ruby-2.1.6@gitlab/gems/sidekiq-3.3.0/lib/sidekiq/client.rb:68:in `push'
# /home/bak1an/.rvm/gems/ruby-2.1.6@gitlab/gems/sidekiq-3.3.0/lib/sidekiq/worker.rb:85:in `client_push'
# /home/bak1an/.rvm/gems/ruby-2.1.6@gitlab/gems/sidekiq-3.3.0/lib/sidekiq/extensions/generic_proxy.rb:19:in `method_missing'
# ./app/services/notification_service.rb:144:in `block in new_note'
# ./app/services/notification_service.rb:143:in `each'
# ./app/services/notification_service.rb:143:in `new_note'
# ./spec/services/notification_service_spec.rb:63:in `block (5 levels) in <top (required)>'
```
I have also added `once` to all `should_email` checks within `notification_service_spec.rb` since it's probably the correct behavior to notify users only once on the same event. Nothing else failed out of the box but we can keep these assertions for future.
See merge request !1925
Two issues:
1. The constraints in the resources were incorrect. Here's what it was before:
```
group_milestone GET /groups/:group_id/milestones/:id(.:format) groups/milestones#show {:id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/, :group_id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/}
```
In this case, id is actually the title of the milestone, which can be anything at the moment.
After:
```
group_milestone GET /groups/:group_id/milestones/:id(.:format) groups/milestones#show {:id=>/[^\/]+/, :group_id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/}
```
2. `parameterize` would strip all Unicode characters, leaving a blank string. Rails would report something like:
ActionView::Template::Error (No route matches {:action=>"show", :controller=>"groups/milestones", :group_id=>#<Group id: 48, name: "ops-dev", path: "ops-dev", owner_id: nil, created_at: "2015-11-15 08:55:30", updated_at: "2015-12-02 06:23:26", type: "Group", description: "", avatar: "sha1.c71e73d51af1865c1bbbf6208e10044d46c9bb93.png", public: false>, :id=>"", :title=>"肯定不是中文的问题"} missing required keys: [:id]):
This change uses the babosa library to create a better slug, which surprisingly
isn't actually used by the global milestone controllers. Instead, they use the
title passed as a query string for some reason.
Closes https://github.com/gitlabhq/gitlabhq/issues/9881
Fix constraints
Ensure "Remove Source Branch" button is not shown when branch is being deleted.
Given the merging of the Merge Request happens in the background, sometimes when the client JS code reloads the page the source branch is not still gone.
This fix appends a new query string parameter that is checked in the view before rendering the `Remove Source Branch` button.
Closes#3583
See merge request !1897
Fix application settings cache not expiring after changes
cache_key is an instance method that relies on updated_at. When changes
were made, the time-dependent key was being used instead of X.application_setting.last.
Closes#3609
See merge request !1972