Commit graph

68 commits

Author SHA1 Message Date
GitLab Bot
5707f305f4 Add latest changes from gitlab-org/gitlab@master 2019-09-26 12:06:00 +00:00
GitLab Bot
bd860c22f6 Add latest changes from gitlab-org/gitlab@master 2019-09-17 12:06:48 +00:00
Ahmad Sherif
3c2b4a1ced Enable serving static objects from an external storage
It consists of two parts:

1. Redirecting users to the configured external storage
1. Allowing the external storage to request the static object(s)
   on behalf of the user by means of specific tokens

Part of https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/6829
2019-09-10 13:43:11 +02:00
George Koltsov
8bcc47ac02 Add SortingPreference concern
Sorting preference functionality has been extracted
from `IssuableCollections` to a new `SortingPreference`
concern in order to reuse this functionality in projects
(and groups in the future).
2019-08-21 10:13:45 +00:00
Alex Buijs
2bc0f0cfcf
Add ConfirmEmailWarning concern 2019-08-08 13:34:11 +02: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
Stan Hu
c41788fe54 Revert "Merge branch '52123-issuable-actions-notesfinder-pderichs' into 'master'"
This reverts merge request 
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 

See merge request 
2019-07-26 22:29:07 +00:00
Patrick Derichs
355a2df560 Use NotesFinder in module IssuableActions
Add spec for concern IssuableActions

Add shared samples for discussions endpoint

Add schema validations for discussions

Fix rubocop style issue

Make target assignable

Use new possibility to provide target
2019-07-26 09:10:36 +02:00
Heinrich Lee Yu
1ce5bcacdb Remove code related to object hierarchy in MySQL
These are not required because MySQL is not
supported anymore
2019-07-25 15:35:06 +08:00
Markus Koller
db132bae1d
Support redirect paths starting with a dash
We use a leading dash for certain things like the WebIDE, which
had the side effect of losing the `params[:continue][:to]` param when
opening the WebIDE on a project where the user doesn't have push access
and therefore needs to fork the project first.
2019-06-25 13:19:30 +02:00
Markus Koller
8fd2c08472
Make checks for continue_params more robust
The check for continue_params&.key?(:to) in Projects::ImportsController
caused an exception in redirect_to if this key contained a nil value.

Since url_for won't add any params for an empty hash, we can just return
that in continue_params if params[:continue] isn't present, and simplify
the code in the controllers to check for the values we actually want to
use.
2019-06-25 13:19:29 +02:00
Riccardo Padovani
b33fb07ef9 Search issuables by iids 2019-06-18 07:45:47 +00:00
Stan Hu
47d3610d0d Fix send_file_upload_spec.rb with right MIME type
This fixes a regression in mime-types-data:
https://github.com/mime-types/mime-types-data/pull/20
2019-06-16 16:40:22 -07:00
charlieablett
0c29aa0da3 Add to_json to represent method call 2019-06-13 10:00:30 +12:00
charlieablett
714018145c Add to_json to represent method call 2019-06-10 19:55:37 +12:00
charlieablett
27dd0b8e36 Use serialization for project boards
- Add serializers and Grape::Entity
- Replace to_json
- Add specs
2019-06-06 22:13:14 +12:00
Stan Hu
cfaf012c53 Fix project settings not being able to update
Previously import_url would always be present in the update parameters,
which would cause the validation to fail. We now only include this
parameter only if there is URL given.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/62708
2019-06-03 15:27:24 -07:00
Igor Drozdov
3d4821a8e7 Hide password on import by url form 2019-05-29 14:03:50 +03: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 
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
James Fargher
c40a99a058 Change specs to match gitlab code standards 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
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
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
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
Andreas Brandl
46b1b9c1d6 Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"
This reverts merge request 
2019-04-05 13:02:56 +00: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
Igor
5b6db251a8 Consider array params on rendering MR list on dashboard
This fixes the bug, when approver filter is provided,
but dashboard asks to enter any filter
2019-04-04 14:54:25 +00:00
Stan Hu
4193e3d475 Bump fog-aws to 3.3.0 and associated dependencies
Fixes issue with AWS V4 signatures not working with Ceph S3:
https://github.com/fog/fog-aws/issues/462
2019-02-28 22:51:03 -08:00
Kamil Trzciński
a555a227dd
Merge branch 'filter-confidential-issues' into 'master'
Ability to filter confidential issues

Closes 

See merge request 
2019-02-26 12:24:39 +01:00
Michael Kozono
e95b88a06d
Revert "Merge branch 'filter-confidential-issues' into 'master'"
This reverts commit d133bf84c6, reversing
changes made to 7981c0292b.
2019-02-25 12:42:34 -08:00
Robert Schilling
bf7846bec0 Only use boolean parameters internally
Use internally only boolean params.
2019-02-22 14:55:07 +01:00
Robert Schilling
bd9ae901ec Ability to filter confidential issues
Add a new search bar filter for confidential issues. Add filtering
support to the IssuesFinder.
2019-02-21 14:02:38 +01:00
Stan Hu
134420f2ef Fix Content-Disposition hard-coded to attachments
Due to a regression in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24919,
Content-Disposition is hard-coded to `attachment` instead of `inline`.
We now use the argument `disposition` to fix that problem.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57660
2019-02-13 11:09:52 -08:00
Stan Hu
41b51c0656 Encode Content-Disposition filenames
Users downloading non-ASCII attachments would see garbled characters.
When used with object storage, AWS S3 would return an InvalidArgument
error: Header value cannot be represented using ISO-8859-1.

Per RFC 5987 and RFC 6266, Content-Disposition should be encoded
properly. This commit takes the Rails 6 implementation of
ActiveSuppport::Http::ContentDisposition
(https://github.com/rails/rails/pull/33829) and ports it here.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/47673
2019-02-04 23:12:44 -08:00
Mario de la Ossa
49c74068ae
Save sorting preference for Issues/MRs in BE
In order to let users' sorting preferences transfer between devices, we
save the preference for issues and MRs (one preference for issues, one
for MRs) in the backend inside the UserPreference object
2019-01-28 12:48:05 -06:00
Rémy Coutable
3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +01:00
blackst0ne
b44a2c801a Update specs to rails5 format
Updates specs to use new rails5 format.

The old format:
`get :show, { some: params }, { some: headers }`

The new format:
`get :show, params: { some: params }, headers: { some: headers }`
2018-12-19 10:04:31 +11:00
Jasper Maes
de399c4a49 Fix deprecation: Comparing equality between ActionController::Parameters and a Hash is deprecated 2018-12-16 13:45:19 +01:00
Felipe Artur
1dbebd543e [CE backport]Add sort direction button with sort dropdown for epics 2018-12-03 10:46:47 -02:00
Jasper Maes
6ffdab63c5 render :nothing option is deprecated, Use head method to respond with empty response body. 2018-11-23 10:56:14 +01:00
Heinrich Lee Yu
2a53198324 Refactor whitelisting of filter params 2018-11-15 01:12:07 +08:00
Stan Hu
e1079ee28f MIME type application/javascript -> application/ecmascript 2018-11-10 06:31:29 -08:00
Kamil Trzciński
5da2f42dc9 backport: Always proxy reports downloads
This makes to always proxy reports
2018-11-07 21:49:45 +01:00
Stan Hu
262b974123 Fix attachments not displaying inline with Google Cloud Storage
There were several issues:

1. With Google Cloud Storage, we can't override the Content-Type with
Response-Content-Type once it is set.  Setting the value to
`application/octet-stream` doesn't buy us anything. GCS defaults to
`application/octet-stream`, and AWS uses `binary/octet-stream`. Just remove
this `Content-Type` when we upload new files.

2. CarrierWave and fog-google need to support query parameters:
https://github.com/fog/fog-google/pull/409/files, https://github.com/carrierwaveuploader/carrierwave/pull/2332/files.
CarrierWave has been monkey-patched until an official release.

3. Workhorse also needs to remove the Content-Type header in the request
(ef80978ff8/internal/objectstore/object.go (L66)),
or we'll get a 403 error when uploading due to signed URLs not matching the headers.
Upgrading to Workhorse 6.1.0 for https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/297
will make Workhorse use the headers that are used by Rails.

Closes 
2018-09-05 17:01:54 -07:00
Stan Hu
b9cee4ba3c Set issuable_sort and diff_view cookies to secure when possible
Closes 
2018-09-03 22:37:36 -07:00
Bob Van Landuyt
de35c044fb Preload ancestors after pagination when filtering
We need to preload the ancestors of search results after applying
pagination limits. This way the search results itself are paginated,
but not the ancestors.

If we don't do this, we might not preload a parent group of a search
result as it has been cut off by pagination.
2018-07-06 14:09:36 +02:00