Commit Graph

6339 Commits

Author SHA1 Message Date
Rémy Coutable 467b44cbbf Merge branch 'api-branch-status' into 'master'
API: Expose branch status

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

See merge request !7796
2016-11-30 17:40:39 +00:00
Rémy Coutable 2c0d9890e6 Merge branch 'grapify-files-api' into 'master'
Grapify the files API

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/22928

See merge request !7806
2016-11-30 15:10:56 +00:00
Robert Schilling 2ce66c071f API: Expose branch status 2016-11-30 13:13:50 +01:00
Robert Schilling dd5f71138c Grapify the files API 2016-11-30 12:48:10 +01:00
Rémy Coutable 43c8788e7b Merge branch 'grapify-projects-api' into 'master'
Grapify the projects API

Related to #22928 

See merge request !7456
2016-11-30 11:32:32 +00:00
Grzegorz Bizon a49e9949c6 Rename `MergeRequest#pipeline` to `head_pipeline` 2016-11-29 14:12:49 +01:00
Sean McGivern d8eee8ed73 Merge branch '24880-configurable-plaintext-emails' into 'master'
Add setting to enable/disable HTML emails

Closes #24880

See merge request !7749
2016-11-29 12:05:23 +00:00
Kamil Trzciński 35212deb06 Merge branch 'zj-issue-search-slash-command' into 'master'
Add issue search slash command

See merge request !7752
2016-11-29 11:04:17 +00:00
Douwe Maan 3bf34face4 Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security'
Replace issue access checks with use of IssuableFinder

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

## Which fixes are in this MR?

⚠️ - 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

### Issue lookup with access check

Using `visible_to_user` likely makes these security issues too. See [Code smells](#code-smells).

- [x] 🚦 app/finders/notes_finder.rb:15 [`visible_to_user`]
- [x] 🚥 app/views/layouts/nav/_project.html.haml:73 [`visible_to_user`] [`.count`]
- [x]  app/services/merge_requests/build_service.rb:84 [`issue.try(:confidential?)`]
- [x]  lib/api/issues.rb:112 [`visible_to_user`]
  - CHANGELOG: Prevented API returning issues set to 'Only team members' to everyone
- [x]  lib/api/helpers.rb:126 [`can?(current_user, :read_issue, issue)`] Maybe here too?
- [x]  lib/gitlab/search_results.rb:53 [`visible_to_user`]

### Previous discussions
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b2ff264eddf9819d7693c14ae213d941494fe2b3_128_126
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#7b6375270d22f880bdcb085e47b519b426a5c6c7_87_87

See merge request !2031
2016-11-28 21:26:23 -03:00
Douwe Maan 3d7704ae5f Merge branch 'zj-fix-label-creation-non-members' into 'security'
Fix label creation non members

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

See merge request !2006
2016-11-28 21:24:19 -03:00
Ruben Davila b62e2bedbf Add new configuration setting to enable/disable HTML emails.
This new global setting will allow admins to specify if HTML emails should be sent or not,
this is basically useful when system administrators want to save some disk space by avoiding
emails in HTML format and using only the Plain Text version.
2016-11-28 17:00:03 -05:00
Robert Schilling 7c607a55ab Grapify the projects API 2016-11-28 21:01:43 +01:00
Douwe Maan d281383261 Merge branch 'refresh-authorizations-with-lease' into 'master'
Refresh project authorizations using a Redis lease

This MR changes `User#refresh_authorized_projects` so it uses a Redis lease instead of relying on serializable transactions. See the commit message(s) for more details.

See merge request !7733
2016-11-28 03:35:37 +00:00
Rémy Coutable e17328986a Merge branch 'zj-expose-coverage-pipelines' into 'master'
Expose coverage on GET pipelines/:id

Closes gitlab-org/gitlab-ce#24801

See merge request !7670
2016-11-25 16:51:53 +00:00
Yorick Peterse 746b6ec82d Merge branch 'timeout-merge-request-for-binary-file' into 'master'
Fix: Timeout creating and viewing merge request for binary file

See merge request !7713
2016-11-25 16:19:03 +00:00
Z.J. van de Weg 40e8185b64 Expose coverage on GET pipelines/:id
The coverage wasn't exposed yet, now it is but only for detailed
requests to save queries on the database.
2016-11-25 15:49:59 +01:00
Z.J. van de Weg 6a08de7386 Add issue search slash command
One of many requested in: gitlab-org/gitlab-ce#24768
2016-11-25 15:41:28 +01:00
Valery Sizov 847ada36c4 Fix: Timeout creating and viewing merge request for binary file 2016-11-25 15:25:01 +02:00
Kamil Trzciński fc03501183 Merge branch 'zj-slash-commands-improvements' into 'master'
Slash commands improvements

See merge request !7638
2016-11-25 13:09:18 +00:00
Yorick Peterse 92b2c74ce1
Refresh project authorizations using a Redis lease
When I proposed using serializable transactions I was hoping we would be
able to refresh data of individual users concurrently. Unfortunately
upon closer inspection it was revealed this was not the case. This could
result in a lot of queries failing due to serialization errors,
overloading the database in the process (given enough workers trying to
update the target table).

To work around this we're now using a Redis lease that is cancelled upon
completion. This ensures we can update the data of different users
concurrently without overloading the database.

The code will try to obtain the lease until it succeeds, waiting at
least 1 second between retries. This is necessary as we may otherwise
end up _not_ updating the data which is not an option.
2016-11-25 13:35:01 +01:00
Yorick Peterse 838c1aad68 Merge branch '22373-reduce-queries-in-api-helpers-find_project' into 'master'
Resolve "Reduce queries in API::Helpers#find_project"

See merge request !7714
2016-11-25 12:17:23 +00:00
Z.J. van de Weg d71ad49fc5 Accept a valid ref for issue show
For example, now we support `/gitlab issue show #1`. Where the # used
to trip the regex.
2016-11-25 12:33:57 +01:00
Rémy Coutable 81ba3f9177
API: Introduce `#find_group!` which also check access permission
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-24 16:58:32 +01:00
Rémy Coutable 604870a6cf Merge branch 'api-no-convert' into 'master'
Don't convert data which already is the target type

With Grape's DSL we already enforce data types. We don't need to explicitly convert to string if there is already one.

See merge request !7740
2016-11-24 14:12:33 +00:00
Rémy Coutable 4f5ed81232
API: Introduce `#find_project!` which also check access permission
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-24 14:40:35 +01:00
Robert Schilling 9dfbfbb2d1 Don't convert data which already is the target type 2016-11-24 13:35:26 +01:00
Rémy Coutable 304163becb
API: Use `#find_project` in API::Triggers and API::Services
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-24 13:22:38 +01:00
Rémy Coutable 4d2e7894ef
Make API::Helpers find a project with only one query
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-24 10:19:36 +01: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
Lin Jen-Shin 9ad2dba250 Use Commit#author so we share logic and cache
Closes #24900
2016-11-24 02:33:55 +08:00
Rémy Coutable 010790ee39 Merge branch 'api-delete-group-share' into 'master'
API: Add endpoint to delete a group share

Closes #24771

See merge request !7662
2016-11-23 15:17:59 +00:00
Rémy Coutable 2317eb5ec9 Merge branch 'grapify-sidekiq-metric-api' into 'master'
Grapify the sidekiq metrics API

Related to #22928

See merge request !7699
2016-11-23 15:06:29 +00:00
Sean McGivern 4646d453b3 Merge branch 'milestone_start_date' into 'master'
Add a starting date to milestones

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

See merge request !7484
2016-11-23 13:23:13 +00:00
Sean McGivern 1a45de3d45 Merge branch 'post_receive-any-email' into 'master'
post_receive: accept any user email from last commit

See merge request !7225
2016-11-23 12:45:11 +00:00
Robert Schilling d2985eb572 Grapify the sidekiq metrics API 2016-11-23 13:36:52 +01: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
Robert Schilling eff1b05ab1 API: Add endpoint to delete a group share 2016-11-23 12:53:37 +01:00
Rémy Coutable 6f7ce37292 Merge branch 'fix-ee_compat_check-when-branch-contains-a-slash' into 'master'
Ensure we sanitize branch names with path-unfriendly characters

See merge request !7696
2016-11-23 11:49:48 +00:00
Valery Sizov 3789cfe056 Add a starting date to milestones 2016-11-23 13:41:04 +02:00
Douwe Maan db02af3e24 Merge branch 'fix/cycle-analytics-plan-issue' into 'master'
Fix cycle analytics plan stage when commits are missing

Takes into account when commits are `nil` so the app doesn't throw an exception and also removes them.

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

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) 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)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)


See merge request !7694
2016-11-23 10:13:29 +00:00
Rémy Coutable cd78e02096
Ensure we sanitize branch names with path-unfriendly characters
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-23 10:55:28 +01:00
James Lopez b938aa5cc8 Fix and relevant spec for plan stage breaking with nil commits 2016-11-23 09:10:04 +01:00
Kamil Trzciński a713c9c12c Merge branch 'zj-fix-trailing-whitespace-issue-create' into 'master'
Issue creation now accepts trailing whitespace

See merge request !7633
2016-11-22 16:57:12 +00:00
Rémy Coutable 7902395f1f Merge branch 'fix-api-iid-filter' into 'master'
Fix IID filter for merge requests and milestones

I updated the example in the docs and added a test. The milestones API was also broken for the same reason.

Related to !7358 and !7373

See merge request !7648
2016-11-22 16:16:43 +00:00
Rémy Coutable 79030a0e12 Merge branch '23532-define-common-helper-for-describe-pagination-params-in-api' into 'master'
Add concern for reuse pagination params declaration in API

Closes #23532

See merge request !7646
2016-11-22 15:33:57 +00:00
Rémy Coutable c111ba6a76 Merge branch 'avoid-api-helper-call' into 'master'
Avoid helper call with default parameters

The helpers can ultimately be removed when the issue API uses the Grape DSL.

See merge request !7649
2016-11-22 12:58:43 +00:00
Robert Schilling 9e608b41a1 Avoid helper call with default parameters 2016-11-22 11:26:29 +01:00
Kamil Trzciński 0f59075030 Merge branch 'fix/ci-linter-undefined-error' into 'master'
Fix undefined error in CI linter

## What does this MR do?

This MR fixes undefined error in CI linter.

## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [x] Tests added for this feature/bug
  
## What are the relevant issue numbers?

Closes #24759

See merge request !7650
2016-11-22 09:20:45 +00:00
Grzegorz Bizon c048d5d2d9 Fix entry lookup in CI config inheritance rules 2016-11-22 09:09:38 +01:00
Z.J. van de Weg 3ff0575669 Issue creation now accepts trailing whitespace 2016-11-22 08:48:17 +01:00