Commit Graph

65 Commits

Author SHA1 Message Date
Bob Van Landuyt e50f4bc066 The dynamic path validator can block out partial paths
So we can block `objects` only when it is contained in `info/lfs` or `gitlab-lfs`
2017-05-01 11:14:24 +02:00
Bob Van Landuyt 1498a9cb0f Check `has_parent?` for determining validation type 2017-05-01 11:14:24 +02:00
Grzegorz Bizon 6d7a52480c Merge branch 'master' into feature/multi-level-container-registry-images
* master: (94 commits)
  Merge branch 'open-redirect-fix-continue-to' into 'security'
  Merge branch 'open-redirect-host-fix' into 'security'
  Merge branch 'path-disclosure-proj-import-export' into 'security'
  Merge branch '29364-private-projects-mr-fix'
  Merge branch '30125-markdown-security'
  Issue title realtime
  Update CHANGELOG.md for 8.16.9
  Update CHANGELOG.md for 8.17.5
  Update CHANGELOG.md for 9.0.4
  Add "search" optional param and docs for V4
  Use PDFLab to render PDFs in GitLab
  Separate Scala from Java in CI examples
  Fix broken link
  Reorganize CI examples, add more links
  Refactor CI index page
  Remove deprecated field from workhorse response
  Use gitlab-workhorse 1.4.3
  Document how ETag caching middleware handles query parameters
  Make group skip validation in the frontend
  Use NamespaceValidator::WILDCARD_ROUTES in ETag caching middleware
  ...
2017-04-06 12:24:46 +02:00
Dmitriy Zaporozhets 0617876d9f Fix subgroup repository disappearance if group was moved
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-04-05 15:13:42 +03:00
Grzegorz Bizon 1d6ddb05bb Fix namespace specs related to container registry 2017-04-03 21:25:52 +02:00
Grzegorz Bizon baa00d5424 Refactor container registry repository tag stubs 2017-04-03 15:52:24 +02:00
Grzegorz Bizon fc550b398b Merge branch 'master' into feature/multi-level-container-registry-images
* master: (230 commits)
  Fix N+1 query in loading pipelines in merge requests
  Fix Spinach and Capybara dependencies
  Prevent users from disconnecting gitlab account from CAS
  30276 Move issue, mr, todos next to profile dropdown in top nav
  Refactor SearchController#show
  Properly eagerly-load the Capybara server for JS feature specs only
  Updating documentation to include a missing step in the update procedure
  Eager-load the Capybara server to prevent timeouts
  Increase Capybara's timeout
  Add metrics button to Environment Overview page
  Fix link to Jira service documentation
  Handle parsing OpenBSD ps output properly to display sidekiq infos on ...
  Eliminate unnecessary queries that add ~500 ms of load time for a large issue
  20914 Limits line length for project home page
  Allow users to import GitHub projects to subgroups
  Update dpl CI example
  Fix the docs:check:links job
  Don't clean up the gitlab-test-fork_bare repo
  Make GitLab use Gitaly for commit_is_ancestor
  Remove unnecessary ORDER BY clause from `forked_to_project_id` subquery
  ...
2017-04-03 09:36:09 +02:00
Rémy Coutable 60c0c0f3d0 Merge branch '29843-project-subgroup-transfer' into 'security'
Use full path for moving directories when changing namespace path

See merge request !2078
2017-03-29 19:16:50 -07:00
Grzegorz Bizon 1a4c60ef57 Merge branch 'master' into feature/multi-level-container-registry-images
* master: (192 commits)
  Implement new service for creating user
  Update sentry-raven 2.0.2 -> 2.4.0
  Update webmock 1.21.0 -> 1.24.6
  Update spring 1.7.2 -> 2.0.1
  Update simplecov 0.12.0 -> 0.14.1
  Update pry-rails 0.3.4 -> 0.3.5
  Update pry-byebug 3.4.1 -> 3.4.2
  Update flay 2.6.1 -> 2.8.1
  Remove Tags filter from Projects Explore dropdown
  Update capybara-screenshot 1.0.11 -> 1.0.14
  Update bullet 5.2.0 -> 5.5.1
  Update brakeman 3.4.1 -> 3.6.1
  Remove web-console gem
  Update better_errors 1.0.1 -> 2.1.1
  Display flash message to unauthenticated user when creating new issue
  Fix up emoji tests that should have failed :/
  Fix RSpec/DescribeSymbol cop violations
  Add event limit warning all tabs Cycle Analytics
  Adding non_archived scope for counting projects
  Resolve "Gitlab administrator cannot create projects in every group"
  ...

Conflicts:
	db/schema.rb
2017-03-27 12:35:10 +02:00
Robert Speicher def164e761 Fix RSpec/DescribeSymbol cop violations 2017-03-24 19:04:03 -04:00
Grzegorz Bizon dcd2eeb1cf Rename container image to repository in specs 2017-03-23 15:54:59 +01:00
Jarka Kadlecova d618d010d7 Add spec that tests ‘LIKE’ query for routes with _ 2017-03-22 12:17:01 +01:00
Grzegorz Bizon c5912ecd73 Merge branch 'master' into feature/multi-level-container-registry-images
* master: (1327 commits)
  Merge branch 'render-json-leak' into 'security'
  Merge branch 'ssrf' into 'security'
  Merge branch 'ssrf' into 'security'
  Merge branch 'fix-links-target-blank' into 'security'
  Merge branch '28058-hide-emails-in-atom-feeds' into 'security'
  Fix karma test
  Reset filters after click
  Handle Route#name being nil after an update
  Only add frontend code coverage instrumentation when generating coverage report
  fix recompile assets step in 9.0 upgrade guide to use yarn
  Undo explicit conversion to Integer
  Make level_value accept string integers
  Make feature spec more robust
  Removed d3.js from the main application.js bundle
  Extend compound status for manual actions specs
  Update css to be nice and tidy.
  Fix pipeline status for transition between stages
  add an index to the ghost column
  Return 404 in project issues API endpoint when project cannot be found
  Improve rename projects migration
  ...

Conflicts:
	doc/ci/docker/using_docker_build.md
	spec/lib/gitlab/import_export/all_models.yml
2017-03-21 14:22:56 +01:00
Sean McGivern a5db7f5425 Merge branch '28447-hybrid-repository-storages' into 'master'
Update storage settings to allow extra values per shard

See merge request !9597
2017-03-07 16:55:03 +00:00
Dmitriy Zaporozhets e6cc7a0a38
Restrict nested group names to prevent ambiguous routes
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-03-07 09:43:35 +02:00
Alejandro Rodríguez 0b9d56f960 Update storage settings to allow extra values per shard
This will be necessary when adding gitaly settings. This version
doesn't make any functional changes, but allows us to include this
breaking change in 9.0 and add the needed extra settings in the future
with backwards compatibility
2017-03-03 12:13:30 -03:00
Douwe Maan ad640bc5f9 Use Namespace#full_path instead of #path where appropriate 2017-02-23 17:55:01 -06:00
Andre Guedes e4fa80f3b6 Fixes broken and missing tests 2017-02-22 11:30:11 -03:00
Dmitriy Zaporozhets 8820f3cdd2 Merge branch 'dz-refactor-full-path' into 'master'
Store group and project full name and full path in routes table

See merge request !8979
2017-02-08 18:45:19 +00:00
Dmitriy Zaporozhets 2989192d1a
Store group and project full name and full path in routes table
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-02-08 19:14:29 +02:00
Douwe Maan 7fa767fe35 Merge branch 'dz-limit-nested-groups' into 'master'
Limit level of nesting for groups

See merge request !9000
2017-02-08 15:04:31 +00:00
Dmitriy Zaporozhets f642a4608d
Limit level of nesting for groups
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-02-08 11:59:01 +02:00
Yorick Peterse ebae38394d
Refresh authorizations when transferring projects
This ensures that project authorizations are refreshed when moving a
project from one namespace to another. When doing so the permissions for
all users of both the old and new namespaces are refreshed.

See #26194 for more information.
2017-02-07 14:58:49 +01:00
Robert Speicher fcb37542e7 Use `:empty_project` where possible in model specs 2017-01-26 17:44:59 -05:00
Dmitriy Zaporozhets 8a9597fc73 Merge branch 'dz-nested-groups-access-improvements' into 'master'
Nested groups feature improvemetns

See merge request !8448
2017-01-25 13:17:43 +00:00
Robert Speicher d7755ede24 Merge branch 'fix/rename-group-export-vuln' into 'security'
Fix export files not removed when a user takes over a namespace

See merge request !2051
2017-01-23 13:42:27 -05:00
Dmitriy Zaporozhets 51c4b20c48 Refactor Namespace code related to nested groups
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-01-13 10:05:02 -05:00
Markus Koller 3ef4f74b1a
Add more storage statistics
This adds counters for build artifacts and LFS objects, and moves
the preexisting repository_size and commit_count from the projects
table into a new project_statistics table.

The counters are displayed in the administration area for projects
and groups, and also available through the API for admins (on */all)
and normal users (on */owned)

The statistics are updated through ProjectCacheWorker, which can now
do more granular updates with the new :statistics argument.
2016-12-21 16:39:49 +01:00
Sean McGivern ecd0c1757d Merge branch 'dz-nested-groups-title-ui' into 'master'
UI improvements for nested group feature

See merge request !8062
2016-12-16 09:41:23 +00:00
Dmitriy Zaporozhets 82f9957d46 Refactor Namespace#parents method
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-15 20:57:03 +02:00
Dmitriy Zaporozhets f8a17a3835
Add tests for Namespace#full_name method
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-13 20:27:08 +02:00
Dmitriy Zaporozhets d806230f9f
Add parents method to Namespace
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-13 16:59:49 +02:00
Dmitriy Zaporozhets 161d7c02d4
Modify namespace name and path validation
Currently namespace name and path have uniq validaiton which does not
allow us to use same group name/path inside different groups. This
commit changes validation in next way:

* Allow same namespace name with different parent_id
* Allow same namespace path. Uniq validation should be handled by routes table

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-12 14:21:02 +02:00
Douwe Maan 05efd19e89 Merge branch 'dz-nested-groups' into 'master'
Add nested groups support on data level

## What does this MR do?

- [x] Add  `parent_id` field to `Namespace`model. 
- [x] Create new database table `routes` that keeps information about full path to each group or project
- [x] Remove uniq index from `namespaces.path`
- [x] Add uniq index on `routes.path`
- [x] Fill routes table with path data from namespaces and projects
- [x] Change Namespace/Project URL lookup by routes table
- [x] Rename related routes (nested groups, projects) when parent path changes

This is solely backend preparation. UI, Permissions and API support will be added in separate merge request.   
 
## Are there points in the code the reviewer needs to double check?

migrations, Route model, Routable concern

Will require downtime. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7121#note_19490281 discussion

## Why was this MR needed?

One step further to full nested groups support

## Screenshots (if relevant)

No UI changes in this merge request so far

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added~~
- ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~API support added~~
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/2772

See merge request !7121
2016-12-09 01:52:36 +00:00
Dmitriy Zaporozhets 83232be0e1
Add nested groups support on data level
* add parent_id field to namespaces table to store relation with nested groups
* create routes table to keep information about full path of every group and project
* project/group lookup by full path from routes table

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-08 11:47:16 +02:00
Rémy Coutable 4e249d5bae
Use :maximum instead of :within for length validators with a 0..N range
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-06 10:23:17 +01:00
Will Starms 4f1de5faac Correct namespace validation to forbid bad names #21077
Adds .git and .atom to the master namespace regex
Updates existing group tests and adds two new ones
Updates path cleaning to also forbid .atom
2016-10-07 13:46:59 -05:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Robert Speicher adc6ec4a9c Avoid `describe`-ing symbols in specs 2016-07-12 10:27:58 -05:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Alejandro Rodríguez 86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00
Kamil Trzcinski 91c4002a0c Improve test coverage 2016-05-16 18:03:55 -05:00
Jeroen van Baarsen f1479b56b7
Remove the annotate gem and delete old annotations
In 8278b763d9 the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.

Fixes: #17382
2016-05-09 18:00:28 +02:00
Yorick Peterse 78244ffcbf Corrected spec title for Namespace.search 2016-03-11 15:25:24 -05:00
Yorick Peterse ee75c49313 Make Namespace.search case-insensitive
This ensures searching namespaces works exactly the same as searching
for any other resource.
2016-03-11 15:25:24 -05:00
Stan Hu 79c0e7212a Annotate models 2016-01-06 13:09:55 +00:00
Douwe Maan 1e8d703a85 Tag model specs 2015-12-09 10:50:51 +01:00
Dmitriy Zaporozhets a237999f00
Annotate models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-13 19:22:46 +01:00
Robert Speicher 5a9ede4721 Update mock and stub syntax for specs 2015-06-22 12:13:46 +02:00
Douwe Maan 175f7f68a6 Move files for moved namespaces. 2015-03-31 09:30:34 +02:00