Commit Graph
4398 Commits
Author SHA1 Message Date
Rémy Coutable 17c12be62f Merge branch 'fix/nomethod-error-on-ci' into 'master'
Fix error when visiting CI root path

Closes #14528, closes #14687

See merge request !3377
2016-03-29 12:35:06 +02:00
Douwe MaanandRémy Coutable 8d5a55ef39 Merge branch 'fix-14607' into 'master'
Ensure private project snippets are not viewable by unauthorized people

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

See merge request !1946
2016-03-29 12:31:22 +02:00
Dmitriy ZaporozhetsandRémy Coutable f8b9dda43d Merge branch 'ci-setup-info' into 'master'
Add links to CI setup documentation from project settings and builds pages

For #14483

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !3384
2016-03-29 12:25:49 +02:00
Douwe MaanandRémy Coutable 30030141f6 Merge branch 'fix-comments-on-confidential-issues-show-activity-feed-for-non-members' into 'master'
Comments on confidential issues doesn't show in activity feed to non-members

Closes #14568

See merge request !3375
2016-03-29 12:18:51 +02:00
Rémy Coutable f45b9bdef0 Merge branch 'fix-build-dependencies' into 'master'
Fix build dependencies, when the dependency is a string

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/14485

See merge request !3344
2016-03-23 12:59:29 +01:00
Douwe MaanandRémy Coutable 83961f9790 Merge branch 'fix-sorting-by-votes-on-groups-page' into 'master'
Fix sorting issues/mrs by votes on the groups page

Closes #14394

The `non_archived` scope applied here https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/concerns/issues_action.rb#L5 overrides the previous `ORDER BY` applied inside the IssuesFinder, with the default scope of the Project model, resulting in SQL errors.

```ruby
Issue.reorder(created_at: :desc).joins(:project).to_sql
=> "SELECT issues.*
    FROM issues INNER JOIN projects ON projects.id = issues.project_id
    ORDER BY issues.created_at DESC"

Issue.reorder(created_at: :desc).joins(:project).merge(Project.non_archived).to_sql
=> "SELECT issues.*
    FROM issues INNER JOIN projects ON projects.id = issues.project_id
    WHERE projects.archived = 'f'
    ORDER BY projects.id DESC"

Issue.reorder(created_at: :desc).joins(:project).merge(Project.non_archived.only(:where)).to_sql
=> "SELECT issues.*
    FROM issues INNER JOIN projects ON projects.id = issues.project_id
    WHERE projects.archived = 'f'
    ORDER BY issues.created_at DESC"
```

/cc @yorickpeterse

See merge request !3333
2016-03-23 12:49:04 +01:00
Rémy Coutable e257e81cbf Merge branch 'fix/14505' into 'master'
Fix an issue causing the Dashboard/Milestones page to be blank

Fixes #14505 and #14514.

See merge request !3348
2016-03-23 12:48:08 +01:00
Douwe MaanandRémy Coutable ae407262f2 Merge branch 'move-issue-section-should-not-be-displayed-in-the-new-issue-form-14489' into 'master'
Moving of issuables only when the record already exists

Closes #14489

See merge request !3340
2016-03-23 12:29:41 +01:00
Douwe MaanandRémy Coutable 3536b17e97 Merge branch 'notifications-for-subscribers-confidential-issue-labels' into 'master'
Restrict notifications for confidential issues

Closes #14468

/cc @rymai

See merge request !3334
2016-03-23 12:26:56 +01:00
Robert SpeicherandRémy Coutable 3129e135eb Merge branch 'drop_db_before_restore' into 'master'
Reload the schema before restoring a database backup

If a user tries to downgrade and restore after a failed upgrade,
the database may still contain newer tables. Reload the older
schema before restoring the database to avoid future upgrade
problems. Also, add a rake task to help users add migration
versions to the database so it's easier to recover from these
errors if they do occur. Fixes #13419

See merge request !2807
2016-03-23 12:25:06 +01:00
Douwe MaanandRémy Coutable d0a7dfd66d Merge branch '2489-soft-delete-issues' into 'master'
Soft delete issuables

Fixes #2489 

What still needs to happen: research on the indexes, the gem suggests a [lot of changes](https://github.com/rubysherpas/paranoia#about-indexes) though this is probably a good idea to discuss and I'm unsure on the impact of an omnibus upgrade as I suspect creating about 10 new indexes has a large impact on the downtime.

TODO: 
- [x] Also group owners can ***soft*** delete
- [x] Button should be hidden

See merge request !2982
2016-03-22 12:36:02 +01:00
Kamil TrzcińskiandRémy Coutable 0fcea6b660 Merge branch 'feature-ci-only-except-trigger' into 'master'
CI: Add 'triggers' keyword to 'only' and 'except' lists to allow control over when triggers cause builds to run

Currently, the `only` and `except` keywords in `.gitlab-ci.yml` only accept ref names or the special `branches` and `tags` keywords. However, these are primarily useful when controlling how repository activity affects the creation of builds. In my case, instead of building on every commit, I'd like to use the following logic:

- If the repository is tagged, do a build.
- Any other normal commits should not cause a build.
- If a build is triggered via the API, always create one for the specified ref.

From what I can tell, this isn't possible via the existing YAML syntax. In this MR, I introduce a new keyword `triggers` that goes along with `branches` and `tags`. I can implement the logic above using the following job configuration:

```yaml
only:
  - tags
  - triggers
```

I updated the tests and documentation to reflect this and everything seems to pass.

See merge request !3230
2016-03-22 12:34:20 +01:00
Robert SpeicherandRobert Speicher c8cc1c16d1 Merge branch 'issue_12658' into 'master'
Add group visibility level

Supersedes https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3051

Closes #12658

See merge request !3323
2016-03-21 21:37:57 -04:00
Robert SpeicherandRémy Coutable b881282486 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 16:40:54 +01:00
Kamil TrzcińskiandRémy Coutable ab3681d149 Merge branch 'feature/issue-move' into 'master'
Ability to move issue to another project

Tasks:

- [x] Create scaffold of service that will move issue to another project.
- [x] Close old issue, add system note about moving issue to a new project.
- [x] Create a new issue, add system note about issue being moved from old project.
- [x] Check if issue can be moved to another project before executing service
- [x] Check permissions when moving an issue (`:admin_issue` ability)
- [x] Display select box for a new project when editing an issue
- [x] Show only projects that issue can be moved into in that select box
- [x] Add project select handler, helper and some permission filters to it
- [x] Preserve as much information as possible, including author
- [x] Prepare mechanisms that unfolds local references in issue description
- [x] Rewrite issue description with references unfolding and add some specs for it
- [x] Rewrite all system notes and comments attached to issue that is being moved
- [x] Update `Label` so that is was able to create cross reference labels (separate MR)
- [x] Add notifications about moving issue to another project
- [x] Display confirmation alert/message when issue move has been requested
- [x] Make it possible to undo selecting project where issue will be moved to
- [x] Add column to issue, that will indicate if it has been moved to another project
- [x] Do not allow to move issue that has been already moved
- [x] Write top-to-bottom feature spec in RSpec instead of Spinach

UI:

![issue_move_ui](/uploads/b3c6b563362c1fded9082cc0f51e5a74/issue_move_ui.png)

![issue_move_tooltip](/uploads/2ab913b06f52df1cafde9abe89bd9cb8/issue_move_tooltip.png)

Closes #3024

See merge request !2831
2016-03-21 16:40:17 +01:00
Robert SpeicherandRémy Coutable c7f3bee7ff Merge branch 'no-gc-retry' into 'master'
Do not retry "git gc"

To prevent 'git gc' timing out on a large repo and then bouncing
around in the retry queue.

See merge request !3266
2016-03-21 12:37:20 +01:00
Jacob SchatzandRémy Coutable 42c4304133 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-21 12:31:20 +01:00
Douwe MaanandRémy Coutable a4e19b6cb0 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-21 12:30:29 +01:00
Douwe MaanandRémy Coutable 2b07702ad5 Merge branch 'label-tooltip' into 'master'
Add label description in tooltip to labels in issue index and sidebar

The tooltip can get quite big, but it’s so useful to inform people about what these labels mean
new

![Screen_Shot_2016-03-08_at_11.48.28](/uploads/894baaaa1f789c3a2069a924d541e64b/Screen_Shot_2016-03-08_at_11.48.28.png)

![Screen_Shot_2016-03-08_at_11.48.20](/uploads/efe4fa0960054c4071b8f6bf83024403/Screen_Shot_2016-03-08_at_11.48.20.png)

@JobV writes on Slack:
> yeah I think it’s better than not, but I’d have to try it 😃 
> 
> cautious yes, revert if it’s annoying 😉

See merge request !3124
2016-03-21 12:28:57 +01:00
Douwe MaanandRémy Coutable 1793a65eeb Merge branch 'trigger-todo-for-mentions-on-commits-page' into 'master'
Trigger a todo for mentions on commits page

Closes #14006 

* Screenshot:

![todo-commit](/uploads/5d34de0b7afcea7548123dafddf60c45/todo-commit.png)

See merge request !3262
2016-03-18 21:23:11 +01:00
Douwe MaanandRémy Coutable 17418461ba Merge branch 'fix/14388' into 'master'
Fix an issue when the target branch of a MR had been deleted

Before displaying the "diverged commits" note, we're checking if the MR
is open, but we should check if it's mergeable instead because this
check ensure the source and target branches exist.

This was introduced by !2217 and fixes #14388.

See merge request !3294
2016-03-18 21:22:41 +01:00
Douwe MaanandRémy Coutable 5b82e15bbc 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 21:22:25 +01:00
Jacob VosmaerandRémy Coutable ddb2de0957 Merge branch 'project-cache-worker-without-diverging' into 'master'
Removed diverging commit count calculation from Repository#build_cache

Using a repository with 1000 branches the old `Repository#build_cache` method would take around 180 seconds to complete. Without calculating the diverging commit counts this method "only" takes around 60 seconds. 

See commit 28cc2413eb5ddf920ce0b5eed803121f8b884754 for more details. This fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/14058

cc @rspeicher 

See merge request !3274
2016-03-18 21:21:58 +01:00
Jacob SchatzandRémy Coutable ece28bda7c Merge branch 'issue-fade-load' into 'master'
Changing filter dropdowns shows loading

Instead of doing a full refresh of the page - i've modified the filterResults method on the Issues object to work for this form as well

![issues](/uploads/3335f09f7df88b6d419de7fd3d6857d2/issues.gif)

Closes #14359

See merge request !3237
2016-03-18 21:18:20 +01:00
Douwe MaanandRémy Coutable cf52a9b435 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 21:03:39 +01:00
Jacob VosmaerandRémy Coutable f14ee2f248 Merge branch 'hide-large-diffs' into 'master'
Show a notice for diffs that are empty/too large

This builds upon https://gitlab.com/gitlab-org/gitlab_git/merge_requests/72 but will fail until said MR has been merged.

Fixes gitlab-org/gitlab-ce#13912, gitlab-org/gitlab-ce#13644, gitlab-org/gitlab-ce#13557, gitlab-org/gitlab-ce#13267, gitlab-org/gitlab-ce#3906

See merge request !3185
2016-03-18 20:31:56 +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
Kamil Trzciński f728e4b519 Merge branch 'glalonde-triggerbuild' into 'master'
Adjusted behavior so canceled builds tagged as allowed to fail do not fail build

## What does this MR do?
This diff changes the 'Allowed to fail' flag to also ignore canceled builds, whereas before, canceled builds could fail the suite even if they were marked as 'Allowed to fail'

dupe of !3258 to force a build

## Are there points in the code the reviewer needs to double check?
no

## Why was this MR needed?
Unexpected behavior as a user

## What are the relevant issue numbers?

## Screenshots (if relevant)
![whatisgoingon](/uploads/fcd7c8f3d8454bc730d7fd41eff59b31/whatisgoingon.png)

See merge request !3271
2016-03-17 15:51:11 +00:00
Geoffrey Lalonde 4117c815df adjusted behavior so canceled builds tagged as allowed to fail do not fail build 2016-03-17 07:55:10 -07: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
Zeger-Jan van de Weg 9337406671 Fix specs
Spinach was right, I was a fool..
2016-03-17 12:05:54 +01:00
Zeger-Jan van de Weg 481e73fb76 Merge branch 'master' into new-branch-button-issue 2016-03-17 11:13:16 +01:00
Zeger-Jan van de Weg 51300d9b2a API support for setting External flag on existing users 2016-03-17 09:36:00 +01:00
Hiroyuki Sato f0b052e168 Fix wiki search results point to raw source 2016-03-17 08:58:52 +09:00
Robert Speicher 374037b8a3 Merge branch 'issue_14306' into 'master'
Return an empty Array when there aren't lines to parse.

Fixes #14306

See merge request !3243
2016-03-16 01:29:09 +00:00
Douwe Maan f83a596db3 Merge branch 'worker-for-user-deletion' into 'master'
A worker deletes a user, so the request doesn't time out

Fixes #13261


See merge request !2855
2016-03-16 01:18:46 +00:00
Rubén Dávila 7e03b40221 Return an empty Array when there aren't lines to parse. 2016-03-15 19:51:27 -05:00
Robert Speicher 64d0dd1807 Merge branch 'fix-capybara-deprecation-warnings' into 'master'
Fix Capybara 2.6.2 deprecation warnings

See merge request !3236
2016-03-16 00:00:38 +00:00
Zeger-Jan van de Weg 29a43373ce Specs for the DeleteUserService 2016-03-15 22:19:51 +01:00
Zeger-Jan van de Weg 4827458155 Incorporate the review and update spec
The feature spec now also tests the absence of the new branch button
2016-03-15 21:59:25 +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 4231cfeba5 Target right release, rebase got it wrong 2016-03-15 21:09:25 +01:00
Zeger-Jan van de Weg d249da1c16 Specs on force deleting of a user 2016-03-15 21:09:25 +01:00
Zeger-Jan van de Weg 4bcc097750 A worker deletes a user, so the request doesn't time out
Fixes #13261
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
Stan Hu 7c61bdcf6f Fix Capybara 2.6.2 deprecation warnings 2016-03-15 11:03:17 -07:00