Commit Graph

1462 Commits

Author SHA1 Message Date
Diego Silva 091b15b742 Change DetectRepositoryLanguagesWorker to not receive user
Fixes #60425
2019-05-09 16:54:20 +01: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 89132bbdd6 Add gitlab-managed option to clusters form
When this option is enabled, GitLab will create namespaces and service
accounts as usual. When disabled, GitLab wont create any project
specific kubernetes resources

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56557
2019-05-03 01:05:53 +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
Thong Kuah abb530a619 DELETE clusters/:id/:application endpoint
Add endpoint to delete/uninstall a cluster application
2019-04-29 22:55:12 -07: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
Grzegorz Bizon 674e5e5baa Merge branch '57171-operations-controller-spec-refactor' into 'master'
Refactor operations controller spec

Closes #57171

See merge request gitlab-org/gitlab-ce!27558
2019-04-26 11:50:39 +00:00
rpereira2 e7e9929e0d Fix a bug in shared_examples definition 2019-04-25 16:06:17 +05:30
syasonik 8926b37d5b Prefer safe_load and deep_symbolize_keys 2019-04-25 14:00:51 +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 a08d4cad90 Defend against dashboard errors, rework sequence 2019-04-24 18:23:04 +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 3d302879f4 Add unit tests and fix broken endpoint 2019-04-24 18:23:03 +08:00
rpereira2 9f9bb16cdf Move shared context to top of spec file
- Rename the shared_context
- Use expect in stub_operations_update_service_returning.
2019-04-24 12:01:29 +05:30
rpereira2 113c7af4c2 Refactor operations controller spec
- Move specs into a shared_context so that they can be reused.
- Move common specs out of a more specific context.
2019-04-22 23:58:27 +05:30
Stan Hu 5d74c95c98 Check that source and target branch exist
This ensures the return value is consistent if the source and/or
branch do not exist.
2019-04-18 22:01:51 -03: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
Rémy Coutable b40ea0f1e2 Merge branch 'sh-validate-ref-name-in-commit' into 'master'
Validate refs used in controllers don't have spaces

Closes #58572 and gitaly#1425

See merge request gitlab-org/gitlab-ce!24037
2019-04-15 13:30:50 +00:00
gfyoung 93a44e135b Add some frozen string to spec/**/*.rb
Adds frozen string to the following:

* spec/bin/**/*.rb
* spec/config/**/*.rb
* spec/controllers/**/*.rb

xref https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-04-15 10:17:05 +00:00
Stan Hu e675fe4621 Validate refs used in controllers don't have spaces
This avoids an unnecessary call to Gitaly and reduces gRPC errors.

* Closes https://gitlab.com/gitlab-org/gitaly/issues/1425
* Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58572
2019-04-14 15:26:25 -07:00
Thong Kuah d119d3d1b2 Align UrlValidator to validate_url gem implementation.
Renamed UrlValidator to AddressableUrlValidator to avoid 'url:' naming collision with ActiveModel::Validations::UrlValidator in 'validates' statement.
Make use of the options attribute of the parent class ActiveModel::EachValidator.
Add more options: allow_nil, allow_blank, message.
Renamed 'protocols' option to 'schemes' to match the option naming from UrlValidator.
2019-04-11 06:29:07 +00:00
Imre Farkas 9bc5ed14fe Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-09 15:38:58 +00:00
Nick Thomas a6218f1bcd Merge branch 'osw-multi-assignees-merge-requests' into 'master'
[Backport] Support multiple assignees for merge requests

See merge request gitlab-org/gitlab-ce!27089
2019-04-09 15:19:36 +00:00
Sarah Yasonik 193e660291 Resolve Environments#additional_metrics TypeError, ensure unix format 2019-04-09 09:54:17 +00:00
Jason Goodman 5b7003282b Set release name when adding release notes to an existing tag
Also set the release sha and author
2019-04-09 06:52:15 +00:00
Oswaldo Ferreira ca884980ee [CE] Support multiple assignees for merge requests
Backports https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10161
(code out of ee/ folder).
2019-04-08 18:40:00 -03:00
Stan Hu 021e8790c6 Enable Gitaly FindCommit caching for TreeController
Accessing /namespace/project/tree/master appears to query
FindCommit 5 times with identical parameters. This reduces
the number of FindCommit queries to 1.
2019-04-07 20:59:40 -07:00
Stan Hu 0d8e9f6ee3 Expand FindCommit caching to blob and refs
This enables FindCommit caching to the following actions:

* BlobController#show
* RefsController#logs_tree

It also improves caching in CommitsController since some
duplicate requests were occuring inside the before_action
definitions.
2019-04-06 05:16:22 -07:00
Chris Baumbauer b77fe7db3e Add Knative metrics to Prometheus 2019-04-06 02:02:39 +00:00
Andreas Brandl 0cf23a7f50 Merge branch 'revert-3962b00b' into 'master'
Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"

See merge request gitlab-org/gitlab-ce!27051
2019-04-05 14:28:34 +00:00
Andreas Brandl 46b1b9c1d6 Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"
This reverts merge request !26823
2019-04-05 13:02:56 +00:00
Stan Hu f1dce21609 Enable FindCommit caching for project and commits pages
This reduces a handful of duplicate FindCommit calls while viewing the
projects and commits pages.
2019-04-05 04:52:42 -07:00
Imre Farkas d9d7237d2e Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-05 11:45:47 +00:00
Sean McGivern 5b273d355f Merge branch '58375-api-controller' into 'master'
Add a prometheus proxy API per environment

Closes #58375

See merge request gitlab-org/gitlab-ce!26841
2019-04-05 09:21:08 +00:00
Thong Kuah 4ec16912b8 Autocorrect with RSpec/ExampleWording cop
- rewords examples starting with 'should'
- rewords examples starting with 'it'

Note: I had to manually fixup "onlies" to "only"
2019-04-05 08:43:27 +00:00
Stan Hu f2fa7c3299 Fix and expand Gitaly FindCommit caching
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26248 added
support for deduplicating FindCommit requests using Gitaly ref name
caching. However, not all endpoints were covered, and in one case the
Gitaly wrapper wasn't actually surrounding the serialization step. We
can safely cache ref names between FindCommit calls for #index and #show
endpoints for merge requests and pipelines. This can significantly
reduce the number of FindCommit requests.
2019-04-04 13:42:58 -07:00
rpereira2 20594de8cc Use environment_params when defining expected_params 2019-04-05 02:12:34 +05:30
rpereira2 e89b073271 Do not hardcode project and namespace name in url
The names can change in different runs of the spec.
2019-04-05 02:12:34 +05:30
rpereira2 5ee7c419ea Call permit! on params 2019-04-05 02:12:34 +05:30
rpereira2 16772b91f0 Remove permitting of params
- It is now being done in ProxyService class.
2019-04-05 02:12:33 +05:30
rpereira2 eac3e2302c Add spec for invalid environment id 2019-04-05 02:12:33 +05:30
Peter Leitzen 4a0c8b4a9c Make filter params specs more readable 2019-04-05 02:12:33 +05:30
Peter Leitzen 1427ad4f5c Streamline controller specs 2019-04-05 02:12:33 +05:30
rpereira2 e1a167ee23 Add a Prometheus API per environment
The api will proxy requests to the environment's prometheus server.
The Prometheus::ProxyService class can be reused when we add support for
group prometheus servers.
2019-04-05 02:12:33 +05:30
Francisco Javier López 8a134f4c65 Renamed terminal_specification to channel_specification
We're moving from using terminology related to terminals when
we refer to Websockets connections in Workhorse.
It's more appropiate a concept like channel.
2019-04-04 18:32:02 +00:00
syasonik ab1e1b55a8 Specify time window for additional metrics api
Adds support for start and end parameters in the #additional_metrics
endpoint of the EnvironmentsController. start and end are meant to be
unix timestamps, per the Prometheus API (as the consumer of this
endpoint will eventually be transitioned to a prometheus endpoint).
This functionality is behind the :metrics_time_window feature flag
for development.
2019-04-03 17:21:56 +08:00