Commit Graph

11 Commits

Author SHA1 Message Date
Jan Provaznik 204ab7c9f8 Fix issuable state indicator
Now the issuable reference check works only in project scope, if we
reference an issuable from a non-project resource (e.g. epics), then
project is not set, and there is mismatch in generated issue references.

This patch enables issuable reference state check also from group scope.

Closes gitlab-ee#4683
Related to #30916
2018-03-23 10:04:44 +01:00
Bob Van Landuyt 148816cd67 Port `read_cross_project` ability from EE 2018-02-22 17:11:36 +01:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04: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
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
Lin Jen-Shin 9f7c29baef Follow feedback on the review 2017-04-26 02:38:59 +08:00
Lin Jen-Shin 4ded8b1cc0 Skip issuable without a project in IssuableExtractor#extract
Closes #31280
2017-04-25 18:39:41 +08:00
Adam Niedzielski 1269ee4c3b Do not append issuable state to links with custom anchor
Closes #30916
Change the presentation from [closed] to (closed)
2017-04-19 18:36:12 +02:00
Adam Niedzielski de71a46594 Display issuable state only in notes and issuable description
Closes #30964
2017-04-19 16:38:46 +02:00
Adam Niedzielski 551d0a3c03 Fix appending state to issuable references
Closes #30874.
Ignore nodes with no children.
Append directly to the node instead of the last child of the node
to avoid inheriting formatting from the last child
2017-04-13 17:09:30 +02:00
Adam Buckland ace833b31d Add indication for closed or merged issuables in GFM
Example: for issues that are closed, the links will now show '[closed]'
following the issue number. This is done as post-process after the markdown has
been loaded from the cache as the status of the issue may change between
the cache being populated and the content being displayed.

In order to avoid N+1 queries problem when rendering notes ObjectRenderer
populates the cache of referenced issuables for all notes at once,
before the post processing phase.

As a part of this change, the Banzai BaseParser#grouped_objects_for_nodes
method has been refactored to return a Hash utilising the node itself as the
key, since this was a common pattern of usage for this method.
2017-04-07 14:31:43 -05:00