3705 Commits
Author SHA1 Message Date
Connor Shea 443fdff1b4 Update New Snippet buttons.
No longer shows New Snippet button to users who aren't able to create a new snippet in the given context.

Also removes the plus icon from the New Snippet buttons, as they're no longer used in other creation buttons.

Fixes #14595.
2016-07-08 13:21:20 -06:00
Rémy Coutable 79304c6a7f Merge branch 'improve-project-limit-field' into 'master'
Add min attribute to projects_limit field on user's form

This PR adds `min=0` attribute to `:projects_limit` field on user's form in the admin panel. It improves UX disallowing user to enter negative values in this field.

![](http://take.ms/70V8W)

See merge request !3622
2016-07-08 17:10:23 +00:00
Andrey Krivko 8e1a18f11f Add min attribute to project_limit field on user's form 2016-07-08 19:22:19 +03:00
Rémy Coutable 140a706e96 Merge branch 'retrieve-mr-closes-issues-just-when-required' into 'master'
Avoid calculation of closes_issues.

## What does this MR do?

Avoid unneeded calls to MR closes issues

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

I'm not sure if calling this method from a view is a good practice, but I cannot see another simple way of avoiding this problem. In case we want to avoid this in the controller we need to specify the action, format and status of the merge request, because in that case we know that the `_open` partial will render. We could add some lazy evaluation but it not a thing I see in use along the app but feedback is welcome

## What are the relevant issue numbers?

#14202 , #19490

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- ~~[ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~[ ] API support added~~
- Tests
  - ~~[ ] Added for this feature/bug~~
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5140
2016-07-08 16:13:08 +00:00
Stan Hu b5a16faa93 Merge branch 'fix-changelog-typo' into 'master'
Fix CHANGELOG typo: by_pass -> bypass



See merge request !5048
2016-07-08 15:43:08 +00:00
Douwe Maan 4b21b45db1 Merge branch 'dont-render-discussion-notes-on-not-html-requests' 2016-07-08 11:01:24 -04:00
Rémy Coutable 8657e327ff Merge branch 'api-shared-projects' into 'master'
Api shared projects

## What does this MR do?

Exposes the shared projects in the group endpoint

## What are the relevant issue numbers?

Builds upon !5148 and closes #18780

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5150
2016-07-08 14:30:35 +00:00
Robert Schilling 33124b4b50 API: Expose shared projects in a group 2016-07-08 13:06:17 +02:00
Paco Guzman 52a89f2022 Memoize MR merged/closed events retrieval 2016-07-08 12:35:42 +02:00
Robert Schilling 0530ec5e6e Expose shared groups for projects 2016-07-08 10:30:52 +02:00
Rémy Coutable 2c650b6f30 Merge branch 'feature/option-set-new-users-external' into 'master'
Added setting to set new users by default as external

## What does this MR do?
This implements the feature request #14508. It adds an option in the application settings to set new users by default as external.

## Are there points in the code the reviewer needs to double check?
Everything. Like I mentioned in the discussion of the issue my knowledge of Ruby basically doesn't exists. I tested it on my machine and it seems to work, but as I am very unexperienced in Ruby I highly recommend to  take a close look at the code.

## Why was this MR needed?
It was requested by @DouweM to work on the issue with the proposed changes by me.

## What are the relevant issue numbers?
This MR is for the issue #14508 that followed up after the implementation of #4009.

See merge request !4545
2016-07-08 08:29:18 +00:00
Paco Guzman 8ab3ab9e0a Don't render discussion notes when requesting diff tab through AJAX 2016-07-08 07:35:49 +02:00
Robert Speicher 0de617772d Revert "Revert "Merge branch 'issue_3946' into 'master' ""
This reverts commit bf2a86b73c.
2016-07-07 23:48:02 -04:00
Robert Speicher dad406da23 Merge remote-tracking branch 'origin/master' 2016-07-07 18:40:29 -04:00
Douwe Maan bf89e06a45 Merge branch '18627-wildcard-branch-protection' into 'master'
Allow specifying protected branches using wildcards

Closes #18627 

# Tasks

- [ ]  #18627 !4665 Allow specifying protected branches using wildcards
    - [x]  Find existing usages of protected branches
        - Protecting branches
            - `ProtectedBranchesController` is used to mark a branch protected/unprotected
            - `API::Branches` can be used to mark a branch protected/unprotected
        - Enforcing branch protection
            - `Gitlab::GitAccess` has helpers (`can_push_to_branch?`, `check`) that are used to deny pushes if a branch is protected
            - Over SSH: `gitlab-shell` receives a push, and calls `/allowed` on the GitLab API, which calls `GitAccess.check`
            - Over HTTP: 
                - `gitlab-workhorse` receives the request, and forwards it to rails
                - Rails (in the `GitHttpController#git-recieve-pack`) runs basic checks (is the user logged in, not protected branch checks) and returns ok with `GL_ID` and `RepoPath`
                - `gitlab-workhorse` looks at the response, and calls the relevant `gitlab-shell` action from `git-http/handlePostRPC`
                - Rest of this flow is the same as the SSH flow above
    - [x]  Implementation
        - [x]  Backend
            - [x]  Change `project#protected_branch?` to look at wildcard protected branches
            - [x]  Change `project#developers_can_push_to_protected_branch?`
            - [x]  Change `project#open_branches`
            - [x]  Better error message when creating a disallowed branch from the Web UI
        - [x]  Frontend
            - [x]  Protected branches page should allow typing out a wildcard pattern
            - [x]  Add help text explaining the use of wildcards
            - [x]  Show matching branches for each protected branch
                - [x]  ~~On the index page~~
                - [x]  On a show page
                - [x]  Index?
            - [x]  Can't have the "last commit" column for wildcard protected branches
    - [x]  Fix / write tests
    - [x]  What happens if a hook is missing in dev?
    - [x]  Refactor
    - [x]  Test workflows
        - Create a branch matching a wildcard pattern
        - Push to a branch matching a wildcard pattern
        - Force push to a branch matching a wildcard pattern
        - Delete a branch matching a wildcard pattern
        - [x]  Test using Web UI
        - [x]  Test over SSH
        - [x]  Test over HTTP
        - [x]  Test as developer and master
    - [x]  Investigate performance
        - [x]  Test with a large number of protected branches / branches
        - [x]  Paginate list of protected branches
        - [x]  ~~Possibly rewrite `open_branches`~~
    - [x]  Add `iid`s to existing `ProtectedBranch`es
    - [x]  Add documentation
    - [x]  Add CHANGELOG entry
    - [x]  Add screenshots
    - [x]  Make sure [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/2f753e3ed2ce681b4444944d521f4419e8ed37f7/builds) passes
    - [x]  Assign to endboss for review
    - [x]  Address @DouweM's comments
        - [x]  `protected_branch_params`
        - [x]  `exact_match` instead of `explicit_match`
        - [x]  When would self.name be blank?
        - [x]  Move `protected_branches.each` to a partial
        - [x]  Move `matching_branches.each` to a partial
        - [x]  If the branch is in @matching_branches, it's not been removed
        - [x]  move this regex to a method and memoize it
        - [x]  `commit_sha` directly for exact matches
        - [x]  Number of matches for wildcard matches, with a link
    - [x]  Wait for [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/43f9ce0e88194b8f719bb1c1e656b7fc13278d56/builds) to pass
    - [x]  Respond to @DouweM's comments
        - [x]  Don't use iid
        - [x]  Controller should use `@project.protected_branches.new`
        - [x]  move the memoization to `def wildcard_regex`
        - [x]  render with `collection: @protected_branches`
    - [x]  Wait for [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/f7beedf122fa0c7aa89e86181fe7499321fb10ca/builds) to pass
    - [x]  Wait for @DouweM's review
    - [x]  Wait for @jschatz1's review
    - [x]  Respond to @jschatz1's comments
        - [x]  Use the new dropdown style
        - [x]  description should be moved to the description section without the styling
        - [x]  Protect button should be disabled when no branch is selected
    - [x]  Update screenshots
    - [x]  Merge conflicts
    - [x]  Make sure [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/20f3cfe8d5540eab64c2ba548043d600b28c61ba/builds) passes
    - [ ]  Revisit performance, possibly with staging/production data
        - [ ]  Get a dump of staging / run against staging live
            - [ ]  Get SSH access to staging
    - [ ]  Wait for review/merge






# Screenshots

## Creating wildcard protected branches

![1](/uploads/9446afccfdf6fa381e00c800dd2cc82e/1.png)
![2](/uploads/0b154503b297a818d3577488c575d845/2.png)
![3](/uploads/36217f79df9e41cc1550601f02627fe8/3.png)
![4](/uploads/041ca9bd529bcfa5373fca67e917cbcb/4.png)

### Using the `GLDropdown` component

![2016-06-30_14-16-15](/uploads/508afc2a5e2463c2954641409a560d88/2016-06-30_14-16-15.gif)

## Enforcing wildcard protected branches

### From the Web UI

![Screen_Shot_2016-06-20_at_1.21.18_PM](/uploads/8b5d4b1911e9152698a0488daf1880bc/Screen_Shot_2016-06-20_at_1.21.18_PM.png)

### Over SSH

![SSH](/uploads/7365989d7e4c406ef37b6ae5106442c9/SSH.gif)

### Over HTTPS

![HTTPS](/uploads/a7c0f56ae58efcffc75e6700fa2f4ac0/HTTPS.gif)

## Listing matching branches

![Screen_Shot_2016-06-20_at_1.33.44_PM](/uploads/d054113022f5d7ec64c0e57e501ac104/Screen_Shot_2016-06-20_at_1.33.44_PM.png)

See merge request !4665
2016-07-07 22:37:30 +00:00
Robert Speicher bf2a86b73c Revert "Merge branch 'issue_3946' into 'master' "
This reverts commit 68155ee73b, reversing
changes made to 7ebd011ed1.
2016-07-07 18:25:05 -04:00
Robert Speicher 91cf0387dd Merge branch 'pending-delete-project-notifications' into 'master'
Exclude projects pending delete from notifications

Make `NotificationSetting.for_projects` exclude projects that are excluded by the default scope on `Project`. (At the moment, that's projects with `pending_delete: true`.)

See https://gitlab.com/gitlab-com/support-forum/issues/819

See merge request !5138
2016-07-07 20:17:24 +00:00
Sean McGivern ea25e0918b Exclude projects pending delete from notifications
If the Sidekiq job fails for some reason, a project can be 'stuck'
pending deletion. The project can't be viewed, so it shouldn't be
available through the notification settings association as this will
throw an exception when we try to show the link.
2016-07-07 20:49:17 +01:00
Alfredo Sumaran 338072cc4b Layout for Users Groups and Projects on admin area 2016-07-07 13:25:58 -05:00
Robert Speicher 86d83a3a85 Merge branch 'escape-file-extension' into 'master'
Escape file extension when parsing search results

When a file extension contains characters which have a meaning in regular expressions, the search may crash.

Fixes #18553 

See merge request !5141
2016-07-07 17:47:03 +00:00
Dravere a0a9494e4e Added setting to set new users by default as external
As requested by the issue #14508 this adds an option in the application
settings to set newly registered users by default as external. The
default setting is set to false to stay backward compatible.
2016-07-07 19:21:18 +02:00
James Lopez cf46a88b8d added changelog 2016-07-07 15:49:16 +02:00
Paco Guzman 664e4c125e Avoid calculation of closes_issues.
We just need to get merge requests closes issues when 
we’re going to show them
2016-07-07 15:01:02 +02:00
winniehell cd63d0a538 Escape file extension when parsing search results (!5141) 2016-07-07 14:49:04 +02:00
Valery SizovandDmitriy Zaporozhets 7950fa48e8 Add data when member joined a team 2016-07-07 09:15:49 +03:00
Rémy Coutable 52a583c120 Merge branch 'show_push_widget_in_upstream' into 'master'
Show last push widget in upstream after push to fork

## What does this MR do?

Show the last push widget in the upstream project when you push to a fork. 

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

In the view, I'm checking if `@project` in the first part of the conditional. I felt it was necessary in case `@project` wasn't an object in all cases. Will it ever not be there? Is this check necessary?

Should there be tests? I don't see existing ones for this. 

## Why was this MR needed?

I use the fork workflow everywhere and it has annoyed me for some time that the last push widget doesn't show up when viewing the upstream project. I'm almost never viewing the fork in GitLab so I want to be able to easily create a MR in any case. 

## Screenshots (if relevant)

**Widget in upstream repo:**

![Screen_Shot_2016-06-23_at_10.05.29_AM](/uploads/f823642e40cf059c3793db6cf00bba50/Screen_Shot_2016-06-23_at_10.05.29_AM.png)

**Widget in fork**:

![Screen_Shot_2016-06-23_at_10.05.25_AM](/uploads/1a976241186ec42cdc43c80bea0c856b/Screen_Shot_2016-06-23_at_10.05.25_AM.png)

**Widget on dashboard**:

![Screen_Shot_2016-06-23_at_10.06.07_AM](/uploads/084ac35f67735aec8042d9bc904255fe/Screen_Shot_2016-06-23_at_10.06.07_AM.png)


See merge request !4880
2016-07-07 05:22:35 +00:00
Rémy Coutable 9b75da8025 Merge branch 'patch-3' into 'master'
Allow everyone to order tags, not only those who has access

## What does this MR do?
Allows everyone to view tags by different order (by name, date, etc), not only those who has access

## Are there points in the code the reviewer needs to double check?
Just check how it's rendered.

## Why was this MR needed?
Because now I can't order other's project tags.

## What are the relevant issue numbers?
#15438

## Screenshots (if relevant)
Exist in related issue. Look [one comment](https://gitlab.com/gitlab-org/gitlab-ce/issues/15438#note_12888763) and [just below there is another one](https://gitlab.com/gitlab-org/gitlab-ce/issues/15438#note_12888819).

## Does this MR meet the acceptance criteria?
Probably, no need

See merge request !5105
2016-07-07 05:11:26 +00:00
Robert Speicher a77f9c521c Update CHANGELOG for 8.9.5
[ci skip]
2016-07-06 16:58:53 -04:00
Drew Blessing 0b34cac1c5 Show last push widget in upstream after push to fork 2016-07-06 12:58:57 -05:00
Serg 3646eb165c Allow everyone to sort tags, not only those who has access 2016-07-06 23:36:57 +06:00
Douglas Barbosa Alexandre 075c899d82 Update CHANGELOG 2016-07-06 13:08:12 -03:00
Douwe Maan 22780c4ac3 Merge branch '15094-throttling-pushes_since_gc' into 'master'
Throttle the update of `project.pushes_since_gc` to 1 minute

## What does this MR do?

Throttle the update of `project.pushes_since_gc` to alleviate DB load

## What are the relevant issue numbers?

Relates to #15094

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- ~~[ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~[ ] API support added~~
- Tests
  - ~~[ ] Added for this feature/bug~~
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)


See merge request !5083
2016-07-06 15:53:04 +00:00
Douwe Maan b5b17d00ed Merge branch '19092-fix-event-for-legacydiffnote-not-considered-note' into 'master'
Fix diff comments not showing up in activity feed

## What does this MR do?

It fixes the detection of note events to check for `Note` and `LegacyDiffNote`.

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

No? /cc @DouweM (since I believe you introduced `LegacyDiffNote`

## Why was this MR needed?

To fix #19092.

## What are the relevant issue numbers?

Fixes #19092.

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5069
2016-07-06 15:25:54 +00:00
Robert Speicher 3df58f1499 Merge branch 'gh-labels' into 'master'
Allow `?`, or `&` for label names

Closes #18727 

See merge request !4724
2016-07-06 15:11:20 +00:00
Robert Speicher be018ba8c4 Merge branch 'fix/import-url-validator' into 'master'
Fixing URL validation for import_url on projects

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

This MR fixes problems related to bypassing `import_url` validation on projects. This makes sure the URL is properly validated so we don't enter crap and fail while running workers that handle this URL.

It also adds a migration to fix current invalid `import_url`s

See merge request !4753
2016-07-06 15:06:01 +00:00
Timothy Andrew 10c446eaa2 Add wildcard protected branches to the CHANGELOG. 2016-07-06 15:43:52 +05:30
Douglas Barbosa Alexandre 998d4eb61f Update CHANGELOG 2016-07-05 20:59:33 -03:00
Patricio Cano 2e96fcff12 Clone button should not be clickable when there is a disabled protocol 2016-07-05 16:54:22 -05:00
Patricio Cano fbaabb3911 Rename enabled_git_access_protocols to singular. 2016-07-05 16:54:22 -05:00
Patricio Cano 512adc21fe Add setting that allows admins to choose which Git access protocols are enabled 2016-07-05 16:54:22 -05:00
Douwe Maan 1141eaf5c8 Merge branch '18593-autofilter-rinku-instrumentation' into 'master'
Instrument Rinku usage

## What does this MR do?

Add metrics instrumentation to Rinku, module methods (autolink)

## What are the relevant issue numbers?

#18593 

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- ~~[ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~[ ] API support added~~
- Tests
  - ~~[ ] Added for this feature/bug~~
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5063
2016-07-05 21:51:56 +00:00
Douwe Maan 95cb0195b0 Merge branch '18593-update-rinku' into 'master'
Bump Rinku to 2.0.0

## What does this MR do?

Update Rinku gem to last stable version.

## What are the relevant issue numbers?

#18593 

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- ~~[ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~[ ] API support added~~
- Tests
  - ~~[ ] Added for this feature/bug~~
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5064
2016-07-05 21:51:41 +00:00
Connor Shea 5d87f4fc09 Fix Changelog [ci skip] 2016-07-05 12:10:39 -06:00
Robert Speicher aefb8a1741 Merge branch 'update-gemoji' into 'master'
Add lib/gitlab/emoji.rb instead of gitlab_emoji gem and upgrade Gemojione

- No reason to split it into a separate gem when the gem barely did anything. We can use gemojione directly, making updating gemojione that much easier. Unless there's a particularly good reason we were using the gem?
- Fixes the Rake task since it broke after all the AwardEmoji changes.
- Update gemojione to 2.6.1.

Spring Update changes! http://emojione.com/releases/#2.2.0

See merge request !4919
2016-07-05 17:08:35 +00:00
Dmitriy Zaporozhets fe9246bf68 Merge branch 'project-header' into 'master'
Updated project header

## What does this MR do?

Updates the project header.

## What are the relevant issue numbers?

Closes #18544, #18832 

## Screenshots (if relevant)

![Screen_Shot_2016-06-29_at_14.16.16](/uploads/4df895e7ecf42e5ddab3f2f1e47f8c7e/Screen_Shot_2016-06-29_at_14.16.16.png)


See merge request !4989
2016-07-05 16:27:16 +00:00
Paco Guzman 330de255b7 RailsCache metrics now includes fetch_hit/fetch_miss and read_hit/read_miss info. 2016-07-05 12:28:06 +02:00
Paco Guzman d91c6c0738 Throttle the update of project.pushes_since_gc to 1 minute 2016-07-05 10:09:47 +02:00
Z.J. van de Weg 16d8251093 Add index on both Award Emoji user and name 2016-07-05 08:51:18 +02:00
Dmitriy Zaporozhets fd2b2dc1de Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2016-07-04 21:52:43 +03:00
Dmitriy Zaporozhets b734167b7a Merge branch 'more_descriptive_git_shell_messages' into 'master'
Handle custom Git hook result in GitLab UI

## What does this MR do?

This MR fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19190
It allows to show messages from git custom hooks

## Screenshots (if relevant)

![joxi_screenshot_1467651998090](/uploads/7f814523c96712c07b4f4b52c843aab3/joxi_screenshot_1467651998090.png)

See merge request !5073
2016-07-04 17:47:30 +00:00