Commit Graph

2572 Commits

Author SHA1 Message Date
Kartikey Tanna fa3aa0c5a7 #61441 Allow user to set email ID before setting up 2FA 2019-05-22 07:59:15 +00:00
Sarah Yasonik ec399e6565 Require time window params in metrics dashboard 2019-05-20 15:04:04 +00:00
Nick Thomas 2bde9de608 Merge branch 'reg-captcha-flag' into 'master'
Add :registrations_recaptcha feature flag

Closes gitlab-ee#11389

See merge request gitlab-org/gitlab-ce!28296
2019-05-16 14:19:01 +00:00
Luke Bennett 9d3676846c
Add :registrations_recaptcha feature flag
Allows instance owners to toggle the recaptcha requirement
on the user registration page by feature flag.
Allows GitLab Growth team to measure
reCAPTCHA's impact on registrations.
2019-05-16 12:59:14 +01:00
Rémy Coutable 3ed2755364 Merge branch 'ce-jej/sso-enforcement-redirect' into 'master'
Refactor RoutableActions to allow additional not_found checks

See merge request gitlab-org/gitlab-ce!28243
2019-05-15 12:32: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
James Edwards-Jones 0f6500d5a7 Added RoutableActions tests 2019-05-15 11:54:25 +07:00
Sean McGivern 79dd92c818 Optimise upload path calls
String#underscore isn't particularly slow, but it's possible for us to
call it many times in a users autocomplete request, with mostly-static
values ('User', 'Group', etc.). We can memoise this and save a
surprising amount of time (around 10% of the total request time in some
cases).
2019-05-14 11:01:48 -05:00
Diego Silva 091b15b742 Change DetectRepositoryLanguagesWorker to not receive user
Fixes #60425
2019-05-09 16:54:20 +01:00
James Fargher c40a99a058 Change specs to match gitlab code standards 2019-05-07 08:37:04 +12:00
James Fargher 265dee5cc6 Stop using `go` function in clusters controller specs 2019-05-07 08:37:04 +12:00
James Fargher beb66cfcba Check instance cluster feature at policy level
Try to simplify feature flag checks by using policies
2019-05-07 08:37:04 +12:00
James Fargher 733da6d6a0 Instance level kubernetes clusters admin
Instance level clusters were already mostly supported, this change adds
admin area controllers for cluster CRUD
2019-05-07 08:37:03 +12: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
Dylan Griffith eae0fc2bcd Remove xit test for uninstall group cluster app 2019-04-29 22:55:12 -07: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
Stan Hu f04f6909ce Merge branch '60906-fix-wiki-links' into 'master'
Use wiki partial in search results

Closes #60906

See merge request gitlab-org/gitlab-ce!27634
2019-04-25 22:18:49 +00:00
Mario de la Ossa d60d50d6ba
Use wiki partial in search results 2019-04-25 14:58:08 -06: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
Rémy Coutable a16d7e414d
Revert Rails.application.env_config after using mock_auth_hash
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-04-23 21:11:08 +02:00
Kamil Trzciński 5b154dafdf Merge branch '60569-timeline-entry-label-link-is-not-applying-the-filter-on-issues' into 'master'
Adds `label_name` back as a scalar param in `IssuableFinder`

Closes #60569

See merge request gitlab-org/gitlab-ce!27507
2019-04-23 10:21:25 +00:00
Heinrich Lee Yu ff627511c0 Add label_name as scalar param of IssuableFinder
This was removed by a previous MR but broke some links
2019-04-23 08:42:04 +08:00
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
Andrew Newdigate 4f4de36cac Migrate correlation and tracing code to LabKit
This change is a fairly straightforward refactor to extract the tracing
and correlation-id code from the gitlab rails codebase into the new
LabKit-Ruby project.

The corresponding import into LabKit-Ruby was in
https://gitlab.com/gitlab-org/labkit-ruby/merge_requests/1

The code itself remains very similar for now.

Extracting it allows us to reuse it in other projects, such as
Gitaly-Ruby. This will give us the advantages of correlation-ids and
distributed tracing in that project too.
2019-04-18 09:57:16 +02: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