Commit Graph

3627 Commits

Author SHA1 Message Date
James Edwards-Jones c7d9d462ec Avoid setting Gitlab::Session on Git HTTP requests 2019-06-05 19:07:20 +01:00
Filipa Lacerda cb18dfea05 Merge branch '28996-create-mvc-ui-in-haml' into 'master'
Add Let's Encrypt option in Pages domain new/edit Haml form

See merge request gitlab-org/gitlab-ce!26438
2019-06-05 13:40:58 +00:00
Grzegorz Bizon 0b864208e4 Merge branch '58941-use-gitlab-serverless-with-existing-knative-installation' into 'master'
Resolve "Use GitLab serverless with existing Knative installation"

Closes #58941

See merge request gitlab-org/gitlab-ce!27173
2019-06-04 11:20:09 +00:00
Nathan Friend 6610f2fdcb
Add auto SSL toggle to Pages domain settings page
This commit adds an auto SSL toggle switch to the settings page of
GitLab Pages domains.  This toggle enable or disabled auto SSL
management via Let's Encrypt.  Toggling the button dynamically
updates the form using client-side JavaScript.  All changes are behind
feature flags.
2019-06-03 19:20:20 -03:00
Douwe Maan 96ff9c6bd8 Merge branch 'osw-sync-merge-ref-upon-mergeability-check' into 'master'
Automatically update MR merge-ref along merge status

Closes #58495

See merge request gitlab-org/gitlab-ce!28513
2019-06-03 16:29:41 +00:00
Yorick Peterse 6cb750a2bb
Merge dev.gitlab.org master into GitLab.com master 2019-06-03 14:56:33 +02:00
Shinya Maeda d4b4693663 Abstract auto merge processes
We have one auto merge strategy today - Merge When Pipeline
Succeeds.

In order to add more strategies for Merge Train feature,
we abstract the architecture to be more extensible.

Removed arguments

Fix spec
2019-06-03 13:15:29 +07:00
Oswaldo Ferreira b965009ddd Automatically update MR merge-ref along merge status
This couples the code that transitions the `MergeRequest#merge_status`
and refs/merge-requests/:iid/merge ref update.

In general, instead of directly telling `MergeToRefService` to update
the merge ref, we should rely on `MergeabilityCheckService` to keep
both the merge status and merge ref synced. Now, if the merge_status is
`can_be_merged` it means the merge-ref is also updated to the latest.

We've also updated the logic to be more systematic and less user-based.
2019-05-31 19:16:01 -03:00
Igor Drozdov 3d4821a8e7 Hide password on import by url form 2019-05-29 14:03:50 +03:00
João Cunha a2aa160cea Adapt functions to work for external Knative
Remove Kn services cache from Clusters::Application::Knative

Knative function can exist even if user did not installed Knative via
GitLab managed apps.

-> Move responsibility of finding services into the Cluster
-> Responsability is inside Clusters::Cluster::KnativeServiceFinder
-> Projects::Serverless::FunctionsFinder now calls depends solely on a
cluster to find the Kn services.
-> Detect Knative by resource presence instead of service presence
-> Mock knative_installed response temporarily for frontend to develop

Display loader while `installed === 'checking'`

Added frontend work to determine if Knative is installed

Memoize with_reactive_cache(*args, &block) to avoid race conditions

When calling with_reactive_cache more than once, it's possible that the
second call will already have the value populated. Therefore, in cases
where we need the sequential calls to have consistent results, we'd fall
under a race condition.

Check knative installation via Knative resource presence

Only load pods if Knative is discovered

Always return a response in FunctionsController#index

- Always indicate if Knative is installed, not installed or checking
- Always indicate the partial response for functions. Final response is
guaranteed when knative_installed is either true | false.

Adds specs for Clusters::Cluster#knative_services_finder

Fix method name when calling on specs

Add an explicit check for functions

Added an explicit check to see if there are any functions available

Fix Serverless feature spec

- we don't find knative installation via database anymore,
rather via Knative resource

Display error message for request timeouts

Display an error message if the request times out

Adds feature specs for when functions exist

Remove a test purposed hardcoded flag

Add ability to partially load functions

Added the ability to partially load functions on the frontend

Add frontend unit tests

Added tests for the new frontend additions

Generate new translations

Generated new frontend translations

Address review comments

Cleaned up the frontend unit test.
Added computed prop for `isInstalled`.

Move string to constant

Simplify nil to array conversion

Put knative_installed states in a frozen hash for better read

Pluralize list of Knative states

Quey services and pods filtering name

This way we don't need to filter the namespace in memory.
Also, the data we get from the network is much smaller.

Simplify cache_key and fix bug

- Simplifies the cache_key by removing namespace duplicate
- Fixes a bug with reactive_cache memoization
2019-05-29 11:21:53 +01:00
Sarah Yasonik ec399e6565 Require time window params in metrics dashboard 2019-05-20 15:04:04 +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
Adriel Santiago 3565ee2ed6 Add external dashboard link
Add settings for linking to external dashboard from
metrics dashboard
2019-05-07 14:47:09 +00:00
Luke Bennett 18c07084a6 Destroy repo mirrors instead of disabling them
It is important to destroy data related to repo mirrors when they are
disabled.
Use `_destroy` nested attribute instead of `enabled` for push mirrors.
Call `remove_import_data` after saving a project if its pull mirror is
disabled.
2019-05-06 13:15:03 +00:00
Krasimir Angelov 85609c117e Implement support for CI variables of type file
Add env_var and file as supported types for CI variables. Variables of
type file expose to users existing gitlab-runner behaviour - save
variable value into a temp file and set the path to this file in an ENV
var named after the variable key.

Resolves https://gitlab.com/gitlab-org/gitlab-ce/issues/46806.
2019-05-06 13:11:42 +00:00
Mayra Cabrera 5432f5480f Adds a way to start multiple manual jobs in stage
- Adds an endpoint on PipelinesController
- Adds a service that iterates over every build in a stage and
plays it.
- Includes 'play_manual' details on EntitySerializer
- Builds a new Stage state: PlayManual. An stage can take this status if
it has manual builds or an skipped, scheduled or manual status
- Includes FE modifications and specs
2019-05-02 18:27:35 +00:00
Sarah Yasonik 552a3d2fd9 Update metrics dashboard API to load yml from repo
Updates the EnvironmentController#metrics_dashboard endpoint
to support a "dashboard" param, which can be used to specify
the filepath of a dashboard configuration from a project
repository. Dashboard configurations are expected to be
stored in .gitlab/dashboards/.

Updates dashboard post-processing steps to exclude custom
metrics, which should only display on the system dashboard.
2019-05-01 10:16:03 +00:00
Ash McKenzie 5d5b9d57de Merge branch '60476-actionview-missingtemplate-missing-template-projects-issues-_merge_requests-with-locale-en-formats-html-varian' into 'master'
Delete leftover code for referenced_merge_requests endpoint

Closes #60476

See merge request gitlab-org/gitlab-ce!27335
2019-04-30 00:34:49 +00:00
Peter Leitzen 80fec5c329 Load environment metrics only for JSON endpoint
When showing the HTML version of the environment metrics we don't need
to fetch their metrics because we don't use them anymore on the HTML
version.

We use additional_metrics.json endpoint now.
2019-04-29 10:25:31 +00:00
Grzegorz Bizon 536d96a3e0 Merge branch '60383-setup-dashboard-endpoint' into 'master'
Create dashboards endpoint & setup dashboard post-processing

Closes #60383

See merge request gitlab-org/gitlab-ce!27405
2019-04-28 11:53:12 +00:00
Reuben Pereira 4376167a04 Add ProjectMetricsDashboardSetting model and table
This new table will be used to store the external_dashboard_url which
allows users to add a link to their external dashboards (ex Grafana)
to the Metrics dashboard.
2019-04-26 17:23:26 +00:00
syasonik 4a5c48c47c Move MetricsDashboard to Metrics::Dashboard 2019-04-25 13:35:05 +08:00
Francisco Javier López dde69bfb2a Added list_pages method to avoid loading all wiki pages content
Inside a wiki, when we show the sidebar or browse to the `pages`,
all page contents are retrieved from Gitaly and that is a waste
of resources, since no content from that pages are going to be
showed.

This MR introduces the method `ProjectWiki#list_pages`,
which uses new wiki_list_pages RPC call to retrieve
pages without content

Also in the `WikisController` we're using the method to show
pages in the sidebar and also on the `pages` page.
2019-04-25 04:19:07 +00:00
Matija Čupić 163730f0a2
Redirect to settings page on invalid update 2019-04-24 15:44:12 +02:00
syasonik dde709912f Rubocop 2019-04-24 18:23:04 +08:00
syasonik a08d4cad90 Defend against dashboard errors, rework sequence 2019-04-24 18:23:04 +08:00
syasonik 25f957711d Remove extra space 2019-04-24 18:23:04 +08:00
syasonik 131494f26f Refactor metrics_dashboard response conditionals 2019-04-24 18:23:04 +08:00
syasonik c1c0fb6693 Make EE interactions and transformations cleaner 2019-04-24 18:23:04 +08:00
syasonik 655fae4242 Reduce cognitivty complexity more 2019-04-24 18:23:04 +08:00
syasonik 1edbf97e25 Try to reduce complexity again 2019-04-24 18:23:04 +08:00
syasonik 57e0d474c2 Reduce congnitive complexity 2019-04-24 18:23:03 +08:00
syasonik 671f698845 Bring in line with EE needs 2019-04-24 18:23:03 +08:00
rpereira2 4a9002cee3 Inherit from BaseService
Change MetricsDashboard::Service to inherit from BaseService so that
it can reuse methods like initialize, success, error.
2019-04-24 18:23:03 +08:00
syasonik 35c412327c Refactor dashboard proccesing into stages 2019-04-24 18:23:03 +08:00
syasonik c9253c3eeb Rubocop cleanup 2019-04-24 18:23:03 +08:00
syasonik 3d302879f4 Add unit tests and fix broken endpoint 2019-04-24 18:23:03 +08:00
syasonik 18183f404e Use existing common metrics 2019-04-24 18:23:03 +08:00
syasonik 185ec80751 Save multi-dashboard logic for another MR 2019-04-24 18:23:03 +08:00
syasonik a2920682ec Add inital dashboard endpoint support 2019-04-24 18:23:03 +08:00
Lin Jen-Shin a96507bf00 Introduce ServiceResponse to wrap around response
See https://gitlab.com/gitlab-org/gitlab-ce/issues/60730
2019-04-22 17:16:32 +08:00
Patrick Derichs 613ce6446e Aligned IssuesController implementation with EE 2019-04-18 08:20:58 +02:00
Nick Thomas 2845e8d973
Revert "Revert "Merge branch '24704-download-repository-path' into 'master'""
This reverts commit 171818df0a.
2019-04-16 15:16:23 +01:00
Kamil Trzciński c16619c527 Merge branch 'mc/feature/custom-metrics-ce' into 'master'
Backport metrics report type

See merge request gitlab-org/gitlab-ce!26798
2019-04-16 12:54:47 +00:00
Matija Čupić 0cfa25ff21
Backport changes from EE
This backports the changes from
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10452
2019-04-16 13:06:52 +02:00
Lin Jen-Shin 57cdf56aa7 Merge branch 'forbid-the-usage-of-reload' into 'master'
Forbid the usage of reload

Closes #60218

See merge request gitlab-org/gitlab-ce!27125
2019-04-15 15:52:12 +00:00
Reuben Pereira 434359446a Add ability to do variable substitution
- In prometheus proxy api, allow variables to be replaced. For example,
if 'up{env="%{ci_environment_slug}"}' is passed to the endpoint, it
becomes 'up{env="production"}' before being sent to prometheus.
2019-04-15 15:31:59 +00:00
Horatiu Eugen Vlad 0aa56d895d Added write_repository scope for personal access token 2019-04-15 13:05:55 +00:00
Kamil Trzciński 650f40865e Forbid the use of `#reload` and prefer `#reset`
The `#reload` makes to load all objects into memory,
and the main purpose of `#reload` is to drop the association cache.

The `#reset` seems to solve exactly that case.
2019-04-15 13:05:14 +02:00
Fatih Acet cf02657234
Delete leftover code for referenced_merge_requests
We rewrote Related MRs widget using Vue.
The previous implementation was using Haml templates
and calling referenced_merge_requests endpoint which is
now deprecated. This MR deletes leftover stuff them.
2019-04-15 09:02:50 +02:00