Commit Graph

12 Commits

Author SHA1 Message Date
Matija Čupić 38ab1ae2f2
Rename latest_successful to be more explicit
* Reword Project#latest_successful_build_for to
Project#latest_successful_build_for_ref
* Reword Ci::Pipeline#latest_successful_for to
Ci::Pipeline#latest_successful_build_for_ref
2019-07-26 00:17:52 +02:00
Roger Rüttimann 4db8336786 API: delete job_artifacts of a single job 2019-03-06 11:06:21 +00:00
Steve Azzopardi 7ac32ae282
Refactor project.latest_successful_builds_for def
`project.latest_successful_builds_for(ref)` is being used to find a
single job all the time. This results into us having to call `find_by`
inside of the controller which violates our CodeReuse/ActiveRecord
rubocop rule.

Refactor `project.latest_successful_builds_for(ref)` to
`project.latest_successful_build_for(job_name, ref)` which will execute
the `find_by` inside of the model.

Also create `project.latest_successful_build_for!(job_name, ref)` which
raises an exception instead of returning nil.
2019-01-07 17:29:26 +01:00
Steve Azzopardi 401f65c43a
Add endpoint to download single artifact by ref
Add a new endpoint
`projects/:id/jobs/artifacts/:ref_name/raw/*artifact_path?job=name`
which is the close the web URL for consistency sake. This endpoint can
be used to download a single file from artifacts for the specified ref
and job.

closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54626
2018-12-07 15:33:30 +01:00
Imre Farkas b1e070bf49
Fix API::Namespaces to accept namepaces with dots
It also renames the API::PROJECT_ENDPOINT_REQUIREMENTS constant to
API::NAMESPACE_OR_PROJECT_REQUIREMENTS
2018-11-28 12:54:11 +01:00
gfyoung 3836d69119 Enable frozen string in lib/api and lib/backup
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
2018-09-29 21:04:50 -07:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
🙈 jacopo beschi 🙉 c6b1043e9d Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
Micaël Bergeron fc6587f1f2 Add proxy_download to perform proxied sending of all files 2018-03-09 09:16:06 -05:00
Lin Jen-Shin 7de317d475 Unify lib/api/job_artifacts.rb with EE 2018-03-06 19:30:13 +08:00
Grzegorz Bizon c922fb4b68 Respond with a bad request if artifact path is invalid 2017-09-06 11:31:08 +02:00
Grzegorz Bizon 80b3dcc777 Extract job artifacts API code to a separate file 2017-09-06 11:20:12 +02:00