Commit Graph

798 Commits

Author SHA1 Message Date
James Lopez 280afe0a64 fix blob controller spec failure - updated not to use file-path- 2016-11-29 10:40:56 +01:00
Douwe Maan 6d37fe952b Merge branch 'jej-fix-missing-access-check-on-issues' into 'security'
Fix missing access checks on issue lookup using IssuableFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

⚠️ - Potentially untested
💣 - No test coverage
🚥 - Test coverage of some sort exists (a test failed when error raised)
🚦 - Test coverage of return value (a test failed when nil used)
 - Permissions check tested

- [x]  app/controllers/projects/branches_controller.rb:39
  - `before_action :authorize_push_code!` helpes limit/prevent exploitation. Always checks for reporter access so fine with
    confidential issues, issues only visible to team, etc.
- [x] 🚥 app/models/cycle_analytics/summary.rb:9 [`.count`]
- [x]  app/controllers/projects/todos_controller.rb:19

- [x] Potential double render in app/controllers/projects/todos_controller.rb

- https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#cedccb227af9bfdf88802767cb58d43c2b977439_24_24

See merge request !2030
2016-11-28 21:25:46 -03:00
Douwe Maan 742cee756b Merge branch 'jej-22869' into 'security'
Fix information disclosure in `Projects::BlobController#update`

It was possible to discover private project names by modifying `from_merge_request`parameter in `Projects::BlobController#update`. This fixes that.

- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

https://gitlab.com/gitlab-org/gitlab-ce/issues/22869

See merge request !2023
2016-11-28 21:25:18 -03:00
Rémy Coutable beedd40ef7
Ensure user is authenticated to create a new snippet
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-28 16:57:49 +01:00
Rémy Coutable bcc030240c Merge branch 'fix-dead-help-link' into 'master'
Fix a broken link and avoid potential creation of future broken links on the help page.

See merge request !7582
2016-11-28 09:01:08 +00:00
Grzegorz Bizon 895d97af87 Merge branch 'master' into fix/rename-mwbs-to-merge-when-pipeline-succeeds
* master: (312 commits)
  Fix bad selection on dropdown menu for tags filter
  Fixed issue boards scrolling with a lot of lists & issues
  You can only assign default_branch when editing a project ...
  Don't convert data which already is the target type
  Stop supporting Google and Azure as backup strategies
  renames some of the specs and adds changelog entry
  Fixed dragging issue moving wrong issue after multiple drags of issue
  Fixed issue boards issue sorting when dragging issue into list
  Rephrase some system notes to be compatible with new system note style
  Add missing JIRA file that redirects to the new location
  Fix documentation to create the `pg_trm` extension before creating the DB
  Document that we always use `do...end` for `before` in RSpec
  Backport Note#commands_changes from EE
  Log mv_namespace parameters
  Add default_branch attr to Project API payload in docs.
  Fix title case to sentence case
  properly escape username validation error message flash
  Remove header ids from University docs
  Add missing documentation.
  Added test that checks the correct select box is there for the LFS ...
  ...

Conflicts:
	app/services/system_note_service.rb
	spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb
	spec/services/merge_requests/merge_when_pipeline_succeeds_service_spec.rb
	spec/services/system_note_service_spec.rb
2016-11-25 11:05:34 +01:00
Robert Speicher fe4ae12ec8 Merge branch 'rephrase-system-notes' into 'master'
Rephrase some system notes to be compatible with new system note style

See merge request !7692
2016-11-25 04:36:13 +00:00
Douwe Maan 6df22f72c6 Rephrase some system notes to be compatible with new system note style 2016-11-24 18:26:29 +08:00
Douwe Maan a7a9db803b Merge branch 'dz-allow-nested-group-routing' into 'master'
Add nested groups support to the routing

## What does this MR do?

It allows routing with `/` in namespace name 

## Why was this MR needed?

For nested groups feature(https://gitlab.com/gitlab-org/gitlab-ce/issues/2772). We need URI like `/group/subgroup/project` be routed correctly


## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~API support added~~
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [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 it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/2772

See merge request !7459
2016-11-24 04:31:54 +00:00
Dmitriy Zaporozhets 6683fdcfb0
Add nested groups support to the routing
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-11-23 14:08:36 +02:00
Sean McGivern dfb21e299f Merge branch 'rs-project-team-helpers' into 'master'
Add shortcuts for adding users to a project team with a specific role

Closes #20944

See merge request !7565
2016-11-22 16:43:03 +00:00
Sean McGivern 45d69bf120 Merge branch '24576_cant_stop_impersonating' into 'master'
Allow admins to stop impersonating users without e-mail addresses

Closes #24576

See merge request !7550
2016-11-22 16:26:34 +00:00
Stan Hu 7953480646 Fix remaining Bitbucket controller specs 2016-11-21 16:47:30 -08:00
Stan Hu af6926283b Fix Bitbucket status controller spec 2016-11-21 16:47:30 -08:00
Stan Hu 7ba65d05af Fix Bitbucket callback spec 2016-11-21 16:47:30 -08:00
James Lopez a3331eee91 Updated code based on feedback 2016-11-21 17:29:07 +01:00
James Lopez dde8fba524 Adds a flag to reflect whether or not there is data in cycle analytics 2016-11-21 17:19:18 +01:00
Grzegorz Bizon 01f238893a Rename MWBS service to Merge When Pipeline Succeeds 2016-11-21 10:22:09 +01:00
David Wagner c4ded595cc Fix broken external links in help/index.html
An external link was recently added but was broken because
'https://gitlab.com/help/' was prepended to every link in the page.

Since no link in the main help readme begins with "help" and since doing
so wouldn't make sense, the substitution conditionaly prepending "help"
can be simplified and reused.

Signed-off-by: David Wagner <david@marvid.fr>
2016-11-20 20:15:08 +01:00
Kamil Trzcinski 8d0018444d Merge remote-tracking branch 'origin/master' into 22539-display-folders 2016-11-18 20:20:30 +01:00
Robert Speicher eef3609123 Add shortcuts for adding users to a project team with a specific role
This also updates _some_ specs to use these new methods, just to serve
as an example for others going forward, but by no means is this
exhaustive.

Original implementations at !5992 and !6012.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20944
2016-11-18 14:55:04 +02:00
Oren Kanner 8dd9a8b6e0 Allow admins to stop impersonating users without e-mail addresses
Resolves #24576

Modify the guard clause of the `ApplicationController#require_email`
before action to skip requests where an admin is impersonating the
current user.
2016-11-17 23:28:39 -05:00
Sean McGivern 0b21a71aeb Merge branch 'fix-singin-redirect-for-fork-new' into 'master'
Fixing the issue of visiting a project fork url giving 500 error when not signed…

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

See merge request !7392
2016-11-17 19:35:30 +00:00
Douglas Barbosa Alexandre 198fe1bfc2 Add toggle_subscription action to Groups::LabelsController 2016-11-17 15:10:13 -02:00
Douglas Barbosa Alexandre 9dfbe1d2a1 Add helper method to toggle label subscription on labels controller spec 2016-11-17 15:10:13 -02:00
Douglas Barbosa Alexandre 0c052f116c Remove default value for `project` argument on subscribable concern 2016-11-17 15:10:13 -02:00
Douglas Barbosa Alexandre 4a29fde577 Allow users to subscribe to group labels at project-level 2016-11-17 15:10:13 -02:00
Douglas Barbosa Alexandre 091efb3152 Fix specs to pass a project when creating subscriptions 2016-11-17 15:10:13 -02:00
Robert Speicher 28d9645926 Merge branch '21992-disable-access-requests-by-default' into 'master'
Disable the "request access" functionality by default for new groups and projects

Currently this feature is enabled by default, and additional action is required to disable it.

Closes #21992 
Closes !7011

See merge request !7425
2016-11-16 14:50:45 +00:00
Grzegorz Bizon 4388d90370 Add controller specs for environments index action 2016-11-16 11:58:06 +00:00
Cagdas Gerede 5bc19dec54 Remove newlines between context and it in addition to testing redirection for create action to import path 2016-11-15 21:23:20 +03:00
Douwe Maan 374b8e95c3 Merge branch '21076-deleted-merged-branches' into 'master'
Add button to delete all merged branches

## What does this MR do?

It adds a button to the branches page that the user can use to delete all the branches that are already merged. This can be used to clean up all the branches that were forgotten to delete while merging MRs.

**Note**  
~~This MR is WIP until MR !6408 is merged.~~

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

The UX of the actual "Delete merged branches" button.

## Why was this MR needed?

Fixes #21076

## Screenshots
![Branches page without "Delete all merged" button](/uploads/3a2936a83c3547a0fce92a74af880a2d/Screen_Shot_2016-10-17_at_20.06.30.png)

Before:
![Screen_Shot_2016-10-17_at_20.07.11](/uploads/55efcebf4e0a45dbfc70ba4a11ca152c/Screen_Shot_2016-10-17_at_20.07.11.png)


After:

## 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 [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [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)

## What are the relevant issue numbers?

Closes #21076

See merge request !6449
2016-11-15 12:08:22 +00:00
Cagdas Gerede 5f2d45c956 Add authentication for for create action. Add more tests for for new and create actions 2016-11-15 01:59:11 +03:00
Rémy Coutable 0f48abf24b Merge branch 'fix-help-page-links' into 'master'
Fix error links in help index page when access it with url `http://gitlab.example.com/help/` which have an extra slash 

Fixes #24349

See merge request !7396
2016-11-14 10:45:56 +00:00
Cagdas Gerede 37cad72970 Move sign_out out of it into before 2016-11-13 03:12:35 +03:00
Earth 2c55d8167b Replace tabs with spaces 2016-11-13 03:05:26 +03:00
Earth f080cb5316 Add a unit test for redirecting to sign-in page when user is not logged in and user visits the new fork page 2016-11-13 02:59:43 +03:00
Fu Xu b99282804d fix error links in help page 2016-11-12 21:45:45 +08:00
Alex Sanford 317c388347 Ensure labels are loaded on "show" methods of MR
Previously, they were only being loaded on the actual `show` action, but
not the actions representing the tabs (commits, builds, etc).
2016-11-11 14:06:43 -04:00
Nick Thomas d211011698 Make access request specs explicitly enable or disable access requests as required 2016-11-11 15:45:47 +00:00
Toon Claes 1afab9eb79 Add button to delete all merged branches
It adds a button to the branches page that the user can use to delete
all the branches that are already merged. This can be used to clean up
all the branches that were forgotten to delete while merging MRs.

Fixes #21076.
2016-11-09 21:04:03 +01:00
Douwe Maan 9c3f3e9e35 Merge branch 'use-separate-token-for-incoming-email' into 'master'
Use separate email-friendly token for incoming email

See merge request !5914
2016-11-08 10:47:45 +00:00
tiagonbotelho 011e561bfa implements reset incoming email token on issues modal and account page,
reactivates all tests and writes more tests for it
2016-11-07 15:56:18 +00:00
Dmitriy Zaporozhets 591e18364a Add tests for project#index routing
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-11-07 16:13:36 +02:00
Rémy Coutable 3f02914460 Complete and improve specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-04 14:58:40 +01: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
Valery Sizov 921677782f Implement CreateMembers service to make controller thin 2016-11-01 10:17:04 +02:00
Yorick Peterse 3645e684bf Merge branch '23106-events-default-scope-results-in-a-slow-query' into 'master'
Optimize Event queries by removing default order

See merge request !7130
2016-10-31 12:53:58 +00:00
Douwe Maan 44cbfeaba8 Merge branch 'adam-fix-labels-find-or-create' into 'master'
Pass user instance to Labels::FindOrCreateService or skip_authorization: true

## What does this MR do?

It fixes a bug described in #23694 when `project.owner` was passed to `Labels::FindOrCreateService`. `Labels::FindOrCreateService` expected a user instance and `project.owner` may return a group as well. This MR makes sure that we either pass a user instance or `skip_authorization: true`.

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

- places where we pass `skip_authorization: true`

## Does this MR meet the acceptance criteria?

- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [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 it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Fixes #23694

See merge request !7093
2016-10-28 15:01:59 +00:00
Adam Niedzielski e2c603696a Pass user instance to Labels::FindOrCreateService or skip_authorization: true
Do not pass project.owner because it may return a group and Labels::FindOrCreateService
throws an error in this case.
Fixes #23694.
2016-10-28 11:31:45 +02:00
Alejandro Rodríguez 0badbef836 Optimize Event queries by removing default order 2016-10-27 20:07:11 -03:00
Steve Halasz 32e46d3502 Merge branch 'master' into 5905-duplicate-email-errors
Getting latest CHANGELOG so I can resolve merge conflict
2016-10-27 16:07:56 -04:00
Steve Halasz 36ec5eaf85 Only show one error message for an invalid email
If notification_email is blank, it's set from email. If an admin
attempted to create a user with an invalid email, an error would be
displayed for both fields. Only validate the notification_email if it's
different from email.
2016-10-27 15:46:28 -04:00
Phil Hughes a2eff1a8e5 Merge branch 'master' into issue-board-sidebar 2016-10-26 08:47:09 +01:00
Rémy Coutable b33e04f9b2 Merge branch 'add-test-for-snippet-download' into 'master'
Adds test for feature in this MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6720

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6720

See merge request !6854
2016-10-25 14:49:27 +00:00
Dmitriy Zaporozhets 3608f9284e Improve create project member test at project_members_controller_spec
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-24 13:14:00 +03:00
Dmitriy Zaporozhets 1eba14ae2e Refactor create member tests from group_members_controller_spec
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-24 13:14:00 +03:00
Linus G Thiel 036fac06d1 Gracefully handle adding of no users to projects and groups
- Disable {project, group} members submit button if no users

  If no users are selected, the submit button should be disabled.

- Alert user when no users were added to {project, group}.

  When no users were selected for adding, an alert message is
  flashed that no users were added.

- Also, this commit adds a feedback when users were actually added to a
  project, in symmetry with how group members are handled.

Closes #22967, #23270.
2016-10-24 13:14:00 +03:00
Rémy Coutable e696896487
Fix status code expectation
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-22 13:46:23 +02:00
Stan Hu 0890aeb61a Fix error in generating labels
Attempting to generate default set of labels would result in
an error:

ArgumentError: wrong number of arguments (given 1, expected 0)

Closes #23649
2016-10-22 02:16:21 -07:00
Sean McGivern 6c09fbd889 Merge branch 'fix_project_member_access_levels' into 'master'
Fix project member access levels

Migrate invalid project members (owner -> master)

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

See merge request !6957
2016-10-21 12:51:44 +00:00
Valery Sizov 168197cd5a Fix project member access levels 2016-10-21 12:57:53 +03:00
Kamil Trzciński a7307c8a9a Merge branch 'zj-use-iid-deployment-refs' into 'master'
Use iid deployment refs

This fixes the 404, because `find_by` will return nil instead of throwing an error.

See merge request !7021
2016-10-20 17:55:38 +00:00
Z.J. van de Weg c1212beaa4 Use deployment IID when saving refs 2016-10-20 14:17:22 +02:00
Phil Hughes fcf0a4a12d Merge branch 'master' into issue-board-sidebar 2016-10-19 22:33:34 +01:00
Douwe Maan 25ff16459c Merge branch 'feature/group-level-labels' into 'master'
Add group level labels

## What does this MR do?

Add group level labels.

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

* `LabelsFinder`
* `Gitlab::Gfm::ReferenceRewriter`
* `Banzai::Filter::LabelReferenceFilter`

## Why was this MR needed?

We'll be adding more feature that allow you to do cross-project management of issues.

## Screenshots (if relevant)

* Group Labels
    ![Group Labels](/uploads/2244c06ad68eae4fb246fb4c81bf8060/2.png)

* Project Labels
    ![Project Labels](/uploads/c5839516d2282b51f7418d9dadbeceb4/1.png)

* Expanded references for group labels when moving issue to another project
    ![Expanded references for group labels when moving issue to another project](/uploads/0c9ab248a8420d4978d59349ae3d42e5/3.png)

## 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)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] 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)

## What are the relevant issue numbers?

#19997

See merge request !6425
2016-10-19 20:41:04 +00:00
Dmitriy Zaporozhets 2fabd1a123
Change the order of tested methods in project_members_controller_spec
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-19 22:14:57 +03:00
Douglas Barbosa Alexandre 3c2aaec1f2 Fix sorting by label priorities 2016-10-19 14:58:27 -02:00
Douglas Barbosa Alexandre 0bfa39d5bd Remove scopes/types for labels 2016-10-19 14:58:25 -02:00
Douglas Barbosa Alexandre baf47a0bd0 Remove project_labels from Projects::ApplicationController 2016-10-19 14:58:24 -02:00
Dmitriy Zaporozhets 357c794a49
Refactor project_members_controller_spec
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-19 15:13:59 +03:00
Dmitriy Zaporozhets fa075771a6
Refactor group_members_controller_spec
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-19 14:13:44 +03:00
Phil Hughes f1350a5c82 Merge branch 'master' into issue-board-sidebar 2016-10-19 08:44:55 +01:00
Phil Hughes a1deb6ece3 Merge branch 'master' into issue_19734_2 2016-10-18 12:23:44 +01:00
Felipe Artur da07c2e4d3 Add visibility level to project repository 2016-10-17 18:12:18 -02:00
Sean McGivern 86dcb79be3 Merge branch 'master' into merge-conflicts-editor-2 2016-10-17 10:56:55 +01:00
Z.J. van de Weg cf15af3135 Add test, fix merge error 2016-10-14 12:28:19 +02:00
Sean McGivern 3764fd4b41 Add blob_ace_mode to conflict content response 2016-10-13 14:16:35 -05:00
Alfredo Sumaran 54bfe70795 Add more tests to check conflicts resolution 2016-10-13 14:16:35 -05:00
Sean McGivern 7529bbae94 Add JSON Schema 2016-10-13 14:16:34 -05:00
Sean McGivern 9727366b5a Make RuboCop happy 2016-10-13 14:16:34 -05:00
Sean McGivern 3f71c43e88 Allow setting content for resolutions
When reading conflicts:

1. Add a `type` field. `text` works as before, and has `sections`;
   `text-editor` is a file with ambiguous conflict markers that can only
   be resolved in an editor.
2. Add a `content_path` field pointing to a JSON representation of the
   file's content for a single file.
3. Hitting `content_path` returns a similar datastructure to the `file`,
   but without the `content_path` and `sections` fields, and with a
   `content` field containing the full contents of the file (with
   conflict markers).

When writing conflicts:

1. Instead of `sections` being at the top level, they are now in a
   `files` array. This matches the read format better.
2. The `files` array contains file hashes, each of which must contain:
   a. `new_path`
   b. `old_path`
   c. EITHER `sections` (which works as before) or `content` (with the
      full content of the resolved file).
2016-10-13 14:16:34 -05:00
Sean McGivern 8776d9a365 Merge branch 'use-language-colours-for-graph' into 'master'
Use defined colour for a language when available

## What does this MR do?

This MR changes the colours of the different languages in the language graph.  It now uses the colour set in Linguist instead of the first six characters of the SHA256'd language name where possible.  If Linguist has no colour defined for a given language, it falls back to the old method of finding a colour.

I talked with @connorshea about creating this MR [on Twitter](https://twitter.com/connorjshea/status/784390886222286849) a few hours earlier. Here's also an older [tweet from May](https://twitter.com/nilsding/status/737018807223496708) where we discussed some possible improvements to the graph. 

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

Hopefully none ;)

## Why was this MR needed?

Aesthetics.

## Screenshots (if relevant)

Before:

![language_colours_before](/uploads/6b4bac784860da746d58708bdd6bba39/language_colours_before.png)

After:

![language_colours_after](/uploads/98818ebf48ffb47e6b785120e69b0b6c/language_colours_after.png)

## Does this MR meet the acceptance criteria?

- [ ] [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
  - [ ] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

- #12455

See merge request !6748
2016-10-13 15:16:12 +00:00
Sean McGivern 11e93ad59d Merge branch 'feature/issues-board' into 'master'
Refactoring Issues Board

## What does this MR do?

This MR aims to minimize conflicts between the CE issues board feature with EE multiple boards feature.

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

## Why was this MR needed?

To avoid a lot of conflicts with EE multiple boards feature.

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [ ] ~~[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)~~
- [x] API support added
- Tests
  - [X] Added for this feature/bug
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [X] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] 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)

## What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ee/issues/929

https://gitlab.com/gitlab-org/gitlab-ee/issues/1084

See merge request !6727
2016-10-13 14:21:14 +00:00
Semyon Pupkov 3ca064eeef Add missing tests for download snippet
ref: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6720
2016-10-13 18:08:15 +05:00
Georg G 85324ff8d3 Fix indentation and change inner matcher 2016-10-13 13:08:19 +02:00
Georg G ce4dad4555 Use test double and matchers 2016-10-13 07:01:34 +02:00
Georg G f32bc1f526 Add spec for Projects::GraphsController#languages 2016-10-12 18:48:53 +02:00
Douwe Maan d1eab555b6 Merge branch '20708-new-branch-is-immediatelly-tagged-as-merged' into 'master'
Removes inconsistency regarding tagging immediately as merged once you create a …

- [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 [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [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)

## What are the relevant issue numbers?


Closes #20708

See merge request !6408
2016-10-12 10:17:35 +00:00
Sean McGivern 3d253e5cb3 Merge branch '22211-500-instead-of-404' into 'master'
Respond with 404 Not Found for non-existent tags

## What does this MR do?

Handles the case when a non-existent tag is being viewed, and responds with 404 Not Found instead of 500 Internal Server Error.

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

The small changes should be clear from a simple diff.

## Why was this MR needed?

To resolve the issue #22211.

## Screenshots (if relevant)

## 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
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [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)

## What are the relevant issue numbers?


Closes #22211

See merge request !6699
2016-10-11 18:13:42 +00:00
Douwe Maan d57d892e3f Merge branch 'assign-issues-for-merge-request-18876' into 'master'
Ability to bulk assign issues to author of merge request

## What does this MR do?
Provides a link to auto-assign issues to the author of a merge request, when they are mentioned as being closed by the MR.

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


## Why was this MR needed?
To help avoid working on a MR without having assigned related issues to self

## What are the relevant issue numbers?
Fixes #18876 

## Screenshots (if relevant)
![ScreenShot-P216](/uploads/1af5e71a0a0ff0a60c5d7b54c0e09d9c/ScreenShot-P216.png)

## Tasks
- [x] Refactor or move away from using `BulkUpdateService`
- [x] ~~Consider alternate link message when only a subset of issues will be assigned~~
- [x] Minimize repeated calls to expensive `closes_issues` method
- [x] Move away from using inflector for pluralization and fix flash message
- [x] Change auth `before_action` and fallback to error flash message
- [x] Shouldn't overwrite current assignee if one exists

## 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 !5725
2016-10-11 17:20:38 +00:00
tiagonbotelho c90483406e refactors tests because of gitlab-test repository changes 2016-10-11 16:33:06 +01:00
Douglas Barbosa Alexandre 1a2002d908 Update board specs to use board factory instead of project_with_board 2016-10-11 11:39:05 -03:00
Douglas Barbosa Alexandre 2c2a1dea67 Refactoring service to create a new issue in a board list 2016-10-11 11:39:05 -03:00
Douglas Barbosa Alexandre 38cece4957 Fix rubocop offenses 2016-10-11 11:39:05 -03:00
Douglas Barbosa Alexandre 6751509865 Update endpoints to handle with board issues 2016-10-11 11:39:05 -03:00
Douglas Barbosa Alexandre e1f889df64 Update endpoints to handle with board list changes 2016-10-11 11:39:05 -03:00
Douglas Barbosa Alexandre 723ed9cc3a Update Projects::BoardsController#show to look up for a specific board 2016-10-11 11:39:05 -03:00
Douglas Barbosa Alexandre ecf4c10e9c Add index action to Projects::BoardsController to return project boards 2016-10-11 11:39:05 -03:00
Robert Speicher 5c6cbfa6cb Merge branch 'atom-routes' into 'master'
Allow browsing branches that end with '.atom'

## What does this MR do?

1. Simplify the regex capture in the routing for the CommitsController
   to not exclude the '.atom' suffix. That's a perfectly valid git
   branch name, so we shouldn't blow up if we get it.
2. Because Rails now can't automatically detect the request format, add
   some code to do so in `ExtractPath` when there is no path. This means
   that, given branches 'foo' and 'foo.atom', the Atom feed for the
   former is unroutable. To fix this: don't do that! Give the branches
   different names!

## Why was this MR needed?

Creating a branch or tag name ending in '.atom' would cause some 500s on that repo.

## What are the relevant issue numbers?

Closes #21955. Related to !5994.

See merge request !6750
2016-10-11 14:04:31 +00:00
Sean McGivern 1022456bb1 Allow browsing branches that end with '.atom'
We need to do two things to support this:

1. Simplify the regex capture in the routing for the CommitsController
   to not exclude the '.atom' suffix. That's a perfectly valid git
   branch name, so we shouldn't blow up if we get it.
2. Because Rails now can't automatically detect the request format, add
   some code to do so in `ExtractPath` when there is no path. This means
   that, given branches 'foo' and 'foo.atom', the Atom feed for the
   former is unroutable. To fix this: don't do that! Give the branches
   different names!
2016-10-11 13:31:12 +01:00
Linus G Thiel d0c240b64f Merge branch 'master' into 22211-500-instead-of-404 2016-10-11 09:22:57 +02:00
Dmitriy Zaporozhets 73adae0f62 Merge branch 'dz-cleanup-routing' into 'master'
Remove NamespacesController

* removes unnecessary NamespacesController. The main purpose of this controller was redirect to group or user page when URL like https://gitlab.com/gitlab-org was used. Now this functionality is handled by constrainers (like this https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/routes/user.rb#L17-21) and take user to correct controller right from the start.
* serve non existing API routes like `/api/v3/whatever` with Grape instead of Rails. Before this change wrong API url was served by rails with not obvious 404, 405 & 500 errors


See merge request !6733
2016-10-11 06:58:05 +00:00
James Edwards-Jones 6606642f8f fixup! Added link to bulk assign issues to MR author. (Issue #18876) 2016-10-10 16:19:46 +01:00
Dmitriy Zaporozhets 66c32cab1a Remove NamespacesController
The main purpose of this controller was redirect to group or user page
when URL like https://gitlab.com/gitlab-org was used. Now this
functionality is handled by contrainers and take user to correct
controller right from the start

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-10 16:32:32 +03:00
Semyon Pupkov 40fa1b6e6f Use user from let instead recreate in before 2016-10-09 20:31:28 +05:00
James Edwards-Jones 8d2de73a83 fixup! Added link to bulk assign issues to MR author. (Issue #18876) 2016-10-07 17:16:42 +01:00
Phil Hughes 7d20a91b2e Restore subscribe status in JSON 2016-10-07 09:24:57 +01:00
Douglas Barbosa Alexandre 0c286d5473 Fix JSON Schema that validates data returned by board issues endpoint 2016-10-07 09:15:46 +01:00
James 492b4332a4 Added link to bulk assign issues to MR author. (Issue #18876) 2016-10-06 13:37:37 +01:00
Douglas Barbosa Alexandre fe3f1657ab Add tests to Projects::Boards::IssuesController#create action 2016-10-06 11:00:01 +01:00
Rémy Coutable d51bb99a7e
Merge commit 'dev/security' into 'master'
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-06 08:33:11 +02:00
Linus G Thiel 6b9671388d Respond with 404 Not Found for non-existent tags
Non-existent tags should be handled with 404 Not Found.
2016-10-05 19:28:39 +02:00
barthc 35ced4dae4 fix group links 404 2016-10-05 09:57:54 +01:00
Rémy Coutable b8005b6112 Merge branch 'restrict-failed-2fa-attempts' into 'master'
Restrict failed login attempts from users with 2FA enabled.

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

See merge request !6668
2016-10-04 15:04:57 +00:00
Sean McGivern 194fbc3c3d Restrict failed login attempts for users with 2FA
Copy logic from `Devise::Models::Lockable#valid_for_authentication?`, as
our custom login flow with two pages doesn't call this method. This will
increment the failed login counter, and lock the user's account once
they exceed the number of failed attempts.

Also ensure that users who are locked can't continue to submit 2FA
codes.
2016-10-04 15:01:38 +01:00
Rémy Coutable c8b1311934 Fix a few things after the initial improvment to Members::DestroyService
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-03 16:57:48 +02:00
Thomas Balthazar ddbe676dc3 Add a /wip slash command
It toggles the 'WIP' prefix in the MR title.
2016-10-03 09:36:21 +02:00
Robert Speicher e64594ac44 Merge branch '21983-member-add_user-doesn-t-detect-existing-members-that-have-requested-access' into 'master'
Resolve "`Member.add_user`doesn't detect existing members that have requested access"

## What does this MR do?

This merge request handle the case when an access requester is added to a group or project (via the members page or the API).

In `Member.add_user`, if an access requester already exists, we simply accept their request (and set the `created_by`, `access_level` and `expires_at` attributes if given).

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

I've taken the opportunity to cleanup the whole `{Group,Project}Member.add_user*` methods since it was quite a mess.

## What are the relevant issue numbers?

Closes #21983

See merge request !6393
2016-10-02 11:42:57 +00:00
James Lopez 29141ed3ea fix broken repo 500 errors in UI and added relevant specs 2016-09-29 16:58:14 +02:00
Rémy Coutable ec0061a95c Allow Member.add_user to handle access requesters
Changes include:

- Ensure Member.add_user is not called directly when not necessary
- New GroupMember.add_users_to_group to have the same abstraction level as for Project
- Refactor Member.add_user to take a source instead of an array of members
- Fix Rubocop offenses
- Always use Project#add_user instead of project.team.add_user
- Factorize users addition as members in Member.add_users_to_source
- Make access_level a keyword argument in GroupMember.add_users_to_group and ProjectMember.add_users_to_projects
- Destroy any requester before adding them as a member
- Improve the way we handle access requesters in Member.add_user
  Instead of removing the requester and creating a new member,
  we now simply accepts their access request. This way, they will
  receive a "access request granted" email.
- Fix error that was previously silently ignored
- Stop raising when access level is invalid in Member, let Rails validation do their work

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-28 09:43:00 +02:00
Connor Shea e13dc69be2 Fix test failure by accessing Content-Type header directly. 2016-09-27 20:52:41 -06:00
Nick Thomas 3ed80a0176 Enforce the fork_project permission in Projects::CreateService
Projects::ForkService delegates to this service almost entirely, but needed
one small change so it would propagate create errors correctly.

CreateService#execute needs significant refactoring; it is now right at the
complexity limit set by Rubocop. I avoided doing so in this commit to keep the
diff as small as possible.

Several tests depend on the insecure behaviour of ForkService, so fi them up at
the same time.
2016-09-27 13:17:56 +01:00
Douwe Maan 166c6cd85c Merge branch 'rc-new-members-approve-request-access-service' into 'master'
New `Members::ApproveAccessRequestService`

Part of #21979.

## Does this MR meet the acceptance criteria?

- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] 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 !6266
2016-09-27 12:10:12 +00:00
Douglas Barbosa Alexandre 97551e8dd9 Improve project_with_board factory to create the default lists 2016-09-26 14:42:38 -03:00
Rémy Coutable 5dcdf1d51b Ensure Members::ApproveAccessRequestService can fin a requester by ID
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-22 15:50:48 +02:00
Rémy Coutable 24fed56787 Merge branch 'and-you-get-awards' into 'master'
And Snippets get awards

## What does this MR do?

Makes snippets more awesome, by making them awardables

## Why was this MR needed?

Because Snippets were left behind.

## What are the relevant issue numbers?

Closes #17878

See merge request !4456
2016-09-21 15:22:28 +00:00
Rémy Coutable fb4d2f9e5a Merge branch 'feature/github-edit-path' into 'master'
Lets the user choose a namespace and name on Github imports

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

See merge request !5728
2016-09-20 12:23:14 +00:00
James Lopez 0c65112da7 modify github import JS and controller so we can now specify a namespace and/or name for a project.
- Fixed and added specs.
- Added different namespace options depending on user privilages
- Updated docs.
2016-09-20 10:14:39 +02:00
Rémy Coutable c61a54f7fe Fix initial implementation to actually render the unsubscribe page
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-20 09:52:57 +02:00
Maximiliano Perez Coto b335730817 Fix "Unsubscribe" link in notification emails that is triggered by anti-virus
* Created a force=true param that will continue with the previous
  behaviour of the unsubscribe method
* Created a filter for not-logged users so they see a unsubsribe
  confirmation page
* Added the List-Unsubscribe header on emails so the email client can
  display it on top
2016-09-20 09:52:57 +02:00
Z.J. van de Weg e8dd0d54cb Fix tests for Snippets toggling awards
Also incorporate feedback
2016-09-19 19:53:09 +03:00
Z.J. van de Weg 25004cbc32 Snippets get award emoji! 👍 2016-09-19 19:47:43 +03:00
Katarzyna Kobierska d88f708b02 Improve grammar 2016-09-13 14:40:05 +02:00
Katarzyna Kobierska 31c37c6c38 Add #closed_without_source_project? 2016-09-13 14:40:05 +02:00
Katarzyna Kobierska 09cded29d8 Checks if deleting forked project closed all open merge requests 2016-09-13 14:40:05 +02:00
Katarzyna Kobierska 8c77a1fb25 Before deleting project if forked unlink fork 2016-09-13 14:40:05 +02:00
Robert Speicher 516100c55b Merge branch 'add-remember-option-u2f' into 'master'
Pass the remember_me option into the u2f form and support it while authenticating

## What does this MR do?

Adds remember me support in the u2f authentication, and makes sure the flag gets passed from the login form to the u2f form.

Based on the changes for the same thing done for regular 2fa: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4369

## Why was this MR needed?

The remember me option wasn't working for u2f devices (yubikey)

## What are the relevant issue numbers?

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

See merge request !5918
2016-09-09 18:42:11 +00:00
Douglas Barbosa Alexandre d86c666662 Refresh todos count cache when an Issue/MR is deleted 2016-09-08 15:50:07 -03:00
Rémy Coutable 8aa025bb85
Merge branch 'master' of https://dev.gitlab.org/gitlab/gitlabhq
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-05 17:23:32 +02:00
Airat Shigapov b76ef40e36
Fix missing flash messages on service edit page 2016-09-05 14:13:15 +03:00
DJ Mountney 9224f031cf Pass the remember_me option into the u2f form and support it while authenticating
Matches the changes done for non-u2f two-factor auth
2016-09-01 17:11:42 -07:00
Felipe Artur 892dea6771 Project tools visibility level 2016-09-01 11:47:59 -03:00
Robert Speicher e71cd7a300 Merge branch 'refactor/add-policies' into 'master'
Refactor ability.rb into Policies

## What does this MR do?
Factors out `ability.rb` into a new abstraction - the "policy" (stored in `app/policies`). A policy is a class named `#{class_name}Policy` (looked up automatically as needed) that implements `rules` as follows:

``` ruby
class ThingPolicy < BasePolicy
  def rules
    @user # this is a user to determine abilities for, optionally nil in the anonymous case
    @subject # this is the subject of the ability, guaranteed to be an instance of `Thing`
    can! :some_ability # grant the :some_ability permission
    cannot! :some_ability # ensure that :some_ability is not allowed. this overrides any `can!` that is called before or after
    delegate! @subject.other_thing # merge the abilities (can!) and prohibitions (cannot!) from `@subject.other_thing`
    can? :some_ability # test whether, so far, :some_ability is allowed
  end

  def anonymous_rules
    # optional. if not implemented `rules` is called where `@user` is nil. otherwise this method is called when `@user` is nil.
  end
end
```

See merge request !5796
2016-08-31 20:53:40 +00:00
Douglas Barbosa Alexandre 325de662ce Don't create groups for unallowed users when importing projects 2016-08-31 12:55:45 -03:00
Stan Hu 341541d3af Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2016-08-30 14:48:17 -07:00
http://jneen.net/ 5853c96b49 remove Ability.abilities 2016-08-30 11:35:06 -07:00
Katarzyna Kobierska 6b02c82cfe Improve grammar 2016-08-30 13:05:40 +02:00
Katarzyna Kobierska c9c2503c51 User can edit closed MR with deleted fork
Add test for closed MR without fork

Add view test visibility of Reopen and Close buttons

Fix controller tests and validation method

Fix missing space

Remove unused variables from test

closed_without_fork? method refactoring

Add information about missing fork

When closed MR without fork can't edit target branch

Tests for closed MR edit view

Fix indentation and rebase, refactoring
2016-08-30 13:05:40 +02:00
Douglas Barbosa Alexandre 4cccfc0f17 Fix issue boards leak private label names and descriptions 2016-08-29 16:04:28 -03:00