Commit Graph

87 Commits

Author SHA1 Message Date
Jarka Kadlecova c6181f9799 API issues - support filtering by iids 2017-03-01 07:28:10 +01:00
Oswaldo Ferreira 2ace39f242 Spam check and reCAPTCHA improvements 2017-02-21 13:32:49 -03:00
Oswaldo Ferreira c2426b4eac Unify issues search behavior by always filtering when ALL labels matches 2017-02-20 13:21:22 -03:00
Oswaldo Ferreira c2d64d6702 Remove deprecated MR and Issue endpoints and preserve V3 namespace 2017-02-06 10:12:20 -02:00
Ruben Davila 0f3c9355c1 Add some API endpoints for time tracking.
New endpoints are:

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/time_estimate"

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/reset_time_estimate"

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/add_spent_time"

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/reset_spent_time"

GET  :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/time_stats"
2017-01-18 10:48:16 -06:00
David Eisner 7ef1c6408e API: Implement project issues iid param with IssuesFinder and add tests
- Use IssuesFinder for the /issues API resouce
- Tests for iid filter in project issues API resource
- Tests for No Milestone filter in issues API resources
  The "No Milestone" case was not previously tested, and the `/issues`
  resource did not support the the `milestone` parameter.
- Return issues where all labels match from the issues and project issues
  API resources, like the group issues resource already does. See
  https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6825#note_17474533

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-12 17:51:06 -05:00
Panagiotis Atmatzidis 5c253116ae Adding 'IssueFinder' for 'projects' API endpoint
Current filtering for "/projects/:id/issues" endpoint
returns no results for "No Milestone" query.

This PR introduces fix by copying filtering from "/groups/:id/issues"
which works as expected.
2017-01-12 17:51:06 -05:00
Robert Schilling 0199f1861b Add missing milestone parameter 2017-01-04 10:07:00 +01:00
Robert Schilling dc6b35e1ae Refactor issues filter in API 2017-01-04 09:50:09 +01:00
Robert Schilling 5961d14292 Fix state_event parameter to reopen an issue 2016-12-22 09:41:53 +01:00
Robert Schilling 3e7818e93a Grapify the issues API 2016-12-07 10:19:28 +01:00
Bob Van Landuyt 51a921baf9 A simpler implementation of finding a merge request
Following a discussion in !7180
2016-12-06 17:46:52 +01:00
Bob Van Landuyt 1123057ab7 Feature: delegate all open discussions to Issue
When a merge request can only be merged when all discussions are
resolved. This feature allows to easily delegate those discussions to a
new issue, while marking them as resolved in the merge request.

The user is presented with a new issue, prepared with mentions of all
unresolved discussions, including the first unresolved note of the
discussion, time and link to the note.

When the issue is created, the discussions in the merge request will get
a system note directing the user to the newly created issue.
2016-12-05 20:55:45 +01:00
Douwe Maan 3bf34face4 Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security'
Replace issue access checks with use of IssuableFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

## Which fixes are in this MR?

⚠️ - Potentially untested  
💣 - No test coverage  
🚥 - Test coverage of some sort exists (a test failed when error raised)  
🚦 - Test coverage of return value (a test failed when nil used)  
 - Permissions check tested

### Issue lookup with access check

Using `visible_to_user` likely makes these security issues too. See [Code smells](#code-smells).

- [x] 🚦 app/finders/notes_finder.rb:15 [`visible_to_user`]
- [x] 🚥 app/views/layouts/nav/_project.html.haml:73 [`visible_to_user`] [`.count`]
- [x]  app/services/merge_requests/build_service.rb:84 [`issue.try(:confidential?)`]
- [x]  lib/api/issues.rb:112 [`visible_to_user`]
  - CHANGELOG: Prevented API returning issues set to 'Only team members' to everyone
- [x]  lib/api/helpers.rb:126 [`can?(current_user, :read_issue, issue)`] Maybe here too?
- [x]  lib/gitlab/search_results.rb:53 [`visible_to_user`]

### Previous discussions
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b2ff264eddf9819d7693c14ae213d941494fe2b3_128_126
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#7b6375270d22f880bdcb085e47b519b426a5c6c7_87_87

See merge request !2031
2016-11-28 21:26:23 -03:00
Douwe Maan 3d7704ae5f Merge branch 'zj-fix-label-creation-non-members' into 'security'
Fix label creation non members

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23416

See merge request !2006
2016-11-28 21:24:19 -03:00
Rémy Coutable 81ba3f9177
API: Introduce `#find_group!` which also check access permission
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-24 16:58:32 +01:00
Douglas Barbosa Alexandre 0c052f116c Remove default value for `project` argument on subscribable concern 2016-11-17 15:10:13 -02:00
Sean McGivern 45fc8b73ed Fix API issues sorting 2016-09-09 16:10:01 +01:00
Robert Schilling 036cc8c27e API: Expose issue#confidential 2016-08-31 09:20:04 +02:00
tiagonbotelho 76c2901eac if issue is not valid we revert back to the old labels when updating 2016-08-30 18:39:03 +01:00
tiagonbotelho 7f0bcf0432 refactors update issue api request and some minor comments 2016-08-30 18:37:21 +01:00
tiagonbotelho b7d29ce659 adds test to check whether or not an email is sent to label subscribers after creating a new issue through the api 2016-08-30 18:37:21 +01:00
tiagonbotelho 7532c012c2 user is now notified when creating an issue through the api 2016-08-30 18:37:21 +01:00
Patricio Cano 43e756d4ea Refactored AkismetHelper into AkismetService and cleaned up `Spammable`
- Refactored SpamCheckService into SpamService
2016-08-15 13:18:15 -05:00
Patricio Cano 64ab2b3d9f Refactored spam related code even further
- Removed unnecessary column from `SpamLog`
- Moved creation of SpamLogs out of its own service and into SpamCheckService
- Simplified code in SpamCheckService.
- Moved move spam related code into Spammable concern
2016-08-15 13:18:15 -05:00
Patricio Cano 722fc84e3d Complete refactor of the `Spammable` concern and tests:
- Merged `AkismetSubmittable` into `Spammable`
- Clean up `SpamCheckService`
- Added tests for `Spammable`
- Added submit (ham or spam) options to `AkismetHelper`
2016-08-15 13:18:15 -05:00
Patricio Cano f01fce7f46 Refactor spam validation to a concern that can be easily reused and improve legibility in `SpamCheckService` 2016-07-26 19:29:16 -05:00
Patricio Cano 8f04cf0ead Refactor `SpamCheckService` to make it cleaner and clearer. 2016-07-26 15:18:07 -05:00
Patricio Cano f7807c5b68 Submit all issues on public projects to Akismet if enabled. 2016-07-26 15:17:52 -05:00
Patricio Cano 9c34fafb8b Submit new issues created via the WebUI by non project members to Akismet for spam check. 2016-07-26 15:17:41 -05:00
Robert Schilling e7d9fcc1c9 API: Expose due_date for issues 2016-07-12 17:59:21 +02:00
Marc Siegfriedt 6587feba65 gitlab-org/gitlab-ce#17818 - add api call for issues by group
rely only on IssuesFinder
docs and changelog
2016-06-23 16:31:48 +00: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
Ahmad Sherif 0c22698bd4 Add API endpoints for un/subscribing from/to a label
Closes #15638
2016-05-12 22:48:09 +02:00
Stan Hu e99cf05875 Use ActionDispatch Remote IP for Akismet checking
Previously all remote IPs appeared at 127.0.0.1, which made Akismet
not very useful. Using the ActionDispatch Remote IP (http://api.rubyonrails.org/classes/ActionDispatch/RemoteIp.html)
should provide more reliable results.

Closes #16629
2016-04-27 22:12:55 -07:00
Michael Greene 28a7fe25fd Allow back dating issues on update 2016-04-13 12:04:09 -05:00
Robert Schilling a9200d93d3 Ensure that issues and merge requests are found 2016-04-13 17:15:42 +02:00
Robert Schilling fa3009095f Make subscription API more RESTful 2016-04-13 13:52:13 +02:00
Robert Schilling f875189b39 API: Ability to subscribe and unsubscribe from a merge request 2016-04-13 13:45:01 +02:00
Robert Schilling bd0be13f5b API: Ability to subscribe and unsubscribe from an issue 2016-04-13 13:45:00 +02:00
Robert Schilling 2b036025d6 Update tests for moving issues via API 2016-04-13 11:31:50 +02:00
Robert Schilling 482f67edb4 API: Ability to move an issue 2016-04-13 11:23:42 +02:00
Robert Schilling fb2fde9d62 API: Expose subscribed? on issues 2016-04-08 15:53:04 +02:00
Zeger-Jan van de Weg 473b261261 Back dating of issues when creating throught the API 2016-03-28 16:45:36 +02:00
Zeger-Jan van de Weg 3b088fc5b5 Minor improvements on IssuableActions 2016-03-21 16:59:35 +01:00
Zeger-Jan van de Weg 1d77822816 minor improvements and fixed specs 2016-03-19 21:24:05 +01:00
Zeger-Jan van de Weg 7342a4566c Dry destroy action on issuables 2016-03-19 21:24:05 +01:00
Zeger-Jan van de Weg 212e83bab3 Soft delete issuables 2016-03-19 21:23:03 +01:00
Douglas Barbosa Alexandre e4f1c001e6 Restrict access to confidential issues through API 2016-03-17 20:55:59 -03:00
Douglas Barbosa Alexandre a2bbf00477 Refactor spam filtering on issues API 2016-02-02 11:25:44 -02:00