Commit Graph
1086 Commits
Author SHA1 Message Date
Douwe Maan 31266c5be4 Address feedback 2016-03-22 00:09:20 +01:00
Douwe Maan ae7b2ef62c Merge branch 'master' into issue_12658
# Conflicts:
#	app/models/issue.rb
#	app/views/projects/_home_panel.html.haml
#	app/views/shared/projects/_project.html.haml
#	db/schema.rb
#	spec/models/project_spec.rb
2016-03-21 23:22:21 +01:00
Zeger-Jan van de Weg 6e5461c6ee Merge branch 'master' into 2489-soft-delete-issues 2016-03-21 19:32:37 +01:00
Robert Speicher ffc3acd498 Merge branch 'issues-show-performance' into 'master'
Improve performance of viewing individual issues

This MR does two things:

1. `Issue#related_branches` no longer performs Git operations that aren't needed
2. The output of `Repository#exists?` is now cached and flushed properly

Combined these two changes should further cut down the amount of Git operations performed when viewing individual issues (and possibly other pages).

See merge request !3296
2016-03-21 14:42:25 +00:00
Douwe Maan 45e8650c4f Fix specs 2016-03-20 23:26:58 +01:00
Douwe Maan 19aa20d528 Fix more specs 2016-03-20 23:09:33 +01:00
Douwe Maan 7c51d5efec Fix some specs 2016-03-20 22:55:08 +01:00
Douwe Maan 2eb19ea3ea Merge branch 'master' into issue_12658 2016-03-20 14:57:25 +01:00
Grzegorz Bizon 797af06491 Merge branch 'master' into feature/issue-move
* master:
  Fix bug where wrong commit ID was being used in a merge request diff to show old image
  Remove CHANGELOG item that was added during merge resolution
  Improve the "easy WIP & un-WIP from link" feature
  Fix specs
  \#to_branch_name now uses the iid as postfix
  Add label description in tooltip to labels in issue index and sidebar
  Easily (un)mark merge request as WIP using link
  Use specialized system notes when MR is (un)marked as WIP
  another attempt to fix oauth issue
  attempting to fix omniauth problem

Conflicts:
	app/assets/javascripts/issuable_form.js.coffee
2016-03-20 11:01:08 +01:00
Yorick Peterse 68a4c98f50 Cache output of Repository#exists?
This caches the output of Repository#exists? in Redis while making sure
it's flushed properly when creating new repositories, deleting them,
etc.

For the ProjectWiki tests to work I had to make ProjectWiki#create_repo!
public as testing private methods in RSpec is a bit of a pain.
2016-03-19 21:54:08 +01:00
Yorick Peterse 41b8d22631 Tweaked performance of Issue#related_branches
Requesting the branch names of a repository works even when it's empty,
thus there's no need to explicitly check for an empty repository.
Removing this check cuts down the amount of Git operations which in turn
cuts down request timings a bit. The regular expression used to compare
branches was also moved out of the loop so it's created only once.
2016-03-19 21:54:08 +01:00
Zeger-Jan van de Weg 212e83bab3 Soft delete issuables 2016-03-19 21:23:03 +01:00
Jacob Schatz 3f22a92f4a Merge branch 'remove-wip' into 'master'
Easily (un)mark merge request as WIP using link

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/3768 and https://gitlab.com/gitlab-org/gitlab-ce/issues/3516

## Link to add `WIP` prefix (underline is visible because of hover)
![wipless_title](/uploads/72a6f7119ba9d8043ca8329641e97c3b/wipless_title.png)

## Link to remove `WIP` prefix
![wip_title](/uploads/8620ad65da9ef620b180603520fead55/wip_title.png)

## System note after WIP is added
![wip_sysnote](/uploads/2de073b75e854d2c9e243eb8b5d5c259/wip_sysnote.png)

## Widget with link to remove WIP
![wip_widget](/uploads/cf83ea93743c4c26d9df759c17cb9d7b/wip_widget.png)

## Flash after WIP is removed
![wip_flash](/uploads/27b7240cd5d7ceeb8b7b477abd94d7ff/wip_flash.png)

## System note after WIP is removed
![wipless_sysnote](/uploads/c0d3368abdf21a2f253532a9a9594d90/wipless_sysnote.png)

## Widget when current user cannot remove the WIP prefix
![wip_widget_unauthorized](/uploads/174ccf1674be86dc81c3078fe297acb7/wip_widget_unauthorized.png)

cc @creamzy 

See merge request !3006
2016-03-19 20:06:59 +00:00
Douwe Maan cb124d1476 Merge branch 'issue-branch-iid-postfix' into 'master'
#to_branch_name now uses the iid as postfix

Given the branch name 'mep-mep' with an iid being 1,
the current way, master's way, would yield a branch name of
1-mep-mep. The problem for larger projects however would be that
a developer might forget what iid the issue was.

When this developer would try to tab complete it would:
- Or result in 20+ branches possibly
- Or start with the wrong digit, try again with digit++
  - Would see 20 branches, repeat

Thus the obvious way of solving this is letting the dev tab complete
on the issue title, which is easier to remember.

@DouweM Should this be labelled `pick-in-master`? 

See merge request !3308
2016-03-19 18:54:18 +00:00
Grzegorz Bizon 0115ad66d2 Merge branch 'master' into feature/issue-move
* master: (121 commits)
  Dedupe labels in labels selector in Dashboard pages
  Refactor colors and lists
  Add a safeguard in MergeRequest#compute_diverged_commits_count
  Fix an issue when the target branch of a MR had been deleted
  Add avatar to issue and MR pages header
  Cleanup somce css colors
  Re-group scss variables
  Refactor `Todo#target`
  Fixes issue with filter label missing on labels & milestones
  Rename `Todo#to_reference` to `Todo#target_reference`
  Fixed failing tests
  Updated controller with before_action Fixed other issues based on feedback
  Fixes issue on dashboard issues
  Full labels data in JSON
  Fixed issue with labels dropdown getting wrong labels
  Update CHANGELOG
  Use `Note#for_project_snippet?` to skip notes on project snippet
  Use `Commit#short_id` instead of `Commit.truncate_sha`
  Reuse `for_commit?` on conditional validations
  Update schema info comment on todo related files
  ...

Conflicts:
	app/models/issue.rb
	db/schema.rb
	spec/models/issue_spec.rb
2016-03-19 18:50:15 +01:00
Felipe Artur 8b830b8c3b Fix specs 2016-03-18 21:04:53 -03:00
Rémy Coutable cafa408b25 Merge remote-tracking branch 'origin/master' into remove-wip 2016-03-18 23:29:18 +01:00
Rémy Coutable 0b942541da Improve the "easy WIP & un-WIP from link" feature 2016-03-18 23:27:35 +01:00
Zeger-Jan van de WegandFelipe Artur b959ae553b Improve group visibility level feature 2016-03-18 16:58:04 -03:00
Zeger-Jan van de Weg 70ca3370eb \#to_branch_name now uses the iid as postfix
Given the branch name 'mep-mep' with an iid being 1,
the current way, master's way, would yield a branch name of
1-mep-mep. The problem for larger projects however would be that
a developer might forget what iid the issue was.

When this developer would try to tab complete it would:
- Or result in 20+ branches possibly
- Or start with the wrong digit, try again with digit++
  - Would see 20 branches, repeat

Thus the obvious way of solving this is letting the dev tab complete
on the issue title, which is easier to remember.
2016-03-18 19:34:04 +01:00
Rémy Coutable bc92de8f03 Add a safeguard in MergeRequest#compute_diverged_commits_count
We have to ensure source_sha and target_sha are not nil before calling
Gitlab::Git::Commit.between.
2016-03-18 19:01:20 +01:00
Douglas Barbosa Alexandre 02b0c37cab Refactor Todo#target 2016-03-18 13:27:27 -03:00
Douglas Barbosa Alexandre 2a8858ca8a Rename Todo#to_reference to Todo#target_reference
Since we're not actually returning a todo reference.
2016-03-18 13:24:47 -03:00
Douglas Barbosa Alexandre 231d4fb9f8 Use Commit#short_id instead of Commit.truncate_sha 2016-03-18 11:07:30 -03:00
Douglas Barbosa Alexandre a5bad46505 Update schema info comment on todo related files 2016-03-18 11:00:53 -03:00
Douglas Barbosa Alexandre fb72271e24 Use todo.done without ! in the controller to mark todo as done 2016-03-18 11:00:53 -03:00
Douglas Barbosa Alexandre c29da3f8ca Trigger a todo for mentions on commits page 2016-03-18 11:00:53 -03:00
Douwe Maan dadd28e317 Merge branch 'fix-mr-source-sha' into 'master'
Fix MergeRequest#source_sha when there is no diff

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/14170

### Overview

This MR fixes an unhandled Exception when visiting the page of an open Merge Request  without diff.

### Description

`MergeRequest#source_sha` is expected to return the sha of the source branch last commit. But when an 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 without consequences before – but since !2217 was merged (a few days ago), it makes `Gitlab::Git::Commit.between` raise an "Unexpected nil argument" exception. This can be reproduced when visiting the http://localhost:3000/gitlab-org/gitlab-test/merge_requests/2 page on a fresh local Gitlab setup.

This MR fixes the crash, by making sure that `source_sha` returns a
correct result even when there is no diff available. I also added tests.

@DouweM I believe you wrote most of this code in the first place ; does this looks correct to you, or is there a better way to resolve this issue maybe?

See merge request !3135
2016-03-18 12:28:43 +00:00
Douwe Maan 9813eac56b Merge branch 'confidential-issues' into 'master'
Add confidential issues

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/3678

More information: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/227

See merge request !3282
2016-03-18 12:04:56 +00:00
Douglas Barbosa Alexandre 9222459ea3 Restrict access to confidential issues on activity feed 2016-03-17 20:56:00 -03:00
Douglas Barbosa Alexandre 482bfd1a6d Restrict access for confidential issues on milestone view 2016-03-17 20:55:59 -03:00
Douglas Barbosa Alexandre 43d8bdb4f0 Restrict access to references for confidential issues 2016-03-17 20:55:59 -03:00
Yorick Peterse dd4b789765 Added tests for Repository#build_cache 2016-03-17 21:45:43 +01:00
Yorick Peterse cd05d3f78d Cache project avatars stored in Git
The avatar logic has been moved from Project to Repository as this makes
caching easier. The logic itself in turn has been changed so that the
logo file names are cached in Redis. This cache is flushed upon pushing
a commit but _only_ if:

1. The commit was pushed to the default branch
2. The commit actually changes any of the logo files

If no branch or commit is given the cache is flushed anyway, this
ensures that calling Repository#expire_cache without any arguments still
flushes the avatar cache (e.g. this is used when removing a project).

Fixes gitlab-org/gitlab-ce#14363
2016-03-17 18:51:54 +01:00
Douwe Maan 21af7459ab Merge branch '4009-external-users' into 'master'
External Users

The user has the rights of a public user execpt it can never create a project, group, or team. Also it cant view internal projects.

Partially fix for both #4009 and #13938 (except the LDAP sync or a pattern to detect external users)


![Screen_Shot_2016-03-14_at_22.02.52](/uploads/486a84ab3acb98c6cfb71a4ec7d268e2/Screen_Shot_2016-03-14_at_22.02.52.png)

See merge request !3171
2016-03-17 14:15:38 +00:00
Grzegorz Bizon b9036ba610 Prevent issue move if issue has been already moved 2016-03-17 11:48:51 +01:00
Zeger-Jan van de Weg 481e73fb76 Merge branch 'master' into new-branch-button-issue 2016-03-17 11:13:16 +01:00
Hiroyuki Sato f0b052e168 Fix wiki search results point to raw source 2016-03-17 08:58:52 +09:00
Felipe Artur 44c127447b Merge 4009-external-users into issue_12658 2016-03-16 20:16:42 -03: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
Pierre de La Morinerie 7cbf8fd0d0 Add tests for MergeRequest#source_sha 2016-03-16 13:56:47 +01:00
Zeger-Jan van de Weg 8077a5f958 Clearify who deletes the user 2016-03-15 21:09:25 +01:00
Zeger-Jan van de Weg a09323c9f5 Fix broken specs 2016-03-15 21:09:25 +01:00
Zeger-Jan van de Weg 2b97c92119 Incorporate review 2016-03-15 20:21:11 +01:00
Zeger-Jan van de WegandZeger-Jan van de Weg ad97bebfed Enhance new branch button on an issue 2016-03-15 20:21:11 +01:00
Zeger-Jan van de WegandZeger-Jan van de Weg 228007dfbc new-branch-button 2016-03-15 20:21:11 +01:00
Zeger-Jan van de Weg 59064aeeef Merge branch 'master' into 4009-external-users 2016-03-15 19:16:16 +01:00
Rémy Coutable 54ec7e9599 Improving the original label-subscribing implementation
1. Make the "subscribed" text in Issuable sidebar reflect the labels
   subscription status

2. Current user mut be logged-in to toggle issue/MR/label subscription
2016-03-15 18:22:02 +01:00
Timothy AndrewandRémy Coutable 0444fa560a Original implementation to allow users to subscribe to labels
1. Allow subscribing (the current user) to a label

- Refactor the `Subscription` coffeescript class
  - The main change is that it accepts a container, and conducts all
    DOM queries within its scope. We need this because the labels
    page has multiple instances of `Subscription` on the same page.

2. Creating an issue or MR with labels notifies users subscribed to those labels

- Label `has_many` subscribers through subscriptions.

3. Adding a label to an issue or MR notifies users subscribed to those labels

- This only applies to subscribers of the label that has just been
  added, not all labels for the issue.
2016-03-15 17:25:37 +01:00
Robert Speicher 178c80a561 Merge branch 'fix-activerecord-join-stupidity' into 'master'
Ignore eager loading in Project.search UNION

This fixes issues such as filtering groups by names on pages such as
https://gitlab.com/dashboard/groups.

See merge request !3229
2016-03-15 16:25:02 +00:00