summaryrefslogtreecommitdiff
path: root/lib/api/issues.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix N+1 Gitaly calls in /api/v4/projects/:id/issuessh-fix-nplusone-issuesStan Hu2019-08-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | 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
* Update sort options for issues list57402-upate-issues-list-sort-options-ceAlexandru Croitor2019-08-231-1/+1
| | | | | | | | | | 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
* Fix Gitaly N+1 calls with listing issues/MRs via APIsh-fix-issues-api-gitaly-nplusoneStan Hu2019-08-171-2/+4
| | | | | | | | | | | | | | | | | | | | 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
* Expose merge requests count based on user accessAlexandru Croitor2019-06-181-3/+3
| | | | | | | | | 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
* API issues - minor cleanup of permission checkJan Provaznik2019-06-111-8/+3
| | | | | | Adds `set_issue_updated_at` similar to `set_issue_created_at` permission and cleans up the related permission check in issues API.
* CE port of Move EE specific lines in API::IssuesImre Farkas2019-05-291-12/+2
|
* Review updates and cleanupce-57402-add-issues-statistics-api-endpointsAlexandru Croitor2019-05-171-14/+8
| | | | | | | * 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
* Add params validations and remove extra params supportAlexandru Croitor2019-05-151-15/+26
| | | | | | | | | 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.
* Move issue details to from IssueBasic to Issue entityAlexandru Croitor2019-05-151-6/+6
| | | | | Cleanup IssueBasic entity to keep it basic and move extra attributes to Issue entity which contains more details
* Changes to issues apiAlexandru Croitor2019-05-151-26/+52
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Set correct timestamps when creating past issues58361-issue-create-system-note-timestampHeinrich Lee Yu2019-04-161-0/+1
| | | | Sets `system_note_timestamp` from `created_at`
* Fix `updated_at` doesn't apply to `state_event` updates of issues via APISean McGivern2019-04-081-3/+7
|
* Remove duplicates from issue related merge requestsduplicate-related-mrsAlexandru Croitor2019-04-051-1/+1
| | | | | | | | Remove duplicates returned by Issues#related_merge_requests API that relies on ReferencedMergeRequestsService which returns 2 arrays one of related MRs and one of related MRs that close the issue(i.e. a subset of first one). We only need related MRs in this case so just pick the first array.
* Expose head pipeline in the related merge requestsAlexandru Croitor2019-04-041-1/+1
| | | | | | | | | Expose head pipeline for the MR in the api when requesting related merge requests for an issue and show a detailed status for the pipeline, which would include: details_path, favicon, group, icon, label, text, tooltip. https://gitlab.com/gitlab-org/gitlab-ce/issues/57662#note_152023412
* Backport API::Issues parameters from EEYorick Peterse2019-03-261-13/+14
| | | | | This backports the parameters that EE adds to API::Issues, and wraps them in conditionals so they are only used in EE.
* Merge branch 'sh-optimize-todos-api' into 'master'Sean McGivern2019-03-071-1/+1
|\ | | | | | | | | | | | | Significantly reduce N+1 queries in /api/v4/todos endpoint Closes #40378 See merge request gitlab-org/gitlab-ce!25711
| * Significantly reduce N+1 queries in /api/v4/todos endpointStan Hu2019-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | By preloading associations and batching issuable metadata lookups, we can significantly cut the number of SQL queries needed to load the Todos API endpoint. On GitLab.com, my own tests showed my user's SQL queries went from 365 to under 60 SQL queries. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/40378
* | Add array support for labelsAlexandru Croitor2019-03-061-2/+2
|/ | | | | * Support label parameter as comma separated and array of strings for merge requests and issues api endpoints
* Merge branch 'filter-confidential-issues' into 'master'Kamil Trzciński2019-02-261-0/+1
| | | | | | | Ability to filter confidential issues Closes #50747 See merge request gitlab-org/gitlab-ce!24960
* Revert "Merge branch 'filter-confidential-issues' into 'master'"Michael Kozono2019-02-251-1/+0
| | | | | This reverts commit d133bf84c668df3dfc9938bb04150754cb873c8b, reversing changes made to 7981c0292b07a0138b096fa082341fcb13e9ce2b.
* Only use boolean parameters internallyRobert Schilling2019-02-221-9/+0
| | | | Use internally only boolean params.
* Add API support for filtering confidential issuesRobert Schilling2019-02-211-0/+10
|
* Merge branch ↵Sean McGivern2019-02-191-10/+5
|\ | | | | | | | | | | | | | | | | '55376-related_merge_requests-api-call-returns-merge-requests-that-are-not-related-to-the-issue' into 'master' Ensure that related_merge_requests api call returns merge requests in the correct scope Closes #55376 See merge request gitlab-org/gitlab-ce!25222
| * Directly use MRs given by ReferencedMergeRequestsServiceRobert Schilling2019-02-141-10/+5
| |
| * API: Reference MRs cross-project wiseRobert Schilling2019-02-131-1/+1
| |
* | Added: Include order by ID desc for tie breakers in paginationNermin Vehabovic2019-02-161-2/+1
|/
* Merge branch 'search-title' into 'master'Sean McGivern2019-02-051-1/+2
|\ | | | | | | | | Add 'in' filter that modifies scope of 'search' filter to issues and merge requests API See merge request gitlab-org/gitlab-ce!24350
| * Fix grammar and spellingHiroyuki Sato2019-02-051-2/+2
| |
| * Add 'in' filter that modifies scope of 'search' filter to issues and merge ↵Hiroyuki Sato2019-01-141-1/+2
| | | | | | | | requests API
* | Enable the Layout/ExtraSpacing cop56392-enable-the-layout-extraspacing-copRémy Coutable2019-01-241-3/+3
|/ | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix API::Namespaces to accept namepaces with dotsif-52811-fix_namespaces_api_routingImre Farkas2018-11-281-2/+2
| | | | | It also renames the API::PROJECT_ENDPOINT_REQUIREMENTS constant to API::NAMESPACE_OR_PROJECT_REQUIREMENTS
* Expose {closed,merged}_{at,by} in merge requests API indexDouwe Maan2018-11-051-1/+1
|
* add related merge request endpointHelmut Januschka2018-11-011-0/+24
|
* Extract EE params in issues API to separate moduleHeinrich Lee Yu2018-10-301-4/+13
|
* Refactor api validator to separate classHeinrich Lee Yu2018-10-261-4/+1
|
* Apply similar change to MRs APIHeinrich Lee Yu2018-10-261-1/+1
|
* Issues API: Add None/Any option to assignee_idHeinrich Lee Yu2018-10-261-1/+5
|
* Enable frozen string in lib/api and lib/backupgfyoung2018-09-291-0/+2
| | | | | | | | | | Partially addresses #47424. Had to make changes to spec files because stubbing methods on frozen objects is a mess in RSpec and leads to failures: https://github.com/rspec/rspec-mocks/issues/1190
* Disable existing offenses for the CodeReuse copsYorick Peterse2018-09-111-0/+10
| | | | | This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
* Use policies to determine if attributes can be set in the APISean McGivern2018-08-221-5/+2
| | | | This is more idiomatic than checking membership explicitly.
* Allow date parameters on Issues and Notes API for group ownersFlorent Dubois2018-08-221-3/+3
| | | | | | | - Allow `created_at` and `updated_at` parameters on Issues API - Allow `created_at` on Issue Notes API Closes gitlab-org/gitlab-ce#40059
* Resolve "Allow issue's Internal ID (`iid`) to be set when creating via the API"Jamie Schembri2018-08-011-1/+5
|
* Remove N+1 query for author in issues APIsh-add-uncached-query-limiterStan Hu2018-06-041-1/+1
| | | | | | | This was being masked by the statement cache because only one author was used per issue in the test.. Also adds support for an Rspec matcher `exceed_all_query_limit`.
* Eliminate cached N+1 queries for projects in Issue APIStan Hu2018-05-311-1/+1
| | | | | | | | | | | | | | | | | | In CE, every `Issue` entity is also a `ProjectEntity`, which calls `entity&.project.try(:id)` to show the project ID. In an API request with 100 issues, this would hit the Rails statement cache 100 times for the same project and cause unnecessary overhead as related models would also be loaded. In EE, we call `Issue#supports_weight?` for each issue, which then calls `project&.feature_available?(:issue_weights)`. If the project is not preloaded, this incurs additional overhead, as each individual Project object has to be queried. This can lead to a significant performance hit. In loading the CE project with 100 issues, this contributed to at least 22% of the load time. See https://gitlab.com/gitlab-org/gitlab-ce/issues/47031 for why testing this is a bit tricky.
* Merge branch '44799-api-naming-issue-scope' into 'master'Rémy Coutable2018-05-211-4/+5
|\ | | | | | | | | | | | | Resolve "API naming for issue scope" Closes #44799 See merge request gitlab-org/gitlab-ce!18935
| * Add created_by_me and assigned_to_me scopes44799-api-naming-issue-scopeMark Chao2018-05-211-4/+5
| | | | | | | | Deprecate corresponding dash versions created-by-me and assigned-to-me
* | Remove authentication for readonly endpoints in issues APIhaseeb2018-05-151-1/+2
|/
* Resolve "Make a Rubocop that forbids returning from a block"🙈 jacopo beschi 🙉2018-04-181-1/+1
|
* Include subgroup issues when searching for group issues using the APIissue_42443Felipe Artur2018-04-051-1/+1
|
* Adds updated_at filter to issues and merge_requests APIJacopo2018-03-051-0/+2
|