Commit Graph

12 Commits

Author SHA1 Message Date
GitLab Bot e5f2a04e9d Add latest changes from gitlab-org/gitlab@master 2021-06-29 12:08:48 +00:00
GitLab Bot 2ac4833015 Add latest changes from gitlab-org/gitlab@master 2020-10-08 18:08:32 +00:00
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
Steve Azzopardi ab6b9a1c43
Remove get_build method for find_by_id
The original intention of `get_build` was as a workaround not to violate
`CodeReuse/ActiveRecord`. `find_by_id` does the exact same thing but
does not violate the rubocop rule.
2019-01-09 16:33:22 +01:00
Steve Azzopardi f9c8822afd
Create `get_build` for project model
Inside of `Projects::ArtifactsController` and
`Projects::BuildArtifactsController` we fetching the build by id using
active record directly which violates `CodeReuse/ActiveRecord` rubocop
rule. Create `get_build` inside of `project` model which does the same
thing.
2019-01-07 17:29:26 +01: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
Matija Čupić 22d1ec661d Disable artifact validation for download action 2018-10-16 13:01:48 +00:00
gfyoung 12ee2753c1 Enable even more frozen string in app/controllers
Enables frozen string for some vestigial files as
well as the following:

* app/controllers/projects/**/*.rb
* app/controllers/sherlock/**/*.rb
* app/controllers/snippets/**/*.rb
* app/controllers/users/**/*.rb

Partially addresses #47424.
2018-09-25 22:43:49 -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
Douwe Maan fe13f11041 Create and use project path helpers that only need a project, no namespace 2017-07-05 11:11:59 -05:00
Lin Jen-Shin 524c947eaf Add checks before redirect, remove status/trace
compatible urls, which were for javascripts
2017-05-24 15:31:30 +08:00
Lin Jen-Shin 43981250c4 Use controllers to redirect 2017-05-23 21:20:59 +08:00