Commit graph

28 commits

Author SHA1 Message Date
Lin Jen-Shin
c772464b68 Introduce MergeRequest#write_ref and Repository#write_ref
so that we don't have to fetch it for non-forks
2017-08-10 22:20:53 +08:00
Lin Jen-Shin
412db1874f Fix some tests and report the error message 2017-08-09 21:41:45 +08:00
Lin Jen-Shin
a85eed6446 Fake out Repository#fetch_ref for merge request if
the project didn't have a repository setup. We don't
try to stub it if the repository was already there.
2017-08-09 19:30:07 +08: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
Stan Hu
11fd2f80b0 Don't delete a branch involved in an open merge request in "Delete all merged branches" service
Customers were surprised by the previous behavior, which destroyed branches
even though an open merge request existed for it.

Closes #29427
2017-04-19 07:56:08 -07: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
Rémy Coutable
169dc4cec1 Fix brittle specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-03 18:54:48 +02:00
Sean McGivern
1974691bfe Revert "Merge branch '29534-todos-performance' into 'master'"
This reverts merge request !10076
2017-03-21 15:25:00 +00:00
Jarka Kadlecova
bf41a2e752 Todos performance: Include associations in Finder 2017-03-20 12:45:43 +01:00
James Lopez
a0101ebf84 Update occurrences of MWBS to MWPS
Rename column in the database
 Rename fields related to import/export feature
 Rename API endpoints
 Rename documentation links
 Rename the rest of occurrences in the code
 Replace the images that contain the words "build succeeds" and docs referencing to them
 Make sure pipeline is green and nothing is missing.

updated doc images

renamed only_allow_merge_if_build_succeeds in projects and fixed references

more updates

fix some spec failures

fix rubocop offences

fix v3 api spec

fix MR  specs

fixed issues with partials

fix MR spec

fix alignment

add missing v3 to v4 doc

wip - refactor v3 endpoints

fix specs

fix a few typos

fix project specs

copy entities fully to V3

fix  entity error

more fixes

fix failing specs

fixed missing entities in V3 API

remove comment

updated code based on feedback

typo

fix spec
2017-03-01 12:02:02 +01:00
Robert Speicher
c1743ba4c4 Use a project factory with a repository where necessary 2017-01-25 14:52:12 -05:00
Rodolfo Santos
1db9f826c1 Add setting to only allow merge requests to be merged when all discussions are resolved
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-04 14:58:40 +01:00
Douglas Barbosa Alexandre
8522ef44bf Recreates missing group labels when moving project to another group 2016-10-19 14:58:24 -02:00
Jeroen van Baarsen
f1479b56b7
Remove the annotate gem and delete old annotations
In 8278b763d9 the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.

Fixes: #17382
2016-05-09 18:00:28 +02:00
Pierre de La Morinerie
18295585d9 Fix MergeRequest#source_sha when there is no diff
`MergeRequest#source_sha` is expected to return the sha of the source
branch last commit.

But when a open Merge Request has no diff (e.g. all commits have already
been merged to the target branch), `merge_request.source_sha`
incorrectly returns `nil`.

This was un-noticed before – but now that !2217 has been merged,
it makes `Gitlab::Git::Commit.between` raise an
"Unexpected nil argument" exception.

This fixes the crash, by making sure that `source_sha` returns a
correct result even when there is no diff available.
2016-03-16 14:02:04 +01:00
Rémy Coutable
e632bd26e4 Fixes "iid of max iid" in Issuable sidebar for merged MR
Fixes #13928
2016-03-08 16:23:20 +01:00
Pierre de La Morinerie
543845f7ef Indicate how much an MR branch diverges from the target branch 2016-03-03 15:11:44 +01:00
Rubén Dávila
f56ee9d3b9 Save merge commit id when MR is merged 2016-02-19 13:14:49 -05:00
Stan Hu
79c0e7212a Annotate models 2016-01-06 13:09:55 +00:00
Zeger-Jan van de Weg
2462a96e45 Incorporate feedback 2015-12-05 15:42:38 +01:00
Dmitriy Zaporozhets
a237999f00
Annotate models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-13 19:22:46 +01:00
Stan Hu
d7812a95cf Re-annotate models 2015-09-06 07:48:48 -07:00
Robert Speicher
0716a559b5 Fix Style/AsciiComments cop violation 2015-06-22 14:43:51 -04:00
Stan Hu
7e204cf389 Added comment notification events to HipChat and Slack services.
Supports four different event types all bundled under the "note" event type:

- comments on a commit
- comments on an issue
- comments on a merge request
- comments on a code snippet
2015-03-06 06:54:00 -08:00
Dmitriy Zaporozhets
98ee4a1fa7 Annotate models 2015-01-22 09:40:03 -08:00
Dmitriy Zaporozhets
92deb451da
Annotate models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-25 12:25:02 +03:00
Dmitriy Zaporozhets
8f1e60b057
Fix satellite tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-06 09:52:56 +03:00
Dmitriy Zaporozhets
5a68c20fba
Fix MR factory and some MR tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-31 18:07:24 +03:00