Commit Graph

3653 Commits

Author SHA1 Message Date
Kamil Trzciński 68e8bbdb54 Merge branch '61927-pages-custom-domain-virtual-domain' into 'master'
Add support for custom domains to the Pages internal API

See merge request gitlab-org/gitlab-ce!32735
2019-09-11 13:21:38 +00:00
Filipa Lacerda 48b98b5898 Enables Run Pipeline button to be rendered
In the Merge Request view, under pipelines tab
the user can see a run pipeline button

Adds axios post request to button click

Adds the logic to handle the user click,
refresh the table and disable the button while thee
request is being made

Updates UI for desktop and mobile

Adds specs
Regenerates potfile

Follow-up after review

Uses .finally to avoid code repetition
2019-09-11 09:06:33 +00:00
Alessio Caiazza daf7810e2e Add Scalability/FileUploads cop
This cop prevents you from using file in API, it points you to the
development documentation about workhorse file acceleration.
2019-09-10 16:24:10 +00:00
Dinesh Panda 736b5908da Avoid calling freeze on already frozen strings in lib 2019-09-10 08:11:43 +00:00
Krasimir Angelov 676675dc0b Add support for custom domains to the internal Pages API
Update the `/internal/pages` endpoint to return virtual domain
configuration for custom domains.
2019-09-10 13:56:07 +12:00
Ash McKenzie d7c1af988d Merge branch 'issue-67127' into 'master'
Expose :protected field for ../tags/:tag_name API endpoint

See merge request gitlab-org/gitlab-ce!32790
2019-09-10 00:49:53 +00:00
Douglas Barbosa Alexandre 814d12b8c7 Merge branch 'api_settings' into 'master'
Improve application settings API

Closes #58180

See merge request gitlab-org/gitlab-ce!31149
2019-09-09 20:29:31 +00:00
Kamil Trzciński cbb35ea882 Merge branch '61927-skeleton-pages-internal-api' into 'master'
Add skeleton Pages internal API

See merge request gitlab-org/gitlab-ce!32732
2019-09-09 13:27:11 +00:00
Mathieu Parent 85776fa3ff Settings API: domain_{black,white}list should be arrays
As in documentation.

Fixes: #58180.

Also remove the requirement between domain_blacklist_enabled and domain_blacklist.
2019-09-09 15:14:52 +02:00
Mathieu Parent d5978d0921 App settings: Allow all import sources from API 2019-09-09 15:11:33 +02:00
Manoj MJ b041321a35 Application Statistics API
This change implements Application
Statistics API
2019-09-09 03:38:42 +00:00
Andrea Leone 26435701bc
Fix after 'static-analysis' job fail 2019-09-07 16:25:53 +02:00
Andrea Leone b807b42aa3
Expose :protected field for ../tags/:tag_name API endpoint 2019-09-07 10:45:52 +02:00
Alessio Caiazza e32069ef6c Process workhorse accelerated wiki uploads
Wiki attachments can be workhorse accelerated.
This commit is backward compatible with older workhorse
2019-09-06 15:53:13 +02:00
Krasimir Angelov 477ba2b346 Add skeleton Pages internal API
Basic `/internal/pages` endpoint that will be used for Pages virtual
domains internal API. The endpoint is currently behind feature flag and
provides authetication similar to how Workhorse is authenticating with
the GitLab.
2019-09-06 16:06:25 +12:00
Ash McKenzie 37cfaf27ab
Extract /internal/allowed API Actor logic out
Created new API::Support::GitAccessActor class to
encapsulate some of the more edge logic, making
the /internal/allowed route much cleaner.
2019-09-05 13:11:29 +10:00
Felipe Artur 13fc0efa57 Let project reporters create issue from group boards
The current state of group issue boards does not show the "Add issues"
button on the UI for users that are reporters of group child projects.
2019-09-04 16:33:02 +00:00
Winnie Hellmann 61515737a5 Add epic_iid to issue API entity
(cherry picked from commit 0bf7fecdee5a200eeb4f27b4888a57ceee63bde9)
2019-09-04 14:44:37 +00:00
Krasimir Angelov c4b804c6db Rename API::Internal class to API::Internal::Base
so that we can use API::Internal namespace.

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/61927.
2019-09-04 10:07:49 +12:00
Michael Kozono 5256f01183 Merge branch '66464-typo-in-release_endpoint_requiremets-constant' into 'master'
Resolve "Typo in RELEASE_ENDPOINT_REQUIREMETS constant"

Closes #66464

See merge request gitlab-org/gitlab-ce!32468
2019-09-03 18:37:09 +00:00
Etienne Baqué a43ab8d6a4 Added relationships between Release and Milestone
Modified schema via migrations.
Added one-to-one relationship between the two models.
Added changelog file
2019-09-03 09:38:59 +00:00
Sean Carroll fc9f3894e8 Correct typo in constant 2019-09-02 09:03:07 +02:00
Robert Speicher 7698d40550
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2019-08-29 17:17:37 -05:00
GitLab Release Tools Bot 090956259c Merge branch 'security-enable-image-proxy' into 'master'
Use image proxy to mitigate stealing ip addresses

Closes #2812

See merge request gitlab/gitlabhq!2926
2019-08-29 21:34:29 +00:00
GitLab Release Tools Bot 5a008d1368 Merge branch 'security-epic-notes-api-reveals-historical-info-ce-master' into 'master'
Filter out old system notes for epics in notes api endpoint response

See merge request gitlab/gitlabhq!3224
2019-08-29 21:34:24 +00:00
GitLab Release Tools Bot a5b2a37860 Merge branch 'security-59549-add-capcha-for-failed-logins' into 'master'
Require a captcha after unique failed logins from the same IP

See merge request gitlab/gitlabhq!3270
2019-08-29 21:34:12 +00:00
Kamil Trzciński 955e23d956 Merge branch 'sh-support-content-for-snippets-api' into 'master'
Standardize use of `content` parameter in snippets API

Closes #66673

See merge request gitlab-org/gitlab-ce!32296
2019-08-29 11:33:48 +00:00
Stan Hu fc52421b55 Standardize use of `content` parameter in snippets API
There was some confusion over whether `code` or `content` is the right
parameter for snippets. Internally, the database stores
`content`. However:

1. Project snippets use `code`. `code` gets remapped in `content` in
`lib/api/project_snippets.rb`.

2. Personal snippets use `content`.

To unify these APIs, allow an alias of `content` to work for project
snippets.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66673
2019-08-28 22:54:07 -07:00
Michael Kozono 50342028aa
Simplify internal post receive messages
Instead of sending varied data to Gitaly, and making Gitaly construct
various messages, build the messages first and have Gitaly print
either basic messages or alert messages, in the order they come.

Depends on https://gitlab.com/gitlab-org/gitaly/merge_requests/1410
2019-08-28 15:18:58 -07:00
Victor Zagorodny e4fbd94cf5 Update CE files for GSD projects filter
A new param with_security_reports was added to
GET /groups/:id/projects API and the code to
support this logic in GroupProjectsFinder and
Project model. Also, a DB index was added to
ci_job_artifacts table to speed up the search
of security reports artifacts for projects
2019-08-28 14:26:42 +00:00
Patrick Derichs c9b4dc677a Filter out old system notes for epics 2019-08-28 15:04:23 +02:00
Winnie Hellmann 75353242e2 Replace prepend_entity with prepend_if_ee
(cherry picked from commit 897a9d308db46b620b738b98f2b0e5630ac7d2dd)
2019-08-27 15:11:15 +00:00
Sean McGivern a390f5ff05 Merge branch '57657-promote-label-to-group-label-via-api-endpoint' into 'master'
Promote Label to Group Label via API endpoint

Closes #57657

See merge request gitlab-org/gitlab-ce!25218
2019-08-27 08:53:09 +00:00
Mayra Cabrera bbd39021c3 Merge branch 'sh-fix-nplusone-issues' into 'master'
Fix N+1 Gitaly calls in /api/v4/projects/:id/issues

See merge request gitlab-org/gitlab-ce!32171
2019-08-26 17:51:59 +00:00
Robert Schilling e2a7dd3f0a Update docs targeting 12.3 2019-08-26 12:48:55 +02:00
Robert Schilling efafc98bd8 Move promote to put and add more specs 2019-08-26 10:45:37 +02:00
Robert Schilling 41412f7360 Add docs and first specs 2019-08-26 10:45:37 +02:00
Robert Schilling 2e83665ed3 API: Promote project labels to group labels 2019-08-26 10:45:37 +02:00
Brett Walker ad05e48863 Add support for using a Camo proxy server
User images and videos will get proxied through
the Camo server in order to keep malicious
sites from collecting the IP address of users.
2019-08-23 23:44:53 -05:00
Stan Hu 440635015f Fix N+1 Gitaly calls in /api/v4/projects/:id/issues
This is a follow-up from
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31938.

In GitLab 9.0,
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9661 removed the
`subscribed` flag from the API when the user requested a list of issues
or merge requests since calculating this value triggers extensive
Markdown processing.

In GitLab 12.0 via a4fbf39e, we accidentally reintroduced this
performance regression by changing `IssueBasic` to `Issue` in
`entities.rb`. This showed up as a Gitaly N+1 issue since the Markdown
processing would attempt to extract a commit if it detected a regex that
matched a commit.

We restore the prior behavior by once again removing the `subscribed`
flag for the bulk list of issues and merge requests and add a test to
ensure they aren't reintroduced.

Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/66202
2019-08-23 21:26:50 -07:00
Marius Bobin 811252536d Read pipelines from public projects though API
Allow users to read pipelines for public projects
with public builds enabled without providing an access token.
2019-08-23 20:54:32 +00:00
Patrick Derichs f1e24d4d31 Add label_id parameter to label API for PUT and DELETE
Add specs for new parameter and updated documentation as well.
2019-08-23 17:45:42 +00:00
Kamil Trzciński 99e8b77e5e Merge branch 'sh-eliminate-gitaly-nplus-one-notes' into 'master'
Eliminate Gitaly N+1 queries with notes API

See merge request gitlab-org/gitlab-ce!32089
2019-08-23 17:21:19 +00:00
Alexandru Croitor f5b855546e Update sort options for issues list
Increase sort options for issues list from updated_at and create_at,
to include more options close to what is required in actual issue list
UI.

This helps us to use REST API for issues list with sorting capabilities

https://gitlab.com/gitlab-org/gitlab-ce/issues/57402
2019-08-23 11:32:15 +03:00
Stan Hu e24b9c2502 Eliminate Gitaly N+1 queries with notes API
Similar to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31834,
we see that in https://gitlab.com/gitlab-org/gitlab-ce/issues/65957
there can be hundreds, even thousands, of Gitaly requests in the
`/api/:version/projects/:id/merge_requests/:noteable_id/notes` endpoint.

Previously, the API to retrieve notes generated hundreds of Gitaly calls
to determine whether a system note should be shown to the user. It did
this by:

1. Rendering the Markdown
2. Extracting cross-references from the Markdown
3. Issuing a Gitaly `FindCommit` RPC for every reference to validate
that the commit exists.

The last step is unnecessary because we don't need to display a commit
if the user doesn't have access to the project in the first place.
`RendersNotes#prepare_notes_for_rendering` is already used in
`MergeRequestsController`, which is why we don't see N+1 Gitaly calls
there. We use it here to optimize the note redaction process.
2019-08-22 22:28:47 -07:00
Kushal Pandya 7b5708d1d9 Merge branch 'ee-2502-refactor-ee-app-assets-javascripts-approvals-components-approvers_select-vue-to-remove-approverusers' into 'master'
Add a new method to `Api.js`: `projectUsers`

See merge request gitlab-org/gitlab-ce!31801
2019-08-22 07:59:22 +00:00
Luke Duncalfe 37b17fa61a Add service classes for mutating AwardEmoji
Adding, destroying and toggling emoji previously lacked services and
instead were performed through methods called on Awardable models.

This led to inconsistencies where relevant todos would be marked as done
only when emoji were awarded through our controllers, but not through
the API. Todos could also be marked as done when an emoji was being
removed.

Behaviour changes

- Awarding emoji through the API will now mark a relevant Todo as done
- Toggling an emoji off (destroying it) through our controllers will no
  longer mark a relevant Todo as done

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63372
2019-08-21 11:39:41 +12:00
Stan Hu e632ae8084 Standardize remote_ip and path keys for auth.log and api_json.log
Current `auth.log` uses `fullpath` and `ip`, while `api_json.log` uses
`remote_ip` and `path` for the same fields. Let's standardize these
namings to make it easier for people working with the data.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66167
2019-08-20 18:12:28 +00:00
Nick Thomas f7f91e84f7 Add a skip_users filter to the project users API
This functionality is available in the /autocomplete users pseudo-API.
We're attempting to replace that with the canonical API, so it needs
support for this parameter too.
2019-08-19 14:21:56 +05:30
Stan Hu ba7c501fef Fix Gitaly N+1 calls with listing issues/MRs via API
In GitLab 9.0,
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9661 removed the
`subscribed` flag from the API when the user requested a list of issues
or merge requests since calculating this value triggers extensive
Markdown processing.

In GitLab 12.0 via a4fbf39e, we accidentally reintroduced this
performance regression by changing `IssueBasic` to `Issue` in
`entities.rb`. This showed up as a Gitaly N+1 issue since the Markdown
processing would attempt to extract a commit if it detected a regex that
matched a commit.

We restore the prior behavior by once again removing the `subscribed`
flag for the bulk list of issues and merge requests and add a test to
ensure they aren't reintroduced.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66202
2019-08-17 20:35:37 -07:00