Commit Graph

304 Commits

Author SHA1 Message Date
Kamil Trzciński 650f40865e Forbid the use of `#reload` and prefer `#reset`
The `#reload` makes to load all objects into memory,
and the main purpose of `#reload` is to drop the association cache.

The `#reset` seems to solve exactly that case.
2019-04-15 13:05:14 +02:00
John Jarvis 69b65a6b74 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into jarv/dev-to-gitlab-2019-04-02 2019-04-02 10:12:32 +02:00
Yorick Peterse be49d9c1ba
Backport parameters from API::Projects
This backports various parameter changes EE makes to API::Projects,
along with moving some code around to make it easier to extend in EE.
2019-03-26 14:18:29 +01:00
Igor Drozdov 732f892db3 Return cached languages if they've been detected before 2019-03-20 20:33:49 +03:00
Yorick Peterse 9faf957bd3 Merge branch 'security-protect-private-repo-information' into 'master'
Fix leaking private repository information in API

See merge request gitlab/gitlabhq!2881
2019-03-04 18:37:03 +00:00
Yorick Peterse b50ad88460 Merge branch '2802-security-add-public-internal-groups-as-members-to-your-project-idor' into 'master'
Add public/internal groups as members to your Project(IDOR)

See merge request gitlab/gitlabhq!2898
2019-03-04 18:36:52 +00:00
Nick Thomas 0b0a04fdf7 Merge branch 'zj-load-languages-from-database' into 'master'
Load repository language from the DB if detected

Closes #47390

See merge request gitlab-org/gitlab-ce!25518
2019-02-25 16:41:04 +00:00
Zeger-Jan van de Weg abe8cbe90b Load repository language from the DB if detected
The repository charts page used to detect the repository language for
each request that was made to the page. Given the detection is an
expensive operation and the same data is stored in the database the
database is now serving the request.

The same goes for an API endpoint that serves the languages.

When a repository is empty or non-existent the languages will always be
empty. And the language detection RPC isn't requested.

Closes: https://gitlab.com/gitlab-org/gitlab-ce/issues/47390
2019-02-25 15:15:16 +01:00
Małgorzata Ksionek 211c4e5985 Change policy regarding group visibility 2019-02-20 11:08:13 +01:00
Balasankar "Balu" C 39f77ad9b4
Let users set name/path on project fork using API 2019-02-20 00:19:27 +05:30
Luke Duncalfe 618b87448e Prevent leaking of private repo data through API
default_branch, statistics and config_ci_path are now only exposed if
the user has permissions to the repository.
2019-02-18 11:30:32 +13:00
Dylan MacKenzie b421bd316f Add programming language filtering to `/projects` 2019-02-04 15:06:17 +00:00
Robert Schilling a612bd0708 Unify user requirements for API slugs 2019-01-31 11:13:23 +01:00
Robert Schilling 2190704c61 API: Support username with dots 2019-01-15 17:16:03 +01:00
Heinrich Lee Yu 63e9969ca3 Refactor upload service to return uploader
Also changes old calls to the service
2019-01-07 11:16:58 +08:00
Imre Farkas b1e070bf49
Fix API::Namespaces to accept namepaces with dots
It also renames the API::PROJECT_ENDPOINT_REQUIREMENTS constant to
API::NAMESPACE_OR_PROJECT_REQUIREMENTS
2018-11-28 12:54:11 +01:00
J.D. Bean ff89680330 Feature/add license to project API 2018-10-26 15:12:14 +00:00
Tuomo Ala-Vannesluoma c84b60b164 Make GitLab pages support access control 2018-10-05 13:41:11 +00:00
gfyoung 3836d69119 Enable frozen string in lib/api and lib/backup
Partially addresses #47424.

Had to make changes to spec files because
stubbing methods on frozen objects is a mess
in RSpec and leads to failures:

https://github.com/rspec/rspec-mocks/issues/1190
2018-09-29 21:04:50 -07:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Toon Claes 7c9983c721 Allow project owners to set up forking relation through API
Before this change only GitLab admins where allowed to set up forking
relation through the API. This changes that so project owners can
do this too.

Closes gitlab-org/gitlab-ce#40550.
2018-08-20 16:25:02 +02:00
James Ramsay 79d90cb6bd Use Projects::UpdateService to archive projects
System hooks were not being triggered when projects were archived or
unarchived. Reuse the Projects::UpdateService to automatically
trigger system hooks and increase code reuse.
2018-08-03 11:55:21 -04:00
Tiago Botelho d138a949da Backports EE-1499 to CE 2018-07-27 16:24:43 +01:00
Marko, Peter 6d72bb3832 Add min_access_level filter to projects API
Signed-off-by: Marko, Peter <peter.marko@siemens.com>
2018-07-23 20:57:50 +02:00
Valery Sizov c3c7f26a34 Backport of gitlab-org/gitlab-ee!6137 2018-07-19 18:32:12 +00:00
Marko, Peter 209fd86442 Fix archived parameter for projects API 2018-07-16 16:25:38 +02:00
Jamie Schembri 38d407d7a7 Fix #48537 - Update avatar only via the projects API 2018-07-09 19:03:44 +02:00
Aram Visser c3de6a8673 Add transfer project endpoint to the Projects API 2018-06-27 18:21:18 +07:00
Douwe Maan cda2c5e76f
Only preload member records for the relevant projects/groups/user in projects API 2018-05-30 15:58:39 +02:00
Mark Fletcher 5716167775 Fix project creation for user endpoint bug
In this endpoint the `jobs_enabled` parameter must be
translated to `builds_enabled` before being passed to
the `Projects::CreateService`.
2018-04-23 08:22:16 +01:00
🙈 jacopo beschi 🙉 c6b1043e9d Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
Roger Rüttimann e467a11ec7 Feature/add language in repository to api 2018-04-13 08:06:04 +00:00
Bob Van Landuyt 11a9fbe65b Make the API project params reusable 2018-04-04 19:49:48 +02:00
Jan f6d58310fc Resolve "Allow the configuration of a project's merge method via the API" 2018-04-04 09:56:38 +00:00
Jan 54baf3a362 Resolve "Forking with namespace doesn't work (API)" 2018-03-26 09:22:03 +00:00
Kárpáti László 8bdfd8aa87 Resolve "API: PUT /projects/:id fails when only ci_config_path is specified" 2018-02-21 15:57:26 +00:00
Markus Koller b7cd99c376
Allow including custom attributes in API responses 2018-02-08 13:30:34 +01:00
Yorick Peterse cca61980d5
Track and act upon the number of executed queries
This ensures that we have more visibility in the number of SQL queries
that are executed in web requests. The current threshold is hardcoded to
100 as we will rarely (maybe once or twice) change it.

In production and development we use Sentry if enabled, in the test
environment we raise an error. This feature is also only enabled in
production/staging when running on GitLab.com as it's not very useful to
other users.
2018-02-01 17:00:46 +01:00
Jan Christophersen 795e546b1c Resolve "Projects API: filter 'with_issues_enabled=true' returns projects with 'issues_enabled=false'" 2018-01-19 07:33:58 +00:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Francisco Javier López c9871e84e4 The API isn't using the appropriate services for managing forks 2017-12-07 08:44:55 +00:00
Francisco Lopez 966f83f965 Undoing debugging change 2017-12-01 18:32:12 +01:00
Francisco Lopez 194f7bca9a Comments from code review applied. Also switched forked_from_project and ForkedProjectLinks to ForkNetworkMember 2017-12-01 18:32:12 +01:00
Francisco Lopez 58c5b463ff Refactored /projects and /user/:user_id/projects endpoints 2017-12-01 18:32:12 +01:00
Markus Koller 6902848a9c
Support custom attributes on projects 2017-11-06 10:51:46 +01:00
Mark Fletcher 63e0a42317 Add an API endpoint to determine the forks of a project 2017-09-20 08:27:16 +10:00
Ashley Dumaine a3f76b76a4 change collapse to resolve and comments to discussions 2017-09-06 10:07:47 +01:00
Ashley Dumaine ef4b3a39bc Add functionality to collapse outdated diff comments regardless of discussion resolution 2017-09-06 10:07:46 +01:00
Robert Schilling 6a2ee0968e API: Use defined project requirements 2017-08-31 14:57:47 +02:00
Robert Schilling ee4820a526 Add a spec when ressource is not modified 2017-08-29 10:12:10 +02:00