gitlab-org--gitlab-foss/spec/requests/api
Rémy Coutable 4a2a127b5c Merge branch 'artifacts-from-ref-and-build-name-api' into 'master'
API for downloading latest successful build

## What does this MR do?

Implement parts of #4255, particularly the API.

## Are there points in the code the reviewer needs to double check?

I still made it that `ref` could be either branch, tag, or even SHA with:

``` ruby
# ref can't be HEAD, can only be branch/tag name or SHA
scope :latest_successful_for, ->(ref) do
  table = quoted_table_name
  # TODO: Use `where(ref: ref).or(sha: ref)` in Rails 5
  where("#{table}.ref = ? OR #{table}.sha = ?", ref, ref).
    success.order(id: :desc)
end
```

Because the reasons I put in:

* https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13165543
* https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13165921

But if you still think that it's not good to do it this way, I'll drop it and let's think about the other way to satisfy the requirement specified in https://gitlab.com/gitlab-org/gitlab-ce/issues/4255#note_13101233 It could be `status=any` or `sha=DEADBEAF`

## What are the relevant issue numbers?

Part of #4255

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5347
2016-07-21 09:01:47 +00:00
..
api_helpers_spec.rb API: Expose 'developers_can_push' for branches 2016-07-19 11:11:56 +02:00
award_emoji_spec.rb Fix not normalized emoji paths 2016-07-14 08:51:00 +02:00
branches_spec.rb API: Expose 'developers_can_merge' for branches 2016-07-19 11:12:03 +02:00
builds_spec.rb Cleanup the use of let, feedback: 2016-07-21 00:09:35 +08:00
commit_statuses_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
commits_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
deploy_keys.rb Add /deploy_keys API to retrieve all deploy keys regardless of project affiliation 2016-07-20 13:39:19 -04:00
doorkeeper_access_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
files_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
fork_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
group_members_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
groups_spec.rb API: Expose shared projects in a group 2016-07-08 13:06:17 +02:00
internal_spec.rb Fix a bug where the project's repository path was returned instead of the wiki path 2016-07-15 21:31:26 -04:00
issues_spec.rb API: Expose due_date for issues 2016-07-12 17:59:21 +02:00
keys_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
labels_spec.rb Allow '?', or '&' for label titles 2016-07-05 20:57:09 -03:00
license_templates_spec.rb Rename Licenses API to License Templates API 2016-06-27 14:42:05 -05:00
merge_requests_spec.rb api: expose {should,force}_remove_source_branch 2016-07-11 14:08:06 -04:00
milestones_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
namespaces_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
notes_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
project_hooks_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
project_members_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
project_snippets_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
projects_spec.rb Merge branch '4142-show-inline-video' into 'master' 2016-07-21 07:29:38 +00:00
repositories_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
runners_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
services_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
session_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
settings_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
sidekiq_metrics_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
system_hooks_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
tags_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
templates_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
todos_spec.rb Return the number of marked todos 2016-07-19 13:09:57 +02:00
triggers_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
users_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
variables_spec.rb Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00