Commit Graph

324 Commits

Author SHA1 Message Date
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
Balasankar "Balu" C 99633a8fa3
Add specs: setting path/name to project fork API 2019-02-20 00:19:28 +05:30
Dylan MacKenzie b421bd316f Add programming language filtering to `/projects` 2019-02-04 15:06:17 +00:00
Rémy Coutable 8028a59d7a Merge branch '51913-api-getting-projects-for-users-with-dot-gets-404' into 'master'
API: Support username with dots

Closes #51913

See merge request gitlab-org/gitlab-ce!24395
2019-02-01 14:35:46 +00:00
Nick Thomas 41ae26d9ea Merge branch 'api-nested-group-permission' into 'master'
Return the maximum group access level in the projects API

Closes #43684

See merge request gitlab-org/gitlab-ce!24403
2019-01-18 15:36:58 +00:00
Alejandro Rodríguez ab94a5a537 Return max group access level in the projects API
Currently if a project is inside a nested group and a user doesn't have
specific permissions for that group but does have permissions on a
parent group the `GET /projects/:id` API call will return the following
permissions:

```json
permissions: { project_access: null, group_access: null }
```

It could also happen that the group specific permissions are of lower
level than the ones the user has in parent groups. This patch makes it
so that the permission returned for `group_access` is the highest from
amongst the hierarchy, which is (ostensibly) the information that the
API user is interested in for that field.
2019-01-16 14:54:05 -03:00
Mathieu Parent 542e26fec0 Add group full path to project's shared_with_groups 2019-01-15 21:09:05 +01:00
Robert Schilling 2190704c61 API: Support username with dots 2019-01-15 17:16:03 +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
James Lopez 64c11f104c Resolve "Can add an existing group member into a group project with new permissions but permissions are not overridden" 2018-12-06 13:15:29 +00:00
J.D. Bean ff89680330 Feature/add license to project API 2018-10-26 15:12:14 +00:00
Bob Van Landuyt f3fba178b9 Remove the `ForkedProjectLink` model
This removes the `ForkedProjectLink` model that has been replaced by
the `ForkNetworkMember` and `ForkNetwork` combination. All existing
relations have been adjusted to use these new models.

The `forked_project_link` table has been dropped.

The "Forks" count on the admin dashboard has been updated to count all
`ForkNetworkMember` rows and deduct the number of `ForkNetwork`
rows. This is because now the "root-project" of a fork network also
has a `ForkNetworkMember` row. This count could become inaccurate when
the root of a fork network is deleted.
2018-10-19 11:57:20 +02:00
🙈 jacopo beschi 🙉 8e52f56d8d Resolve "500 Internal Server Error: Deleting branch of deleted project" 2018-09-12 20:52:30 +00:00
Steve 175f689eb7 Initialize projects with readme 2018-09-12 13:58:31 +00:00
Sean McGivern e922750e89 Merge branch 'api-shared_group_expires-at' into 'master'
API: Add shared project's expiration date

Closes #46107

See merge request gitlab-org/gitlab-ce!21104
2018-08-22 08:26:29 +00:00
Robert Schilling 7308a9be1e API: Add shared project's expiration date 2018-08-21 11:23:05 +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
sliaquat 4157073068 Remove some duplicate tests and fix some typos 2018-08-16 16:40:03 +05: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
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
Francisco Javier López c52ab9141c Fix gitlab import project load 2018-07-23 07:52:15 +00:00
Marko, Peter 209fd86442 Fix archived parameter for projects API 2018-07-16 16:25:38 +02:00
Mark Chao a63bce1a4b Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
Jamie Schembri 38d407d7a7 Fix #48537 - Update avatar only via the projects API 2018-07-09 19:03:44 +02:00
Lin Jen-Shin 4ee08b77bc Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
Aram Visser c3de6a8673 Add transfer project endpoint to the Projects API 2018-06-27 18:21:18 +07:00
Robert Speicher 6d165c740c Make all uses of `fixture_file_upload` use relative paths 2018-06-07 09:54:41 -05:00
Imre Farkas 10237d458d Expose readme url in Project API 2018-05-22 10:53:37 +00: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
Roger Rüttimann e467a11ec7 Feature/add language in repository to api 2018-04-13 08:06:04 +00: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
Nick Thomas 17d842db30
Fix order dependencies in some specs
Our automatically-generated project paths are of the form project<N>. If a spec
manually specifies a project path of that form, it may conflict with the
automatically-generated paths in some circumstances.
2018-02-16 20:39:47 +00:00
Nick Thomas 6b0c6e69e1
Use hashed storage in the specs 2018-02-07 13:40:46 +00:00
Mario de la Ossa eaada9d706 use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00: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
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Jacopo 181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Douwe Maan 20ac30a705 Merge branch '36099-api-responses-missing-x-content-type-options-header' into '10-1-stable'
Include X-Content-Type-Options (XCTO) header into API responses

See merge request gitlab/gitlabhq!2211

(cherry picked from commit 6c818e77f2)

e087e075 Include X-Content-Type-Options (XCTO) header into API responses
2017-11-08 20:11:18 -08:00
Markus Koller 6902848a9c
Support custom attributes on projects 2017-11-06 10:51:46 +01:00
Jacopo 2f40dac352 Refactor `have_http_status` into `have_gitlab_http_status` in the specs 2017-10-20 10:13:18 +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
Douwe Maan a019369409 Expose avatar_url when requesting list of projects from API with simple=true 2017-09-26 12:47:48 +02:00
Mark Fletcher 63e0a42317 Add an API endpoint to determine the forks of a project 2017-09-20 08:27:16 +10:00
Bob Van Landuyt 9c300fd98d Use the new query-recorder features as a PoC 2017-09-14 17:46:28 +02:00
Douwe Maan 523a1c69ab Merge branch '23079-remove-default-scope-in-sortable' into 'master'
Removes default scope from sortable

Closes #23079

See merge request !13558
2017-09-07 16:15:32 +00:00
Tiago Botelho cfd475a45e Removes default scope from sortable 2017-09-07 13:01:59 +01:00
Sean McGivern 7f778b7a10 Tidy up projects API specs 2017-09-06 10:08:05 +01:00
Ashley Dumaine a3f76b76a4 change collapse to resolve and comments to discussions 2017-09-06 10:07:47 +01:00