Commit graph

16 commits

Author SHA1 Message Date
GitLab Bot
1bab0ba591 Add latest changes from gitlab-org/gitlab@master 2019-10-01 09:10:39 +00:00
GitLab Bot
7bb7a8d529 Add latest changes from gitlab-org/gitlab@master 2019-09-25 03:06:21 +00:00
GitLab Bot
bd860c22f6 Add latest changes from gitlab-org/gitlab@master 2019-09-17 12:06:48 +00:00
Stan Hu
440635015f Fix N+1 Gitaly calls in /api/v4/projects/:id/issues
This is a follow-up from
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31938.

In GitLab 9.0,
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9661 removed the
`subscribed` flag from the API when the user requested a list of issues
or merge requests since calculating this value triggers extensive
Markdown processing.

In GitLab 12.0 via a4fbf39e, we accidentally reintroduced this
performance regression by changing `IssueBasic` to `Issue` in
`entities.rb`. This showed up as a Gitaly N+1 issue since the Markdown
processing would attempt to extract a commit if it detected a regex that
matched a commit.

We restore the prior behavior by once again removing the `subscribed`
flag for the bulk list of issues and merge requests and add a test to
ensure they aren't reintroduced.

Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/66202
2019-08-23 21:26:50 -07:00
Alexandru Croitor
f5b855546e Update sort options for issues list
Increase sort options for issues list from updated_at and create_at,
to include more options close to what is required in actual issue list
UI.

This helps us to use REST API for issues list with sorting capabilities

https://gitlab.com/gitlab-org/gitlab-ce/issues/57402
2019-08-23 11:32:15 +03:00
Stan Hu
ba7c501fef Fix Gitaly N+1 calls with listing issues/MRs via API
In GitLab 9.0,
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9661 removed the
`subscribed` flag from the API when the user requested a list of issues
or merge requests since calculating this value triggers extensive
Markdown processing.

In GitLab 12.0 via a4fbf39e, we accidentally reintroduced this
performance regression by changing `IssueBasic` to `Issue` in
`entities.rb`. This showed up as a Gitaly N+1 issue since the Markdown
processing would attempt to extract a commit if it detected a regex that
matched a commit.

We restore the prior behavior by once again removing the `subscribed`
flag for the bulk list of issues and merge requests and add a test to
ensure they aren't reintroduced.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66202
2019-08-17 20:35:37 -07:00
Winnie Hellmann
915bc89396 Revert "Merge branch '4221-board-milestone-should-persist-any-none-properly-ce' into 'master'"
This reverts merge request !30613
2019-08-09 09:59:38 +00:00
charlie ablett
5d7b46d523 Port CE changes from EE
- DB migration of board milestone values
- issue finder & spec updates
2019-07-31 13:51:46 +00:00
Heinrich Lee Yu
1ce5bcacdb Remove code related to object hierarchy in MySQL
These are not required because MySQL is not
supported anymore
2019-07-25 15:35:06 +08:00
Alexandru Croitor
09163e423a Expose merge requests count based on user access
Count issues related merge requests based on user access level. And
issue can have related MRs from projects where user does not have
access so the number of related merge requests should be adjusted
based on user's ability to access the related MRs.

https://gitlab.com/gitlab-org/gitlab-ce/issues/59581
2019-06-18 12:46:46 +03:00
Dmitriy Zaporozhets
15ba85ab8e
Remove some deprecated code
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2019-06-07 14:32:31 +03:00
Heinrich Lee Yu
e55e5d6d5a Fix test with hard coded id 2019-05-30 20:54:36 +08:00
Alexandru Croitor
9ff6edf690 Review updates and cleanup
* Cleaned issues and issues_statistics docs
* Renamed param with_labels_data to with_labels_details
* Added spec for N+1 check when retrieving labels from issue
* Refactoed CheckAssigneesCount validation class
2019-05-17 13:56:25 +03:00
Alexandru Croitor
f117c032ac Add params validations and remove extra params support
Remove label_name and milestone_title params support
Add mutually_exclusive validation for author_id and author_username
Add mutually_exclusive validation for assignee_id and assignee_username
Add validation to allow single value for asignee_username on CE
Add separate issue_stats_params helper for statistics params and
reuse in issues_params.
2019-05-15 10:15:17 +03:00
Alexandru Croitor
a4fbf39eca Move issue details to from IssueBasic to Issue entity
Cleanup IssueBasic entity to keep it basic and move extra attributes
to Issue entity which contains more details
2019-05-15 10:15:17 +03:00
Alexandru Croitor
5ec28dc387 Changes to issues api
When issues_controller endpoint was used for search, the parameters
passed to the controller were slightly different then the ones
passed to API. Because the searchbar UI is reused in different
places and builds the parameters passed to request in same way
we need to account for old parameter names.


Add issues_statistics api endpoints

Adds issue_statistics api endpoints for issue lists and returns
counts of issues for all, closed and opened states.


Expose more label attributes based on a param

When requesting issues list through API expose more attributes
for labels, like color, description if with_labels_data param is
being passed, avoiding this way to change response schema for users
that already use API.

https://gitlab.com/gitlab-org/gitlab-ce/issues/57402
2019-05-15 10:15:16 +03:00