Commit Graph

1603 Commits

Author SHA1 Message Date
Grzegorz Bizon 1068ec2e92 Merge branch '66741-remove-spec-rails_helper-rb' into 'master'
Remove spec/rails_helper.rb

Closes #66741

See merge request gitlab-org/gitlab-ce!32380
2019-09-03 13:48:17 +00:00
Filipa Lacerda 288e709cb7 Creates Feature Flag for job log
Updates frontend code and specs to allow for the new
feature flag
2019-08-30 21:51:30 +00:00
Ash McKenzie 19ff9d9899
Replace rails_helper.rb with spec_helper.rb
rails_helper.rb's only logic was to require
spec_helper.rb.
2019-08-30 12:26:18 +10:00
Robert Speicher 7698d40550
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2019-08-29 17:17:37 -05:00
GitLab Release Tools Bot 21b5239a00 Merge branch 'security-2853-prevent-comments-on-private-mrs' into 'master'
Ensure only authorised users can create notes on merge requests and issues

See merge request gitlab/gitlabhq!3137
2019-08-29 21:34:27 +00:00
GitLab Release Tools Bot 7d6ec7f7ed Merge branch 'security-fix_jira_ssrf_vulnerability' into 'master'
Fix DNS rebind vulnerability for JIRA integration

See merge request gitlab/gitlabhq!3266
2019-08-29 21:34:17 +00:00
GitLab Release Tools Bot e20fb7cb39 Merge branch 'security-mr-head-pipeline-leak' into 'master'
Permission fix for MergeRequestsController#pipeline_status

See merge request gitlab/gitlabhq!3274
2019-08-29 21:34:10 +00:00
GitLab Release Tools Bot 70818d3d68 Merge branch 'security-ci-metrics-permissions' into 'master'
Restrict MergeRequests#test_reports to authenticated users with read-access on Builds

See merge request gitlab/gitlabhq!3329
2019-08-29 21:33:55 +00:00
Stan Hu f6c7e38040 Make it harder to delete issuables accidentally
Previously submitting a DELETE request to an issuable URL would be
enough to destroy it, but this should require human confirmation.  We
now require that the `destroy_confirm` parameter is set to a truthy
value before this can complete.

In addition, we log a Sentry error if a deletion arrived without
confirmation.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/62387
2019-08-29 12:54:19 -07:00
Alex Ives 3e2b45870a Issue #39099: Add links for latest pipelines 2019-08-22 08:49:40 -05:00
drew cimino f7fbf49929 Restrict MergeRequests#test_reports to authenticated users with read-access on Builds 2019-08-22 03:16:32 -04:00
Grzegorz Bizon 89f6584fb3 Merge branch '63372-award-emoji-services' into 'master'
Add service classes for mutating AwardEmoji

Closes #63372

See merge request gitlab-org/gitlab-ce!29782
2019-08-21 09:38:40 +00:00
Luke Duncalfe 926bf71e51 Improve specs for Issues and Notes controllers
This adds test that Todos are completed.

https://gitlab.com/gitlab-org/gitlab-ce/issues/63372
2019-08-21 11:39:41 +12:00
Luke Duncalfe 93a618f0e5 New wiki page redirects user to random slug
Previously we asked a user to enter a new slug before taking them to
the Create Page page.

As a UX improvement, we now take them to a randomly generated URI so
they can begin creating their new page.

https://gitlab.com/gitlab-org/gitlab-ce/issues/46299
2019-08-21 09:33:12 +12:00
Stan Hu e632ae8084 Standardize remote_ip and path keys for auth.log and api_json.log
Current `auth.log` uses `fullpath` and `ip`, while `api_json.log` uses
`remote_ip` and `path` for the same fields. Let's standardize these
namings to make it easier for people working with the data.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66167
2019-08-20 18:12:28 +00:00
Douglas Barbosa Alexandre 31b508e820 Merge branch 'fix-deprecation-warnings-change-success-to-successful' into 'master'
Change `be_success` to `be_successful` in specs

See merge request gitlab-org/gitlab-ce!31969
2019-08-20 16:02:32 +00:00
Stan Hu f3d65e78bc Merge branch 'mc/bug/nplusone-pipelines-show' into 'master'
Improve nplusone spec for PipelinesController#show

See merge request gitlab-org/gitlab-ce!31976
2019-08-19 21:52:56 +00:00
Douglas Barbosa Alexandre 2067f677df
Fix N+1s queries while loading users 2019-08-19 17:35:46 -03:00
Matija Čupić ae7f5faf67
Improve nplusone spec for PipelinesController#show 2019-08-19 21:02:28 +02:00
Vitali Tatarintev 6a6411938a Change `be_success` to `be_successful` in specs
Fixes deprecation warning:

```
DEPRECATION WARNING: The success? predicate is deprecated and
will be removed in Rails 6.0.
Please use successful? as provided by Rack::Response::Helpers.
```
2019-08-19 14:40:56 +02:00
Stan Hu 2dcb69c903 Merge branch '66023-starrers-count-do-not-match-after-searching' into 'master'
Fix starrers counts after searching

See merge request gitlab-org/gitlab-ce!31823
2019-08-16 20:34:27 +00:00
Thong Kuah f4ce990b0e Merge branch '24705-multi-selection-for-delete-on-registry-page' into 'master'
Resolve "Multi selection for delete on registry page"

Closes #24705

See merge request gitlab-org/gitlab-ce!30837
2019-08-15 23:57:38 +00:00
Douglas Barbosa Alexandre 38ba59bedd
Fix starrers counters after searching 2019-08-15 14:34:16 -03:00
Drew Blessing 7f00bcb92e Allow CI to clone public projects when HTTP protocol is disabled
GitLab has a mechanism that allows CI to clone repositories via HTTP
even when the HTTP protocol is disabled. This works as expected
when a project is private or internal. However, when a project is
public CI gets an error message that HTTP is not allowed. This
happens because Git only sends auth in a subsequent request after a
401 is returned first. For public projects, GitLab grabs onto that
unauthenticated request and sends it through since it recognizes
that Guests are ordinarily allowed to access the repository.
Later on this leads to a 403 since HTTP protocol is disabled.
Fix this by only continuing with unauthenticated requests when
HTTP is allowed.
2019-08-14 14:15:33 -05:00
Adam Hegyi c5cb5da4ac Track page views for cycle analytics show page
This change adds a new counter 'cycle_analytics_views' to the usage data
metrics to count the page views for cycle analytics show page.
2019-08-14 16:12:12 +00:00
Mayra Cabrera b6c51f57dd Return 429 on rate limiter on raw endpoint
It was originally returning 302 when the rate limit kicks in, because
using the the correct status code makes it easier to track rate limiting
events

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/65974
2019-08-13 18:13:37 +00:00
drew cimino 1c7c91806d Permission fix for MergeRequestsController#pipeline_status
- Use set_pipeline_variables to filter for visible pipelines
- Mimic response of nonexistent pipeline if not found
- Provide set_pipeline_variables as a before_filter for other actions
2019-08-12 17:39:32 -04:00
Igor b99011af62 Split MR widget into cached and non-cached serializers
Splits auto-refreshing of MR widget into 2 requests:

- the one which uses etag-caching and invalidates the fields on change
- the one without caching

The idea is to gradually move all the fields to etag-cached endpoint
2019-08-09 21:01:55 +00:00
Tristan Read 5e6a58040b Remove gfm_embed_metrics flag from BE
Removes the feature flag that controls whether
metrics dashboard urls unfurl the metrics dashboard
charts.
2019-08-09 20:35:43 +00:00
Hordur Freyr Yngvason 5f82ff1469 Bring scoped environment variables to core
As decided in https://gitlab.com/gitlab-org/gitlab-ce/issues/53593
2019-08-08 18:51:52 +00:00
Felipe Artur 492a7e753d Fix DNS rebind vulnerability for JIRA integration
Uses Gitlab::HTTP for JIRA requests instead of Net::Http.
Gitlab::Http comes with some built in SSRF protections.
2019-08-08 10:24:43 -03:00
Camil Staps d4078b535c
Fix public/private starrers counts in special cases 2019-08-07 20:49:37 +02:00
Camil Staps e726ed5e12
Handle reviewer comments on !24690 2019-08-07 20:49:37 +02:00
Camil Staps 3123be9fbb
Add tests for starrers views 2019-08-07 20:49:17 +02:00
Sarah Yasonik bf918b68f6 Support dashboard params for metrics dashboard
https://gitlab.com/gitlab-org/gitlab-ce/issues/62971

Adds support to EnvironmentsController#metrics_dashboard
for the following params: group, title, y_label
These params are used to uniquely identify a panel on
the metrics dashboard.

Metrics are stored in several places, so this adds
utilities to find a specific panel from the database
or filesystem depending on the metric specified.

Also moves some shared utilities into separate classes,
notably default values and errors.
2019-08-07 16:17:35 +00:00
Tiger Watson 36a01a88ce Use separate Kubernetes namespaces per environment
Kubernetes deployments on new clusters will now have
a separate namespace per project environment, instead
of sharing a single namespace for the project.

Behaviour of existing clusters is unchanged.

All new functionality is controlled by the
:kubernetes_namespace_per_environment feature flag,
which is safe to enable/disable at any time.
2019-08-07 04:40:29 +00:00
Alex Kalderimis d30a90a354 Prevent unauthorised comments on merge requests
* Prevent creating notes on inaccessible MRs

This applies the notes rules at the MR scope. Rather than adding extra
rules to the Project level policy, preventing :create_note here is
better since it only prevents creating notes on MRs.

* Prevent creating notes in inaccessible Issues

without this policy, non-team-members are allowed to comment on issues
even when the project has the private-issues policy set. This means that
without this change, users are allowed to comment on issues that they
cannot read.

* Add CHANGELOG entry
2019-08-07 03:04:33 +01:00
Luke Duncalfe 6ba99cf8b5 Rewrite issues show spec as a feature spec
This spec needs to run as a request-style spec in order to invoke the
Rails router.

A controller-style spec matches the wrong route, and
`session['user_return_to']` becomes incorrect.
2019-08-05 16:36:44 +12:00
Lukas '+ alert('Eipi') + ' Eipert fc9f099884 Prevent empty classes in ansi2html conversion
Currently we write out empty CSS classes (`class=""`) every time we
create a new tag. This adds 9 unnecessary bytes per span element. In a
recent trace, I have counted 11950 span elements. So we transported 105
unnecessary kilobytes!
2019-08-02 14:38:50 +00:00
Stan Hu dbc6c24403 Merge branch '52123-issuable-actions-notesfinder-pderichs' into 'master'
Use NotesFinder to fetch notes on API and Controllers

Closes #52123

See merge request gitlab-org/gitlab-ce!31300
2019-08-01 16:27:02 +00:00
Patrick Derichs 0e99daae4a Use NotesFinder in IssuableActions module
Remove project from NotesFinder constructor

Add project parameter to specs

Also look for methods in private scope

Fix specs to match new NotesFinder constructor
2019-08-01 10:42:42 +02:00
Giorgenes Gelatti 0426d15c08
Support bulk registry tag delete 2019-07-30 13:49:47 -03:00
Lin Jen-Shin 89a8d02c35
Use spec_helper than rails_helper 2019-07-30 23:06:37 +08:00
Sarah Yasonik dfe13131d7 Move BaseService to Services directory
In preparation for embedding specific metrics in issues
https://gitlab.com/gitlab-org/gitlab-ce/issues/62971,
this commit moves the BaseService for metrics dashboards
to a new services subdirectory. This is purely for the sake
of organization and maintainability.
2019-07-29 23:03:59 +00:00
Robert Speicher fe22704a20
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2019-07-29 13:19:50 -05:00
Matija Čupić a5aa40c5fe Add Job specific variables
Adds Job specific variables to facilitate specifying variables when
running manual jobs.
2019-07-29 07:43:10 +00:00
Stan Hu c41788fe54 Revert "Merge branch '52123-issuable-actions-notesfinder-pderichs' into 'master'"
This reverts merge request !29733
2019-07-27 04:28:56 +00:00
Stan Hu 7dccb44448 Merge branch '52123-issuable-actions-notesfinder-pderichs' into 'master'
Use NotesFinder to fetch notes in module IssuableActions

Closes #52123

See merge request gitlab-org/gitlab-ce!29733
2019-07-26 22:29:07 +00:00
Lin Jen-Shin bd1a5a9f42 Merge branch 'remove-nested-groups-checks' into 'master'
Remove code related to object hierarchy and MySQL

Closes #65056 and #65055

See merge request gitlab-org/gitlab-ce!31095
2019-07-26 14:57:12 +00:00
GitLab Release Tools Bot 7501d64912 Merge branch 'security-fix-badges-leaked-to-unauthorized-users' into 'master'
Don't display badges when builds are restricted

Closes #2864

See merge request gitlab/gitlabhq!3175
2019-07-26 13:41:08 +00:00