Commit Graph

260 Commits

Author SHA1 Message Date
Valery Sizov ceb1ebd959 Active tense test coverage
Ports changes from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/642 back into CE
2017-02-01 22:45:41 +00:00
Oswaldo Ferreira cc24682b58 Unify projects search by removing /projects/:search endpoint 2017-01-30 11:22:15 -02:00
Robert Speicher 9a31ecbef2 Use `:empty_project` where possible in request specs 2017-01-26 18:52:10 -05:00
Rémy Coutable 9c560b5cdf
Replace many :project with :empty_projects in API specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-17 11:41:27 -05:00
Rémy Coutable 281f3fcfd5 Merge branch 'dot-in-project-queries' into 'master'
Add a constraint on the query parameter to allow querying for projects with dots in their name.

See merge request !8210
2017-01-16 00:03:01 +00:00
Bruno Melli 322534aa94 Add a constraint on the query parameter to allow querying for projects with dots in their name. 2017-01-14 23:13:39 -07: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
Markus Koller d05dd81b99
Don't expose all namespace fields in API 2016-12-21 16:36:53 +01:00
Rydkin Maxim 170efaaba2 Enable Style/MultilineOperationIndentation in Rubocop, fixes #25741 2016-12-16 21:37:22 +03:00
Rémy Coutable c8fb6f6f37 Merge branch 'update-api-spec-files' into 'master'
Update  API spec files to describe the correct class by changing `API::API` to the corresponding class, for example `API::AwardEmoji`.

Closes #24902

See merge request !7718
2016-12-02 09:38:11 +00:00
Rémy Coutable d757247247
Allow public access to some Project API endpoints
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-01 16:39:42 +01:00
Robert Schilling 7c607a55ab Grapify the projects API 2016-11-28 21:01:43 +01:00
Livier eb4f15571d Changed API spec files to describe the correct class
Restore changes for api spec files

Fix error in rspec Users

Delete extra space Repositories-spec
2016-11-28 10:55:27 -07:00
Robert Schilling eff1b05ab1 API: Add endpoint to delete a group share 2016-11-23 12:53:37 +01:00
Alejandro Rodríguez 591f10f6bd Update 8.14-rc1 migrations to minimize downtime and deploy time
See https://gitlab.com/gitlab-org/gitlab-ce/issues/24386
2016-11-11 15:34:00 -03:00
Borja Aparicio c2e2cde910 Added API spec test for projects/owned endpoint 2016-11-08 10:44:07 +01:00
Rodolfo Santos 1db9f826c1 Add setting to only allow merge requests to be merged when all discussions are resolved
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-04 14:58:40 +01:00
Robert Speicher c0c45c72a8 Merge branch 'speed-up-api-projects-spec' into 'master'
Speed up specs for GET /projects/:id/events

## What does this MR do?

Just groups some expectations into a single `it` block. Reduce this particular tests block time by half.

See merge request !6778
2016-10-12 10:23:39 +00:00
Rémy Coutable 670b2eb5c0
Merge branch 'api-fix-project-group-sharing' into 'security'
API: Share projects only with groups current_user can access

Aims to address the issues here: https://gitlab.com/gitlab-org/gitlab-ce/issues/23004

* Projects can be shared with non-existent groups
* Projects can be shared with groups that the current user does not have access to read

Concerns:

The new implementation of the API endpoint allows projects to be shared with a larger range of groups than can be done via the web UI.

The form for sharing a project with a group uses the following API endpoint to index the available groups: 494269fc92/lib/api/groups.rb (L17). The groups indexed in the web form will only be those groups that the user is currently a member of.

The new implementation allows projects to be shared with any group that the authenticated user has access to view. This widens the range of groups to those that are public and internal.

See merge request !2005

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-11 20:36:26 +02:00
Rémy Coutable 4917bbd7ff
Speed up specs for GET /projects/:id/events
From 8.15s to 4.55s by grouping expectations

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-10 17:07:58 +02:00
Keith Pope 07365e5183 Add config option to project to allow custom .gitlab-ci.yml location 2016-10-08 12:30:47 +01:00
Rémy Coutable 1be1516217 Merge branch 'ben.boeckel/gitlab-ce-api-visible-projects' into 'master'
Add visible projects API

## What does this MR do?

Add a new `/projects/visible` API endpoint. Originally created by @ben.boeckel in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5970.

## Are there points in the code the reviewer needs to double check?

Does the API make sense?

## Why was this MR needed?

The `/projects` endpoint only returned projects the user was explicitly a member of.

Closes #19361, #3119.

See merge request !6681
2016-10-07 09:54:44 +00:00
Nick Thomas e94cd6fdfe Add markdown cache columns to the database, but don't use them yet
This commit adds a number of _html columns and, with the exception of Note,
starts updating them whenever the content of their partner fields changes.

Note has a collision with the note_html attr_accessor; that will be fixed later

A background worker for clearing these cache columns is also introduced - use
`rake cache:clear` to set it off. You can clear the database or Redis caches
separately by running `rake cache:clear:db` or `rake cache:clear:redis`,
respectively.
2016-10-07 02:54:25 +01:00
Sean McGivern 42cb659726 Update API docs and specs for /projects/visible 2016-10-04 17:46:08 +01:00
Ben Boeckel e956a24dfd api: add /projects/visible API endpoint
FIxes #19361, #3119.
2016-10-04 17:23:18 +01:00
Felipe Artur 93d849beae Expose project share expiration_date field on API 2016-09-28 10:12:49 -03:00
Felipe Artur e0067d1850 Allow to set request_access_enabled for groups and projects using API 2016-09-19 12:13:57 -03:00
Felipe Artur 892dea6771 Project tools visibility level 2016-09-01 11:47:59 -03:00
Marc Dequènes (Duck) 31b2c1ef88 expose 'only_allow_merge_if_build_succeeds' project setting in the API 2016-08-24 17:11:48 +09:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Z.J. van de Weg 460065b743 Move deploy_key tests to deploy_key_spec.rb
Also, fix the failing test in the process
2016-08-04 16:55:20 +02:00
Rémy Coutable ed19b9cc43 Merge branch '4142-show-inline-video' into 'master'
Add support for inline videos in issue, MR and notes (on issue, commit, MR, and MR diff)

## What does this MR do?

It adds support for inline videos in issue, MR and notes (on issue, commit, MR, and MR diff). Most of the work was done by @hayesr in !3508 but a few improvements were still missing.

## Why was this MR needed?

To be able to play uploaded videos in GitLab!

## What are the relevant issue numbers?

Closes #4142.

## Screenshots

### Video players

![Screen_Shot_2016-07-19_at_18.44.09](/uploads/e85e531b455a41c3e66b26b356abaafd/Screen_Shot_2016-07-19_at_18.44.09.png)

-----

![Screen_Shot_2016-07-19_at_18.44.29](/uploads/05f52a812760210d1eae86a7f8fc48bc/Screen_Shot_2016-07-19_at_18.44.29.png)

-----

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
  - [x] Test `VideoLinkFilter`
  - [x] Test in `spec/features/markdown_spec.rb`
  - [x] Improve `spec/uploaders/file_uploader_spec.rb`
  - [x] All builds are passing
- [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 you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5215
2016-07-21 07:29:38 +00:00
Alejandro Rodríguez 818ad89ea5 Add /deploy_keys API to retrieve all deploy keys regardless of project affiliation
Also, in favour of consistency, deprecate `/projects/:id/keys/...` routes in favour of
`/projects/:id/deploy_keys/...`
2016-07-20 13:39:19 -04:00
Rémy Coutable 356b2d2bd7 Get rid of `is_image` in FileUploader
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-19 18:51:09 +02:00
tiagonbotelho 228073986b formats my test properly 2016-07-13 15:55:22 +01:00
tiagonbotelho 770d2831f8 fixes test for simplified version of project 2016-07-12 18:45:16 +01:00
tiagonbotelho 3e44aac08d fixes test according to four-phase test pattern 2016-07-12 17:36:22 +01:00
tiagonbotelho a4678edde4 moves let variable to it statement by using a local variable 2016-07-12 16:36:42 +01:00
tiagonbotelho c4dc0f52c3 adds test to check json fields on simple request and changes the url request format 2016-07-12 16:36:42 +01:00
Robert Schilling 0530ec5e6e Expose shared groups for projects 2016-07-08 10:30:52 +02:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Grzegorz Bizon 28bafd5354 Enable Style/SpaceAfterComma Rubocop cop 2016-06-29 15:23:44 +02:00
Z.J. van de Weg abca19da8b Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
Felipe Artur e5aa902860 Merge master into issue_12758 2016-06-17 14:29:11 -03:00
Felipe Artur dc2ca59433 Expose notification setting events in API 2016-06-13 15:51:11 -03:00
Sean McGivern 97424ea544 Restrict starred projects to viewable ones
`User#starred_projects` doesn't perform any visibility checks. This has
a couple of problems:

1. It assumes a user can always view all of their starred projects in
   perpetuity (project not changed to private, access revoked, etc.).
2. It assumes that we'll only ever allow a user to star a project they
   can view. This is currently the case, but bugs happen.

Add `User#viewable_starred_projects` to filter the starred projects by
those the user either has explicit access to, or are public or
internal. Then use that in all places where we list the user's starred
projects.
2016-05-10 18:13:52 +01:00
Stan Hu d5267dfd0d Prevent private snippets in public/internal projects from being leaked via API
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/15580
2016-04-25 12:02:06 -07:00
Robert Schilling 54231aa4e0 Styling changes to code and docs 2016-04-13 16:25:24 +02:00
Robert Schilling 3ab9ea8dae Make staring API more restful 2016-04-13 14:26:41 +02:00
Robert Schilling ea2193aaeb API: Star and unstar a project 2016-04-13 14:26:40 +02:00
Zeger-Jan van de Weg 3549d7c1d4 PUT becomes POST on archiving endpoints
Also the specs have a minor improvement. Mainly the access right spec.
Changes are reflected in the docs
2016-03-24 18:58:42 +01:00
Zeger-Jan van de Weg 2c5bcf2e1b Add endpoints for archiving and unarchiving 2016-03-23 22:36:35 +01:00
Felipe Artur 8b830b8c3b Fix specs 2016-03-18 21:04:53 -03:00
Dmitriy Zaporozhets e8b3b92dde
Bring share project with group API from EE
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-13 11:52:43 +01:00
Robert Speicher de944c914b Add traits for each access_level to ProjectMember factory 2016-03-06 16:53:22 -05:00
Josh Frye ae6080c791 Add specs. Adjust filter. 2016-01-19 09:57:00 -05:00
Douwe Maan 1886d727f7 Add API project upload endpoint 2016-01-07 13:37:14 +01:00
Stan Hu 086cfc8685 Fix API project lookups when querying with a namespace with dots
Attempting to use the /projects/:id API by specifying :id in
"namespace/project" format would always result in a 404 if the namespace
contained a dot.

The reason? From http://guides.rubyonrails.org/routing.html#specifying-constraints:

"By default the :id parameter doesn't accept dots - this is because the dot is
used as a separator for formatted routes. If you need to use a dot within an
:id add a constraint which overrides this - for example id: /[^\/]+/ allows
anything except a slash."

Closes https://github.com/gitlabhq/gitlabhq/issues/9573
2016-01-03 15:08:44 -08:00
Stan Hu 301a30e0ea Add project permissions to all project API endpoints
This standardizes all the project API formats. Also needed to support Huboard.
2015-12-22 10:58:23 -08:00
Zeger-Jan van de Weg c36821df9f Api support for requesting starred projects for user
Fixes #4112
2015-12-16 21:46:00 +01:00
Dmitriy Zaporozhets b8570576e8
Merge branch 'add-open-issues-count-to-api' of https://gitlab.com/stanhu/gitlab-ce
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-16 16:08:35 +01:00
Stan Hu 3efae53bd7 Add open_issues_count to project API
This is needed to support Huboard and a generally useful value.
2015-12-11 23:17:36 -08:00
Kamil Trzcinski e80e3f5372 Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00
Stan Hu 631a30276e Fix API setting of 'public' attribute to false will make a project private
Closes #3864
2015-12-05 17:39:36 -08:00
Dmitriy Zaporozhets 3227a5ead2
Extent Event and Note API
* add note to Events API
* add author section to Events API
* add noteable_id and noteable_type to Notes API

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-04 12:22:50 +01:00
Kamil Trzcinski 6384c757b7 Expose CI enable option in project features
- Enable CI by default for all new projects
2015-11-13 10:52:50 +01: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
Kamil Trzcinski 297f969bab Fix specs 2015-09-24 16:25:40 +02:00
Valery Sizov a0c1a12dee remove API calls from CE to CI 2015-09-18 18:02:11 +02:00
Marin Jankovski 302c52551a Fix failing specs after adding format verification for token and project url in gitlab ci service. 2015-07-17 15:58:26 +02:00
Robert Speicher cf7c57aaf5 Use stub_application_setting in a few more specs
These specs also failed when run by themselves before this change, so
we've likely got some kind of cross-test contamination going on.
2015-07-06 22:39:56 -04:00
Dmitriy Zaporozhets f40b99d02e
Merge branch 'master' into rubocop-for-tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	spec/features/issues_spec.rb
	spec/models/forked_project_link_spec.rb
	spec/models/hooks/service_hook_spec.rb
	spec/models/hooks/web_hook_spec.rb
	spec/models/project_services/hipchat_service_spec.rb
	spec/requests/api/project_members_spec.rb
	spec/requests/api/projects_spec.rb
	spec/requests/api/system_hooks_spec.rb
	spec/services/archive_repository_service_spec.rb
	spec/support/matchers.rb
	spec/tasks/gitlab/backup_rake_spec.rb
2015-06-23 10:44:03 +02:00
Dmitriy Zaporozhets 7b9b3c5aab
Fix part of api specs for rubocop
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-22 15:05:19 +02:00
Robert Speicher bf71d53f63 Change `to_not` calls to `not_to`
Both work, but now we're consistent across the entire app.
2015-06-22 12:13:49 +02:00
Robert Speicher 5a9ede4721 Update mock and stub syntax for specs 2015-06-22 12:13:46 +02:00
Robert Speicher 422236c71e Change `foo.should` syntax to `expect(foo).to` in specs 2015-06-13 18:37:30 -04:00
Dmitriy Zaporozhets 58ab8a4a9d
Fix tests and increase delay time before remove repository
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-03 15:09:12 +02:00
Robert Speicher 9789b56a31 Update ffaker gem
Adds a version requirement which it didn't have before, at 2.0.0. This
version has breaking API changes in that the namespace is now `FFaker`
instead of `Faker`.
2015-05-20 19:22:00 -04:00
Valery Sizov 7c3ca86370 Add order option for projects API 2015-05-14 15:49:09 +03:00
Cristian Medina f045490568 Modified lib/api/entities.rb to expose Project class tag_list property to the API
Updated projects.md to show tag_list field when performing GETs
Updated projects_spec.rb to include check for tag_list key in project list
Added changes to the CHANGELOG
2015-04-03 04:35:12 -04:00
Douwe Maan 1d829ca151 Fix tests. 2015-03-27 11:10:56 +01:00
Douwe Maan dfe0f9eedf Use more specific regexes. 2015-03-27 11:09:29 +01:00
Vinnie Okada 928fc94c3d Enforce restricted visibilities for snippets
Add new service classes to create and update project and personal
snippets.  These classes are responsible for enforcing restricted
visibility settings for non-admin users.
2015-03-08 17:57:08 -06:00
Vinnie Okada 285c534185 Allow admins to override restricted visibility
Allow admins to use restricted visibility levels when creating or
updating projects.
2015-03-08 16:10:05 -06:00
Douwe Maan 421e882ea4 Fix specs. 2015-02-13 14:43:31 +01: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
Jeroen van Baarsen 0ef495734d Improved speed of the project_spec.rb
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-03 18:26:17 +01:00
Hannes Rosenögger 47625ab75e Fix tests and CHANGELOG entry for project edit via API 2015-01-22 17:46:34 +01:00
Mika Mäenpää 7dd5656a5b Implement edit via API for projects 2015-01-22 16:58:01 +01:00
Marin Jankovski ef0cf7b42d Fix the api project ordering spec. 2015-01-12 11:49:07 +01:00
Marin Jankovski 8689ce1efe Add search filter option on project api for authorized projects. 2015-01-12 11:08:53 +01:00
Marin Jankovski 0da5154b5a Fix api tests. 2014-12-30 15:40:11 +01:00
Dmitriy Zaporozhets f775809910
Fix test
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-12-22 19:11:15 +02:00
Ciro Santilli 98db90c4c9 Factor regex error messages with spec API tests 2014-11-05 15:49:35 +01:00
Marin Jankovski d59f8abea5 Fix tests after change to regex validation message. 2014-11-05 13:58:51 +01:00
Dmitriy Zaporozhets ef9f8677e6
Expose author username in project events API
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-10-31 12:08:45 +02:00
Vinnie Okada 41518a467d Remove :keep_repo option
Always delete repositories from the filesystem when deleting a project.
2014-10-22 21:08:19 -05:00
Vinnie Okada 68b5ac7f18 Add option to keep repo on project delete
Update the project API controller to use `Projects::DestroyService`
instead of calling `Project#destroy` directly.

Also add an optional parameter, `:keep_repo`, that allows a project to
be deleted without deleting the repository, wiki, and satellite from
disk.
2014-10-07 15:21:00 -05:00
Marin Jankovski 86d5a63e5e Fix failing api specs. 2014-10-06 10:19:11 +02:00
Dmitriy Zaporozhets d0e3ab5826 Merge branch 'api/improve-error-reporting' of https://github.com/jubianchi/gitlabhq into jubianchi-api/improve-error-reporting 2014-09-23 21:35:45 +03:00