Commit Graph

138 Commits

Author SHA1 Message Date
Jan Provaznik 4189ffe214 Added labels_hook_attrs method
Based on review comment fetching labels hook_attrs is now
wrapped in an issue's model method.
2019-06-24 11:51:34 +02:00
Brett Walker 40b67a4f6a Allow issues to be sorted by relative_position
- adding a "Manual" option to the dropdown
- show 100 issues list when manually sorting
2019-05-28 11:36:10 -05:00
Stan Hu b7b852c250 Additional fix to handle NULL lock_version
If the UI sends a string value for lock_version (e.g. "0"), then the
previous monkey patch did not properly handle that properly. This
commit casts the value to an integer to determine whether to look for
NULL lock_versions.

For merge requests, GitLab sends a POST request to
`namespace/project/merge_requests/:iid` with the
`merge_request[lock_version]` parameter with a string `0`. The string
value comes from the form field, which explains why
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/28145 wasn't
sufficient.
2019-05-06 21:21:56 -07:00
Sean McGivern 835c616b12 Fix editing issues and MRs with NULL lock_version 2019-05-06 20:24:23 +00:00
Imre Farkas 9bc5ed14fe Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-09 15:38:58 +00:00
Andreas Brandl 46b1b9c1d6 Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"
This reverts merge request !26823
2019-04-05 13:02:56 +00:00
Imre Farkas d9d7237d2e Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE 2019-04-05 11:45:47 +00:00
Thong Kuah a2cfc150ce Add # frozen_string_literal to spec/models
Adds `# frozen_string_literal: true` to spec/models ruby files
2019-04-01 14:37:54 +13:00
Kamil Trzciński a555a227dd
Merge branch 'filter-confidential-issues' into 'master'
Ability to filter confidential issues

Closes #50747

See merge request gitlab-org/gitlab-ce!24960
2019-02-26 12:24:39 +01:00
Michael Kozono e95b88a06d
Revert "Merge branch 'filter-confidential-issues' into 'master'"
This reverts commit d133bf84c6, reversing
changes made to 7981c0292b.
2019-02-25 12:42:34 -08:00
Robert Schilling 56a54c62fb Add confidential_only scop to issue model 2019-02-21 14:12:11 +01:00
Sean McGivern d00b4a2eb1 Don't check confidential issues for spam
Spam checks are meant for content that could be indexed by search
engines. Confidential issues aren't indexed by search engines, so we
don't need to do spam checks for them.

We do need to check for spam when an issue changes from confidential to
public, even if nothing else changed.
2019-01-18 12:46:05 +00:00
Felipe Artur 0ae48e0687 Move issue related_branches to service
Moves the related_branches method from Issue model
to RelatedBranchesService
2018-10-04 15:59:14 -03:00
Jarka Košanová 3a7c29417d Add specs for closing and reopening issue 2018-09-24 22:50:17 +02:00
Sean McGivern c73da6c1e7 Move Issue#{referenced,closed_by}_merge_requests to service
These methods don't really need to be on the Issue model. Issue#related_branches
can also be moved to a service, but we can do that in a separate commit.

This commit does not change any behaviour; it just moves code around, renames
the service, and refactors the specs.
2018-08-21 12:40:44 +01:00
Mark Chao a63bce1a4b Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
Shinya Maeda 82a49d0fea Clarify scope for AtomicInternalId shared spec 2018-05-14 17:41:56 +09:00
Jacopo 5a29a304be Shows new branch/mr button even when branch exists 2018-04-19 13:56:36 +02:00
Andreas Brandl 6568b4a98e Add shared specs for AtomicInternalId concern. 2018-03-16 13:35:26 +01:00
Bob Van Landuyt 148816cd67 Port `read_cross_project` ability from EE 2018-02-22 17:11:36 +01:00
Yorick Peterse d0b8f536a1
Remove soft removals related code
This removes all usage of soft removals except for the "pending delete"
system implemented for projects. This in turn simplifies all the query
plans of the models that used soft removals. Since we don't really use
soft removals for anything useful there's no point in keeping it around.

This _does_ mean that hard removals of issues (which only admins can do
if I'm not mistaken) can influence the "iid" values, but that code is
broken to begin with. More on this (and how to fix it) can be found in
https://gitlab.com/gitlab-org/gitlab-ce/issues/31114.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37447
2018-01-08 17:04:45 +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
Yorick Peterse 856447ccd3
Throttle the number of UPDATEs triggered by touch
This throttles the number of UPDATE queries that can be triggered by
calling "touch" on a Note, Issue, or MergeRequest. For Note objects we
also take care of updating the associated "noteable" relation in a
smarter way than Rails does by default.
2017-12-06 15:59:37 +01:00
George Andrinopoulos 3963f91ee3 Move update_project_counter_caches? out of issue and merge request 2017-11-11 21:06:28 +02:00
Rémy Coutable f070265a6d
Introduce new hook data builders for Issue and MergeRequest
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-09 16:44:47 +02:00
Rémy Coutable 075d651604 Start adding Gitlab::HookData::IssuableBuilder
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-09 15:07:10 +02:00
Yorick Peterse c158a22fd3
Only update the sidebar count caches when needed
This ensures the issues/MR cache of the sidebar is only updated when the
state or confidential flags changes, instead of changing this for every
update.
2017-08-30 15:49:40 +02:00
Yorick Peterse 6ec53f5d48
Cache the number of open issues and merge requests
Every project page displays a navigation menu that in turn displays the
number of open issues and merge requests. This means that for every
project page we run two COUNT(*) queries, each taking up roughly 30
milliseconds on GitLab.com. By caching these numbers and refreshing them
whenever necessary we can reduce loading times of all these pages by up
to roughly 60 milliseconds.

The number of open issues does not include confidential issues. This is
a trade-off to keep the code simple and to ensure refreshing the data
only needs 2 COUNT(*) queries instead of 3. A downside is that if a
project only has 5 confidential issues the counter will be set to 0.

Because we now have 3 similar counting service classes the code
previously used in Projects::ForksCountService has mostly been moved to
Projects::CountService, which in turn is reused by the various service
classes.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36622
2017-08-23 13:42:29 +02:00
Rémy Coutable 1b413bd62f Enable Timecop safe mode
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-11 14:53:17 +02:00
Rémy Coutable c946ee1282
Enable the Layout/SpaceBeforeBlockBraces cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-09 11:52:22 +02:00
Sean McGivern c94990820a Merge branch '32844-issuables-performance' into 'master'
Issuables: Move some code from create services to Sidekiq workers

See merge request !13326
2017-08-07 21:21:29 +00:00
Jarka Kadlecova 9ef3c431e4 Move some after_create parts to worker to improve performance 2017-08-07 15:57:56 +02:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02: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
Valery Sizov e2a3a5095a Move update_assignee_cache_counts to the service 2017-05-12 14:12:29 +03:00
Valery Sizov 387c4b2c21 Backport of multiple_assignees_feature [ci skip] 2017-05-04 17:11:53 +03:00
Alfredo Sumaran b64a37c4ed Allow to create new branch and empty WIP merge request from issue page 2017-05-04 08:09:21 +00:00
Valery Sizov 36a8cc3eca Remove helpers assigned_issuables_count and cached_assigned_issuables_count 2017-04-20 13:28:04 +03:00
Robert Speicher add1c18860 Remove an unused `Issue.open_for` scope 2017-04-10 18:32:30 -04:00
Felipe Artur 251255e7ca Do not set closed_at to nil when issue is reopened 2017-04-04 15:19:09 -03:00
Oswaldo Ferreira d730b69eb2 Spam check only when spammable attributes have changed 2017-03-21 14:20:15 -03:00
Felipe Artur 94c19fbfe8 Add closed_at field to issues 2017-03-17 16:41:09 -03:00
Douwe Maan b7123a8f59 Merge branch '27271-missing-time-spent-in-issue-webhook' into 'master'
Include time tracking attributes in webhooks payload

Closes #27271

See merge request !9942
2017-03-15 15:29:16 +00:00
Ruben Davila dd53a9c013 Include time tracking attributes in webhooks payload 2017-03-14 11:56:15 -05:00
Valery Sizov 29e34c3326 Preserve order by priority on issues board 2017-03-14 18:13:52 +02:00
Oswaldo Ferreira aeb9db6753 Present group and dashboard MR list without grouping by project 2017-01-27 20:20:18 -02:00