Commit Graph

2338 Commits

Author SHA1 Message Date
Connor Shea 16a8160e9f
Fix help page paths to make sure shortcuts and the UI help page work.
Add a test to make sure the help page UI path doesn't break in the future.

Fix #19972 and #19889.
2016-07-19 11:17:14 -06:00
Rémy Coutable e953b8afd2 Merge branch 'allow-deploy-key-to-download-public-projects' into 'master'
Allow to pull code with deploy key from public projects

## What does this MR do?
With deploy keys you can download any public projects stored in GitLab.

## What are the relevant issue numbers?
Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/1217

## 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 [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)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5316
2016-07-19 15:21:29 +00:00
James Lopez 76771c2946 squashed - added avatar saver/restorer and specs
added spec for avatar saver

avatar saver!

added avatar restorer spec

fix spec

added avatar restorer class

fix export service

fix warnings, added changelog

fix spec

some refactoring based on feedback

fixed a few issues after testing i/e avatar
2016-07-19 13:06:06 +02:00
Kamil Trzcinski 2532ec9edc Allow to pull code with deploy key from public projects 2016-07-19 12:23:41 +02:00
James Lopez bf1ea8c6fe Squashed - fix encoding issue
WIP - trying to replicate UTF-8 error

fix spec

fixing encoding issue and another spec, to do with MR diffs

fix issue and spec failure

Add changelog and bumped up I/E version

fix spec based on feedback - omitted target project
2016-07-19 09:59:54 +02:00
Robert Speicher a27212ab90 Merge branch 'cs-gemojione-3' into 'master'
Upgrade gemojione to 3.0.0

Upgrades gemojione to 3.0.0, see the Changelog: b98aa8b07e/CHANGELOG.md (v300-2016-07-12)

[Here are all the new 2016 emoji](http://emojione.com/releases/2.2.4/) 🎉

This update has new emoji and more sensical categories.

See merge request !5237
2016-07-18 23:57:13 +00:00
Douwe Maan f0b446e555 Merge branch '19820-safer-diffs' into 'master'
Collapsed diffs lines/size don't accumulate to overflow diffs.

## What does this MR do?

Reduce the number of lines that we highlight on big diffs to try to reduce the degradation introduced by  !4990 as you can see on the issue description #19820 .

We collapse any files after the diff is over the number of safe files (100), or over the safe lines (500) or over the safe number of bytes (5KB x 100 files).

We still need to bump the gitlab_git and point this branch to the new gitlab_git version.

## What are the relevant issue numbers?

Closes #19820 
Closes #19885

## 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 [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 !5306
2016-07-18 21:28:24 +00:00
Paco Guzman a404ab380d Collapsed diffs lines/size don't accumulate to overflow diffs. 2016-07-18 14:43:28 -06:00
Connor Shea 6a06c5cfb9
Upgrade Gemojione from 2.6.1 to 3.0.1.
This adds the 2016 emoji as well as support for using SVG images instead of PNGs.

It also fixes a number of incorrectly categorized emoji and other minor issues.

Upgrade Rake task for Gemojione 3.0.0 and generate sprites.

Upgrade aliases.json by pulling down index.json from the gemojione repository and running the generate_aliases.rb file.

Changelog: https://github.com/jonathanwiesel/gemojione/blob/master/CHANGELOG.md#v301-2016-07-16

For the specific emoji added to the Unicode standard, see: http://emojione.com/releases/2.2.4/

Huge kudos to Jonathan Wiesel (@jonathanwiesel) for his work on the gemojione gem!
2016-07-18 10:40:16 -06:00
Rémy Coutable 08264f4334 Merge branch 'undo-revert-of-4892' into 'master'
Revert "Revert "Merge branch '18193-developers-can-merge' into 'master'""

## What does this MR do?

Reverts the revert of !4892 which lacked an EE MR at the time. This has been done in gitlab-org/gitlab-ee!564.

## What are the relevant issue numbers?

Closes #19872.

See merge request !5310
2016-07-18 15:31:07 +00:00
James Lopez 60a2b3eff2 allow empty repos on import/export 2016-07-18 11:02:07 +02:00
Rémy Coutable 2cf7f09b1e
Revert "Revert "Merge branch '18193-developers-can-merge' into 'master' ""
This reverts commit 530f5158e2.

See !4892.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-18 10:16:56 +02:00
Rémy Coutable 31a5a03c6c Merge branch 'fix-lfs-ci-fetch' into 'master'
Fix LFS CI fetch

## What does this MR do?
Fixes LFS fetching for CI objects that were kind of broken.

## Why was this MR needed?
This also refactors LFS tests to be a blackbox tests instead of whitebox tests. Actually testing GrackAuth instead of LFSRouter.

## Related isssues
Resolves: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1199

- [ ] [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 [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)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)


See merge request !5270
2016-07-18 07:52:06 +00:00
Robert Speicher fbd75c35fd Merge branch 'feature.rouge-20' into 'master'
Upgrade to Rouge 2.0

## What does this MR do?

This MR is a refactor of the HTMLGitlab formatter. The original was copy-pasted from the legacy HTML formatter and adapted to suit our needs. In particular, this MR:

* Strips dead code and unused options
* Factors out the "wrapping" into the places that care about it - Bonzai and the view helpers
* Uses the Rouge 2.0 `token_lines` method to split tokens into lines, removing the custom code we used to do the same
* Uses the now-public `span` method instead of re-implementing it ourselves
* Removes options to not split into lines - the places where this feature wasn't being used are now using the plain `Formatters::HTML` instead of this class

See merge request !4691
2016-07-15 20:15:30 +00:00
Douwe Maan 686381f7e6 Merge branch 'fix/project-export-filename' into 'master'
add project name and namespace to filename on project export

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

 Export filename now includes project and namespace path

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry 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 !5268
2016-07-15 19:21:35 +00:00
Douwe Maan 4859770e26 Merge branch 'fix/ee-to-ce-import' 2016-07-15 14:18:31 -05:00
James Lopez 9b86006ca1 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-export-filename 2016-07-15 17:05:05 +02:00
Robert Speicher 8b7932c219 Merge branch 'disable-statement-timeout' into 'master'
Disable PostgreSQL statement timeout during migrations

Long-running migrations may take more than the timeout allowed by the database. Disable the session's statement timeout to ensure migrations don't get killed prematurely.

See merge request !5263
2016-07-15 14:51:20 +00:00
Kamil Trzcinski e300dac293 Fix LFS specs 2016-07-15 15:06:19 +02:00
Kamil Trzcinski bb9f827ddc Fix fetching LFS objects for private CI projects 2016-07-15 14:23:26 +02:00
James Lopez 65549a5866 add project name and namespace to filename on project export
added changelog
2016-07-15 12:55:28 +02:00
Stan Hu f700f3ec5d Disable statement timeout outside of transaction and during adding concurrent index 2016-07-14 18:50:46 -07:00
Stan Hu e5c7e11840 Disable PostgreSQL statement timeout during migrations
Long-running migrations may take more than the timeout allowed by
the database. Disable the session's statement timeout to ensure
migrations don't get killed prematurely.
2016-07-14 18:40:54 -07:00
http://jneen.net/ c763c7e402 use the proper variable names o_O 2016-07-14 12:21:22 -07:00
http://jneen.net/ b468672d76 style: factor out `@lexer` into a method 2016-07-14 11:44:59 -07:00
http://jneen.net/ 822304b19f fix Gitlab::Highlight#initializer bugs from rebase 2016-07-14 11:40:55 -07:00
http://jneen.net/ f82287e2cc use the local lexer variable to respect plain: ... 2016-07-14 10:08:15 -07:00
http://jneen.net/ 6107933ba3 inline #rouge_formatter 2016-07-14 10:08:15 -07:00
http://jneen.net/ e1824aa101 use the new token_lines interface to format lines 2016-07-14 10:08:15 -07:00
http://jneen.net/ 3bb65815b0 kill the :cssclass option 2016-07-14 10:08:15 -07:00
http://jneen.net/ 7214a221e0 kill the nowrap option
the <pre><code> wrapping is *always* used by the helper, and *never* by
anywhere else, so pull the wrapping into the helper
2016-07-14 10:08:14 -07:00
http://jneen.net/ 7e8a92fbd1 the call site always specifies this option 2016-07-14 10:08:14 -07:00
http://jneen.net/ 681b5af586 do this thing in a clearer way 2016-07-14 10:08:14 -07:00
James Lopez 37e363c9cf fixed similar issue with gitlab.com importer because why not! 2016-07-14 17:06:48 +02:00
James Lopez b1ab079fae fix updated_at not preserved after import - for GitLab projects 2016-07-14 16:03:00 +02:00
James Lopez 097706b458 fix EE => CE project import, and updated JSON spec 2016-07-14 12:07:54 +02:00
Robert Speicher 530f5158e2 Revert "Merge branch '18193-developers-can-merge' into 'master' "
This reverts commit 9ca633eb4c, reversing
changes made to fb229bbf79.
2016-07-13 13:57:30 -05:00
Robert Speicher 9b0ef1559f Merge branch 'better-parallel-diff' into 'master'
Actually render old and new sections of parallel diff next to each other

See merge request !5173
2016-07-13 18:10:01 +00:00
Douglas Barbosa Alexandre a14ee9bef9 Keeps issue number when importing from Gitlab.com
With these changes we don’t lost the issue references when importing
from `GitLab.com`.
2016-07-13 11:35:38 -03:00
Timothy Andrew bb81f2afc1 Implement last round of review comments from !4892.
1. Fix typos, minor styling errors.

2. Use single quotes rather than double quotes in `user_access_spec`.

3. Test formatting.
2016-07-13 14:18:05 +05:30
Timothy Andrew ea9e8f4609 Move all "checks" under `GitLab::Checks`.
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4892#note_12892160
- This is more consistent.
2016-07-13 13:24:56 +05:30
Timothy Andrew 4d00ed21eb Appease rubocop. 2016-07-13 13:24:56 +05:30
Timothy Andrew 60245bbe22 Refactor `Gitlab::GitAccess`
1. Don't use case statements for dispatch anymore. This leads to a lot
   of duplication, and makes the logic harder to follow.

2. Remove duplicated logic.

    - For example, the `can_push_to_branch?` exists, but we also have a
      different way of checking the same condition within `change_access_check`.

    - This kind of duplication is removed, and the `can_push_to_branch?`
      method is used in both places.

3. Move checks returning true/false to `UserAccess`.

    - All public methods in `GitAccess` now return an instance of
      `GitAccessStatus`. Previously, some methods would return
      true/false as well, which was confusing.

    - It makes sense for these kinds of checks to be at the level of a
      user, so the `UserAccess` class was repurposed for this. The prior
      `UserAccess.allowed?` classmethod is converted into an instance
      method.

    - All external uses of these checks have been migrated to use the
      `UserAccess` class

4. Move the "change_access_check" into a separate class.

    - Create the `GitAccess::ChangeAccessCheck` class to run these
      checks, which are quite substantial.

    - `ChangeAccessCheck` returns an instance of `GitAccessStatus` as
      well.

5. Break out the boolean logic in `ChangeAccessCheck` into `if/else`
   chains - this seems more readable.

6. I can understand that this might look like overkill for !4892, but I
   think this is a good opportunity to clean it up.

    - http://martinfowler.com/bliki/OpportunisticRefactoring.html
2016-07-13 13:24:56 +05:30
Timothy Andrew 495db09653 Enforce "developers can merge" during `pre-receive`.
1. When a merge request is being merged, save the merge commit SHA in
   the `in_progress_merge_commit_sha` database column.

2. The `pre-receive` hook looks for any locked (in progress) merge
   request with `in_progress_merge_commit_sha` matching the `newrev` it
   is passed.

3. If it finds a matching MR, the merge is legitimate.

4. Update `git_access_spec` to test the behaviour we added here. Also
   refactored this spec a bit to make it easier to add more contexts / conditions.
2016-07-13 13:24:56 +05:30
Mathias Vestergaard f0577d8385 Added "developers can merge" setting to protected branches
- Cherry-picked from `mvestergaard:branch-protection-dev-merge`
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4220
2016-07-13 13:24:26 +05:30
Douwe Maan 5fea640e90 Merge branch 'multi-line-inline-diff' into 'master'
Render inline diffs for multiple changed lines following eachother

Before:

![Screen_Shot_2016-07-11_at_00.08.27](/uploads/b14664211e0f5cef6e77a78eadfcbcdf/Screen_Shot_2016-07-11_at_00.08.27.png)

After:

![Screen_Shot_2016-07-11_at_00.07.34](/uploads/567be631869a4867a2edf6ff7eda6369/Screen_Shot_2016-07-11_at_00.07.34.png)

See merge request !5174
2016-07-13 05:29:49 +00:00
Douwe Maan 545a85dc64 Actually render old and new sections of parallel diff next to each other 2016-07-13 00:04:07 -05:00
Douwe Maan 489e193704 Rename constant to be more descriptive 2016-07-13 00:02:20 -05:00
Douwe Maan e981d6cd0d Extended regexes ignore whitespace, so use \s 2016-07-12 11:25:39 -05:00
Douglas Barbosa Alexandre 78a5de99e9 Memoize response from `has_rate_limit?` to avoid extra API call 2016-07-12 12:14:17 -03:00