Commit Graph
17795 Commits
Author SHA1 Message Date
Valery Sizov 6454bcbfa4 revert cache issue 2015-07-22 17:53:18 +03:00
Valery Sizov 95d89e442a Merge branch 'revert_note_caching' into 'master'
revert caching of note text

This MR reverts the caching of note texts because what is rendered as a link in Markdown depends on the user's access to other projects and groups.

Until we find a solution that doesn't decrease security, let's not use the cache for this.

See discussion in gitlab-org/gitlab-ce!911 for more information.

/cc @DouweM @stanhu @vsizov

See merge request !1014
2015-07-22 10:51:37 +00:00
Douwe Maan 546731244a Merge branch 'rs-security-spec-speed' into 'master'
Speed up security feature specs

Before: `rspec spec/features/security/  0.12s user 0.04s system 0% cpu 3:38.00 total`

After: `rspec spec/features/security/  0.12s user 0.04s system 0% cpu 1:40.58 total`

The majority of the speed improvements is from two things:

1. Instead of using our standard `login_as` helper in the matchers, we take advantage
   of the `Warden::Test::Helpers` version of the method which bypasses the login form
   and logs the user in directly. We were essentially testing that filling out the login
   form works hundreds of times.
2. There were many tests that verified if a user of a certain access level
   (master, owner, reporter, guest) had access to a resource. Unfortunately we were
   creating every type of user for each test even though a test was only verifying one of
   them at a time. Now the tests only create the one user role they're testing.

See merge request !1023
2015-07-22 09:22:43 +00:00
Marin Jankovski 39dc39e335 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-07-22 09:56:43 +02:00
Job van der Voort 806be101a9 Merge branch 'fork-project' into 'master'
Added Fork Project document to GitLab Basics



See merge request !1909
2015-07-22 07:38:23 +00:00
Robert Speicher b42422a7a9 Move spec/features/admin/security_spec to spec/features/security 2015-07-22 00:39:18 -04:00
Robert Speicher b24d5f13a5 Consolidate group access specs into one file 2015-07-22 00:01:17 -04:00
Robert Speicher 0d5cf111f3 Move custom matchers to their own files under spec/support/matchers 2015-07-22 00:01:17 -04:00
Robert Speicher ff8811c40b Remove redundant Profile access test cases
The user being created was no different than what `be_allowed_for` was
doing behind the scenes so we were essentially testing all user-level
accesses twice.
2015-07-22 00:01:17 -04:00
Robert Speicher 421b06508d Remove be_not_found_for matcher
It was only used in one test, and the test was kind of redundant.
2015-07-22 00:01:17 -04:00
Robert Speicher a2ecfdc585 Move access-related matchers to their own module 2015-07-22 00:01:17 -04:00
Stan Hu 6bf1beaf94 Merge branch 'fix-cache-clear-test-issue' into 'master'
Use project repository expire_cache to clear cache in test

Clearing the entire Redis cache in 643557d for the `branches_spec.rb` may be causing issues. Just clear what we need.

See merge request !1022
2015-07-22 02:11:14 +00:00
Robert Speicher 1fee24a361 Remove unused be_valid_commit matcher 2015-07-21 22:11:08 -04:00
Stan Hu 5aff5223d4 Clearing the entire Redis cache may be too expensive; just use
the repository expire_cache method
2015-07-21 19:09:33 -07:00
Stan Hu dc5504812d Merge branch 'fix-dup-changelog-entry' into 'master'
Remove 7.14 entry that was pushed to 7.13

See merge request !1020
2015-07-22 01:13:50 +00:00
Stan Hu 913e1b217e Remove 7.14 entry that was pushed to 7.13 2015-07-21 18:09:06 -07:00
Stan Hu f593b621e3 Merge branch 'fix-404-empty-repo' into 'master'
Fix 404 error in files view after deleting the last file in a repository

Here's the logic:

1. In `TreeController`, `require_non_empty_project` will prevent `show` from being called if the project is  empty. That means all calls to `show` will be guaranteed to have at least 1 commit.
2. If the ref name is not valid, then return a 404. This ensures that at least the controller is looking at a valid branch/tag/SHA ID.
3. This leaves a number of cases:

```
3a. Valid ref, valid directory
3b. Valid ref, valid filename
3c. Valid ref, invalid path
3d. Valid ref, no files
```

Case 3a: The tree will not be `empty?` and will pass through the whole function.

Case 3b: The tree will be `empty?` but the `blob_at` will resolve properly and trigger a redirect to the file.

Case 3c: In this case, a path is given. Return 404 if it cannot be resolved neither as a tree nor a blob.

Case 3d: In this case, no path is given. If the tree is empty, this means it's an empty branch and just fall through.

Example broken branch: https://gitlab.com/gitlab-org/gitlab-test/tree/empty-branch

Closes #1362

See merge request !1010
2015-07-22 01:01:03 +00:00
karen Carias afc8e92223 fixed image 2015-07-21 15:47:17 -07:00
karen Carias 42130a97e9 added Fork Project document 2015-07-21 15:45:12 -07:00
Hannes Rosenögger 815cf7f843 Merge branch 'fix-snippet-note-fullscreen' into 'master'
Fix full screen mode for snippet comments

ZenMode is now initialized for snippet pages.

Fixes #2036.

See merge request !1016
2015-07-21 22:07:01 +00:00
Stan Hu 643557dabc Fix 404 error in files view after deleting the last file in a repository
Closes #1362
2015-07-21 14:12:43 -07:00
Daniel Gerhardt 65bd871be7 Fix full screen mode for snippet comments
ZenMode is now initialized for snippet pages.

Fixes #2036.
2015-07-21 19:51:16 +02:00
Valery Sizov 8ba1a7a03f Merge branch 'document-2fa-backup' into 'master'
You need to store your DB encryption key

You can break two-factor authentication for existing users when
restoring a backup if you lost your DB encryption key.

See merge request !1015
2015-07-21 13:08:12 +00:00
Jacob Vosmaer 96819d2fb4 You need to store your DB encryption key 2015-07-21 14:35:58 +02:00
Hannes Rosenögger bf3b318ec5 revert caching of note text 2015-07-21 13:59:14 +02:00
Valery Sizov 74778d7064 Merge branch 'changelog_update' into 'master'
Update changelog



See merge request !1013
2015-07-21 10:41:15 +00:00
Valery Sizov 280576a2d5 Update changelog 2015-07-21 10:40:05 +00:00
Valery Sizov 2c4210f538 Merge branch 'overwrite-during-backup' into 'master'
Don't stop if database.sql.gz already exists

The existing behavior of the backups is to overwrite whatever data
was still there in the scratch directories. This broke when we added
a 'gzip' step because 'gzip database.sql' will fail if 'database.sql.gz'
already exists. Doing 'rm -f database.sql.gz' before the 'gzip'
avoids this failure.

See merge request !1011
2015-07-21 09:12:42 +00:00
Jacob Vosmaer 346b074979 Don't stop if database.sql.gz already exists
The existing behavior of the backups is to overwrite whatever data
was still there in the scratch directories. This broke when we added
a 'gzip' step because 'gzip database.sql' will fail if 'database.sql.gz'
already exists. Doing 'rm -f database.sql.gz' before the 'gzip'
avoids this failure.
2015-07-21 10:37:27 +02:00
Robert Schilling 57f9a1ccd4 Merge branch 'fix-changelog-7.11-7.12' into 'master'
Fix change log for 7.11 and move entry to 7.12

The change log for 7.11 was accidentally split in
3865a1d925. Additionally, the change added
with this commit did not make it into 7.11 according to
`git branch --contains` and it has not been cherry picked to 7-11-stable
so the entry is moved to 7.12.

Refs GH-5625, GH-9318.

See merge request !1009
2015-07-20 17:28:43 +00:00
Daniel Gerhardt e252410058 Fix change log for 7.11 and move entry to 7.12
The change log for 7.11 was accidentally split in
3865a1d925. Additionally, the change added
with this commit did not make it into 7.11 according to
`git branch --contains` and it has not been cherry picked to 7-11-stable
so the entry is moved to 7.12.

Refs GH-5625, GH-9318.

[ci skip]
2015-07-20 18:57:58 +02:00
Stan Hu e8c147903b Merge branch 'gc-images-no-casing' into 'master'
GoogleCode importer: Do not care about casing of image file extensions

When a GoogleCode repository contains an attached image with an UPPERCASE file extension, it's not inlined.

/CC @DouweM

See merge request !1003
2015-07-20 16:42:52 +00:00
Stan Hu 996ad35bed Merge branch 'fix-disabled-feature-access' into 'master'
Fix (i.e. prevent) access to disabled features for unauthenticated users

Unauthenticated users had access to disabled features of public
projects. The code has been slightly refactored so that feature checks
are done in a separate method and can also be applied for public access.

See merge request !1006
2015-07-20 16:42:07 +00:00
Stan Hu 3522018db3 Merge branch 'mr-fetch-command' into 'master'
merge_requests: add fetch command to the MR page

In our instance, users asked for an easy way to get the contents of the MR into their local clone. This adds a command line which can be used to fetch the contents of the MR.

Screenshot:

![fetch-command](https://gitlab.com/gitlab-org/gitlab-ce/uploads/d83acfbdb69f023d13b45dff5d583ac1/fetch-command.png)

See merge request !678
2015-07-20 16:40:24 +00:00
Ben Boeckel 374b95c38e merge_requests: add fetch command to the MR page 2015-07-20 11:23:27 -04:00
Valery Sizov cb691f417d Merge branch 'fix-slow-repository-cache-update' into 'master'
Remove repository graph log to fix slow cache updates after push event

Recalculating `graph_log` took minutes on a large repository since each
of the 6000 commits would need to calculate the diff. Since graph_log
does not appear to be used, remove it from the list of things to update.
For the Linux kernel repository, this reduced the `ProjectCacheWorker` time
from 8+ minutes to 16 seconds.

Closes #2016

See merge request !1005
2015-07-20 12:40:29 +00:00
Valery Sizov 922b738ae5 Merge branch 'remove-redundant-last-push' into 'master'
Remove redundant last push event if activity feed is set to main page

### What does this MR do?

This MR eliminates a redundant last push event message if the user's preferences are set to the main activity feed.

### Why was this MR needed?

Lots of wasted space was introduced as a result.

### Screenshots

#### Before

![image](https://gitlab.com/stanhu/gitlab-ce/uploads/e7fdeb58b2017ec45443bf0d54a94685/image.png)

#### After

![image](https://gitlab.com/stanhu/gitlab-ce/uploads/d4a15113127be119e7c33ff501020f16/image.png)

### What are the relevant issue numbers?

Closes #2009

See merge request !995
2015-07-20 12:12:24 +00:00
Valery Sizov 825adf461b Merge branch 'activity_publicly_accessible' into 'master'
Public project activity page asks for sign-in

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

See merge request !1007
2015-07-20 11:48:37 +00:00
Marin Jankovski da039ed51c Merge branch 'master' of github.com:gitlabhq/gitlabhq 2015-07-20 13:26:36 +02:00
Valery Sizov c61e7dd4ac Public project activity page asks for sign-in 2015-07-20 13:54:56 +03:00
Jacob Vosmaer 83304bf410 Merge pull request #9400 from tuxillo/patch-1
Use whoami instead of $USER
2015-07-20 11:45:34 +02:00
Marin Jankovski 8fa9da49c4 Merge branch 'set-omniauth-full-host' into 'master'
Set OmniAuth full_host parameter to ensure redirect URIs are correct

### What does this MR do?

This MR sets the OmniAuth `full_host` parameter to the configured GitLab URL to ensure the `redirect_uri` parameter is called with the right GitLab host.

### Why was this MR needed?

[OmniAuth attempts to grab the request URI](http://awesomeprogrammer.com/blog/2012/12/09/dealing-with-omniauth-redirect-uri-mismatch-invalid-port-number-gotcha/) and use that. If you set up a reverse proxy that terminates SSL at the Web server layer (e.g. https://gitlab.domain.com), omniauth will use the internal URL (e.g. http://my-host:8080) in its redirect URI unless all the Web server headers are properly set (e.g. `X-Forwarded-Port`, etc.). This is easy to forget or mess up, and it's better to ensure that OmniAuth has the right value from the start.

### What are the relevant issue numbers?

Closes #1967

See merge request !991
2015-07-20 08:45:58 +00:00
Daniel Gerhardt 4a0e4c857f Fix access to disabled features for unauthenticated users
Unauthenticated users had access to disabled features of public
projects. The code has been slightly refactored so that feature checks
are done in a separate method and can also be applied for public access.
2015-07-20 09:45:24 +02:00
Stan Hu e1811316d7 Remove repository graph log to fix slow cache updates after push event
Recalculating graph_log took minutes on a large repository since each
of the 6000 commits would need to calculate the diff. Since graph_log
does not appear to be used, remove it from the list of things to update.
For the Linux kernel repository, this reduced the ProjectCacheWorker time
from 8+ minutes to 16 seconds.

Closes #2016
2015-07-19 22:53:14 -07:00
Stan Hu e5a12596ab Merge branch 'fix-unauthenticated-label-access' into 'master'
Fix label read access for unauthenticated users

The label page was added to navigation for unauthorized users because
the previously used milestone read permission was still checked. This
has been fixed and read access to labels is now granted (again) for
public projects.

This regression has been introduced in
07efb17e10 (7.12).

See also 9bcd36396b.

Refs !836, !842.

See merge request !1000
2015-07-20 03:29:13 +00:00
Sven Strickroth 5eeab9f0a6 GoogleCode importer: Do not care about casing of image file extensions
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2015-07-20 00:53:43 +02:00
Valery Sizov d0ef64ac8e Merge branch 'rs-issue-2001' into 'master'
Dynamically check `:admin_*` ability in issuable context

Closes #2001

See merge request !1002
2015-07-19 21:27:38 +00:00
Robert Speicher e65b081062 Dynamically check :admin_* ability in issuable context
Closes #2001
2015-07-19 16:48:33 -04:00
Daniel Gerhardt 69417d36b2 Fix label read access for unauthenticated users
The label page was added to navigation for unauthorized users because
the previously used milestone read permission was still checked. This
has been fixed and read access to labels is now granted (again) for
public projects.

This regression has been introduced in
07efb17e10 (7.12).

See also 9bcd36396b.

Refs !836, !842.
2015-07-19 21:33:21 +02:00
Valery Sizov e8aaf56803 Merge branch 'fix-mixed-color-preview' into 'master'
Fix bug where notes were being rendered with wrong color preferences due to caching

### What does this MR do?

This MR adds the user's color preferences as part of the caching key for notes.

### Why was this MR needed?

This should fix a bug introduced via 4d80360b where notes were being loaded from the cache without regard to the current user's color scheme.

### What are the relevant issue numbers?

Closes #2008

See merge request !994
2015-07-19 09:19:30 +00:00