Commit Graph

86 Commits

Author SHA1 Message Date
GitLab Bot af60c8a79f Add latest changes from gitlab-org/gitlab@master 2022-12-14 09:08:01 +00:00
GitLab Bot 5fe2d74e00 Add latest changes from gitlab-org/gitlab@master 2022-12-09 09:08:55 +00:00
GitLab Bot a16398e10f Add latest changes from gitlab-org/gitlab@master 2022-07-29 18:08:58 +00:00
GitLab Bot 842ac3526c Add latest changes from gitlab-org/gitlab@master 2022-04-08 18:08:29 +00:00
GitLab Bot 389d5aa505 Add latest changes from gitlab-org/gitlab@master 2022-03-15 09:07:33 +00:00
GitLab Bot a40d39ddd2 Add latest changes from gitlab-org/gitlab@master 2022-02-26 00:14:54 +00:00
GitLab Bot da59ce8b21 Add latest changes from gitlab-org/gitlab@master 2021-04-12 18:12:15 +00:00
GitLab Bot 49a897eff9 Add latest changes from gitlab-org/gitlab@master 2020-09-08 09:08:31 +00:00
GitLab Bot bdca097916 Add latest changes from gitlab-org/gitlab@master 2020-08-11 03:11:00 +00:00
GitLab Bot fa7ac2663b Add latest changes from gitlab-org/gitlab@master 2020-06-24 06:09:01 +00:00
GitLab Bot abae8f34f3 Add latest changes from gitlab-org/gitlab@master 2020-03-31 21:08:05 +00:00
GitLab Bot 8f9beefac3 Add latest changes from gitlab-org/gitlab@master 2020-03-23 12:09:47 +00:00
GitLab Bot 17ab40ca08 Add latest changes from gitlab-org/gitlab@master 2020-02-26 15:08:56 +00:00
GitLab Bot c0d8f9f3f9 Add latest changes from gitlab-org/gitlab@master 2020-01-03 09:07:33 +00:00
GitLab Bot cfc792b9ca Add latest changes from gitlab-org/gitlab@master 2019-12-10 07:53:40 +00:00
GitLab Bot abfafe3c57 Add latest changes from gitlab-org/gitlab@master 2019-10-29 00:06:10 +00: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
Rémy Coutable 3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +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
Mark Chao a63bce1a4b Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
Lin Jen-Shin 4ee08b77bc Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
Jan Provaznik dcdfa04b32 Add discussion API
* adds basic discussions API for issues and snippets
* reorganizes notes specs (so same tests can be used for all noteable types - issues, MRs, snippets)
2018-03-07 12:27:50 +01:00
Oswaldo Ferreira bf8c20729b Cache merged and closed events data in merge_request_metrics table 2018-01-02 17:45:25 -02:00
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
haseeb 57d9121127 support ordering of project notes in notes api 2017-11-29 16:22:22 +00:00
Jacopo 2f40dac352 Refactor `have_http_status` into `have_gitlab_http_status` in the specs 2017-10-20 10:13:18 +02:00
Jarka Kadlecova 994e7d1359 Create system notes for MR too, improve doc + clean up code 2017-09-14 14:50:32 +02:00
Robert Schilling 915dd57fe2 Add tests for the unmodified header 2017-08-28 17:10:34 +02:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Robert Speicher a6ec5121f0 Correct RSpec/SingleLineHook cop offenses 2017-06-14 13:18:56 -05:00
Jacopo ff76adb547 Unnecessary "include WaitForAjax" and "include ApiHelpers"
Removed all the unnecessary include of `WaitForAjax` and `ApiHelpers` in the specs.
Removed unnecessary usage of `api:true`
2017-04-21 22:32:02 +02:00
Toon Claes add5cd996f API: Make the /notes endpoint work with noteable iid instead of id
In API V4 all endpoints were changed so Merge Requests and Issues
should be referred by iid, instead of id. Except the /notes endpoint
was forgotten. So change the endpoints from:

- /projects/:id/issues/:issue_id/notes
- /projects/:id/merge_requests/:merge_request_id/notes

To:

- /projects/:id/issues/:issue_iid/notes
- /projects/:id/merge_requests/:merge_request_iid/notes

For Project Snippets nothing changes.
2017-03-27 15:29:37 +02:00
Sean McGivern 523fb730c2 Merge branch '25437-just-emoji' into 'master'
#25437 Allow posting of just an emoji in comment; add /award slash command

Closes #25437

See merge request !9382
2017-03-01 11:15:51 +00:00
mhasbini 9f949d4e24 add /award slash command
add /award slash command; Allow posting of just an emoji in comment
2017-02-28 22:38:19 +02:00
Robert Schilling 86c58687b2 Return 204 for delete endpoints 2017-02-28 08:32:38 +01:00
Robert Schilling 993c3d14d5 Remove shared example for pagination 2017-02-20 15:39:16 +01:00
Robert Schilling c70dfbc686 Add a custom pagination matcher 2017-02-16 15:38:40 +01:00
Robert Speicher a1f959430b Merge branch 'fix-guest-access-posting-to-notes' into 'security'
Prevent users from creating notes on resources they can't access

See https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2054
2017-01-23 13:54:52 -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 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
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
Douwe Maan 6df22f72c6 Rephrase some system notes to be compatible with new system note style 2016-11-24 18:26:29 +08:00
barthc ea6c5c1c0e
Fix authored vote from notes
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-24 15:24:56 +02:00
Nick Thomas bfb20200e9 Add a be_like_time matcher and use it in specs
The amount of precision times have in databases is variable, so we need
tolerances when comparing in specs. It's better to have the tolerance defined
in one place than several.
2016-10-17 14:44:20 +01:00
Z.J. van de Weg cf00fbecc5 Fix API notes endpoint when posting only emoji 2016-09-16 16:28:53 +02:00
Clement Ho 77abf8cccf Capitalize mentioned issue timeline notes 2016-08-25 10:47:40 -05:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Z.J. van de Weg abca19da8b Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00