Commit Graph

58 Commits

Author SHA1 Message Date
GitLab Bot 418a39f6c2 Add latest changes from gitlab-org/gitlab@master 2021-04-07 00:09:26 +00:00
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
Dennis Tang dc31dac219 Merge remote-tracking branch 'origin/master' into 43446-new-cluster-page-tabs 2018-06-19 15:27:39 +00:00
Dennis Tang ce0ce1cb19 consolidate back into one controller 2018-06-19 15:01:43 +00: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
Dennis Tang f00c1b7f47 rubocop fix 2018-06-06 08:43:23 -07:00
Dennis Tang 08d513a59e redirect back to form if token expires 2018-06-05 21:47:09 -07:00
Dennis Tang edb89f555b split into gcp and user controllers again 2018-06-05 20:04:40 -07:00
Dennis Tang a5217676ed Merge remote-tracking branch 'origin/master' into 43446-new-cluster-page-tabs
# Conflicts:
#	doc/user/project/clusters/index.md
2018-06-01 21:27:18 -07:00
Dmitriy Zaporozhets ef5282ee36 Merge remote-tracking branch 'origin/master' into 46487-add-support-for-jupyter-in-gitlab-via-kubernetes 2018-05-30 14:26:54 +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
Matija Čupić 1e431464ff
Move token_in_session to helper method 2018-05-28 19:23:27 +02:00
Dennis Tang 1a30e153a8 combine "create" and "existing" GKE cluster views into one new page
# Conflicts:
#	app/controllers/projects/clusters/gcp_controller.rb
#	app/views/projects/clusters/gcp/_form.html.haml
2018-05-26 00:15:00 +02:00
Dennis Tang 95a63a8816 Merge remote-tracking branch 'origin/master' into 38759-fetch-available-parameters-directly-from-gke-when-creating-a-cluster 2018-05-25 23:56:17 +02: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
Matija Čupić 534bb0b617
Remove list_projects action from Google API check 2018-05-02 17:28:21 +02:00
Matija Čupić 6472025ea3
Remove Projects::Clusters::GcpController#list_projects 2018-05-02 17:24:55 +02:00
Matija Čupić 444cee56cb
Use ListGcpProjectsWorker#read_projects instead of get_projects 2018-04-23 17:09:35 +02:00
Matija Čupić 45dadeec7d
Remove the GCP billing verification step 2018-04-20 21:58:53 +02:00
Matija Čupić e3176c2014
Store projects in ListGcpProjectsWorker 2018-04-20 19:14:43 +02:00
Matija Čupić 3b1612515f
Rename CheckGcpProjectBillingWorker to ListGcpProjectsWorker 2018-04-20 17:02:48 +02:00
Matija Čupić e911a0f896
Expose CloudPlatform::Client#projects_list as GcpController#list_projects 2018-03-16 18:42:30 +01:00
Matija Čupić 7c5968788c
Do not persist Google Project Billing Failure errors after a reload 2018-02-22 22:59:04 +01:00
Matija Čupić 0215435058
Refactor CheckGcpProjectBillingWorker 2018-02-12 21:32:55 +01:00
Winnie Hellmann 0ecd759d73 Replace "cluster" with "Kubernetes cluster" 2018-02-06 10:05:02 +01:00
Matija Čupić e6012d3ecc
Change failed GCP billing check wording 2018-01-11 07:17:06 +01:00
Matija Čupić 0b294fc2bb
Use new tab for link in flash 2018-01-11 06:10:14 +01:00
Kamil Trzciński 0cdd56e658 Fix link to billing 2018-01-10 15:44:15 +01:00
Kamil Trzciński cf6258af41 Fix billing checking 2018-01-10 15:23:22 +01:00
Matija Čupić b44583e9c6
Extract GCP billing check as method 2018-01-10 14:35:52 +01:00
Matija Čupić e7a8564f39
Refactor GCP session token exchange scheme 2018-01-07 16:18:53 +01:00
Matija Čupić d13be3c2d9
Store OAuth token in Redis for worker to pick up 2018-01-06 19:41:49 +01:00
Matija Čupić b4e9e07cdd
Remove polling interval from GcpController 2018-01-05 00:09:33 +01:00
Matija Čupić e395a2c190
Implement GCP billing check in cluster form 2017-12-21 19:25:28 +01:00
Matija Čupić 59c7f46e2a
Remove actions for async GCP project billing check 2017-12-21 19:02:06 +01:00
Matija Čupić 305bce8d24
Merge branch 'master' into 39957-redirect-to-gpc-page-if-users-try-to-create-a-cluster-but-the-account-is-not-enabled 2017-12-21 18:30:34 +01:00
Matija Čupić 9616e70a08
Allow environment_scope in cluster controllers 2017-12-16 17:28:59 +01:00
Matija Čupić 886fd13fce
Add Worker rerun action to GcpController 2017-12-16 17:02:26 +01:00
Matija Čupić 6c0fd3c22d
Handle html format in addition to json 2017-12-16 05:31:53 +01:00
Matija Čupić 914260930f
Expand controller test suite matrix 2017-12-16 05:26:07 +01:00
Matija Čupić 935a27cfef
Use 1 minute for status polling interval 2017-12-16 04:22:16 +01:00