summaryrefslogtreecommitdiff
path: root/app/models/issue.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * Include time tracking attributes in webhooks payload27271-missing-time-spent-in-issue-webhookRuben Davila2017-03-141-1/+7
| |
* | Preserve order by priority on issues boardpreserve_order_issue_boardValery Sizov2017-03-141-0/+7
|/
* Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into orderable-issuesValery Sizov2017-02-241-2/+0
|\
| * Disable unused tags count cache for Projects, Builds and RunnersPawel Chojnacki2017-02-231-2/+0
| | | | | | | | + remove complete leftover when Issues were tagged using acts_as_taggable
* | Allow issues in boards to be orderedDouwe Maan2017-02-171-0/+1
|/
* Add commment to Issue, Project and MergeRequest #to_referenceOswaldo Ferreira2017-01-271-0/+1
|
* Present group and dashboard MR list without grouping by projectOswaldo Ferreira2017-01-271-2/+2
|
* Refactor Project#to_reference and make full_path a keyword argumentBerna Castro2017-01-271-2/+2
| | | | | | | | | | | | Refactor overall code and fix failing specs Fix Project#to_reference Fix wrong spaces and update changelog Refactor #to_reference for Project & Issue Fix and improves Project#to_reference
* Fix cross-project references copy to include the project referencefix/cross-project-ref-pathJames Lopez2017-01-031-2/+2
| | | | Also added relevant specs and refactored to_references in a bunch of places to be more consistent.
* Fix N+1 queries on milestone show pagesJames Edwards-Jones2016-12-201-0/+2
|
* Merge branch 'jej-24637-move-issue-visible_to_user-to-finder' into 'security' Sean McGivern2016-12-151-55/+0
| | | | | | | Issue#visible_to_user moved to IssuesFinder Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24637. See merge request !2039
* Add shorthand support to gitlab markdown referencesOswaldo Ferreira2016-12-021-5/+1
|
* Merge branch 'events-cache-invalidation' into 'master' Douwe Maan2016-11-281-12/+0
|\ | | | | | | | | | | | | Remove caching of events data This MR removes the caching of events data as this was deemed unnecessary while increasing load on the database. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6578#note_18864037 and 5371da341e9d7768ebab8e159b3e2cc8fad1d827 for more information. See merge request !6578
| * Remove event caching codeYorick Peterse2016-11-231-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flushing the events cache worked by updating a recent number of rows in the "events" table. This has the result that on PostgreSQL a lot of dead tuples are produced on a regular basis. This in turn means that PostgreSQL will spend considerable amounts of time vacuuming this table. This in turn can lead to an increase of database load. For GitLab.com we measured the impact of not using events caching and found no measurable increase in response timings. Meanwhile not flushing the events cache lead to the "events" table having no more dead tuples as now rows are only inserted into this table. As a result of this we are hereby removing events caching as it does not appear to help and only increases database load. For more information see the following comment: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6578#note_18864037
* | Drop Project#authorized_for_user? in favor of ProjectTeam#member?Ahmad Sherif2016-11-231-1/+1
|/ | | | Closes #23938
* Remove default value for `project` argument on subscribable concernDouglas Barbosa Alexandre2016-11-171-1/+1
|
* Fixed issue boards when not logged inissue-boards-signed-out-statePhil Hughes2016-11-141-1/+1
|
* Merge branch 'issue_23548_dev' into 'master'Douwe Maan2016-11-091-22/+30
| | | | | | | | | | | | | | | | | | | | | disable markdown in comments when referencing disabled features fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23548 This MR prevents the following references when tool is disabled: - issues - snippets - commits - when repo is disabled - commit range - when repo is disabled - milestones This MR does not prevent references to repository files, since they are just markdown links and don't leak information. See merge request !2011 Signed-off-by: Rémy Coutable <remy@rymai.me>
* add "x of y tasks completed" on issuableGuilherme Salazar2016-10-281-1/+0
| | | | | | fix issues pointed out in !6527 add task completion status feature to CHANGELOG
* Merge branch 'master' into issue-board-sidebarissue-board-sidebarPhil Hughes2016-10-261-1/+7
|\
| * Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests ↵14192-issues-closed-by-merge-requests-using-metrics-dataPaco Guzman2016-10-201-1/+7
| | | | | | | | method
* | Merge branch 'master' into issue-board-sidebarPhil Hughes2016-10-191-0/+12
|\ \ | |/
| * Add self.project_foreign_key on both Issue and MergeRequestDouglas Barbosa Alexandre2016-10-191-0/+4
| |
| * Fix issue board related controllers to expose label priority per projectDouglas Barbosa Alexandre2016-10-191-0/+12
| |
* | Restore subscribe status in JSONPhil Hughes2016-10-071-0/+6
|/
* Use the `IssuableBaseService` lifecycle hooks to cache ↵Timothy Andrew2016-09-211-1/+1
| | | | | | | `MergeRequestsClosingIssues` - Instead of overriding `create` and `update` in `MergeRequests::BaseService` - Get all merge request service specs passing
* Implement a second round of review comments from @DouweM.Timothy Andrew2016-09-211-1/+2
| | | | | | | | | | | | | | - Don't use `TableReferences` - using `.arel_table` is shorter! - Move some database-related code to `Gitlab::Database` - Remove the `MergeRequest#issues_closed` and `Issue#closed_by_merge_requests` associations. They were either shadowing or were too similar to existing methods. They are not being used anywhere, so it's better to remove them to reduce confusion. - Use Rails 3-style validations - Index for `MergeRequest::Metrics#first_deployed_to_production_at` - Only include `CycleAnalyticsHelpers::TestGeneration` for specs that need it. - Other minor refactorings.
* Implement (some) comments from @DouweM's review.Timothy Andrew2016-09-201-9/+0
| | | | | | - Move things common to `Issue` and `MergeRequest` into `Issuable` - Move more database-specific functions into `Gitlab::Database` - Indentation changes and other minor refactorings.
* Implement review comments from @yorickpeterseTimothy Andrew2016-09-201-3/+3
| | | | | | | | | | | | | | 1. Change multiple updates to a single `update_all` 2. Use cascading deletes 3. Extract an average function for the database median. 4. Move database median to `lib/gitlab/database` 5. Use `delete_all` instead of `destroy_all` 6. Minor refactoring
* Miscellaneous cycle-analytics-related changes.Timothy Andrew2016-09-201-5/+1
| | | | | | | | 1. Add indexes to `CreateMergeRequestsClosingIssues` columns. 2. Remove an extraneous `check_if_open` check that is redundant now. It would've been better to rebase this in, but that's not possible because more people are working on this branch.
* Remove extraneous code that was previously added for performance.Timothy Andrew2016-09-191-2/+2
|
* Improve performance of the cycle analytics page.Timothy Andrew2016-09-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. These changes bring down page load time for 100 issues from more than a minute to about 1.5 seconds. 2. This entire commit is composed of these types of performance enhancements: - Cache relevant data in `IssueMetrics` wherever possible. - Cache relevant data in `MergeRequestMetrics` wherever possible. - Preload metrics 3. Given these improvements, we now only need to make 4 SQL calls: - Load all issues - Load all merge requests - Load all metrics for the issues - Load all metrics for the merge requests 4. A list of all the data points that are now being pre-calculated: a. The first time an issue is mentioned in a commit - In `GitPushService`, find all issues mentioned by the given commit using `ReferenceExtractor`. Set the `first_mentioned_in_commit_at` flag for each of them. - There seems to be a (pre-existing) bug here - files (and therefore commits) created using the Web CI don't have cross-references created, and issues are not closed even when the commit title is "Fixes #xx". b. The first time a merge request is deployed to production When a `Deployment` is created, find all merge requests that were merged in before the deployment, and set the `first_deployed_to_production_at` flag for each of them. c. The start / end time for a merge request pipeline Hook into the `Pipeline` state machine. When the `status` moves to `running`, find the merge requests whose tip commit matches the pipeline, and record the `latest_build_started_at` time for each of them. When the `status` moves to `success`, record the `latest_build_finished_at` time. d. The merge requests that close an issue - This was a big cause of the performance problems we were having with Cycle Analytics. We need to use `ReferenceExtractor` to make this calculation, which is slow when we have to run it on a large number of merge requests. - When a merge request is created, updated, or refreshed, find the issues it closes, and create an instance of `MergeRequestsClosingIssues`, which acts as a join model between merge requests and issues. - If a `MergeRequestsClosingIssues` instance links a merge request and an issue, that issue closes that merge request. 5. The `Queries` module was changed into a class, so we can cache the results of `issues` and `merge_requests_closing_issues` across various cycle analytics stages. 6. The code added in this commit is untested. Tests will be added in the next commit.
* Add the "Review" cycle analytics section.Timothy Andrew2016-08-261-3/+7
|
* Add an `Issue::Metrics` model.Timothy Andrew2016-08-261-0/+9
| | | | | - And store the `first_associated_with_milestone_at` and `first_added_to_board_at` times, when an issue is saved.
* Further refactor and syntax fixes.Patricio Cano2016-08-151-2/+1
|
* Refactored AkismetHelper into AkismetService and cleaned up `Spammable`Patricio Cano2016-08-151-10/+3
| | | | - Refactored SpamCheckService into SpamService
* Refactored spam related code even furtherPatricio Cano2016-08-151-0/+13
| | | | | | | - Removed unnecessary column from `SpamLog` - Moved creation of SpamLogs out of its own service and into SpamCheckService - Simplified code in SpamCheckService. - Moved move spam related code into Spammable concern
* Complete refactor of the `Spammable` concern and tests:Patricio Cano2016-08-151-0/+2
| | | | | | | - Merged `AkismetSubmittable` into `Spammable` - Clean up `SpamCheckService` - Added tests for `Spammable` - Added submit (ham or spam) options to `AkismetHelper`
* Lay the ground works to submit information to AkismetPatricio Cano2016-08-151-0/+1
| | | | | | - New concern `AkismetSubmittable` to allow issues and other `Spammable` models to be submitted to Akismet. - New model `UserAgentDetail` to store information needed for Akismet. - Services needed for their creation and tests.
* Added concern for a faster "cache_key" methodfaster-cache-keysYorick Peterse2016-08-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This concern provides an optimized/simplified version of the "cache_key" method. This method is about 9 times faster than the default "cache_key" method. The produced cache keys _are_ different from the previous ones but this is worth the performance improvement. To showcase this I set up a benchmark (using benchmark-ips) that compares FasterCacheKeys#cache_key with the regular cache_key. The output of this benchmark was: Calculating ------------------------------------- cache_key 4.825k i/100ms cache_key_fast 21.723k i/100ms ------------------------------------------------- cache_key 59.422k (± 7.2%) i/s - 299.150k cache_key_fast 543.243k (± 9.2%) i/s - 2.694M Comparison: cache_key_fast: 543243.4 i/s cache_key: 59422.0 i/s - 9.14x slower To see the impact on real code I applied these changes and benchmarked Issue#referenced_merge_requests. For an issue referencing 10 merge requests these changes shaved off between 40 and 60 milliseconds.
* Method for returning issues readable by a userability-batch-issue-checkingYorick Peterse2016-07-291-0/+28
| | | | | | | | | | | | | The method Ability.issues_readable_by_user takes a list of users and an optional user and returns an Array of issues readable by said user. This method in turn is used by Banzai::ReferenceParser::IssueParser#nodes_visible_to_user so this method no longer needs to get all the available abilities just to check if a user has the "read_issue" ability. To test this I benchmarked an issue with 222 comments on my development environment. Using these changes the time spent in nodes_visible_to_user was reduced from around 120 ms to around 40 ms.