Commit Graph

19 Commits

Author SHA1 Message Date
James Edwards-Jones bedb9a3e6d Avoid passing not_found_or_authorized_proc around
Since this needs to be called on every find_routable!(Project, ...
we can instead move it to a RoutableActions check.
2019-05-15 17:36:50 +07:00
Thong Kuah 1a1fdf8efe Resolve controller sharing concern
Use ClustersController as base while having Projects::ClustersController
to inform what `clusterable` is. Thanks @ayufan for the great suggestion
!

- View changes to work with new approach

- Fix javascript for new approach

- Fix feature specs for new approach

- Fix QA
2018-11-01 19:37:33 +13:00
Thong Kuah 5b3c096c9e Convert clusters to use a top-level controller
In preparation so that we can create both cluster attached to project
and cluster attached to group.

- Move ClustersController to top level

- Move Clusters::ApplicationsController to top-level too

- Creates a Clusters::BaseController to share common functions

- Do not rely on @project ivar. Anything could set the ivar.

- Fix Vue page components due to new data-page value

Because of the controller change we have gone from
`projects:clusters:new` to `clusters:new`, so we need to update the file
location of the page components. There is somewhere a function that will
convert data-page to a file location.

On that note, projects/clusters/gcp/new/, translate to
Projects::Clusters::Gcp#new doesn't exist so replace that with
clusters/create_gcp/ and clusters/create_user/
2018-11-01 18:38:36 +13:00
Thong Kuah 504cbb27c1 Remove un-used inheritance from service
Remove the inheritance from ::BaseService which is causing us to inherit
the initializer that has project as the first arg, as we will not have
access to project with forthcoming group clusters.

Also call install service from create service - 1 less thing to re-use

Extract TestRequest code into a spec helper. Given that we need
different behaviour for Rails 5.0 (and again in Rails 5.1!), it's handy
to have that branching behaviour in one place
2018-10-15 11:09:10 +13:00
Thong Kuah cc1ccbf83a Move non-controller code into dedicated service
This should help with code re-use when we create applications for group
level cluster next.

Change `find_or_initialize_by` to explicitly find or build the right
association based on the application name. The benefit here is that we
use the associations on @cluster rather than querying from the other
side of the association.
2018-10-15 11:07:47 +13: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
Dmitriy Zaporozhets dbbcffa186
Pass request to oauth creation during cluster app install
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-06-07 13:27:07 +03:00
Dmitriy Zaporozhets 6f5206178d
Fix exception in clusters/applications_controller.rb
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-05-30 14:11:46 +03:00
Dmitriy Zaporozhets c075a047cd
Refactor cluster app creation code in controller
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-05-30 12:02:45 +03:00
Dmitriy Zaporozhets b3cf153082 Add oauth reference to jupyter cluster app
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-05-25 17:16:41 +03:00
Dmitriy Zaporozhets 4220e914db Add support for Jupyter in GitLab via Kubernetes
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-05-25 17:16:41 +03:00
Dmitriy Zaporozhets cf996685be
Refactor code around scheduling cluster installations
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-05-24 12:31:36 +03:00
Alessio Caiazza f676f38815
Add more tests to Projects::Clusters::ApplicationsController 2017-11-06 18:21:10 +01:00
Alessio Caiazza c0299ce494
Add Projects::Clusters::ApplicationsController tests 2017-11-03 16:40:13 +01:00
Alessio Caiazza e6616e0468 Fix typos 2017-11-03 13:55:44 +01:00
Alessio Caiazza 49210dfff1
Schedule k8s application installation with a service 2017-11-03 11:10:50 +01:00
Kamil Trzcinski 30938b898c Fix and add applications controller 2017-11-02 15:31:25 +01:00
Kamil Trzcinski 64be8d70ae Improve backend structure of data 2017-11-02 15:10:46 +01:00