Commit Graph
12054 Commits
Author SHA1 Message Date
Yorick Peterse 54aa0969d4 Fixed Repository#exists? to handle errors
Now that Repository#raw_repository no longer sets the autocrlf option it
will also no longer raise any NoRepository errors since it doesn't
access Rugged any more. This also means that Repository#exists? can't
simply return the raw repository as this is no indication of whether or
not the repository actually exists (besides returning a non boolean is
weird in the first place).

To solve this problem Repository#exists? now properly checks if the
repository exists and returns true/false instead of a
Gitlab::Git::Repository or nil object.
2016-02-18 12:19:49 +01:00
Yorick Peterse c475b17111 Only set autocrlf when creating/updating files
Setting the "autocrlf" Git option is an overkill since it's rarely
actually needed. More importantly, it has quite the impact on
performance (see gitlab-org/gitlab-ce#13457 for more information).

By setting "autocrlf" when creating or updating files we guarantee the
option is always set properly when we actually need it _without_
introducing overhead for requests that have nothing to do with this
option.

Fixes gitlab-org/gitlab-ce#13457
2016-02-18 11:46:05 +01:00
Douwe Maan 52a8d1f3c6 Merge branch 'fix/gitpushservice-complexity-issue' into 'master'
Reduce code complexity on GitPushService#execute

Code complexity for gitlab-ce after this has been refactored:
```
  27.3: GitPushService#execute
```
This still needs to be merged into `gitlab-ee` presumably with conflicts... Perhaps we should create another issue for doing that?

I left the code sort of similar to what it was... If I could, I would have refactored most of the code into separate classes, etc. as it breaks probably all SOLID principles.

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


See merge request !2784
2016-02-18 09:33:21 +00:00
Rubén Dávila 2770de9617 Reopened MRs should also be considered as open. 2016-02-17 21:15:13 -05:00
Douwe Maan ff28ac9c18 Merge branch 'see-and-sort-on-vote-count-mr-issues' into 'master'
Add ability to see and sort on vote count from Issues and MR lists

Fixes #3763

* Sort options

![Sort Options](/uploads/df6543d574d4df8bf7e4496a876e2930/sort.png)

* Most popular

![Most popular](/uploads/bb92cc2fbef7b6b806dcdf8c52778fdd/most-popular.png)

* Least popular

![Least popular](/uploads/7988ed451922c81dc228419b5edbd7cd/least-popular.png)

See merge request !2781
2016-02-17 17:20:35 +00:00
Douwe Maan 879d66b6ab Merge branch 'git-archive-refactor' into 'master'
Refactor 'git archive' hand-off to gitlab-workhorse

We have a nicer way now to hand off HTTP responses to gitlab-workhorse.

Companion MR: https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/36

See merge request !2675
2016-02-17 17:16:34 +00:00
Rémy Coutable be4cdd9344 Merge branch 'bugfix/jschatz1/milestone-icon' into 'master'
Correct icon for milestones.



See merge request !2856
2016-02-17 16:21:08 +00:00
Douwe Maan 14488f79b5 Merge branch 'fix/13464-order-line-notes-create_at-in-parallel-diff-view' into 'master'
Sort line notes used in parallel diff by created_at


Fixes #13464.

See merge request !2858
2016-02-17 15:57:34 +00:00
Douwe Maan 6483a4c7b1 Merge branch 'fix/13367-redirect-to-project-page-if-no-import' into 'master'
Redirect /import to project page if no importing at all and repo exists


Fixes gitlab-org/gitlab-ce#13367.

See merge request !2857
2016-02-17 15:52:35 +00:00
Rémy Coutable 42c2064a36 Sort line notes used in parallel diff by created_at
Fixes #13464.
2016-02-17 16:31:14 +01:00
Jacob Vosmaer 64d8a38b54 Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-archive-refactor 2016-02-17 15:25:57 +01:00
Douwe Maan f7ee31a2c3 Merge branch 'expire-fork-import-caches' into 'master'
Expire caches after forking/importing a repository

cc @dblessing @DouweM 

Related issue: gitlab-org/gitlab-ce#13505

See merge request !2838
2016-02-17 14:07:54 +00:00
Douwe Maan cb2591e83f Merge branch 'image-diff' into 'master'
Fixes for showing images

- Render scrubbed SVG's inline, not via /raw/
- Use /raw/ requests on image diffs

Both of these are needed because of no longer eager loading blobs.

This a follow-up to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2830

Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/13350

See merge request !2837
2016-02-17 14:06:10 +00:00
Rémy Coutable 3d3ac87af9 Redirect /import to project page if no importing at all and repo exists
Fixes #13367.
2016-02-17 15:05:44 +01:00
Jacob Schatz 16e116bc16 Correct icon for milestones. 2016-02-17 09:02:34 -05:00
Douwe Maan 534d480993 Merge branch 'fix/13517-impossible-subsequent-issuable-edits-in-sidebar' into 'master'
Fix a bug preventing from doing subsequent edits in any Issuable sidebar

Fixes #13517. Fixes #12572.

### Issue

![impossible-subsequent-issue-edits-in-sidebar](/uploads/bd45c0effb46848641932d9cd38d3fe2/impossible-subsequent-issue-edits-in-sidebar.gif)

---

### Merge request

![impossible-subsequent-mr-edits-in-sidebar](/uploads/b4e1e3e93df4ac0a3d962df8b6139de9/impossible-subsequent-mr-edits-in-sidebar.gif)

/cc @jschatz1 @sytses 

See merge request !2848
2016-02-17 14:01:30 +00:00
Douwe Maan 522eb17923 Merge branch 'klowner/gitlab-ce-fix-compare-by-tag-crash' into 'master'
Fix 500 error when comparing by tags

_Originally opened at !2787 by @klowner._

- - -

Fixes #13171.
Fixes #13370.

See merge request !2849
2016-02-17 14:00:58 +00:00
Douglas Barbosa Alexandre 9823d00e0b Add ability to see and sort on vote count from Issues and MR lists 2016-02-17 11:32:02 -02:00
Mark RiedeselandRémy Coutable e9e01bcd96 Fix 500 error when comparing by tags 2016-02-17 12:56:53 +01:00
Jacob Schatz 29bfdf88ea Fix double scrollbar issues 2016-02-17 06:37:21 -05:00
Jacob Schatz 943bed68bc Merge branch 'issue_13359' into 'master'
Prevents floated button group on issues view

Issue #13359 

![screenshot](/uploads/962ac4f3f1f3d6ef87f7152c09090801/screenshot.jpg)

See merge request !2826
2016-02-17 11:30:26 +00:00
Yorick Peterse b1203108b0 Flush all repository caches when deleting a repo
This ensures that _all_ caches (including any caches normally only
flushed under certain conditions) are flushed whenever a project is
removed. Because cache keys are based on project namespaces (excluding
IDs) not doing so could result in a newly created project re-using old
caches (if the project was re-created using the same name).
2016-02-17 11:38:18 +01:00
Yorick Peterse a9e0301c23 Expire caches after forking/importing a repository
This ensures the caches for Repository#empty? and
Repository#has_visible_content? are flushed after a repository has been
imported or forked.

Fixes gitlab-org/gitlab-ce#13505
2016-02-17 11:38:18 +01:00
Jacob Vosmaer a0ccb0731b Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-archive-refactor 2016-02-17 11:30:42 +01:00
Jacob Vosmaer a87fe2a472 Fixes requested by Rémy 2016-02-17 11:08:47 +01:00
Jacob Vosmaer 016367c640 No use to sanitize partial blob data 2016-02-17 11:08:10 +01:00
James Lopez 5255a54df9 refactored some stuff based on MR feedback 2016-02-17 10:42:59 +01:00
Rémy Coutable c569f8b480 Fix a bug preventing from doing subsequent edits in any Issuable sidebar 2016-02-17 10:17:57 +01:00
Jacob Vosmaer 24fa458615 Use /raw/ requests for image diffs 2016-02-16 17:29:45 +01:00
Alfredo Sumaran 6d80a4c4f9 Wrap issue details to prevent content misalignment 2016-02-16 11:06:15 -05:00
Jacob Vosmaer 15126fc70f Fix SVG blob rendering 2016-02-16 17:01:25 +01:00
Jacob Schatz 7cc4b73942 Merge branch 'bugfix/jschatz1/sidebar-fixes-13215' into 'master'
Sidebar fixes

Fixes #13215 

* when editing a dropdown, but not changing anything you end up in an ugly state
* the hover-over state for the subscribe and other buttons are veeery subtle
* the collapse button needs some sort of hover-over state
* the reference gets shortened. It always got shortened. Not an issue with this in particular.
* the minimized sidebar is not functional. The copy button doesn't do anything
* looks all funky in safari (not for me)

See merge request !2736
2016-02-16 15:52:07 +00:00
Alfredo Sumaran 18390c6a91 Change "opened by" to just "by" 2016-02-16 09:30:34 -05:00
Douwe Maan bbbfdba0b9 Merge branch 'bugagazavr/gitlab-ce-extend-hooks' into 'master'
Add new data to project in push, issue, merge-request and note webhooks data

_Originally opened at !2738 by @bugagazavr._

- - -

**What does this MR do?**

Adds more data to hooks, makes repository data in all hook more dry ( use one hook_attrs method for repository data in all hooks )

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

1. https://gitlab.com/bugagazavr/gitlab-ce/blob/extend-hooks/app/models/project.rb#L738
2. https://gitlab.com/bugagazavr/gitlab-ce/blob/extend-hooks/app/models/concerns/issuable.rb#L132
3. https://gitlab.com/bugagazavr/gitlab-ce/blob/extend-hooks/lib/gitlab/push_data_builder.rb#L52
4. https://gitlab.com/bugagazavr/gitlab-ce/blob/extend-hooks/lib/gitlab/note_data_builder.rb#L56

**Why was this MR needed?**

More information about user for push events, and more data about repositiry ( project )

**What are the relevant issue numbers?**

No

**Screenshots (if relevant)**

No

See merge request !2788
2016-02-16 13:08:36 +00:00
Douwe Maan 4ae2131376 Merge branch 'fix/13356-issuable-index-of-total-in-sidebar' into 'master'
Fix the "x of y" displayed at the top of Issuables' sidebar

1. We now display the index of the current issuable among all its project's
issuables, of the same type and with the same state.
1. Also, refactored a bit the Issuable helpers into a new `IssuablesHelper`
module.
1. Added acceptance specs for the sidebar counter.

Note: I didn't add a CHANGELOG item since it's a bug fix for an unreleased version.

Fixes #13356.

See merge request !2818
2016-02-16 13:02:33 +00:00
Rémy Coutable 1de9513790 Use project.web_url instead deprecated repository.homepage in PushoverService 2016-02-16 13:03:00 +01:00
Rémy Coutable d28fa2ce23 Display "iid of max_iid" in Issuables' sidebar 2016-02-16 12:58:12 +01:00
Douwe Maan b6c5d52ab5 Merge branch 'cleanup-repository-initialize' into 'master'
Cleaned up Repository#initialize

The "default_branch" argument is never used and the "project" argument
isn't optional.



See merge request !2832
2016-02-16 11:52:45 +00:00
Douwe Maan 21fa421ca3 Merge branch 'fix/13458-eager-load-blob-data' into 'master'
Eager-load image blob data in diffs

Since gitlab_git 8.0, blob data are lazy-loaded so we have to call
`blob.load_all_data!(repo)` to eager-load them.

Fixes #13458.

/cc @jacobvosmaer @dblessing @rspeicher 

### New image in commit view

#### Before
![Screen_Shot_2016-02-16_at_11.28.18](/uploads/01c2afa2d25f3249b27744154ab2069b/Screen_Shot_2016-02-16_at_11.28.18.png)

#### After
![Screen_Shot_2016-02-16_at_11.30.56](/uploads/5ef72f717f22dfd0c1efa9e6d8ed926f/Screen_Shot_2016-02-16_at_11.30.56.png)

### Replaced image in commit view

#### Before
![Screen_Shot_2016-02-16_at_11.28.20](/uploads/39bb61851608643a86d9d7616139fc6c/Screen_Shot_2016-02-16_at_11.28.20.png)

#### After
![Screen_Shot_2016-02-16_at_11.30.59](/uploads/27e754fe8b57a838ac695bace27618c3/Screen_Shot_2016-02-16_at_11.30.59.png)

### Deleted image in commit view

#### Before
![Screen_Shot_2016-02-16_at_11.28.22](/uploads/3648dcc2c36bc644556080e203a29fca/Screen_Shot_2016-02-16_at_11.28.22.png)

#### After
![Screen_Shot_2016-02-16_at_11.31.01](/uploads/2585915d994bb6e245dd8c8553730bbf/Screen_Shot_2016-02-16_at_11.31.01.png)

### Image diff in merge request diff view

#### Before
![Screen_Shot_2016-02-16_at_11.28.37](/uploads/a7963f7139fc91975ca40568570ce4f0/Screen_Shot_2016-02-16_at_11.28.37.png)

#### After
![Screen_Shot_2016-02-16_at_11.31.04](/uploads/6773dbf3b870f082f0262febc9722d20/Screen_Shot_2016-02-16_at_11.31.04.png)

See merge request !2830
2016-02-16 11:48:52 +00:00
Douwe Maan 42d088fcb1 Merge branch 'fix/cross-reference-notes-forks' into 'master'
Fix cross reference notes  on forks

Updates `cross_reference_exists?` to match on commit only.

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

See merge request !2731
2016-02-16 11:47:46 +00:00
Douwe Maan 8db62f2548 Merge branch 'rs-issue-13467' into 'master'
Ensure Commit#show responds 404 instead of 500 when given an invalid ID

Closes #13467

See merge request !2823
2016-02-16 11:40:06 +00:00
Yorick Peterse f253f72529 Cleaned up Repository#initialize
The "default_branch" argument is never used and the "project" argument
isn't optional.
2016-02-16 12:13:13 +01:00
Rémy Coutable 5cd20de749 Eager-load image blob data in diffs
Since gitlab_git 8.0, blob data are lazy-loaded so we have to call
blob.load_all_data!(repo) to eager-load them.

Fixes #13458.
2016-02-16 10:50:24 +01:00
James Lopez 11913a762a updated system note service and spec based on feedback 2016-02-16 09:01:56 +01:00
Alfredo Sumaran 828f7a12dc Prevent author name to split into multiple lines 2016-02-15 16:46:21 -05:00
Robert Speicher ae13389b0b Provide explicit html format when rendering git_not_found page
Prior, if the request format was, for example, .zip, we'd get an
`ActionView::MissingTemplate` error.
2016-02-15 16:38:27 -05:00
Alfredo Sumaran 4af93e0296 Prevent split time into multiple lines for better reading 2016-02-15 16:30:17 -05:00
Alfredo Sumaran 807765b6a7 Move issue details after action buttons 2016-02-15 16:29:22 -05:00
Robert Speicher 012c75d1b0 Properly render the errors/git_not_found page 2016-02-15 15:52:39 -05:00
Robert Speicher f5ab126fd0 Ensure Commit#show responds 404 instead of 500 when given an invalid ID
Closes #13467
2016-02-15 15:48:16 -05:00