Commit Graph
8711 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
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
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
Hannes Rosenögger bf3b318ec5 revert caching of note text 2015-07-21 13:59:14 +02: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
Valery Sizov c61e7dd4ac Public project activity page asks for sign-in 2015-07-20 13:54:56 +03: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
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
Robert Speicher f92bbd2f28 Show the first tab automatically on MergeRequests#new
Closes #2013
2015-07-18 18:05:07 -04:00
Stan Hu 682c0deffe Remove redundant last push event if activity feed is set to main page
Closes #2009
2015-07-18 08:02:38 -07:00
Stan Hu 875d8e7f31 Fix bug where notes were being rendered with wrong color preferences due to caching
Closes #2008
2015-07-18 07:32:18 -07:00
Stan Hu 895d988d55 Merge branch 'fix-note-edit-upload-link' into 'master'
Fix file upload dialog for comment editing

This fixes the file upload dialog which currently works for new comments
but not for comment editing. The cause for this is a missing DOM class
which causes traversal to the dropzone to fail.

This is fixed by adding the expected `gfm-form` class to the edit form.
It has to be added dynamically since adding it to the form template
would break the form's layout and comment saving.

The following screenshot illustrates the issue:
![gitlab-dropzone-upload-dialog-bug](https://gitlab.com/gitlab-org/gitlab-ce/uploads/3a9885c8ba7c07338148ec9e605e5771/gitlab-dropzone-upload-dialog-bug.png)

See merge request !956
2015-07-18 06:06:59 +00:00
Robert Speicher 4998f7a0b5 Merge branch 'fix-line-highlighter-link-click' into 'master'
Fix bug where clicking on the link icon on a file would result in "#Lundefined" in the URL

Closes #2002

See merge request !988
2015-07-18 00:39:08 +00:00
Daniel Gerhardt 7825001586 Fix file upload dialog for comment editing
This fixes the file upload dialog which currently works for new comments
but not for comment editing. The cause for this is a missing DOM class
which causes traversal to the dropzone to fail.

This is fixed by adding the expected `gfm-form` class to the edit form.
It has to be added dynamically since adding it to the form template
would break the form's layout and comment saving.
2015-07-17 21:15:52 +02:00
Stan Hu a84ed6eb23 Merge branch 'add-support-remove-milestone' into 'master'
Add support for destroying project milestones

### What does this MR do?

This MR adds a "Remove" button to the project milestones page and the milestone page itself.

### Why was this MR needed?

Because lots of people talked about needing to clean their toilets. :)

### What are the relevant issue numbers?

Closes https://github.com/gitlabhq/gitlabhq/issues/1504

### Screenshots

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

![image](https://gitlab.com/gitlab-org/gitlab-ce/uploads/33eb01c7bc30fb235de96db5efb8746d/image.png)

See merge request !980
2015-07-17 17:15:27 +00:00
Dmitriy Zaporozhets c413a5507d Merge branch 'validate_token_and_url_format_for_gitlab_ci' into 'master'
Validate format of project_url and token for GitLab CI service.

If `project_url` and `token` for are invalid, [service_hook creation](https://gitlab.com/gitlab-org/gitlab-ce/blob/7-13-stable/app/models/project_services/gitlab_ci_service.rb#L30-34) will silently fail due to validation of URL in `WebHook`.

Given that token is a sequence of numbers and letters for GitLab CI making sure that there are no unexpected characters should be enough to prevent service_hook being nil. 

Fixes #1997 

See merge request !987
2015-07-17 16:25:03 +00:00
Dmitriy Zaporozhets 67fb9ef266 Merge branch 'even-faster-search' into 'master'
Avoid copy of strings in memory for parsing git grep result

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !967
2015-07-17 16:22:45 +00:00
Stan Hu 5bac64552d Fix bug where clicking on the link icon on a file would result in "L#undefined" in the URL
Closes #2002
2015-07-17 07:32:17 -07:00
Dmitriy Zaporozhets 67654a44d1 Avoid cache building for super-weird case when repository root_ref is nil
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-17 16:03:38 +02:00
Stan Hu df2bb60f90 Add support for destroying project milestones
Closes https://github.com/gitlabhq/gitlabhq/issues/1504
2015-07-17 06:54:32 -07:00
Marin Jankovski c3e35917fb Validate format of project_url and token for GitLab CI service. 2015-07-17 15:26:09 +02:00
Dmitriy Zaporozhets f0116f1335 Store commit count in project table
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-17 15:22:56 +02:00
Dmitriy Zaporozhets 67ca5a53f6 Build missing cache items in background job after each push
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-17 14:50:03 +02:00
Valery Sizov d2479a25c7 Time ago fix for compare page 2015-07-15 16:59:31 +03:00
Dmitriy Zaporozhets 2280cb23d4 Merge branch 'nice-scroll-sidebar' into 'master'
Add nice scroll for sidebar

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !978
2015-07-14 10:48:21 +00:00
Dmitriy Zaporozhets 98cb6256fa Add nice scroll for sidebar
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-14 12:29:57 +02:00
Kamil Trzcinski 2def2cc60a Hide scrollbar from sidebar when external mouse is connected to OSX 2015-07-14 12:02:42 +02:00
Dmitriy Zaporozhets 90e47dd949 Merge branch 'rs-issue-1773' into 'master'
Fix mentions not being created upon issue/merge request update

New cross-references weren't being added when they were made in an issue or merge request update.

This happened because the relevant `UpdateService`s were making the `notice_added_references` call
after the model had already been updated and saved, so the `changes` attribute was empty and no
cross-references were made at all.

This fixes the bug and adds a bit of testing and a bit of refactoring.

Closes #1773

See merge request !974
2015-07-14 08:40:08 +00:00
Dmitriy Zaporozhets 5c53dc5a1e Merge branch 'project-default-view' into 'master'
Allow user to specify content he wants to see on project page

Improvement to !938. Since a lot of people complain on fact they don't like to see README.
Especially since we already have a switcher for dashboard - it kind of acceptable to select behaviour.

User can specify which content he/she wants to see:

![Screenshot_2015-07-13_18.24.31](https://gitlab.com/gitlab-org/gitlab-ce/uploads/d237474e8f52df4a62ba7e951fa28bd8/Screenshot_2015-07-13_18.24.31.png)

![Screenshot_2015-07-13_18.24.36](https://gitlab.com/gitlab-org/gitlab-ce/uploads/473b0e2a94b3de16d048b8332b539816/Screenshot_2015-07-13_18.24.36.png)

cc @JobV @jacobvosmaer @marin @sytses

See merge request !970
2015-07-14 08:30:46 +00:00
Robert Speicher f3d4767d0c Rename notice_added_references to create_new_cross_references! 2015-07-13 21:31:16 -04:00
Robert Speicher e4c698fd5c Refactor Mentionable#notice_added_references
It now accounts for models that have changed but have already been
persisted, such as when called from an UpdateService.

Closes #1773
2015-07-13 21:31:00 -04:00
Dmitriy Zaporozhets fd84567545 Improve project new item dropdown
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-13 23:36:21 +02:00
Dmitriy Zaporozhets 59d7f4c97f Merge branch 'use_password_field_defaults_for_services' into 'master'
Use password field defaults for services

Previously we masked the password field manually. After the refactor that services page received we can use `password_field` default masking.

Fixes internal https://dev.gitlab.org/gitlab/gitlab-ee/issues/314

See merge request !969
2015-07-13 18:10:08 +00:00
Dmitriy Zaporozhets 13e987a6de Merge branch 'project-dropdown' into 'master'
Add dropdown to quickly create issue or branch from project page

because just 'new issue' link is not valid for all users. A lot of people use external issue tracker. So I grouped several links under one button

![Screenshot_2015-07-13_18.40.43](https://gitlab.com/gitlab-org/gitlab-ce/uploads/9db7394c16d1a8718c8a6a15fd2c98cc/Screenshot_2015-07-13_18.40.43.png)

![Screenshot_2015-07-13_18.40.41](https://gitlab.com/gitlab-org/gitlab-ce/uploads/d880532bb15370bb3f8e76bd06b411ad/Screenshot_2015-07-13_18.40.41.png)

cc @JobV @marin @jacobvosmaer @sytses

See merge request !971
2015-07-13 17:53:27 +00:00
Dmitriy Zaporozhets 24ecc9049f Increase padding between menu items a bit
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-13 19:24:41 +02:00
Dmitriy Zaporozhets a839b2afc4 Make sidebar scrollable. It prevents content overflow for small screens
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-13 19:23:15 +02:00
Dmitriy Zaporozhets 67c17df221 Better wording for project dropdown
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-13 19:04:48 +02:00
Dmitriy Zaporozhets 78a94027ea Add dropdown to quickly create issue or branch from project page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-13 18:42:07 +02:00
Dmitriy Zaporozhets 5f34759ecb Allow user to specify content he wants to see on project page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-13 18:24:15 +02:00