Commit Graph

50 Commits

Author SHA1 Message Date
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
Lin Jen-Shin 28e324ae67 Use Gitlab-Workhorse-Send-Data to send entry:
Closes #19224, Closes #19128

Also requires this MR to work:
https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/53
2016-07-05 22:58:38 +08:00
Kamil Trzcinski 7e9273dd94 Test controllers if they allow to keep artifacts 2016-06-13 11:07:23 +01:00
Kamil Trzcinski c59947112f Validate existence of artifacts in ArtifactsController, render 404 if not found 2016-06-13 11:03:30 +01:00
Kamil Trzcinski ffe8dbde9b Move keep to ArtifactsController 2016-06-13 11:03:30 +01:00
Tomasz Maczukin 1f608ac461
Remove 'unscoped' from project builds selection 2016-06-04 00:02:40 +02:00
Kamil Trzcinski 055afab5c7 Make the CI permission model simpler
This MR simplifies CI permission model:
- read_build: allows to read a list of builds, artifacts and trace
- update_build: allows to cancel and retry builds
- create_build: allows to create builds from gitlab-ci.yml (not yet implemented)
- admin_build: allows to manage triggers, runners and variables
- read_commit_status: allows to read a list of commit statuses (including the overall of builds)
- create_commit_status: allows to create a new commit status using API

Remove all extra methods to manage permission.
Made all controllers to use explicitly the new permissions.
2016-02-02 09:18:08 +01:00
Grzegorz Bizon 6b2f38f39a Fix nonexistent method in artifacts controller 2016-01-15 13:48:29 +01:00
Grzegorz Bizon 6b0a43aff3 Improve readability of artifacts browser `Entry` related code 2016-01-14 12:48:17 +01:00
Grzegorz Bizon 487b0a026f Improvements, readability for artifacts browser 2016-01-14 12:48:16 +01:00
Grzegorz Bizon e9c2628220 Check if file exists in metadata in download action 2016-01-14 12:48:16 +01:00
Grzegorz Bizon 09a4a5aff8 Render only valid paths in artifacts metadata
In this version we will support only relative paths in artifacts
metadata. Support for absolute paths will be introduced later.
2016-01-14 12:48:16 +01:00
Grzegorz Bizon 61fb47a432 Simplify implementation of build artifacts browser (refactoring) 2016-01-14 12:48:15 +01:00
Grzegorz Bizon cd3b8bbd2f Add method that checks if path exists in `StringPath` 2016-01-14 12:48:15 +01:00
Grzegorz Bizon a5e1905d28 Render 404 when artifacts path is invalid 2016-01-14 12:48:15 +01:00
Grzegorz Bizon a7f99b67a0 Extract artifacts metadata implementation to separate class 2016-01-14 12:48:15 +01:00
Grzegorz Bizon 3de8a4620a Parse artifacts metadata stored in JSON format 2016-01-14 12:48:15 +01:00
Grzegorz Bizon 447f56036e Use metadata stored in artifacats metadata file 2016-01-14 12:48:14 +01:00
Grzegorz Bizon 662f4b9e1d Add artifacts metadata uploader filed
Artifacts metadata field will be used to store a filename of gzipped
file containing metadata definition for given artifacts archive.
2016-01-14 12:48:14 +01:00
Grzegorz Bizon 8eeed761a9 Update specs for CI Build, add `artifacts?` method
`artifacts?` method checks if artifacts archive is available.
2016-01-14 12:48:14 +01:00
Grzegorz Bizon ebd69c5fc1 Remove artifacts metadata column from database 2016-01-14 12:48:13 +01:00
Grzegorz Bizon 5a1faf61f6 Add artifacts browser
This implementation makes it possible to browse artifacts, it
depends on artifacts metadata.
2016-01-14 12:48:13 +01:00
Grzegorz Bizon 80a71576ba Use `Gitlab::StringPath` in CI build artifacts controller 2016-01-14 12:48:13 +01:00
Grzegorz Bizon f091272f19 Move artifacts controller level up
This reverts nesting artifacts controller in builds module.
2016-01-14 12:48:12 +01:00