Commit Graph

73 Commits

Author SHA1 Message Date
GitLab Bot 2ac4833015 Add latest changes from gitlab-org/gitlab@master 2020-10-08 18:08:32 +00:00
GitLab Bot 7a1895c74a Add latest changes from gitlab-org/gitlab@master 2020-08-11 18:10:06 +00:00
GitLab Bot 4a3ba3e5f2 Add latest changes from gitlab-org/gitlab@master 2020-05-22 09:08:09 +00:00
GitLab Bot f2151c65d5 Add latest changes from gitlab-org/gitlab@master 2020-05-19 15:08:04 +00:00
GitLab Bot 31a340adab Add latest changes from gitlab-org/gitlab@master 2020-05-15 18:07:52 +00:00
GitLab Bot e4c711546c Add latest changes from gitlab-org/gitlab@master 2019-09-18 21:06:34 +00:00
Matija Čupić 7cee6139c0
Find build by sha from ref
Adds ability to find builds by sha when only specifying a ref.
2019-07-23 20:55:59 +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
Douwe Maan 16f7243fef
Revert "[Rails5] Set request.format for artifacts_controller"
This reverts commit c48e7dc263.

# Conflicts:
#	app/controllers/projects/artifacts_controller.rb
2018-12-03 12:29:01 +01:00
Kamil Trzciński 5da2f42dc9 backport: Always proxy reports downloads
This makes to always proxy reports
2018-11-07 21:49:45 +01:00
Matija Čupić 22d1ec661d Disable artifact validation for download action 2018-10-16 13:01:48 +00:00
Matija Čupić 48c911b75e CE Resolve "Refactor code quality similar to JUnit tests" 2018-10-02 17:01:26 +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
blackst0ne c48e7dc263 [Rails5] Set request.format for artifacts_controller
Since Rails 5 request.format gets set by extension if it's not explicitly
set.
That means artifacts_controller#file no longer works as expected.
This commit explicitly sets request.format for artifacts_controller#file.
2018-06-16 21:46:31 +11:00
Grzegorz Bizon 6ca02a4150 Merge branch 'zj-multiple-artifacts-ee' into 'master'
Multiple artifacts ee

See merge request gitlab-org/gitlab-ee!3276
2018-02-28 20:44:09 +01:00
Kamil Trzciński e0401df121 Merge commit '11c67e7c2f992299ff5918ce67995b73d1e0be6d' into object-storage-ee-to-ce-backport 2018-02-28 20:35:22 +01:00
Douwe Maan bc76062774 Merge branch 'jej/lfs-object-storage' into 'master'
Can migrate LFS objects to S3 style object storage

Closes #2841

See merge request !2760
2018-02-28 20:29:37 +01:00
Zeger-Jan van de Weg e4d07f12b6
Test against public projects 2017-10-05 12:41:22 +02:00
Zeger-Jan van de Weg 8cbfe3aea6
Redirect to pages daemon 2017-10-03 12:34:24 +02:00
Grzegorz Bizon 3b874414c0 Do not use artifacts metadata to access single artifact 2017-09-05 12:34:49 +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
Sean McGivern 04251829ba Merge branch 'dm-collapsed-blob' into 'master'
Consistent diff and blob size limit names

See merge request !11776
2017-06-01 09:10:53 +00:00
Douwe Maan aed0387f97 Consistent diff and blob size limit names 2017-05-29 17:02:02 -05:00
Lin Jen-Shin 71777a4a18 Rename BuildsController to JobsController
Rename other URL generators

admin_builds_path -> admin_jobs_path

Fix tests and more renaming

Fix more tests

Also change build_id to job_id in the controller
2017-05-17 20:17:30 +08:00
Douwe Maan 0f58eb6bde Add artifact file page that uses the blob viewer 2017-05-04 08:50:12 -05:00
Douwe Maan df36f1f47b Add breadcrumb, build header and pipelines submenu to artifacts browser 2017-05-03 16:32:36 -05:00
Lin Jen-Shin b17df0507b Extract ref_name and path in before_action, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_14469768
2016-08-26 13:10:03 +08:00
Lin Jen-Shin dd8afbf05d Just use instance variable instead, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_14400736
2016-08-25 15:04:15 +08:00
Lin Jen-Shin e65bc0f175 Path could also have slashes! Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_14347729
2016-08-24 16:02:56 +08:00
Lin Jen-Shin 17d0406546 Not sure why I missed this renaming 2016-08-18 19:30:20 +08:00
Lin Jen-Shin e8b03baf6b Use path rather than URL because it should work for http 302:
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_14035941
2016-08-18 15:31:20 +08:00
Lin Jen-Shin 4fbe044b74 Use switch case in a helper, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13988401
2016-08-17 17:38:38 +08:00
Lin Jen-Shin f86a507745 Rename to latest_succeeded, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13908017
2016-08-16 22:10:10 +08:00
Lin Jen-Shin 73bbaffbfc Use URL helper, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13880889
2016-08-16 01:03:08 +08:00
Lin Jen-Shin 85ceb8b72f Rename latest_success* to latest_successful:
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13164642
2016-07-19 17:51:45 +08:00
Lin Jen-Shin 3be2c3f566 Merge branch 'master' into artifacts-from-ref-and-build-name
* master: (335 commits)
  Disable transaction when adding index for Ci::Pipeline
  added changelog
  allow empty repos on import/export
  Modify test for Build tabs
  Add tests to project builds for pending tab
  Remove unused .js-running-count class
  Add test for new pending tab and update tests for running tab
  Add Pending Tab to Admin Builds
  added changelog
  limit project expor retry to only 3
  use method in validates statement
  Fix spec to set import_url before attempting to create import_data
  Allow a project import URL to be blank to prevent false positives preventing settings from being saved
  Refactor gitlab_ci_yaml_processor variables tests
  Fix CI yaml example
  Align cancel and retry buttons
  Remove deploy to production button
  Remove irrelevant comments
  Fix gitlab_ci_yaml_processor_spec.rb
  Fix AddWhenAndYamlVariablesToCiBuilds migration
  ...
2016-07-18 21:34:48 +08:00
Lin Jen-Shin 78c37bdd77 Use find_by, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13125486
2016-07-18 13:39:53 +08:00
Lin Jen-Shin 53a9dee6cb Introduce Project#latest_success_builds_for:
So it's more accessible for views to access the names of jobs.
Only filter Build#name from where we really need to download it.
2016-07-15 02:22:29 +08:00
Lin Jen-Shin d7bbee7593 Update routes based on feedback from:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13058785

And note that job/build_name could contain `/`
2016-07-14 16:45:46 +08:00
Lin Jen-Shin bb5f06718c Rename to ref_name so it's aligning with API 2016-07-13 18:19:29 +08:00
Lin Jen-Shin 57c72cb0df Could be faster when params[:path] is missing 2016-07-12 23:26:30 +08:00
Lin Jen-Shin e383254070 Add all the tests and fix stuffs along the way:
It turns out they are different:

    builds.success.latest.first

and

    builds.latest.success.first

If we put success first, that latest would also filter via success,
and which is what we want here.
2016-07-12 23:15:08 +08:00
Lin Jen-Shin 2b728ed3da Just give regular 404, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5094#note_12984211
2016-07-11 20:04:46 +08:00
Lin Jen-Shin 1f733a95c7 Remove redundant return 2016-07-11 19:06:40 +08:00
Lin Jen-Shin df5b78676e Using plain if/else is much easier to understand 2016-07-11 19:06:14 +08:00
Lin Jen-Shin ef833a2205 Give latest succeeded one, don't give pending/running ones 2016-07-11 18:51:23 +08:00
Lin Jen-Shin f601ec54fc Introduce Projects::ArtifactsController#search:
So we redirect from ref and build_name to the particular build, namely:

* /u/r/artifacts/ref/build_name/* -> /u/r/builds/:build_id/artifacts/*

For:

* download
* browse
* file
2016-07-11 18:17:32 +08:00