diff options
author | Rémy Coutable <remy@rymai.me> | 2016-07-22 08:46:04 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-07-22 08:46:04 +0000 |
commit | 50124864e389e6813296cc803efac76f7c23b633 (patch) | |
tree | f75e74fbab5674a9e89f26b33b8aa6634d5d5cf1 /lib | |
parent | cbe787c5872318befb9d3cbd2918a44878e04497 (diff) | |
parent | 0b67945c99fde0d2c1ac6287f826001ef4c5d03b (diff) | |
download | gitlab-ce-50124864e389e6813296cc803efac76f7c23b633.tar.gz |
Merge branch 'artifacts-from-ref-and-build-name-api' into 'master'
Simpler two queries than one JOIN with subquery
This is a follow up from !5347
Originally it was:
``` ruby
pipeline = pipelines.latest_successful_for(ref)
builds.where(pipeline: pipeline).latest.with_artifacts
```
However MySQL would complain that we can't use `IN` against a subquery which has `LIMIT`. Using `INNER JOIN` would be a workaround, however, doing that is too complicated in current version of Rails.
So let's just use two queries in this case.
Closes #14419
See merge request !5388
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/builds.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/builds.rb b/lib/api/builds.rb index 657d421fe97..be5a3484ec8 100644 --- a/lib/api/builds.rb +++ b/lib/api/builds.rb @@ -80,7 +80,7 @@ module API # ref_name (required) - The ref from repository # job (required) - The name for the build # Example Request: - # GET /projects/:id/artifacts/:ref_name/download?job=name + # GET /projects/:id/builds/artifacts/:ref_name/download?job=name get ':id/builds/artifacts/:ref_name/download', requirements: { ref_name: /.+/ } do authorize_read_builds! |