summaryrefslogtreecommitdiff
path: root/app/models/issue.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove soft removals related codeYorick Peterse2018-01-081-3/+1
| | | | | | | | | | | | | | 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
* Refactor matchers for background migrationsce-backport=reorder-issuesJarka Kadlecová2018-01-051-1/+1
|
* Refactor RelativePositioning so that it can be used by other classesJarka Kadlecová2018-01-051-0/+6
|
* Cache merged and closed events data in merge_request_metrics tableOswaldo Ferreira2018-01-021-0/+5
|
* Fix migration that removes issues.branch_namefix-remove-branch-name-migrationYorick Peterse2017-12-111-1/+1
|
* Add spec for removing issues.assignee_idSean McGivern2017-12-111-0/+3
| | | | | This migration also needs to be a post-deployment migration, as it removes a column.
* Throttle the number of UPDATEs triggered by touchYorick Peterse2017-12-061-0/+1
| | | | | | | 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.
* Create issue and merge request destroy servicesGeorge Andrinopoulos2017-11-251-1/+0
|
* Add issue sidebar and toggle_subscription endpoint in board issues dataOswaldo Ferreira2017-11-201-1/+6
|
* Move update_project_counter_caches? out of issue and merge requestGeorge Andrinopoulos2017-11-111-4/+0
|
* Refactor issuables index actionsJarka Kadlecova2017-11-071-2/+0
|
* CE port of code changed for epicsjk-epic-changes-ce-portJarka Kadlecova2017-11-021-0/+3
|
* Introduce new hook data builders for Issue and MergeRequest34284-add-changes-to-issuable-webhook-dataRémy Coutable2017-10-091-51/+1
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Start adding Gitlab::HookData::IssuableBuilderRémy Coutable2017-10-091-15/+54
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Include the changes in issuable webhook payloadsRémy Coutable2017-10-091-0/+1
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Improve list of sorting optionsVitaliy @blackst0ne Klachkov2017-09-231-1/+2
|
* Fix refreshing of issues/MR count cachesfix-counts-cachingYorick Peterse2017-09-191-2/+0
| | | | | | | | | | | | | | | This ensures the open issues/MR count caches are refreshed properly when creating new issues or MRs. This MR also includes a change to the cache keys to ensure all caches are rebuilt on the fly. This particular problem was not caught in the test suite due to a null cache being used, resulting in all calls that would use a cache using the underlying data directly. In production the code would fail because a newly saved record returns an empty hash in #changes meaning checks such as `state_changed? || confidential_changed?` would return false for new rows, thus never updating the counters. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/38061
* Delete duplicated lines.Shinichi Maeshima2017-09-111-3/+0
|
* Merge branch 'master' into issue-discussions-refactorDouwe Maan2017-08-311-0/+6
|\ | | | | | | | | # Conflicts: # app/models/issue.rb
| * Only update the sidebar count caches when neededsidebar-cache-updatesYorick Peterse2017-08-301-0/+6
| | | | | | | | | | | | 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.
* | Merge branch 'master' into issue-discussions-refactorDouwe Maan2017-08-301-0/+7
|\ \ | |/ | | | | | | # Conflicts: # app/models/issue.rb
| * Merge branch 'cache-issue-and-mr-counts' into 'master'Douwe Maan2017-08-231-0/+7
| |\ | | | | | | | | | | | | | | | | | | Cache the number of open issues and merge requests Closes #36622 See merge request !13639
| | * Cache the number of open issues and merge requestsYorick Peterse2017-08-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge branch 'master' into issue-discussions-refactorDouwe Maan2017-08-231-3/+0
|\ \ \ | |/ / | | | | | | | | | # Conflicts: # package.json
| * | Remove ignore columnsFelipe Artur2017-08-181-3/+0
| |/
* | Prefer polymorphism over `is_a?`Douwe Maan2017-08-171-0/+4
|/
* Merge issuable "reopened" state into "opened"merge-issuable-reopened-into-opened-stateYorick Peterse2017-07-281-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having two states that essentially mean the same thing is very much like having a boolean "true" and boolean "mostly-true": it's rather silly. This commit merges the "reopened" state into the "opened" state while taking care of system notes still showing messages along the lines of "Alice reopened this issue". A big benefit from having only two states (opened and closed) is that indexing and querying becomes simpler and more performant. For example, to get all the opened queries we no longer have to query both states: SELECT * FROM issues WHERE project_id = 2 AND state IN ('opened', 'reopened'); Instead we can query a single state directly, which can be much faster: SELECT * FROM issues WHERE project_id = 2 AND state = 'opened'; Further, only having two states makes indexing easier as we will only ever filter (and thus scan an index) using a single value. Partial indexes could help but aren't supported on MySQL, complicating the development process and not being helpful for MySQL.
* fix created_afterJames Lopez2017-07-071-2/+0
|
* refactor created at filter to use model scopesJames Lopez2017-07-071-0/+1
|
* Added Cop to blacklist the use of `dependent:`Yorick Peterse2017-07-061-2/+7
| | | | | | | | This is allowed for existing instances so we don't end up 76 offenses right away, but for new code one should _only_ use this if they _have_ to remove non database data. Even then it's usually better to do this in a service class as this gives you more control over how to remove the data (e.g. in bulk).
* Add many foreign keys to the projects tableYorick Peterse2017-07-061-1/+1
| | | | | | | | | | | | This removes the need for relying on Rails' "dependent" option for data removal, which is _incredibly_ slow (even when using :delete_all) when deleting large amounts of data. This also ensures data consistency is enforced on DB level and not on application level (something Rails is really bad at). This commit also includes various migrations to add foreign keys to tables that eventually point to "projects" to ensure no rows get orphaned upon removing a project.
* Create and use project path helpers that only need a project, no namespaceDouwe Maan2017-07-051-5/+1
|
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-2/+2
|
* Migration - Remove position field from issues and merge requestsFelipe Artur2017-06-161-0/+3
|
* Order issues by priorityFelipe Artur2017-06-161-1/+1
|
* Enable the Style/PreferredHashMethods coprc/enable-PreferredHashMethods-copRémy Coutable2017-06-021-2/+2
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Rename all references to rendered_title to realtime_changesrename-rendered_titleLuke "Jared" Bennett2017-05-131-1/+1
|
* Consistently use monospace font for commit SHAs and branch and tag namesDouwe Maan2017-05-121-1/+1
|
* Backport of multiple_assignees_feature [ci skip]Valery Sizov2017-05-041-3/+32
|
* Allow to create new branch and empty WIP merge request from issue pageAlfredo Sumaran2017-05-041-0/+8
|
* Fix Error 500 when referencing issue with project in pending deletesh-fix-issue-31215Stan Hu2017-04-201-1/+1
| | | | Closes #31215
* Remove an unused `cared` scope from Issue and MergeRequestrs-remove-open-for-scopeRobert Speicher2017-04-101-1/+0
|
* Remove an unused `Issue.open_for` scopeRobert Speicher2017-04-101-1/+0
|
* Merge branch 'update-droplab-to-webpack-version' into new-resolvable-discussionLuke "Jared" Bennett2017-04-061-0/+11
|\
| * Issue title realtimeRegis Boudinot2017-04-061-0/+11
| |
* | Add option to start a new discussion on an MRDouwe Maan2017-04-051-0/+1
|/
* Do not set closed_at to nil when issue is reopenedissue_91_ee_backportFelipe Artur2017-04-041-4/+0
|
* Spam check only when spammable attributes have changedOswaldo Ferreira2017-03-211-2/+1
|
* Add closed_at field to issuesFelipe Artur2017-03-171-0/+8
|
* Merge branch '27271-missing-time-spent-in-issue-webhook' into 'master' Douwe Maan2017-03-151-1/+7
|\ | | | | | | | | | | | | Include time tracking attributes in webhooks payload Closes #27271 See merge request !9942