Commit Graph
237 Commits
Author SHA1 Message Date
Paco Guzman 52a2b8a410 Include user relationship when retrieving award_emoji
Avoiding N+1 when showing grouped awards and when 
calculating participants for awardable entities
2016-06-15 06:50:12 +02:00
Rémy Coutable 515205d3c1 UI and copywriting improvements
+ Move 'Edit Project/Group' out of membership-related partial
+ Show the access request buttons only to logged-in users
+ Put the request access buttons out of in a more visible button
+ Improve the copy in the #remove_member_message helper

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:18:14 +02:00
Rémy Coutable d26f81239a Add request access for groups
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00
Alejandro Rodríguez fade1a4cde Fix pseudo n+1 queries with Note and Note Authors in issuables APIs
This was not a clear cut n+1 query, given that if you're directly subscribed to all issues
that the API is returning you never really need to check for the notes. However, if you're
subscribed to _all_ of them, then for each issuable you need to go once to `notes`, and
once to `users` (for the authors). By preemtively loading notes and authors, at worst you have
1 extra query, and at best you saved 2n extra queries. We also took advantage of this preloading
of notes when counting user notes.
2016-06-08 10:26:05 -04:00
Alejandro Rodríguez ad83c30855 Remove projects inclusion in notes_with_associations to skip some unnecessary queries
`notes_with_associations` are used for `participant` declarations, but `Participable`
only really cares about the target entity project, and not the participants
projects.

`notes_with_associations` are also used in `Commit::has_been_reverted?` which
employs the reference extractor of the commit, so no references to the notes
projects are made there (`Mentionable::all_references` cares only about the
`author` and other `attr_mentionable`). A paralel situation occurs on
`Issue::referenced_merge_requests`.
2016-06-08 10:26:05 -04:00
Rémy CoutableandAlfredo Sumaran 499bb9f305 Improve Issuable.order_labels_priority
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-06 11:59:49 -05:00
Thijs WoutersandAlfredo Sumaran d8263b2851 Sort by label priority
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-06 11:59:49 -05:00
Z.J. van de Weg 9d491712cf Merge branch 'master' into awardables 2016-06-03 15:20:11 +02:00
Robert Speicher 6eda07b717 Merge branch '13312-remove-issuable-is_assigned' into 'master'
Remove unused Issuable#is_assigned? method

Fixes #13312.

See merge request !4440
2016-06-03 11:45:05 +00:00
Paco Guzman 078ba8c090 issuable#labels_array explicitly load the labels
This will be useful when you want to ask for the 
number of items and later iterate over them, without 
needing to ask if the association is load or not.

So you avoid extra database queries
2016-06-02 21:43:01 +02:00
Rémy Coutable 905e8b6b54 Remove unused Issuable#is_assigned? method
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-02 18:14:33 +02:00
Josh Frye 0f3df62e1a Update specs. Add CHANGELOG entry 2016-06-02 09:25:40 -04:00
Josh Frye 8835b7889a Flush cache in callback. Add tests 2016-06-02 09:13:59 -04:00
Douwe Maan 2d084dd848 Merge branch 'separate-banzai-references' into 'master'
Separate reference gathering from rendering

This is a required step to allow batch processing when gathering references. This in turn would allow grabbing (for example) all mentioned users of an issue/merge request using a single query.

cc @rspeicher @DouweM 

See merge request !3969
2016-06-01 15:51:59 +00:00
Yorick Peterse 580d250166 Refactor Participable
There are several changes to this module:

1. The use of an explicit stack in Participable#participants
2. Proc behaviour has been changed
3. Batch permissions checking

== Explicit Stack

Participable#participants no longer uses recursion to process "self" and
all child objects, instead it uses an Array and processes objects in
breadth-first order. This allows us to for example create a single
Gitlab::ReferenceExtractor instance and pass this to any Procs. Re-using
a ReferenceExtractor removes the need for running potentially many SQL
queries every time a Proc is called on a new object.

== Proc Behaviour Changed

Previously a Proc in Participable was expected to return an Array of
User instances. This has been changed and instead it's now expected that
a Proc modifies the Gitlab::ReferenceExtractor passed to it. The return
value of the Proc is ignored.

== Permissions Checking

The method Participable#participants uses
Ability.users_that_can_read_project to check if the returned users have
access to the project of "self" _without_ running multiple SQL queries
for every user.
2016-06-01 16:22:35 +02:00
Z.J. van de Weg 91a7b9333b Incorportate feedback 2016-06-01 12:10:08 +02:00
Felipe Artur 56f3b243ce Add leading comment space cop 2016-05-31 19:33:46 -03:00
Felipe Artur 30e61ed79c Fix error 500 when sorting issues by milestone due date and filtering by labels 2016-05-31 10:35:57 -03:00
ZJ van de Weg cbd7801b3d Merge branch 'master' into awardables 2016-05-30 18:54:08 +02:00
Yorick Peterse 35e977d69b Refactor Mentionable
Caching is now always enabled when rendering attributes as there's no
reason to not cache them. The method Mentionable#all_references has also
been modified to take an optional Gitlab::ReferenceExtractor instance to
allow other code to create one and re-use it between multiple calls.
2016-05-26 17:14:07 +02:00
Felipe Artur dac9b4212d Fix outer join when filtering milestones 2016-05-24 16:51:43 -04:00
Felipe Artur 45e516b817 Fix bug when ordering by milestone due date and filtering by milestone 2016-05-24 16:49:15 -04:00
Felipe Artur 3b2223f116 improve ordering sql for milestones 2016-05-24 16:49:15 -04:00
Felipe Artur 673196e0a8 Fix ordering for Mysql 2016-05-24 16:49:15 -04:00
Felipe Artur 996240a489 Fix issues/MRs filter when ordering by milestone due date 2016-05-24 16:49:15 -04:00
Fatih Acet bb883387f9 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into awardables
# Conflicts:
#	app/controllers/projects/merge_requests_controller.rb
#	app/models/note.rb
#	db/schema.rb
#	spec/models/note_spec.rb
2016-05-18 13:05:53 -05:00
Ahmad Sherif 0c22698bd4 Add API endpoints for un/subscribing from/to a label
Closes #15638
2016-05-12 22:48:09 +02:00
Zeger-Jan van de Weg 7a4e7ad04e Fix tests and wrong choices during merge 2016-05-12 09:23:21 +02:00
Zeger-Jan van de Weg 4558b5b9fe Incorporate feedback 2016-05-11 22:43:58 +02:00
Zeger-Jan van de Weg 7e6dcf9cd0 Merge branch 'master' into awardables 2016-05-11 08:47:04 +02:00
Rémy Coutable a278b36ab0 Fix an issue when filtering merge requests with more than one label
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-05-10 19:07:46 +02:00
Douwe Maan 93b4a3a156 Merge branch 'fix/todos-for-private-group-mentions' into 'master'
Fix adding a todo for private group memebers



See merge request !4081
2016-05-09 18:31:41 +00:00
cnam-depandRémy Coutable 5364400741 API: Expose Issue#user_notes_count 2016-05-09 16:07:35 +02:00
Ahmad Sherif ab4671f26a Fix adding a todo for private group members
Fixes #14002
2016-05-07 01:37:29 +02:00
Takuya Noguchi 4ab49fab94 Use outer join for issues ordering by milestones due. 2016-05-06 19:57:26 +09:00
Zeger-Jan van de Weg 3bdc57f0a7 Create table for award emoji 2016-05-06 10:47:11 +02:00
Arinde Eniola ded3b02f33 Use a better message when milestone is newly created
make some changes for the checks to determine when the messages should be displayed

add item to changelog and also integration test

make some changes to the test

make some changes
2016-04-29 10:15:49 +01:00
Grzegorz Bizon bdb86ea6cf Render canceled status if any of the jobs canceled
This status will be returned only when there are no failed jobs
that are not allowed to fail.
2016-04-27 14:16:01 +02:00
Douwe Maan 7ded28ff99 Merge branch 'fix/label-filters' into 'master'
Filter labels by including ALL filter titles

Fixed query to use `AND` and not `OR`. Refactored relevant specs

See merge request !3815
2016-04-21 13:13:10 +00:00
James Lopez af18cddddf udpated a few things based on MR feedback. Also added model spec 2016-04-20 10:56:28 +02:00
Kamil Trzcinski 27e0c7723c Merge remote-tracking branch 'origin/master' into ci-commit-as-pipeline
# Conflicts:
#	db/schema.rb
2016-04-19 14:00:14 -04:00
James Lopez 6fdde5fabd filter labels by including all filter titles as part of the query 2016-04-19 12:56:58 +02:00
Douglas Barbosa Alexandre d13bba44f0 Use GitHub Issue/PR number as iid to keep references
With these changes we don’t lost the issue/pr references when importing
them to GitLab.
2016-04-18 12:15:50 -03:00
Kamil Trzcinski 433ca7390d Make some logic less twistable 2016-04-17 09:32:49 -04:00
Kamil Trzcinski 1c5b172abb Write specs for this feature 2016-04-16 22:43:40 +02:00
Kamil Trzcinski 0b1655e7b2 Rename CiStatus to Statusable 2016-04-16 21:46:26 +02:00
Kamil Trzcinski 2a7f7f7528 Update handling of skipped status 2016-04-13 20:51:11 +02:00
Kamil Trzcinski 3d38e46191 Support skipped status 2016-04-13 17:26:22 +02:00
Kamil Trzcinski 4af0968c43 Merge remote-tracking branch 'origin/master' into ci-commit-as-pipeline 2016-04-13 15:47:18 +02:00
Kamil Trzcinski 102537072b Fix CiStatus implementation and tests 2016-04-13 15:40:12 +02:00