Commit graph

18 commits

Author SHA1 Message Date
GitLab Bot
587794b4b8 Add latest changes from gitlab-org/gitlab@master 2019-10-02 00:06:26 +00:00
Thong Kuah
94bb660460 Add frozen_string_literal to spec/factories
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-07-26 13:18:39 +12:00
Jacopo
e2056f08f0 Hides Close MR button on merged MR
When a Merge request is merged, shows only the Report abuse menu item
in the dropdown menu instead of showing the close_reopen_report toggle
with an unusable Close button.
The Report abuse is still hidden when the author of the Merge request
is the current_user.

Hides the Reopen button on a closed and locked issue when the
issue.author is not the current_user
2018-10-02 16:17:55 +02:00
Lin Jen-Shin
4ee08b77bc Updates from rubocop -a 2018-07-09 21:13:08 +08:00
🙈 jacopo beschi 🙉
4c8783636c Resolve "Update updated_at on an issue/mr on every issue/mr changes" 2018-06-01 15:09:08 +00:00
Rémy Coutable
a2718ebaff Make user/author use project.creator in most factories
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-01-31 18:31:21 +01:00
Rémy Coutable
a2d39b8010 Use gitlab-styles
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-12-22 08:34:44 -06:00
Rémy Coutable
4af9d592c5 Replace factory_girl_rails with factory_bot_rails
I've followed the [upgrade guide](https://github.com/thoughtbot/factory_bot/blob/4-9-0-stable/UPGRADE_FROM_FACTORY_GIRL.md) and ran these two commands:

```
grep -e FactoryGirl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|FactoryGirl|FactoryBot|"
grep -e factory_girl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|factory_girl|factory_bot|"
```

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-12-14 15:01:55 +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
Lin Jen-Shin
4ded8b1cc0 Skip issuable without a project in IssuableExtractor#extract
Closes #31280
2017-04-25 18:39:41 +08:00
Rémy Coutable
169dc4cec1 Fix brittle specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-03 18:54:48 +02:00
Rémy Coutable
4e3516788f Don't use FFaker in factories, use sequences instead
FFaker can generate data that randomly break our test suite. This
simplifies our factories and use sequences which are more predictive.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-03 18:54:48 +02:00
Robert Speicher
d0315d5393 Factories with a project association use :empty_project by default 2017-01-24 20:30:56 -05:00
Paco Guzman
b7814205dc Ensure specs on sorting of issues in API are deterministic on MySQL
MySQL could not have support for millisecond precision, depends on the MySQL version 
so we just create issues in different seconds in a deterministic way
2016-09-12 15:44:41 +02:00
Robert Speicher
97c4a1dcea Refactor Issues::BulkUpdateService spec
- Create fewer Issue objects; 2 is as good as 5 for these cases. This
  gives us a nice little speed improvement.
- Don't `describe` Symbols.
- Simplify object creation.
- Lessen "mystery guest" antipattern
2016-07-20 17:59:34 -06:00
Douglas Barbosa Alexandre
34ee75379c Restrict access to confidential issues 2016-03-17 20:55:38 -03:00
Robert Speicher
6df45eb463 Move all factory definitions to their own file 2016-03-04 15:26:51 -05:00