Commit graph

12 commits

Author SHA1 Message Date
DJ Mountney
86675194aa Fix failing todo tests 2016-06-02 15:30:13 -07:00
DJ Mountney
14a9b0d7dd Update target todo test to use a public project 2016-06-02 12:23:32 -07:00
DJ Mountney
b173ea2bd4 Use the project finder in the todos finder to limit todos to just ones within projects you have access to. 2016-06-02 12:20:27 -07:00
DJ Mountney
c3e923c496 Ensure we don't show TODOS for projects pending delete
By joining the Todos on the project table.
2016-06-02 11:24:18 -07:00
Stan Hu
f8a3344d12 Fix 404 page when viewing TODOs that contain milestones or labels in different projects
A user viewing the TODOs page will see a 404 if there are mentioned labels
in multiple different projects. This is likely a caching bug and only occurs
when Markdown rendering occurs across multiple projects, which is why it's so
tricky to reproduce. This is what I think is happening:

1. LabelReferenceFilter#references_in encounters label ~X for ProjectA and finds the label in the DB as id = 1.
2. LabelReferenceFilter.references_in yields [1, 'X', nil, ...]
3. Since project_ref is nil, AbstractReferenceFilter#project_from_ref_cache caches nil => ProjectA.
4. LabelReferenceFilter#references_in encounters label ~Y for ProjectB and finds the label in the DB as id = 2.
5. LabelReferenceFilter.references_in yields [2, 'Y', nil, ...]
6. AbstractReferenceFilter#project_from_ref_cache lookups nil and returns ProjectA. It was supposed to be ProjectB.
7. A is the wrong project, so the label lookup fails.

This MR caches Markdown references if the key is present.

Closes #17898
2016-05-31 20:37:53 -07:00
Alfredo Sumaran
9a10205a4f Reduce spacing 2016-05-25 08:15:20 -04:00
Alfredo Sumaran
fd0c40fc80 Address feedback
Signed-off-by: Alfredo Sumaran <alfredo@gitlab.com>
2016-05-25 08:15:20 -04:00
Alfredo Sumaran
38d6bc77f9 Add tests for Todos target's state 2016-05-25 08:15:20 -04:00
Alfredo Sumaran
d2f898e7ea Fix Todos test 2016-04-27 14:52:51 -05:00
Robert Speicher
bdd844f312 Refactor Todos feature spec to be faster and less brittle
We now only create two Todos instead of 21 when testing pagination, and
we've updated the test to be less brittle when dealing with slower CI
environments.
2016-04-22 13:08:11 -04:00
Alfredo Sumaran
50c9c6a875 Grammar fix 2016-04-18 16:28:15 -05:00
Alfredo Sumaran
45c93b52e4 Todos spec 2016-04-07 21:22:58 -05:00