Commit Graph

233 Commits

Author SHA1 Message Date
GitLab Bot b4028d4500 Add latest changes from gitlab-org/gitlab@master 2020-01-07 15:07:34 +00:00
GitLab Bot 7f8330873c Add latest changes from gitlab-org/gitlab@master 2019-12-18 21:07:37 +00:00
GitLab Bot e723867717 Add latest changes from gitlab-org/gitlab@master 2019-12-17 18:07:48 +00:00
GitLab Bot 784fae4b9d Add latest changes from gitlab-org/gitlab@master 2019-12-12 12:07:33 +00:00
GitLab Bot 134fe18200 Add latest changes from gitlab-org/gitlab@master 2019-12-05 21:07:40 +00:00
GitLab Bot 68b6846fa6 Add latest changes from gitlab-org/gitlab@master 2019-11-22 15:06:39 +00:00
GitLab Bot 29c01c6c91 Add latest changes from gitlab-org/gitlab@master 2019-11-14 03:06:25 +00:00
GitLab Bot 759bab0585 Add latest changes from gitlab-org/gitlab@master 2019-11-08 15:06:21 +00:00
GitLab Bot d8ccc7a00b Add latest changes from gitlab-org/gitlab@master 2019-11-07 18:06:21 +00:00
GitLab Release Tools Bot a7329f4372 Merge branch 'security-remove-leaky-401-responses-master' into 'master'
Private/internal repository enumeration via bruteforce on a vulnerable URL

See merge request gitlab/gitlabhq!3454
2019-10-29 15:58:14 +00:00
GitLab Bot b3e4ec8e8a Add latest changes from gitlab-org/gitlab@master 2019-10-23 09:06:03 +00:00
Kerri Miller 8395032721 Avoid #authenticate_user! in #route_not_found
This method, #route_not_found, is executed as the final fallback for
unrecognized routes (as the name might imply.) We want to avoid
`#authenticate_user!` when calling `#route_not_found`;
`#authenticate_user!` can, depending on the request format, return a 401
instead of redirecting to a login page. This opens a subtle security
exploit where anonymous users will receive a 401 response when
attempting to access a private repo, while a recognized user will
receive a 404, exposing the existence of the private, hidden repo.
2019-10-09 10:47:45 -07:00
GitLab Bot 587794b4b8 Add latest changes from gitlab-org/gitlab@master 2019-10-02 00:06:26 +00:00
manojmj a07efbdfd0 CE: Audit event for archiving and unarchiving projects 2019-08-21 09:12:48 +05:30
Peter Leitzen 7b87ed1499 Cleanup usages of `JSON.parse` in specs
Prefer `json_response` where applicable.
2019-07-16 08:03:49 +00:00
Stan Hu d48ee86053 Make Housekeeping button do a full garbage collection
Previously the Housekeeping button and API would use the counter of last
pushes to determine whether to do a full garbage collection, or whether
to do one of the less comprehensive tasks: a full repack, incremental
pack, or ref pack. This was confusing behavior, since a project owner
might have to click the button dozens of times before a full GC would be
initiated.

This commit forces a full GC each time this is initiated. Note that the
`ExclusiveLease` in `HousekeepingService` prevents users from clicking
on the button more than once a day.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63349
2019-07-03 00:21:33 -07:00
Małgorzata Ksionek b9cb49ad45 Move specs to ce directory 2019-06-03 09:32:12 +02: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 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
Oswaldo Ferreira e540c0d71e Fixed test specs
- added suggestions to mock data
- fixed props to be not required
2019-04-04 13:08:34 +00:00
Małgorzata Ksionek b641c654b1 Refactor specs according to the code review 2019-03-26 09:30:16 +01:00
Małgorzata Ksionek b7ecf43388 Add cr remarks 2019-03-25 11:08:20 +01:00
Małgorzata Ksionek 0b324d3463 Disallow changing namespace of a project in update method 2019-03-20 14:52:18 +01: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
Dmitriy Zaporozhets f13edec8c7 Add ability to resolve project id into path
By visiting `projects/:id` you will be redirected to project page with
path in it.

projects/123 => foo/bar

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2019-01-22 09:59:10 +02:00
Jasper Maes d53755da68 Fix deprecation: Using positional arguments in integration tests 2019-01-02 22:33:28 +01:00
Tiago Botelho 8772bdabb2
Project guests no longer are able to see refs page
Adds download_code authorization check to ProjectsController#refs
action, to prevent a project guest from seeing branch, tags and
commits information
2018-12-19 10:21:02 +00: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
Zeger-Jan van de Weg 896c0bdbfb
Allow public forks to be deduplicated
When a project is forked, the new repository used to be a deep copy of everything
stored on disk by leveraging `git clone`. This works well, and makes isolation
between repository easy. However, the clone is at the start 100% the same as the
origin repository. And in the case of the objects in the object directory, this
is almost always going to be a lot of duplication.

Object Pools are a way to create a third repository that essentially only exists
for its 'objects' subdirectory. This third repository's object directory will be
set as alternate location for objects. This means that in the case an object is
missing in the local repository, git will look in another location. This other
location is the object pool repository.

When Git performs garbage collection, it's smart enough to check the
alternate location. When objects are duplicated, it will allow git to
throw one copy away. This copy is on the local repository, where to pool
remains as is.

These pools have an origin location, which for now will always be a
repository that itself is not a fork. When the root of a fork network is
forked by a user, the fork still clones the full repository. Async, the
pool repository will be created.

Either one of these processes can be done earlier than the other. To
handle this race condition, the Join ObjectPool operation is
idempotent. Given its idempotent, we can schedule it twice, with the
same effect.

To accommodate the holding of state two migrations have been added.
1. Added a state column to the pool_repositories column. This column is
managed by the state machine, allowing for hooks on transitions.
2. pool_repositories now has a source_project_id. This column in
convenient to have for multiple reasons: it has a unique index allowing
the database to handle race conditions when creating a new record. Also,
it's nice to know who the host is. As that's a short link to the fork
networks root.

Object pools are only available for public project, which use hashed
storage and when forking from the root of the fork network. (That is,
the project being forked from itself isn't a fork)

In this commit message I use both ObjectPool and Pool repositories,
which are alike, but different from each other. ObjectPool refers to
whatever is on the disk stored and managed by Gitaly. PoolRepository is
the record in the database.
2018-12-07 19:18:37 +01:00
Cindy Pallares fe5f75930e
Merge branch 'security-fix-pat-web-access' into 'master'
[master] Resolve "Personal access token with only `read_user` scope can be used to authenticate any web request"

See merge request gitlab/gitlabhq!2583
2018-11-28 19:13:59 -05:00
James Lopez a2aa505805
Refactor code to remove object storage flag from Import/Export
Updated docs, refactor import/export code
Fix AvatarUploader path issue
Fix project export upload webhook error
2018-09-06 16:52:42 +02:00
Winnie Hellmann 743add978a Move badge settings to general settings 2018-09-03 13:16:23 +00:00
Mark Chao a63bce1a4b Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
Lin Jen-Shin 4ee08b77bc Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
James Lopez a2bf164154
Update Import/Export to use object storage (based on aa feature flag) 2018-07-06 15:46:18 +02:00
Oswaldo Ferreira d038fac4b6 Present state indication on GFM preview 2018-07-05 23:24:11 -03:00
Aram Visser 0d22b2141f Set flash error message only for current request when updating project 2018-06-25 10:19:13 +07:00
Hiroyuki Sato 59154779d8 The json keys of ref switcher should not be translated 2018-06-20 13:02:08 +09:00
Jacob Vosmaer (GitLab) 5cf5680f9c Deny repository disk access in development and test 2018-06-14 11:18:25 +00:00
Robert Speicher 6d165c740c Make all uses of `fixture_file_upload` use relative paths 2018-06-07 09:54:41 -05:00
Nick Thomas 6b0c6e69e1
Use hashed storage in the specs 2018-02-07 13:40:46 +00:00
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Sean McGivern a39d6d896f Merge branch '32878-merge-request-from-email' into 'master'
Create merge request from email

Closes #32878

See merge request gitlab-org/gitlab-ce!13817
2017-12-05 12:28:49 +00:00
Jan Provaznik 8cce70730c Create merge request from email
* new merge request can be created by sending an email to the specific
email address (similar to creating issues by email)
* for the first iteration, source branch must be specified in the mail
subject, other merge request parameters can not be set yet
* user should enable "Receive notifications about your own activity" in
user settings to receive a notification about created merge request

Part of #32878
2017-12-05 08:41:58 +01:00
Bob Van Landuyt 3d4ba90c50 Count occurrences of a specific query in the query recorder. 2017-12-04 17:43:48 +01:00
Bob Van Landuyt 20f78421c8 Cache the forks in a namespace in the RequestStore
On the `show` of a project that is part of a fork network. We check if
the user already created a fork of this project in their personal
namespace.

We do this in several places, so caching the result of this query in
the request store prevents us from repeating it.
2017-12-04 17:43:48 +01:00
Vitaliy @blackst0ne Klachkov e2b28d2526 Change tags order in refs dropdown 2017-11-07 15:32:51 +11:00
Jacopo 2f40dac352 Refactor `have_http_status` into `have_gitlab_http_status` in the specs 2017-10-20 10:13:18 +02:00
Annabel Dunstone Gray a42d7980af
Add readme only option as project view 2017-10-16 15:33:20 -07:00
Jacopo 0ce6785851 Replaces `tag: true` into `:tag` in the specs
Replaces all the explicit include metadata syntax in the specs (tag:
true) into the implicit one (:tag).
Added a cop to prevent future errors and handle autocorrection.
2017-10-07 13:57:54 +02:00
Bob Van Landuyt e8ca579d88 Add a project forks spec helper
The helper creates a fork of a project with all provided attributes,
but skipping the creation of the repository on disk.
2017-10-07 11:46:23 +02:00
Zeger-Jan van de Weg 4656283c5c
Gitaly namespace service enabled for GitLab 2017-10-05 14:11:32 +02:00
Valery Sizov 3940ac8520 Pulling merge_method spec for project_controller_spec from EE[ci skip] 2017-09-20 12:10:47 +03:00
Rubén Dávila b9b0b37b36 Add check for access to Namespace 2017-08-30 12:24:49 -05:00
Robin Bobbitt 649d042dbc Add option to disable project export on instance 2017-08-11 12:22:37 -04:00
Bob Van Landuyt 3598e60bf2 Add a Circuitbreaker for storage paths 2017-08-04 15:38:48 +02:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Grzegorz Bizon b4349fd331 Remove one assertion from projects controller specs 2017-07-14 14:07:32 +02:00
Grzegorz Bizon 881bc45abb Fix rubocop offense in projects controller specs 2017-07-14 11:23:46 +02:00
Grzegorz Bizon 613208c360 Recover from renaming project that has container images 2017-07-13 15:34:36 +02:00
Douwe Maan fe13f11041 Create and use project path helpers that only need a project, no namespace 2017-07-05 11:11:59 -05:00
Robert Speicher a6ec5121f0 Correct RSpec/SingleLineHook cop offenses 2017-06-14 13:18:56 -05:00
Jose Ivan Vargas acd573f1e6 minor adjustments to the specs 2017-05-22 15:14:13 -05:00
Jose Ivan Vargas fbde5e3313 Renamed some messages and refactored the project_edit class to a function 2017-05-22 12:55:01 -05:00
Jose Ivan Vargas 42604d4c33 Prevent project transfer if a new group is not selected 2017-05-22 12:55:01 -05:00
Michael Kozono f9785dcec3 Fix ensure_canonical_path for top level routes
Don’t replace a substring of the path if it is part of the top level route.

E.g. When redirecting from `/groups/ups` to `/groups/foo`, be careful not to do `/grofoo/ups`.

Projects are unaffected by this issue, but I am grouping the `#ensure_canonical_path` tests similar to the group and user tests.
2017-05-18 16:24:10 -07:00
Michael Kozono ab98f8b5b1 Fix redirect message for groups and users 2017-05-11 15:28:13 -07:00
Michael Kozono f05469f99b Resolve discussions 2017-05-05 12:12:50 -07:00
Michael Kozono e4bcc90d95 Add “project moved” flash message on redirect 2017-05-05 12:12:50 -07:00
Michael Kozono 7d02bcd2e0 Redirect from redirect routes to canonical routes 2017-05-05 12:11:57 -07:00
Jarka Kadlecova 87327c5845 Support preview_markdown action for personal_snippets 2017-04-26 12:51:06 +02:00
Lin Jen-Shin 08d3a40c31 Expect @issuable_meta_data to be set, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9956#note_25445832
2017-03-16 14:46:12 +08:00
Lin Jen-Shin 668a5b9fe1 Fix projects without repo and wiki
When repo and wiki are disabled for a project,
we're showing issues so we'll need to set @issuable_meta_data
otherwise it would be giving nil errors. See:

https://sentry.gitlap.com/gitlab/staginggitlabcom/issues/23106/
2017-03-15 14:42:02 +08:00
Annabel Dunstone Gray 1565d7f6e6 Remove readme-only project view preference 2017-03-06 14:49:59 -06:00
Douwe Maan ad640bc5f9 Use Namespace#full_path instead of #path where appropriate 2017-02-23 17:55:01 -06:00
blackst0ne 63dac85385 Fixed redirection from http://someproject.git to http://someproject 2017-02-04 00:00:26 +11:00
Robert Speicher 4642ca6686 Use `empty_project` where possible in controller specs 2017-01-25 17:14:38 -05:00
sandish chen 81f7a7ab62 Fix to display notice when project settings updated.
Change validity checking for UpdateService.

Add return value for project update service.

Return 302(redirect_to) when successfully updated.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-15 01:31:25 -05:00
Douwe Maan 9c3f3e9e35 Merge branch 'use-separate-token-for-incoming-email' into 'master'
Use separate email-friendly token for incoming email

See merge request !5914
2016-11-08 10:47:45 +00:00
tiagonbotelho 011e561bfa implements reset incoming email token on issues modal and account page,
reactivates all tests and writes more tests for it
2016-11-07 15:56:18 +00:00
Dmitriy Zaporozhets 591e18364a Add tests for project#index routing
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-11-07 16:13:36 +02:00
Felipe Artur da07c2e4d3 Add visibility level to project repository 2016-10-17 18:12:18 -02:00
James Lopez 29141ed3ea fix broken repo 500 errors in UI and added relevant specs 2016-09-29 16:58:14 +02:00
Katarzyna Kobierska d88f708b02 Improve grammar 2016-09-13 14:40:05 +02:00
Katarzyna Kobierska 31c37c6c38 Add #closed_without_source_project? 2016-09-13 14:40:05 +02:00
Katarzyna Kobierska 09cded29d8 Checks if deleting forked project closed all open merge requests 2016-09-13 14:40:05 +02:00
Katarzyna Kobierska 8c77a1fb25 Before deleting project if forked unlink fork 2016-09-13 14:40:05 +02:00
tiagonbotelho 519275c110 fixes part1 of files to start using active tense 2016-08-09 15:06:23 +01:00
Sean McGivern 87035c2945 Don't blow up in tree view on empty repo 2016-07-18 14:06:21 +01:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Z.J. van de Weg abca19da8b Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
Phil Hughes f112e2a1da Fixed issue with returning ref in commits JSON
Added tests to project controller
2016-06-20 11:37:27 +01:00
Zeger-Jan van de Weg be613de2cf Project#show on projects pending deletion will 404
fixes #17508
2016-05-28 03:14:43 -07:00
Felipe Artur 6fb9bf87c4 Use the right default notification settings for non members 2016-05-19 19:47:07 -04:00
Felipe Artur 07ff874f57 Let users set notification levels in projects which they are not members 2016-05-17 21:53:03 -05:00
Stan Hu 934f1e9097 Fix Error 500 after renaming a project path
Closes #14885
2016-04-05 11:18:13 -07:00
Stan Hu 3315fb820b Remove unnecessary go-get test (superseded by middleware) 2016-03-12 11:14:56 -08:00
James Lopez 7b868c61ab refactored migration and spec based on feedback 2016-02-04 13:20:55 +01:00
James Lopez eb51a4ac1b refactor previous test and add validation to project model 2016-01-29 15:35:21 +01:00
James Lopez 4d2da5fd25 WIP - spec failure on .atom project URL 2016-01-22 17:55:12 +01:00
Stan Hu 2497d3d550 Fix 404 in redirection after removing a project
Closes https://github.com/gitlabhq/gitlabhq/issues/9844

Closes #3559
2015-11-25 23:11:35 -08:00
Douwe Maan 98f982f91d Only postgres does case sensitive compares 2015-10-22 10:19:12 +02:00
Douwe Maan 310f49af35 Don't load entire spec with MySQL 2015-10-21 10:21:01 +02:00
Douwe Maan 4a02dfa48f Disable case sensitive spec for MySQL. 2015-10-21 10:09:40 +02:00
Douwe Maan 2f7fc7e9f7 Prefer project with exact path to differently cased one when both exist. 2015-10-20 16:16:08 +02:00
Douwe Maan 8adeda37b5 Merge branch 'hanloong/gitlab-ce-remove-forks-from-projects-settings' into 'master'
Add ability to remove the fork relationship from project settings

![Screen_Shot_2015-10-18_at_12.37.24](/uploads/676571642a4c90f7f286280d714599a3/Screen_Shot_2015-10-18_at_12.37.24.png)
![Screen_Shot_2015-10-18_at_12.37.28](/uploads/1a069ecfc4cd3b5438772a9c3f04b6fc/Screen_Shot_2015-10-18_at_12.37.28.png)

Replaces !1579.

Fixes #2578.

See merge request !1636
2015-10-19 09:32:07 +00:00
Douwe Maan 42cbc7f813 Tweak wording. 2015-10-18 12:38:01 +02:00
Douwe Maan aebe0ddc33 Make spec names more clear 2015-10-17 19:27:02 +02:00
Douwe Maan 70240f433c Merge branch 'master' into cristianbica/gitlab-ce-user-project-view-files 2015-10-17 18:20:04 +02:00
Han Loong Liauw 0bea5ced8b Made suggested content changes based on MR Review
Changed the authentication method for removing fork through API
Reflected changes to new auth method in API specs
2015-10-14 20:19:41 +11:00
Han Loong Liauw df99ddbba1 Adds ability to remove the forked relationship
This was previously possible through the API but can now be done
through the project#edit settings screen if the current user is
the owner of the project.
Update changelog
2015-10-13 21:42:17 +11:00
Cristian Bica c528043439 Allow users to select the Files view as default project view 2015-10-01 17:05:20 +03:00
Francesco Levorato 333463ddf2 Fix indentation 2015-09-18 16:37:21 +02:00
Francesco Levorato 1bbcc29687 Redirect case sensitive project path to the normalized one 2015-09-18 16:37:21 +02:00
Stan Hu 359ed48638 Fix Style/AlignHash cop violations 2015-06-22 22:24:39 -07:00
Douwe Maan 3702c4ad80 Render go-import meta tag for private repos. 2015-03-03 11:22:30 +01:00
Douwe Maan 0283fff591 Merge branch 'master' into extend_markdown_upload
# Conflicts:
#	app/views/projects/issues/_form.html.haml
#	app/views/projects/merge_requests/_form.html.haml
#	app/views/projects/merge_requests/_new_submit.html.haml
#	app/views/projects/milestones/_form.html.haml
#	app/views/projects/notes/_form.html.haml
#	app/views/projects/wikis/_form.html.haml
#	config/routes.rb
#	spec/controllers/projects_controller_spec.rb
2015-02-24 14:54:39 +01:00
Douwe Maan d2ebdf664b Refactor. 2015-02-17 22:23:31 +01:00
Hannes Rosenögger 192e730662 Fix tests 2015-02-17 22:21:13 +01:00
Hannes Rosenögger 9bf8480b4a Generalize the image upload in markdown
This commit generalizes the image upload via drag and drop so it supports all files.
It also adds access control for these files.
2015-02-17 22:20:44 +01:00
Vinnie Okada 76aad9b76e Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2:

* Use nested resources to avoid slashes in arguments to path helpers.
2015-02-14 11:09:23 -07:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Ciro Santilli 9b5c7a4d60 Add star count, view logic, more tests. 2014-07-17 22:47:16 +02:00
Ciro Santilli 714f7201d3 Add project stars. 2014-07-17 22:47:16 +02:00
Marin Jankovski 9b2a13497d Need txt file in test. 2014-05-26 15:58:03 +02:00
Marin Jankovski f8a6d3405e Add image_service spec. 2014-05-26 15:47:54 +02:00
Marin Jankovski 8bec6b0bcb Make existing tests test something, return correct errors. 2014-05-26 14:17:46 +02:00
Earle Bunao & Neil Calabroso 6a85cdf162 Implements drag and drop upload in creating issues 2014-05-23 16:22:42 +08:00