Commit graph

20 commits

Author SHA1 Message Date
Bob Van Landuyt
54b56f20b7 Expose permissions on types in GraphQL
This adds a reusable way to expose permissions for a user to types in
GraphQL.
2018-06-28 13:50:17 +02:00
Mark Chao
5b994b8199 Notify only when unmergeable due to conflict
There is still the edge case when 'no commits' changes to 'conflict'
would not trigger notification, which we ignore for now.

Calling can_be_merged? can cause exception (e.g. non-UTF8)
Ignore those by rescueing.

Remove unmergeable_reason as now only conflict is notified

Update spec
2018-06-20 23:27:17 +08:00
Bob Van Landuyt
aa4b1ae712 Add present_using to types
By specifying a presenter for the object type, we can keep the logic
out of `GitlabSchema`.

The presenter gets initialized using the object being presented, and
the context (including the `current_user`).
2018-06-05 20:47:42 +02:00
lulalala
dc174e9655 Notify with email when merge request became unmergeable
Display MR unmergeable reasons
2018-05-17 08:54:51 +08:00
Bob Van Landuyt
12dd2b0cc0 Share collaboration check between view and presenter 2018-04-11 10:51:15 +02:00
Bob Van Landuyt
8ad9c4e873 Rename create_merge_request permissions
So we can distinguish between the permissions on the source and the
target project.

- `create_merge_request_from` indicates a user can create a merge
  request with the project as a source_project
- `create_merge_request_in` indicates a user can create a merge
  request with the project as a target_project
2018-04-11 10:51:15 +02:00
Bob Van Landuyt
ec43e36444 Prevent new merge requests for archived projects
This prevents creating merge requests targeting archived projects.

This could happen when a project was already forked, but then the
source was archived.
2018-04-11 10:51:14 +02:00
Bob Van Landuyt
e74879280f Allow maintainers to edit directly in a fork 2018-03-07 16:55:34 +01:00
Oswaldo Ferreira
fd372ce395 Address naming suggestion 2018-02-07 16:29:28 -02:00
Oswaldo Ferreira
dfe9f0bc6e Remove duplicate calls of MergeRequest#can_be_reverted? 2018-02-07 16:29:27 -02:00
Jan Provaznik
27a75ea175 Backport 'Rebase' feature from EE to CE
When a project uses fast-forward merging strategy user has
to rebase MRs to target branch before it can be merged.
Now user can do rebase in UI by clicking 'Rebase' button
instead of doing rebase locally.

This feature was already present in EE, this is only backport
of the feature to CE. Couple of changes:
* removed rebase license check
* renamed migration (changed timestamp)

Closes #40301
2018-01-05 09:34:59 +01:00
Felipe Artur
5cf3ff27c8 Use actual head pipeline on merge request serializer 2017-12-05 12:54:10 -02:00
Oswaldo Ferreira
1f54c9216f Reduce method calls while evaluating Projects::MergeRequestsController#show.json 2017-10-04 00:09:48 -03:00
Clement Ho
6eeb638434 Make commits behind text a link to the target branch commits page 2017-07-11 11:49:22 -05:00
Clement Ho
09193a4fe1 Convert target branch link to use tree 2017-07-11 09:48:59 -05:00
Clement Ho
9e4e1afb4a MR branch link now links to tree instead of commits 2017-07-10 14:55:13 -05: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
Adam Niedzielski
4bfd06e60e Display issue state in issue links section of merge request widget 2017-06-09 10:21:56 +02:00
Sean McGivern
ad2bfeb857 Fix conflict resolution from corrupted upstream
I don't know why this happens exactly, but given an upstream and fork repository
from a customer, both of which required GC, resolving conflicts would corrupt
the fork so badly that it couldn't be cloned.

This isn't a perfect fix for that case, because the MR may still need to be
merged manually, but it does ensure that the repository is at least usable.

My best guess is that when we generate the index for the conflict
resolution (which we previously did in the target project), we obtain a
reference to an OID that doesn't exist in the source, even though we already
fetch the refs from the target into the source.

Explicitly setting the source project as the place to get the merge index from
seems to prevent repository corruption in this way.
2017-05-12 20:47:51 +01:00
Fatih Acet
0151325dac Merge request widget redesign 2017-05-09 04:15:34 +00:00