Commit Graph

174 Commits

Author SHA1 Message Date
Bob Van Landuyt 9b27027619 Add documentation for allowing maintainers to push 2018-03-07 16:59:17 +01:00
Bob Van Landuyt 8b2ec23fef Set `allow_maintainer_to_push` using the API 2018-03-07 16:59:17 +01:00
Lin Jen-Shin 156cc98d10 Unify lib/api/merge_requests.rb with EE 2018-03-06 01:44:51 +08:00
Sean McGivern 5a1da682a7 Merge branch '41616-api-issues-between-date' into 'master'
Resolve "API support for selecting only  updated issues before/after a given date"

Closes #41616

See merge request gitlab-org/gitlab-ce!17417
2018-03-05 14:04:35 +00:00
Jacopo 168ff28506 Adds updated_at filter to issues and merge_requests API 2018-03-05 14:10:32 +01:00
haseeb bb89412ffb expose metrics in merge request api 2018-03-02 16:48:55 +00:00
Sean McGivern 2f7dffe548 Add source and target branch filters to merge requests API 2018-03-01 10:41:02 +00:00
Yorick Peterse cca61980d5
Track and act upon the number of executed queries
This ensures that we have more visibility in the number of SQL queries
that are executed in web requests. The current threshold is hardcoded to
100 as we will rarely (maybe once or twice) change it.

In production and development we use Sentry if enabled, in the test
environment we raise an error. This feature is also only enabled in
production/staging when running on GitLab.com as it's not very useful to
other users.
2018-02-01 17:00:46 +01:00
Sean McGivern 06713cb7b0 Merge branch '39214__pipeline_api' into 'master'
Add `pipelines` endpoint to merge requests API

Closes #39214

See merge request gitlab-org/gitlab-ce!15454
2018-01-11 11:29:53 +00:00
Tony Rom 7ed08fcd5d Fix style 2018-01-10 20:05:34 +03:00
Brent Greeff 34b9cc9674 API: get participants from merge_requests & issues 2018-01-05 15:21:53 +00:00
Mark Fletcher 055543b915 Add optional `search` param for Merge Requests API 2017-12-20 07:23:57 +00:00
Mark Fletcher c9732b3c6d Employ declared_params in finder methods for MR and Issue API lists
- Ensure that unwanted params are no passed to actual finder classes
2017-12-20 07:23:57 +00:00
Tony Rom fd88b0ca56 Add `pipelines` endpoint to merge requests API 2017-12-15 19:53:57 +03:00
George Andrinopoulos 7fb1bb01bd Create issue and merge request destroy services 2017-11-25 22:09:18 +02:00
Sean McGivern 991bf24ec8 Use latest_merge_request_diff association
Compared to the merge_request_diff association:

1. It's simpler to query. The query uses a foreign key to the
   merge_request_diffs table, so no ordering is necessary.
2. It's faster for preloading. The merge_request_diff association has to load
   every diff for the MRs in the set, then discard all but the most recent for
   each. This association means that Rails can just query for N diffs from N
   MRs.
3. It's more complicated to update. This is a bidirectional foreign key, so we
   need to update two tables when adding a diff record. This also means we need
   to handle this as a special case when importing a GitLab project.

There is some juggling with this association in the merge request model:

* `MergeRequest#latest_merge_request_diff` is _always_ the latest diff.
* `MergeRequest#merge_request_diff` reuses
  `MergeRequest#latest_merge_request_diff` unless:
    * Arguments are passed. These are typically to force-reload the association.
    * It doesn't exist. That means we might be trying to implicitly create a
      diff. This only seems to happen in specs.
    * The association is already loaded. This is important for the reasons
      explained in the comment, which I'll reiterate here: if we a) load a
      non-latest diff, then b) get its `merge_request`, then c) get that MR's
      `merge_request_diff`, we should get the diff we loaded in c), even though
      that's not the latest diff.

Basically, `MergeRequest#merge_request_diff` is the latest diff in most cases,
but not quite all.
2017-11-23 12:14:56 +00:00
Mark Fletcher ff1e3a47c4 Fix namespacing for MergeWhenPipelineSucceedsService in MR API 2017-10-30 17:19:51 +00:00
Sean McGivern a68a39e341 Merge branch '18608-lock-issues-v2' into 'master'
Resolve "Lock issue and merge request"

Closes #18608

See merge request gitlab-org/gitlab-ce!14531
2017-10-06 16:47:27 +00:00
Vitaliy @blackst0ne Klachkov c55a9ac4ae Remove 'Repo' prefix from API entites 2017-10-05 19:48:05 +11:00
Luke "Jared" Bennett ff7b545c8e
Merge remote-tracking branch 'origin/master' into 18608-lock-issues 2017-09-20 15:23:00 +01:00
haseeb ff4e81e0ae fix #35290 Make read-only API for public merge requests available without authentication 2017-09-18 17:29:17 +00:00
Jarka Kadlecova 073ba05d31 Support discussion lock in the API 2017-09-14 14:50:32 +02:00
Hiroyuki Sato 7e42711659 Add my_reaction_emoji param to /merge_requests API 2017-09-05 11:56:17 +09:00
Robert Schilling 6a2ee0968e API: Use defined project requirements 2017-08-31 14:57:47 +02:00
Robert Speicher 966b635221 Merge branch '28453-add-time-estimate-time-spent-to-api-issue-output' into 'master'
Add time stats to Issue and Merge Request API

Closes #28453

See merge request !13335
2017-08-30 17:35:14 +00:00
Travis Miller 749c389345 Add time stats to issue and merge request API end points 2017-08-29 08:31:36 -05:00
Robert Schilling e80313f9ee Conditionally destroy a ressource 2017-08-28 16:40:25 +02:00
Robert Schilling 998afa5f74 API: Respect the 'If-Unmodified-Since' for delete endpoints 2017-08-28 16:40:25 +02:00
Toon Claes d77088bb0b Default /merge_request API endpoint to `scope=created-by-me`
This matches the behavior of the /issues endpoint.
2017-07-28 00:07:28 +02:00
Toon Claes d7505de8b3 Add top-level /merge_requests API endpoint
And add support for additional query parameters:
- `author_id`: Returns merge requests created by the given user `id`
- `assignee_id`: Returns merge requests assigned to the given user `id`
- `scope`: Return merge requests for the given scope: `created-by-me`, `assigned-to-me` or `all`
2017-07-27 23:34:57 +02:00
Jarka Kadlecova 7bee7b848a Support both internal and external issue trackers 2017-07-24 08:13:43 +02:00
Dmitriy Zaporozhets 6b8ad689da
Update grape gem
New version of the gem returns 200 status code on delete with content
instead of 204 so we explicitly set status code to keep existing
behavior

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-07-20 16:33:18 +03:00
Stan Hu faf9543827 Use view=simple for simplifying merge requests API 2017-07-11 08:02:13 -07:00
Stan Hu e17ac5705d Add a simple mode to merge request API
The current "basic" merge request API still loads too much data. For integrations
like the Trello Power-up, we just need the basics.

Closes #34920
2017-07-11 06:32:13 -07:00
Stan Hu 1f0ee9ca19 Fix sort ordering with merge request API 2017-07-10 15:08:07 -07:00
Stan Hu ef526ff33c Paginate the merge requests API earlier to avoid eager loading every merge request
Fixes a performance regression introduced in !12732
2017-07-10 13:56:46 -07:00
Stan Hu 88c4248ac7 Remove remaining N+1 queries in merge requests API with emojis and labels
Closes #34159
2017-07-08 22:19:34 -07:00
Stan Hu b963d45ca4 Remove many N+1 queries with merge requests API
Identified via `ENABLE_BULLET=1 bundle exec rspec spec/requests/api/merge_requests_spec.rb:34`

Improves speed of #34159
2017-07-07 16:31:21 -07:00
Rémy Coutable 9fe6c2b2c2 Merge branch 'add-since-and-until-params-to-issuables' into 'master'
add created_after and created_before params to issuables

Closes #32901

See merge request !12151
2017-06-19 12:13:27 +00:00
Kyle Bishop ef633d2478 add since and until params to issuables 2017-06-18 15:43:51 -07:00
Felipe Artur c472017078 Fix API bug accepting wrong merge requests parameters 2017-06-16 16:33:09 -03:00
mhasbini ccac05dd90 Fix 404 when upstream has disabled merge requests 2017-04-27 01:04:07 +03:00
Robert Schilling 2ea5d4b7af Ability to filter merge requests by labels and milestones 2017-04-25 22:07:38 +02:00
Chris Wilson e670cb271e Fix updating merge_when_build_succeeds via merge API endpoint
When updating a merge request via the `/merge` endpoint we
check the `mergeable` and `mergeable_state` status, these will return
`false` if the application option only_allow_merge_if_pipeline_succeeds is
enabled. We should skip CI checks if the request uses the
merge_when_pipeline_succeeds param

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/22740
2017-04-24 20:51:05 +10:00
Oswaldo Ferreira fd32960e7c Separate CE params on Grape API 2017-04-10 16:13:48 -03:00
Toon Claes d536d9590b Remove `:id/merge_requests/:merge_request_iid/comments` endpoints
Comments for a merge request should be obtained to the `notes` endpoint.
2017-03-27 10:23:14 +02:00
Rémy Coutable 63360adeae
Add `requirements: { id: %r{[^/]+} }` for all projects and groups namespaced API routes
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-16 18:00:24 +01:00
Timothy Andrew 719327112c
API routes referencing a specific merge request should use the MR `iid`
- As opposed to the `id` that was previously being used.
- This brings the API routes closer to the web interface's routes.
- This is specific to API v4.
2017-03-07 13:06:42 +05:30
Adam Niedzielski c727d4328f Remove "subscribed" field from API responses returning list of issues or merge requests 2017-03-06 14:17:07 +01:00
James Lopez a0101ebf84 Update occurrences of MWBS to MWPS
Rename column in the database
 Rename fields related to import/export feature
 Rename API endpoints
 Rename documentation links
 Rename the rest of occurrences in the code
 Replace the images that contain the words "build succeeds" and docs referencing to them
 Make sure pipeline is green and nothing is missing.

updated doc images

renamed only_allow_merge_if_build_succeeds in projects and fixed references

more updates

fix some spec failures

fix rubocop offences

fix v3 api spec

fix MR  specs

fixed issues with partials

fix MR spec

fix alignment

add missing v3 to v4 doc

wip - refactor v3 endpoints

fix specs

fix a few typos

fix project specs

copy entities fully to V3

fix  entity error

more fixes

fix failing specs

fixed missing entities in V3 API

remove comment

updated code based on feedback

typo

fix spec
2017-03-01 12:02:02 +01:00