Commit Graph

207 Commits

Author SHA1 Message Date
Felipe Artur 998833dfdc Remove ignore columns 2017-08-18 13:03:58 -03:00
Yorick Peterse 6ef87a2083
Merge issuable "reopened" state into "opened"
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.
2017-07-28 13:31:51 +02:00
James Lopez e5acf85c57 fix created_after 2017-07-07 18:38:44 +02:00
James Lopez cda7cbde03 refactor created at filter to use model scopes 2017-07-07 18:31:50 +02:00
Yorick Peterse 8fbbf41e29
Added Cop to blacklist the use of `dependent:`
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).
2017-07-06 12:01:36 +02:00
Yorick Peterse c63e322158
Add many foreign keys to the projects table
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.
2017-07-06 12:01:36 +02:00
Douwe Maan fe13f11041 Create and use project path helpers that only need a project, no namespace 2017-07-05 11:11:59 -05:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Felipe Artur 85cdde8d33 Migration - Remove position field from issues and merge requests 2017-06-16 12:03:15 -03:00
Felipe Artur 86fc145c3c Order issues by priority 2017-06-16 11:59:39 -03:00
Rémy Coutable 4cfa5ce4a9
Enable the Style/PreferredHashMethods cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-02 19:11:26 +02:00
Luke "Jared" Bennett 3efb60642a
Rename all references to rendered_title to realtime_changes 2017-05-13 21:23:58 +01:00
Douwe Maan ff82acf343 Consistently use monospace font for commit SHAs and branch and tag names 2017-05-12 09:55:25 -05: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
Stan Hu 8a570944a9 Fix Error 500 when referencing issue with project in pending delete
Closes #31215
2017-04-20 23:48:20 -07:00
Robert Speicher a1a94e739e Remove an unused `cared` scope from Issue and MergeRequest 2017-04-10 18:41:36 -04:00
Robert Speicher add1c18860 Remove an unused `Issue.open_for` scope 2017-04-10 18:32:30 -04:00
Luke "Jared" Bennett 9cee280d70
Merge branch 'update-droplab-to-webpack-version' into new-resolvable-discussion 2017-04-06 13:47:52 +01:00
Regis Boudinot 1c783007e6 Issue title realtime 2017-04-06 01:13:06 +00:00
Douwe Maan 08bbb9fce6
Add option to start a new discussion on an MR 2017-04-05 17:44:14 +01: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
Valery Sizov 1ff3cd9934 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into orderable-issues 2017-02-24 16:32:35 +02:00
Pawel Chojnacki 2f0599b6c8 Disable unused tags count cache for Projects, Builds and Runners
+ remove complete leftover when Issues were tagged using acts_as_taggable
2017-02-23 12:36:23 +01:00
Douwe Maan ac868482a7 Allow issues in boards to be ordered 2017-02-17 11:29:16 +00:00
Oswaldo Ferreira 0e14a2f21d Add commment to Issue, Project and MergeRequest #to_reference 2017-01-27 20:20:18 -02:00
Oswaldo Ferreira aeb9db6753 Present group and dashboard MR list without grouping by project 2017-01-27 20:20:18 -02:00
Berna Castro ac66268443 Refactor Project#to_reference and make full_path a keyword argument
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
2017-01-27 20:20:17 -02:00
James Lopez 112f470572 Fix cross-project references copy to include the project reference
Also added relevant specs and refactored to_references in a bunch of places to be more consistent.
2017-01-03 13:01:46 +01:00
James Edwards-Jones a2f57f2361 Fix N+1 queries on milestone show pages 2016-12-20 12:56:48 +00:00
Sean McGivern 4bf61b8bd4 Merge branch 'jej-24637-move-issue-visible_to_user-to-finder' into 'security'
Issue#visible_to_user moved to IssuesFinder

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24637.

See merge request !2039
2016-12-15 11:41:04 -03:00
Oswaldo Ferreira f272ee6eba Add shorthand support to gitlab markdown references 2016-12-02 19:18:17 -02:00
Douwe Maan d8f7523368 Merge branch 'events-cache-invalidation' into 'master'
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 5371da341e for more information.

See merge request !6578
2016-11-28 03:34:12 +00:00
Yorick Peterse 5371da341e
Remove event caching code
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
2016-11-23 14:17:07 +01:00
Ahmad Sherif 916332815e Drop Project#authorized_for_user? in favor of ProjectTeam#member?
Closes #23938
2016-11-23 12:57:58 +02:00
Douglas Barbosa Alexandre 0c052f116c Remove default value for `project` argument on subscribable concern 2016-11-17 15:10:13 -02:00
Phil Hughes b16780f766 Fixed issue boards when not logged in 2016-11-14 12:12:01 +00:00
Douwe Maan bf061d0aff
Merge branch 'issue_23548_dev' into 'master'
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>
2016-11-09 12:25:17 +01:00
Guilherme Salazar 32913b74b8 add "x of y tasks completed" on issuable
fix issues pointed out in !6527

add task completion status feature to CHANGELOG
2016-10-28 14:01:36 -02:00
Phil Hughes a2eff1a8e5 Merge branch 'master' into issue-board-sidebar 2016-10-26 08:47:09 +01:00
Paco Guzman 493367108e Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method 2016-10-20 12:55:14 +02:00
Phil Hughes fcf0a4a12d Merge branch 'master' into issue-board-sidebar 2016-10-19 22:33:34 +01:00
Douglas Barbosa Alexandre fc2c64fcdf Add self.project_foreign_key on both Issue and MergeRequest 2016-10-19 14:58:28 -02:00
Douglas Barbosa Alexandre 86e0b5d643 Fix issue board related controllers to expose label priority per project 2016-10-19 14:58:27 -02:00
Phil Hughes 7d20a91b2e Restore subscribe status in JSON 2016-10-07 09:24:57 +01:00