From 2fd9f1cc2b2389dade7d124694a6dd2c5872fca5 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Tue, 17 Mar 2015 16:23:43 -0700 Subject: [PATCH 01/39] Version 7.9.0.rc1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e5d25bf79a9..03d55a5a014 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.9.0.pre +7.9.0.rc1 \ No newline at end of file -- GitLab From 2e2f9d3eed63597b3306e56cd18eda6410ba296c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 18 Mar 2015 06:23:29 +0000 Subject: [PATCH 02/39] Merge branch 'fix_subscription' into 'master' Fix public issue See merge request !1717 --- .../projects/issues/_issue_context.html.haml | 27 ++++++++++--------- .../merge_requests/show/_context.html.haml | 27 ++++++++++--------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/app/views/projects/issues/_issue_context.html.haml b/app/views/projects/issues/_issue_context.html.haml index cb4846a41d1..d43ce0aa293 100644 --- a/app/views/projects/issues/_issue_context.html.haml +++ b/app/views/projects/issues/_issue_context.html.haml @@ -27,19 +27,20 @@ = hidden_field_tag :issue_context = f.submit class: 'btn' - %div.prepend-top-20.clearfix - .issuable-context-title - %label - Subscription: - %button.btn.btn-block.subscribe-button - %i.fa.fa-eye - %span= @issue.subscribed?(current_user) ? "Unsubscribe" : "Subscribe" - - subscribtion_status = @issue.subscribed?(current_user) ? "subscribed" : "unsubscribed" - .subscription-status{"data-status" => subscribtion_status} - .description-block.unsubscribed{class: ( "hidden" if @issue.subscribed?(current_user) )} - You're not receiving notifications from this thread. - .description-block.subscribed{class: ( "hidden" unless @issue.subscribed?(current_user) )} - You're receiving notifications because you're subscribed to this thread. + - if current_user + %div.prepend-top-20.clearfix + .issuable-context-title + %label + Subscription: + %button.btn.btn-block.subscribe-button + %i.fa.fa-eye + %span= @issue.subscribed?(current_user) ? "Unsubscribe" : "Subscribe" + - subscribtion_status = @issue.subscribed?(current_user) ? "subscribed" : "unsubscribed" + .subscription-status{"data-status" => subscribtion_status} + .description-block.unsubscribed{class: ( "hidden" if @issue.subscribed?(current_user) )} + You're not receiving notifications from this thread. + .description-block.subscribed{class: ( "hidden" unless @issue.subscribed?(current_user) )} + You're receiving notifications because you're subscribed to this thread. :coffeescript $ -> diff --git a/app/views/projects/merge_requests/show/_context.html.haml b/app/views/projects/merge_requests/show/_context.html.haml index 753c7e0e611..14ad89a2000 100644 --- a/app/views/projects/merge_requests/show/_context.html.haml +++ b/app/views/projects/merge_requests/show/_context.html.haml @@ -29,19 +29,20 @@ = hidden_field_tag :merge_request_context = f.submit class: 'btn' - %div.prepend-top-20.clearfix - .issuable-context-title - %label - Subscription: - %button.btn.btn-block.subscribe-button - %i.fa.fa-eye - %span= @merge_request.subscribed?(current_user) ? "Unsubscribe" : "Subscribe" - - subscribtion_status = @merge_request.subscribed?(current_user) ? "subscribed" : "unsubscribed" - .subscription-status{"data-status" => subscribtion_status} - .description-block.unsubscribed{class: ( "hidden" if @merge_request.subscribed?(current_user) )} - You're not receiving notifications from this thread. - .description-block.subscribed{class: ( "hidden" unless @merge_request.subscribed?(current_user) )} - You're receiving notifications because you're subscribed to this thread. + - if current_user + %div.prepend-top-20.clearfix + .issuable-context-title + %label + Subscription: + %button.btn.btn-block.subscribe-button + %i.fa.fa-eye + %span= @merge_request.subscribed?(current_user) ? "Unsubscribe" : "Subscribe" + - subscribtion_status = @merge_request.subscribed?(current_user) ? "subscribed" : "unsubscribed" + .subscription-status{"data-status" => subscribtion_status} + .description-block.unsubscribed{class: ( "hidden" if @merge_request.subscribed?(current_user) )} + You're not receiving notifications from this thread. + .description-block.subscribed{class: ( "hidden" unless @merge_request.subscribed?(current_user) )} + You're receiving notifications because you're subscribed to this thread. :coffeescript $ -> -- GitLab From 368a391182039f7973f7cf3da7b4e29c760003df Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 18 Mar 2015 01:37:04 +0000 Subject: [PATCH 03/39] Merge branch 'css-vars' into 'master' More actively use css variabled to prevent colors duplication See merge request !1715 --- app/assets/stylesheets/generic/files.scss | 2 +- app/assets/stylesheets/generic/lists.scss | 9 ++--- .../stylesheets/generic/nav_sidebar.scss | 34 +++++++++---------- .../stylesheets/generic/typography.scss | 3 +- app/assets/stylesheets/pages/diff.scss | 2 +- app/assets/stylesheets/pages/editor.scss | 2 +- app/assets/stylesheets/pages/events.scss | 2 +- .../stylesheets/pages/merge_requests.scss | 2 +- app/assets/stylesheets/pages/tree.scss | 2 +- .../notify/project_was_moved_email.html.haml | 4 +-- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/app/assets/stylesheets/generic/files.scss b/app/assets/stylesheets/generic/files.scss index 91220a856ac..8014dcb165b 100644 --- a/app/assets/stylesheets/generic/files.scss +++ b/app/assets/stylesheets/generic/files.scss @@ -94,7 +94,7 @@ } .author, .blame_commit { - background: #f5f5f5; + background: $background-color; vertical-align: top; } .lines { diff --git a/app/assets/stylesheets/generic/lists.scss b/app/assets/stylesheets/generic/lists.scss index 5950885c42c..85176fec0dc 100644 --- a/app/assets/stylesheets/generic/lists.scss +++ b/app/assets/stylesheets/generic/lists.scss @@ -35,7 +35,7 @@ color: #8a6d3b; } - &.smoke { background-color: #f5f5f5; } + &.smoke { background-color: $background-color; } &:hover { background: $hover; @@ -46,7 +46,7 @@ border-bottom: none; &.bottom { - background: #f5f5f5; + background: $background-color; } } @@ -74,9 +74,10 @@ } .row_title { - color: #444; + color: $text-color; + &:hover { - color: #444; + color: $text-color; text-decoration: underline; } } diff --git a/app/assets/stylesheets/generic/nav_sidebar.scss b/app/assets/stylesheets/generic/nav_sidebar.scss index c14f12284da..bb890171985 100644 --- a/app/assets/stylesheets/generic/nav_sidebar.scss +++ b/app/assets/stylesheets/generic/nav_sidebar.scss @@ -1,18 +1,18 @@ .page-with-sidebar { - background: #F5F5F5; + background: $background-color; .sidebar-wrapper { position: fixed; top: 0; left: 0; height: 100%; - border-right: 1px solid #EAEAEA; + border-right: 1px solid $border-color; } } .sidebar-wrapper { z-index: 99; - background: #F5F5F5; + background: $background-color; } .content-wrapper { @@ -39,7 +39,7 @@ .nav-sidebar li { &.active a { - color: #333; + color: $text-color; background: #FFF !important; font-weight: bold; border: 1px solid #EEE; @@ -52,32 +52,33 @@ } i { - color: #444; + color: $text-color; } } } .nav-sidebar li { + text-shadow: 0 1px 1px $border-color; + &.separate-item { - border-top: 1px solid #ddd; + border-top: 1px solid $border-color; padding-top: 10px; margin-top: 10px; } a { - color: #555; + color: #3b5a5b; display: block; text-decoration: none; padding: 8px 15px; font-size: 13px; line-height: 20px; - text-shadow: 0 1px 2px #FFF; padding-left: 20px; &:hover { text-decoration: none; - color: #333; - background: #EEE; + color: $text-color; + background: #f2f6f7; } &:active, &:focus { @@ -86,7 +87,7 @@ i { width: 20px; - color: #888; + color: $gray-dark; margin-right: 23px; } } @@ -156,18 +157,17 @@ position: fixed; top: 46px; padding: 5px 13px 5px 13px; - left: 197px; + left: 198px; font-size: 13px; - background: #EEE; + background: transparent; color: black; - border-left: 1px solid rgba(0,0,0,0.035); - border-right: 1px solid rgba(0,0,0,0.035); + border-left: 1px solid $border-color; + border-bottom: 1px solid $border-color; } .collapse-nav a:hover { text-decoration: none; - color: #333; - background: #eaeaea; + background: #f2f6f7; } @media (max-width: $screen-md-max) { diff --git a/app/assets/stylesheets/generic/typography.scss b/app/assets/stylesheets/generic/typography.scss index 4d940ee6b29..80190424c1b 100644 --- a/app/assets/stylesheets/generic/typography.scss +++ b/app/assets/stylesheets/generic/typography.scss @@ -4,7 +4,6 @@ */ .page-title { margin-top: 0px; - color: #333; line-height: 1.5; font-weight: normal; margin-bottom: 5px; @@ -16,7 +15,7 @@ pre { &.dark { background: #333; - color: #f5f5f5; + color: $background-color; } } diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss index 5a9f93dc03d..83f65913ee6 100644 --- a/app/assets/stylesheets/pages/diff.scss +++ b/app/assets/stylesheets/pages/diff.scss @@ -89,7 +89,7 @@ margin: 0px; padding: 0px; border: none; - background: #F5F5F5; + background: $background-color; color: rgba(0,0,0,0.3); padding: 0px 5px; border-right: 1px solid $border-color; diff --git a/app/assets/stylesheets/pages/editor.scss b/app/assets/stylesheets/pages/editor.scss index 851f126318d..759ba6b1c22 100644 --- a/app/assets/stylesheets/pages/editor.scss +++ b/app/assets/stylesheets/pages/editor.scss @@ -37,7 +37,7 @@ } .editor-ref { - background: #f5f5f5; + background: $background-color; padding: 11px 15px; border-right: 1px solid #CCC; display: inline-block; diff --git a/app/assets/stylesheets/pages/events.scss b/app/assets/stylesheets/pages/events.scss index 3e9e36e477e..480cc2c50a9 100644 --- a/app/assets/stylesheets/pages/events.scss +++ b/app/assets/stylesheets/pages/events.scss @@ -188,7 +188,7 @@ li a { font-size: 13px; padding: 5px 10px; - background: rgba(0,0,0,0.045); + background: $background-color; margin-left: 4px; } } diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss index d41e34caba1..fe5667a587f 100644 --- a/app/assets/stylesheets/pages/merge_requests.scss +++ b/app/assets/stylesheets/pages/merge_requests.scss @@ -129,7 +129,7 @@ font-size: 15px; border-bottom: 1px solid #BBB; color: #777; - background-color: #F5F5F5; + background-color: $background-color; &.ci-success { color: $gl-success; diff --git a/app/assets/stylesheets/pages/tree.scss b/app/assets/stylesheets/pages/tree.scss index ce02cdb1652..b0e6a05fa06 100644 --- a/app/assets/stylesheets/pages/tree.scss +++ b/app/assets/stylesheets/pages/tree.scss @@ -27,7 +27,7 @@ } &.selected { td { - background: #f5f5f5; + background: $background-color; border-top: 1px solid #EEE; border-bottom: 1px solid #EEE; } diff --git a/app/views/notify/project_was_moved_email.html.haml b/app/views/notify/project_was_moved_email.html.haml index f53de2de287..d2df398ed4a 100644 --- a/app/views/notify/project_was_moved_email.html.haml +++ b/app/views/notify/project_was_moved_email.html.haml @@ -6,10 +6,10 @@ = @project.name_with_namespace %p To update the remote url in your local repository run (for ssh): -%p{ style: "background:#f5f5f5; padding:10px; border:1px solid #ddd" } +%p{ style: "background:$background-color; padding:10px; border:1px solid #ddd" } git remote set-url origin #{@project.ssh_url_to_repo} %p or for http(s): -%p{ style: "background:#f5f5f5; padding:10px; border:1px solid #ddd" } +%p{ style: "background:$background-color; padding:10px; border:1px solid #ddd" } git remote set-url origin #{@project.http_url_to_repo} %br -- GitLab From b6e7940c3db2d3e580e592cb2f9490eb4a3b0cef Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 17 Mar 2015 18:38:10 -0700 Subject: [PATCH 04/39] Fix email template css for project moved emails --- app/views/notify/project_was_moved_email.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/notify/project_was_moved_email.html.haml b/app/views/notify/project_was_moved_email.html.haml index d2df398ed4a..3cd759f1f57 100644 --- a/app/views/notify/project_was_moved_email.html.haml +++ b/app/views/notify/project_was_moved_email.html.haml @@ -6,10 +6,10 @@ = @project.name_with_namespace %p To update the remote url in your local repository run (for ssh): -%p{ style: "background:$background-color; padding:10px; border:1px solid #ddd" } +%p{ style: "background: #f5f5f5; padding:10px; border:1px solid #ddd" } git remote set-url origin #{@project.ssh_url_to_repo} %p or for http(s): -%p{ style: "background:$background-color; padding:10px; border:1px solid #ddd" } +%p{ style: "background: #f5f5f5; padding:10px; border:1px solid #ddd" } git remote set-url origin #{@project.http_url_to_repo} %br -- GitLab From e34d778f0186ef89ef1ab22401e288318f32b1d4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 17 Mar 2015 22:57:58 -0700 Subject: [PATCH 05/39] Merge branch 'refactor-css' --- app/assets/stylesheets/base/gl_variables.scss | 755 +----------------- app/assets/stylesheets/base/variables.scss | 14 +- app/assets/stylesheets/generic/forms.scss | 4 +- app/assets/stylesheets/generic/lists.scss | 4 +- .../stylesheets/generic/nav_sidebar.scss | 8 +- app/assets/stylesheets/generic/timeline.scss | 4 +- 6 files changed, 20 insertions(+), 769 deletions(-) diff --git a/app/assets/stylesheets/base/gl_variables.scss b/app/assets/stylesheets/base/gl_variables.scss index ce82ad80318..17b5622d74a 100644 --- a/app/assets/stylesheets/base/gl_variables.scss +++ b/app/assets/stylesheets/base/gl_variables.scss @@ -1,5 +1,5 @@ // Override Bootstrap variables here (defaults from bootstrap-sass v3.3.3): - +// For all variables see https://github.com/twbs/bootstrap-sass/blob/master/templates/project/_bootstrap-variables.sass // // Variables // -------------------------------------------------- @@ -15,12 +15,6 @@ // $gray: lighten($gray-base, 33.5%) // #555 // $gray-light: lighten($gray-base, 46.7%) // #777 // $gray-lighter: lighten($gray-base, 93.5%) // #eee -$gray-base: #000; -$gray-darker: lighten($gray-base, 13.5%); // #222 -$gray-dark: #7b8a8b; // #333 -$gray: #95a5a6; // #555 -$gray-light: #b4bcc2; // #999 -$gray-lighter: #ecf0f1; // #eee $brand-primary: $gl-primary; $brand-success: $gl-success; @@ -31,68 +25,17 @@ $brand-danger: $gl-danger; //== Scaffolding // -//## Settings for some of the most global styles. - -//** Background color for ``. -// $body-bg: #fff -//** Global text color on ``. -$text-color: $brand-primary; - -//** Global textual link color. +$text-color: $gl-text-color; $link-color: $gl-link-color; -//** Link hover color set via `darken()` function. -// $link-hover-color: darken($link-color, 15%) -//** Link hover decoration. -// $link-hover-decoration: underline //== Typography // //## Font, line-height, and color for body text, headings, and more. -// $font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif -// $font-family-serif: Georgia, "Times New Roman", Times, serif -//** Default monospace fonts for ``, ``, and `
`.
-// $font-family-monospace:   Menlo, Monaco, Consolas, "Courier New", monospace
-// $font-family-base:        $font-family-sans-serif
-
-$font-size-base:          $gl-font-size;
-// $font-size-large:         ceil(($font-size-base * 1.25)) // ~18px
-// $font-size-small:         ceil(($font-size-base * 0.85)) // ~12px
-
-// $font-size-h1:            floor(($font-size-base * 2.6)) // ~36px
-// $font-size-h2:            floor(($font-size-base * 2.15)) // ~30px
-// $font-size-h3:            ceil(($font-size-base * 1.7)) // ~24px
-// $font-size-h4:            ceil(($font-size-base * 1.25)) // ~18px
-// $font-size-h5:            $font-size-base
-// $font-size-h6:            ceil(($font-size-base * 0.85)) // ~12px
-
-//** Unit-less `line-height` for use in components like buttons.
-// $line-height-base:        1.428571429 // 20/14
-//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
-// $line-height-computed:    floor(($font-size-base * $line-height-base)) // ~20px
-
-//** By default, this inherits from the ``.
-// $headings-font-family:    inherit
-// $headings-font-weight:    500
-// $headings-line-height:    1.1
-// $headings-color:          inherit
-
-
-//== Iconography
-//
-//## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
-
-//** Load fonts from this directory.
-
-// [converter] If $bootstrap-sass-asset-helper if used, provide path relative to the assets load path.
-// [converter] This is because some asset helpers, such as Sprockets, do not work with file-relative paths.
-// $icon-font-path: if($bootstrap-sass-asset-helper, "bootstrap/", "../fonts/bootstrap/")
-
-//** File name for all font files.
-// $icon-font-name:          "glyphicons-halflings-regular"
-//** Element ID within SVG icon file.
-// $icon-font-svg-id:        "glyphicons_halflingsregular"
+$font-family-sans-serif: $regular_font;
+$font-family-monospace:  $monospace_font;
+$font-size-base:         $gl-font-size;
 
 
 //== Components
@@ -102,348 +45,15 @@ $font-size-base:          $gl-font-size;
 $padding-base-vertical:     6px;
 $padding-base-horizontal:   14px;
 
-// $padding-large-vertical:    10px
-// $padding-large-horizontal:  16px
-
-// $padding-small-vertical:    5px
-// $padding-small-horizontal:  10px
-
-// $padding-xs-vertical:       1px
-// $padding-xs-horizontal:     5px
-
-// $line-height-large:         1.3333333 // extra decimals for Win 8.1 Chrome
-// $line-height-small:         1.5
-
-// $border-radius-base:        4px
-// $border-radius-large:       6px
-// $border-radius-small:       3px
-
-//** Global color for active items (e.g., navs or dropdowns).
-// $component-active-color:    #fff
-//** Global background color for active items (e.g., navs or dropdowns).
-// $component-active-bg:       $brand-primary
-
-//** Width of the `border` for generating carets that indicator dropdowns.
-// $caret-width-base:          4px
-//** Carets increase slightly in size for larger components.
-// $caret-width-large:         5px
-
-
-//== Tables
-//
-//## Customizes the `.table` component with basic values, each used across all table variations.
-
-//** Padding for ``s and ``s.
-// $table-cell-padding:            8px
-//** Padding for cells in `.table-condensed`.
-// $table-condensed-cell-padding:  5px
-
-//** Default background color used for all tables.
-// $table-bg:                      transparent
-//** Background color used for `.table-striped`.
-// $table-bg-accent:               #f9f9f9
-//** Background color used for `.table-hover`.
-// $table-bg-hover:                #f5f5f5
-// $table-bg-active:               $table-bg-hover
-
-//** Border color for table and cell borders.
-// $table-border-color:            #ddd
-
-
-//== Buttons
-//
-//## For each of Bootstrap's buttons, define text, background and border color.
-
-// $btn-font-weight:                normal
-
-// $btn-default-color:              #333
-// $btn-default-bg:                 #fff
-// $btn-default-border:             #ccc
-
-// $btn-primary-color:              #fff
-// $btn-primary-bg:                 $brand-primary
-// $btn-primary-border:             darken($btn-primary-bg, 5%)
-
-// $btn-success-color:              #fff
-// $btn-success-bg:                 $brand-success
-// $btn-success-border:             darken($btn-success-bg, 5%)
-
-// $btn-info-color:                 #fff
-// $btn-info-bg:                    $brand-info
-// $btn-info-border:                darken($btn-info-bg, 5%)
-
-// $btn-warning-color:              #fff
-// $btn-warning-bg:                 $brand-warning
-// $btn-warning-border:             darken($btn-warning-bg, 5%)
-
-// $btn-danger-color:               #fff
-// $btn-danger-bg:                  $brand-danger
-// $btn-danger-border:              darken($btn-danger-bg, 5%)
-
-// $btn-link-disabled-color:        $gray-light
-
 
 //== Forms
 //
 //##
 
-//** `` background color
-// $input-bg:                       #fff
-//** `` background color
-// $input-bg-disabled:              $gray-lighter
-
-//** Text color for ``s
 $input-color:                    $text-color;
-//** `` border color
-$input-border:                   #dce4ec;
-
-// TODO: Rename `$input-border-radius` to `$input-border-radius-base` in v4
-//** Default `.form-control` border radius
-// This has no effect on ``s in CSS.
-// $input-border-radius:            $border-radius-base
-//** Large `.form-control` border radius
-// $input-border-radius-large:      $border-radius-large
-//** Small `.form-control` border radius
-// $input-border-radius-small:      $border-radius-small
-
-//** Border color for inputs on focus
+$input-border:                   #DDD;
 $input-border-focus:             $brand-info;
-
-//** Placeholder text color
-// $input-color-placeholder:        #999
-
-//** Default `.form-control` height
-// $input-height-base:              ($line-height-computed + ($padding-base-vertical * 2) + 2)
-//** Large `.form-control` height
-// $input-height-large:             (ceil($font-size-large * $line-height-large) + ($padding-large-vertical * 2) + 2)
-//** Small `.form-control` height
-// $input-height-small:             (floor($font-size-small * $line-height-small) + ($padding-small-vertical * 2) + 2)
-
 $legend-color:                   $text-color;
-// $legend-border-color:            #e5e5e5
-
-//** Background color for textual input addons
-// $input-group-addon-bg:           $gray-lighter
-//** Border color for textual input addons
-// $input-group-addon-border-color: $input-border
-
-//** Disabled cursor for form controls and buttons.
-// $cursor-disabled:                not-allowed
-
-
-//== Dropdowns
-//
-//## Dropdown menu container and contents.
-
-//** Background for the dropdown menu.
-// $dropdown-bg:                    #fff
-//** Dropdown menu `border-color`.
-// $dropdown-border:                rgba(0,0,0,.15)
-//** Dropdown menu `border-color` **for IE8**.
-// $dropdown-fallback-border:       #ccc
-//** Divider color for between dropdown items.
-// $dropdown-divider-bg:            #e5e5e5
-
-//** Dropdown link text color.
-// $dropdown-link-color:            $gray-dark
-//** Hover color for dropdown links.
-// $dropdown-link-hover-color:      darken($gray-dark, 5%)
-//** Hover background for dropdown links.
-// $dropdown-link-hover-bg:         #f5f5f5
-
-//** Active dropdown menu item text color.
-// $dropdown-link-active-color:     $component-active-color
-//** Active dropdown menu item background color.
-// $dropdown-link-active-bg:        $component-active-bg
-
-//** Disabled dropdown menu item background color.
-// $dropdown-link-disabled-color:   $gray-light
-
-//** Text color for headers within dropdown menus.
-// $dropdown-header-color:          $gray-light
-
-//** Deprecated `$dropdown-caret-color` as of v3.1.0
-// $dropdown-caret-color:           #000
-
-
-//-- Z-index master list
-//
-// Warning: Avoid customizing these values. They're used for a bird's eye view
-// of components dependent on the z-axis and are designed to all work together.
-//
-// Note: These variables are not generated into the Customizer.
-
-// $zindex-navbar:            1000
-// $zindex-dropdown:          1000
-// $zindex-popover:           1060
-// $zindex-tooltip:           1070
-// $zindex-navbar-fixed:      1030
-// $zindex-modal:             1040
-
-
-//== Media queries breakpoints
-//
-//## Define the breakpoints at which your layout will change, adapting to different screen sizes.
-
-// Extra small screen / phone
-//** Deprecated `$screen-xs` as of v3.0.1
-// $screen-xs:                  480px
-//** Deprecated `$screen-xs-min` as of v3.2.0
-// $screen-xs-min:              $screen-xs
-//** Deprecated `$screen-phone` as of v3.0.1
-// $screen-phone:               $screen-xs-min
-
-// Small screen / tablet
-//** Deprecated `$screen-sm` as of v3.0.1
-// $screen-sm:                  768px
-// $screen-sm-min:              $screen-sm
-//** Deprecated `$screen-tablet` as of v3.0.1
-// $screen-tablet:              $screen-sm-min
-
-// Medium screen / desktop
-//** Deprecated `$screen-md` as of v3.0.1
-// $screen-md:                  992px
-// $screen-md-min:              $screen-md
-//** Deprecated `$screen-desktop` as of v3.0.1
-// $screen-desktop:             $screen-md-min
-
-// Large screen / wide desktop
-//** Deprecated `$screen-lg` as of v3.0.1
-// $screen-lg:                  1200px
-// $screen-lg-min:              $screen-lg
-//** Deprecated `$screen-lg-desktop` as of v3.0.1
-// $screen-lg-desktop:          $screen-lg-min
-
-// So media queries don't overlap when required, provide a maximum
-// $screen-xs-max:              ($screen-sm-min - 1)
-// $screen-sm-max:              ($screen-md-min - 1)
-// $screen-md-max:              ($screen-lg-min - 1)
-
-
-//== Grid system
-//
-//## Define your custom responsive grid.
-
-//** Number of columns in the grid.
-// $grid-columns:              12
-//** Padding between columns. Gets divided in half for the left and right.
-// $grid-gutter-width:         30px
-// Navbar collapse
-//** Point at which the navbar becomes uncollapsed.
-// $grid-float-breakpoint:     $screen-sm-min
-//** Point at which the navbar begins collapsing.
-// $grid-float-breakpoint-max: ($grid-float-breakpoint - 1)
-
-
-//== Container sizes
-//
-//## Define the maximum width of `.container` for different screen sizes.
-
-// Small screen / tablet
-// $container-tablet:             (720px + $grid-gutter-width)
-//** For `$screen-sm-min` and up.
-// $container-sm:                 $container-tablet
-
-// Medium screen / desktop
-// $container-desktop:            (940px + $grid-gutter-width)
-//** For `$screen-md-min` and up.
-// $container-md:                 $container-desktop
-
-// Large screen / wide desktop
-// $container-large-desktop:      (1140px + $grid-gutter-width)
-//** For `$screen-lg-min` and up.
-// $container-lg:                 $container-large-desktop
-
-
-//== Navbar
-//
-//##
-
-// Basics of a navbar
-// $navbar-height:                    50px
-// $navbar-margin-bottom:             $line-height-computed
-// $navbar-border-radius:             $border-radius-base
-// $navbar-padding-horizontal:        floor(($grid-gutter-width / 2))
-// $navbar-padding-vertical:          (($navbar-height - $line-height-computed) / 2)
-// $navbar-collapse-max-height:       340px
-
-// $navbar-default-color:             #777
-// $navbar-default-bg:                #f8f8f8
-// $navbar-default-border:            darken($navbar-default-bg, 6.5%)
-
-// Navbar links
-// $navbar-default-link-color:                #777
-// $navbar-default-link-hover-color:          #333
-// $navbar-default-link-hover-bg:             transparent
-// $navbar-default-link-active-color:         #555
-// $navbar-default-link-active-bg:            darken($navbar-default-bg, 6.5%)
-// $navbar-default-link-disabled-color:       #ccc
-// $navbar-default-link-disabled-bg:          transparent
-
-// Navbar brand label
-// $navbar-default-brand-color:               $navbar-default-link-color
-// $navbar-default-brand-hover-color:         darken($navbar-default-brand-color, 10%)
-// $navbar-default-brand-hover-bg:            transparent
-
-// Navbar toggle
-// $navbar-default-toggle-hover-bg:           #ddd
-// $navbar-default-toggle-icon-bar-bg:        #888
-// $navbar-default-toggle-border-color:       #ddd
-
-
-// Inverted navbar
-// Reset inverted navbar basics
-// $navbar-inverse-color:                      lighten($gray-light, 15%)
-// $navbar-inverse-bg:                         #222
-// $navbar-inverse-border:                     darken($navbar-inverse-bg, 10%)
-
-// Inverted navbar links
-// $navbar-inverse-link-color:                 lighten($gray-light, 15%)
-// $navbar-inverse-link-hover-color:           #fff
-// $navbar-inverse-link-hover-bg:              transparent
-// $navbar-inverse-link-active-color:          $navbar-inverse-link-hover-color
-// $navbar-inverse-link-active-bg:             darken($navbar-inverse-bg, 10%)
-// $navbar-inverse-link-disabled-color:        #444
-// $navbar-inverse-link-disabled-bg:           transparent
-
-// Inverted navbar brand label
-// $navbar-inverse-brand-color:                $navbar-inverse-link-color
-// $navbar-inverse-brand-hover-color:          #fff
-// $navbar-inverse-brand-hover-bg:             transparent
-
-// Inverted navbar toggle
-// $navbar-inverse-toggle-hover-bg:            #333
-// $navbar-inverse-toggle-icon-bar-bg:         #fff
-// $navbar-inverse-toggle-border-color:        #333
-
-
-//== Navs
-//
-//##
-
-//=== Shared nav styles
-// $nav-link-padding:                          10px 15px
-// $nav-link-hover-bg:                         $gray-lighter
-
-// $nav-disabled-link-color:                   $gray-light
-// $nav-disabled-link-hover-color:             $gray-light
-
-//== Tabs
-// $nav-tabs-border-color:                     #ddd
-
-// $nav-tabs-link-hover-border-color:          $gray-lighter
-
-// $nav-tabs-active-link-hover-bg:             $body-bg
-// $nav-tabs-active-link-hover-color:          $gray
-// $nav-tabs-active-link-hover-border-color:   #ddd
-
-// $nav-tabs-justified-link-border-color:            #ddd
-// $nav-tabs-justified-active-link-border-color:     $body-bg
-
-//== Pills
-// $nav-pills-border-radius:                   $border-radius-base
-// $nav-pills-active-link-hover-bg:            $component-active-bg
-// $nav-pills-active-link-hover-color:         $component-active-color
 
 
 //== Pagination
@@ -467,38 +77,10 @@ $pagination-disabled-bg:               lighten($brand-success, 15%);
 $pagination-disabled-border:           transparent;
 
 
-//== Pager
-//
-//##
-
-// $pager-bg:                             $pagination-bg
-// $pager-border:                         $pagination-border
-// $pager-border-radius:                  15px
-
-// $pager-hover-bg:                       $pagination-hover-bg
-
-// $pager-active-bg:                      $pagination-active-bg
-// $pager-active-color:                   $pagination-active-color
-
-// $pager-disabled-color:                 $pagination-disabled-color
-
-
-//== Jumbotron
-//
-//##
-
-// $jumbotron-padding:              30px
-// $jumbotron-color:                inherit
-// $jumbotron-bg:                   $gray-lighter
-// $jumbotron-heading-color:        inherit
-// $jumbotron-font-size:            ceil(($font-size-base * 1.5))
-
-
 //== Form states and alerts
 //
 //## Define colors for form feedback states and, by default, alerts.
 
-
 $state-success-text:             #fff;
 $state-success-bg:               $brand-success;
 $state-success-border:           $brand-success;
@@ -516,316 +98,22 @@ $state-danger-bg:                $brand-danger;
 $state-danger-border:            $brand-danger;
 
 
-//== Tooltips
-//
-//##
-
-//** Tooltip max width
-// $tooltip-max-width:           200px
-//** Tooltip text color
-// $tooltip-color:               #fff
-//** Tooltip background color
-// $tooltip-bg:                  #000
-// $tooltip-opacity:             .9
-
-//** Tooltip arrow width
-// $tooltip-arrow-width:         5px
-//** Tooltip arrow color
-// $tooltip-arrow-color:         $tooltip-bg
-
-
-//== Popovers
-//
-//##
-
-//** Popover body background color
-// $popover-bg:                          #fff
-//** Popover maximum width
-// $popover-max-width:                   276px
-//** Popover border color
-// $popover-border-color:                rgba(0,0,0,.2)
-//** Popover fallback border color
-// $popover-fallback-border-color:       #ccc
-
-//** Popover title background color
-// $popover-title-bg:                    darken($popover-bg, 3%)
-
-//** Popover arrow width
-// $popover-arrow-width:                 10px
-//** Popover arrow color
-// $popover-arrow-color:                 $popover-bg
-
-//** Popover outer arrow width
-// $popover-arrow-outer-width:           ($popover-arrow-width + 1)
-//** Popover outer arrow color
-// $popover-arrow-outer-color:           fade_in($popover-border-color, 0.05)
-//** Popover outer arrow fallback color
-// $popover-arrow-outer-fallback-color:  darken($popover-fallback-border-color, 20%)
-
-
-//== Labels
-//
-//##
-
-//** Default label background color
-// $label-default-bg:            $gray-light
-//** Primary label background color
-// $label-primary-bg:            $brand-primary
-//** Success label background color
-// $label-success-bg:            $brand-success
-//** Info label background color
-// $label-info-bg:               $brand-info
-//** Warning label background color
-// $label-warning-bg:            $brand-warning
-//** Danger label background color
-// $label-danger-bg:             $brand-danger
-
-//** Default label text color
-// $label-color:                 #fff
-//** Default text color of a linked label
-// $label-link-hover-color:      #fff
-
-
-//== Modals
-//
-//##
-
-//** Padding applied to the modal body
-// $modal-inner-padding:         15px
-
-//** Padding applied to the modal title
-// $modal-title-padding:         15px
-//** Modal title line-height
-// $modal-title-line-height:     $line-height-base
-
-//** Background color of modal content area
-// $modal-content-bg:                             #fff
-//** Modal content border color
-// $modal-content-border-color:                   rgba(0,0,0,.2)
-//** Modal content border color **for IE8**
-// $modal-content-fallback-border-color:          #999
-
-//** Modal backdrop background color
-// $modal-backdrop-bg:           #000
-//** Modal backdrop opacity
-// $modal-backdrop-opacity:      .5
-//** Modal header border color
-// $modal-header-border-color:   #e5e5e5
-//** Modal footer border color
-// $modal-footer-border-color:   $modal-header-border-color
-
-// $modal-lg:                    900px
-// $modal-md:                    600px
-// $modal-sm:                    300px
-
-
 //== Alerts
 //
 //## Define alert colors, border radius, and padding.
 
-// $alert-padding:               15px
 $alert-border-radius:            0;
-// $alert-link-font-weight:      bold
-
-// $alert-success-bg:            $state-success-bg
-// $alert-success-text:          $state-success-text
-// $alert-success-border:        $state-success-border
-
-// $alert-info-bg:               $state-info-bg
-// $alert-info-text:             $state-info-text
-// $alert-info-border:           $state-info-border
-
-// $alert-warning-bg:            $state-warning-bg
-// $alert-warning-text:          $state-warning-text
-// $alert-warning-border:        $state-warning-border
-
-// $alert-danger-bg:             $state-danger-bg
-// $alert-danger-text:           $state-danger-text
-// $alert-danger-border:         $state-danger-border
-
-
-//== Progress bars
-//
-//##
-
-//** Background color of the whole progress component
-// $progress-bg:                 #f5f5f5
-//** Progress bar text color
-// $progress-bar-color:          #fff
-//** Variable for setting rounded corners on progress bar.
-// $progress-border-radius:      $border-radius-base
-
-//** Default progress bar color
-// $progress-bar-bg:             $brand-primary
-//** Success progress bar color
-// $progress-bar-success-bg:     $brand-success
-//** Warning progress bar color
-// $progress-bar-warning-bg:     $brand-warning
-//** Danger progress bar color
-// $progress-bar-danger-bg:      $brand-danger
-//** Info progress bar color
-// $progress-bar-info-bg:        $brand-info
-
-
-//== List group
-//
-//##
-
-//** Background color on `.list-group-item`
-// $list-group-bg:                 #fff
-//** `.list-group-item` border color
-// $list-group-border:             #ddd
-//** List group border radius
-// $list-group-border-radius:      $border-radius-base
-
-//** Background color of single list items on hover
-// $list-group-hover-bg:           #f5f5f5
-//** Text color of active list items
-// $list-group-active-color:       $component-active-color
-//** Background color of active list items
-// $list-group-active-bg:          $component-active-bg
-//** Border color of active list elements
-// $list-group-active-border:      $list-group-active-bg
-//** Text color for content within active list items
-// $list-group-active-text-color:  lighten($list-group-active-bg, 40%)
-
-//** Text color of disabled list items
-// $list-group-disabled-color:      $gray-light
-//** Background color of disabled list items
-// $list-group-disabled-bg:         $gray-lighter
-//** Text color for content within disabled list items
-// $list-group-disabled-text-color: $list-group-disabled-color
-
-// $list-group-link-color:         #555
-// $list-group-link-hover-color:   $list-group-link-color
-// $list-group-link-heading-color: #333
 
 
 //== Panels
 //
 //##
 
-// $panel-bg:                    #fff
-// $panel-body-padding:          15px
-// $panel-heading-padding:       10px 15px
-// $panel-footer-padding:        $panel-heading-padding
 $panel-border-radius:            0;
-
-//** Border color for elements within panels
-// $panel-inner-border:          #ddd
-// $panel-footer-bg:             #f5f5f5
-
 $panel-default-text:          $text-color;
 $panel-default-border:        $border-color;
 $panel-default-heading-bg:    $background-color;
 
-// $panel-primary-text:          #fff
-// $panel-primary-border:        $brand-primary
-// $panel-primary-heading-bg:    $brand-primary
-
-// $panel-success-text:          $state-success-text
-// $panel-success-border:        $state-success-border
-// $panel-success-heading-bg:    $state-success-bg
-
-// $panel-info-text:             $state-info-text
-// $panel-info-border:           $state-info-border
-// $panel-info-heading-bg:       $state-info-bg
-
-// $panel-warning-text:          $state-warning-text
-// $panel-warning-border:        $state-warning-border
-// $panel-warning-heading-bg:    $state-warning-bg
-
-// $panel-danger-text:           $state-danger-text
-// $panel-danger-border:         $state-danger-border
-// $panel-danger-heading-bg:     $state-danger-bg
-
-
-//== Thumbnails
-//
-//##
-
-//** Padding around the thumbnail image
-// $thumbnail-padding:           4px
-//** Thumbnail background color
-// $thumbnail-bg:                $body-bg
-//** Thumbnail border color
-// $thumbnail-border:            #ddd
-//** Thumbnail border radius
-// $thumbnail-border-radius:     $border-radius-base
-
-//** Custom text color for thumbnail captions
-// $thumbnail-caption-color:     $text-color
-//** Padding around the thumbnail caption
-// $thumbnail-caption-padding:   9px
-
-
-//== Wells
-//
-//##
-
-$well-bg:                     $gray-lighter;
-$well-border:                 transparent;
-
-
-//== Badges
-//
-//##
-
-// $badge-color:                 #fff
-//** Linked badge text color on hover
-// $badge-link-hover-color:      #fff
-// $badge-bg:                    $gray-light
-
-//** Badge text color in active nav link
-// $badge-active-color:          $link-color
-//** Badge background color in active nav link
-// $badge-active-bg:             #fff
-
-// $badge-font-weight:           bold
-// $badge-line-height:           1
-// $badge-border-radius:         10px
-
-
-//== Breadcrumbs
-//
-//##
-
-// $breadcrumb-padding-vertical:   8px
-// $breadcrumb-padding-horizontal: 15px
-//** Breadcrumb background color
-// $breadcrumb-bg:                 #f5f5f5
-//** Breadcrumb text color
-// $breadcrumb-color:              #ccc
-//** Text color of current page in the breadcrumb
-// $breadcrumb-active-color:       $gray-light
-//** Textual separator for between breadcrumb elements
-// $breadcrumb-separator:          "/"
-
-
-//== Carousel
-//
-//##
-
-// $carousel-text-shadow:                        0 1px 2px rgba(0,0,0,.6)
-
-// $carousel-control-color:                      #fff
-// $carousel-control-width:                      15%
-// $carousel-control-opacity:                    .5
-// $carousel-control-font-size:                  20px
-
-// $carousel-indicator-active-bg:                #fff
-// $carousel-indicator-border-color:             #fff
-
-// $carousel-caption-color:                      #fff
-
-
-//== Close
-//
-//##
-
-// $close-font-weight:           bold
-// $close-color:                 #000
-// $close-text-shadow:           0 1px 0 #fff
 
 
 //== Code
@@ -837,34 +125,3 @@ $code-bg:                     #f9f2f4;
 
 $kbd-color:                   #fff;
 $kbd-bg:                      #333;
-
-$pre-bg:                      $gray-lighter;
-$pre-color:                   $text-color;
-$pre-border-color:            #ccc;
-// $pre-scrollable-max-height:   340px
-
-
-//== Type
-//
-//##
-
-//** Horizontal offset for forms and lists.
-// $component-offset-horizontal: 180px
-//** Text muted color
-// $text-muted:                  $gray-light
-//** Abbreviations and acronyms border color
-// $abbr-border-color:           $gray-light
-//** Headings small color
-$headings-small-color:        $gray-dark;
-//** Blockquote small color
-// $blockquote-small-color:      $gray-light
-//** Blockquote font size
-// $blockquote-font-size:        ($font-size-base * 1.25)
-//** Blockquote border color
-// $blockquote-border-color:     $gray-lighter
-//** Page header border color
-// $page-header-border-color:    $gray-lighter
-//** Width of horizontal description list titles
-// $dl-horizontal-offset:        $component-offset-horizontal
-//** Horizontal line color.
-// $hr-border:                   $gray-lighter
diff --git a/app/assets/stylesheets/base/variables.scss b/app/assets/stylesheets/base/variables.scss
index 4e2c64aa132..596376c3970 100644
--- a/app/assets/stylesheets/base/variables.scss
+++ b/app/assets/stylesheets/base/variables.scss
@@ -1,5 +1,6 @@
 $style_color: #474D57;
 $hover: #FFF3EB;
+$gl-text-color: #222222;
 $gl-link-color: #446e9b;
 $nprogress-color: #c0392b;
 $gl-font-size: 14px;
@@ -8,23 +9,18 @@ $sidebar_width: 230px;
 $avatar_radius: 50%;
 $code_font_size: 13px;
 $code_line_height: 1.5;
-$border-color: #dce4ec;
-$background-color: #ECF0F1;
+$border-color: #E5E5E5;
+$background-color: #f5f5f5;
 
 /*
  * State colors:
  */
-$gl-success: #019875;
-$gl-danger: #d9534f;
 $gl-primary: #446e9b;
+$gl-success: #019875;
 $gl-info: #029ACF;
 $gl-warning: #EB9532;
+$gl-danger: #d9534f;
 
-$gl-primary:         #2C3E50;
-$gl-success:         #18BC9C;
-$gl-info:            #3498DB;
-$gl-warning:         #F39C12;
-$gl-danger:          #E74C3C;
 /*
  * Commit Diff Colors
  */
diff --git a/app/assets/stylesheets/generic/forms.scss b/app/assets/stylesheets/generic/forms.scss
index 19bc11086e9..31fe5a03f37 100644
--- a/app/assets/stylesheets/generic/forms.scss
+++ b/app/assets/stylesheets/generic/forms.scss
@@ -29,8 +29,8 @@ fieldset legend {
   padding: 17px 20px 18px;
   margin-top: 18px;
   margin-bottom: 18px;
-  background-color: #ecf0f1;
-  border-top: 1px solid #e5e5e5;
+  background-color: $background-color;
+  border-top: 1px solid $border-color;
 }
 
 @media (min-width: $screen-sm-min) {
diff --git a/app/assets/stylesheets/generic/lists.scss b/app/assets/stylesheets/generic/lists.scss
index 85176fec0dc..08bf6e943d2 100644
--- a/app/assets/stylesheets/generic/lists.scss
+++ b/app/assets/stylesheets/generic/lists.scss
@@ -61,7 +61,7 @@
     p {
       padding-top: 1px;
       margin: 0;
-      color: #222;
+      color: $gray-dark;
       img {
         position: relative;
         top: 3px;
@@ -74,7 +74,7 @@
     }
 
     .row_title {
-      color: $text-color;
+      color: $gray-dark;
 
       &:hover {
         color: $text-color;
diff --git a/app/assets/stylesheets/generic/nav_sidebar.scss b/app/assets/stylesheets/generic/nav_sidebar.scss
index bb890171985..3bcb7b81333 100644
--- a/app/assets/stylesheets/generic/nav_sidebar.scss
+++ b/app/assets/stylesheets/generic/nav_sidebar.scss
@@ -58,8 +58,6 @@
 }
 
 .nav-sidebar li {
-  text-shadow: 0 1px 1px $border-color;
-
   &.separate-item {
     border-top: 1px solid $border-color;
     padding-top: 10px;
@@ -67,7 +65,7 @@
   }
 
   a {
-    color: #3b5a5b;
+    color: $gray;
     display: block;
     text-decoration: none;
     padding: 8px 15px;
@@ -78,7 +76,7 @@
     &:hover {
       text-decoration: none;
       color: $text-color;
-      background: #f2f6f7;
+      background: $border-color;
     }
 
     &:active, &:focus {
@@ -87,7 +85,7 @@
 
     i {
       width: 20px;
-      color: $gray-dark;
+      color: $gray-light;
       margin-right: 23px;
     }
   }
diff --git a/app/assets/stylesheets/generic/timeline.scss b/app/assets/stylesheets/generic/timeline.scss
index f92a79f7a5f..97831eb7c27 100644
--- a/app/assets/stylesheets/generic/timeline.scss
+++ b/app/assets/stylesheets/generic/timeline.scss
@@ -54,7 +54,7 @@
 
       .timeline-content {
         position: relative;
-        background: #f5f5f6;
+        background: $background-color;
         padding: 10px 15px;
         margin-left: 60px;
 
@@ -70,7 +70,7 @@
           height: 0;
           border-style: solid;
           border-width: 9px 9px 9px 0;
-          border-color: transparent #f5f5f6 transparent transparent;
+          border-color: transparent $background-color transparent transparent;
           left: 0;
           top: 10px;
           margin-left: -9px;
-- 
GitLab


From d71e2318f94f53c5ab924c1b9dcf603e28770dea Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets 
Date: Tue, 17 Mar 2015 18:11:27 -0700
Subject: [PATCH 06/39] Fix scroll for last push widget

---
 app/assets/stylesheets/pages/events.scss | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/assets/stylesheets/pages/events.scss b/app/assets/stylesheets/pages/events.scss
index 480cc2c50a9..83daea10ed5 100644
--- a/app/assets/stylesheets/pages/events.scss
+++ b/app/assets/stylesheets/pages/events.scss
@@ -154,10 +154,12 @@
   overflow: auto;
   .event-last-push-text {
     @include str-truncated(100%);
+    padding: 5px 0;
+    font-size: 13px;
     float:left;
     margin-right: -150px;
     padding-right: 150px;
-    line-height: 24px;
+    line-height: 20px;
   }
 }
 
-- 
GitLab


From 245f03cd6102e64998799f843843f593d48c0e54 Mon Sep 17 00:00:00 2001
From: Marin Jankovski 
Date: Wed, 18 Mar 2015 08:25:50 -0700
Subject: [PATCH 07/39] Fix the order of signin and signup on features page.

---
 app/views/admin/application_settings/_form.html.haml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index 781600a3766..edfcccfcf4c 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -12,13 +12,13 @@
         .checkbox
           = f.label :signup_enabled do
             = f.check_box :signup_enabled
-            Signin enabled
+            Signup enabled
     .form-group
       .col-sm-offset-2.col-sm-10
         .checkbox
           = f.label :signin_enabled do
             = f.check_box :signin_enabled
-            Signup enabled
+            Signin enabled
     .form-group
       .col-sm-offset-2.col-sm-10
         .checkbox
-- 
GitLab


From c0524574c8d2c94fd50499b754f8aaa70e2dde4c Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets 
Date: Wed, 18 Mar 2015 10:25:22 -0700
Subject: [PATCH 08/39] Bump gitlab_git to 7.1.2

---
 Gemfile      | 2 +-
 Gemfile.lock | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Gemfile b/Gemfile
index 9dd75455c87..08bcd85f53e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -39,7 +39,7 @@ gem "browser"
 
 # Extracting information from a git repository
 # Provide access to Gitlab::Git library
-gem "gitlab_git", '~> 7.1.0'
+gem "gitlab_git", '~> 7.1.2'
 
 # Ruby/Rack Git Smart-HTTP Server Handler
 gem 'gitlab-grack', '~> 2.0.0.rc2', require: 'grack'
diff --git a/Gemfile.lock b/Gemfile.lock
index d6e66707c8a..1bea70d5a0c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -213,7 +213,7 @@ GEM
       mime-types (~> 1.19)
     gitlab_emoji (0.1.0)
       gemojione (~> 2.0)
-    gitlab_git (7.1.1)
+    gitlab_git (7.1.2)
       activesupport (~> 4.0)
       charlock_holmes (~> 0.6)
       gitlab-linguist (~> 3.0)
@@ -705,7 +705,7 @@ DEPENDENCIES
   gitlab-grack (~> 2.0.0.rc2)
   gitlab-linguist (~> 3.0.1)
   gitlab_emoji (~> 0.1)
-  gitlab_git (~> 7.1.0)
+  gitlab_git (~> 7.1.2)
   gitlab_meta (= 7.0)
   gitlab_omniauth-ldap (= 1.2.0)
   gollum-lib (~> 4.0.0)
-- 
GitLab


From 33d5a60571267ffa33fcb3e19f03f977e1a3f9c8 Mon Sep 17 00:00:00 2001
From: Vinnie Okada 
Date: Wed, 18 Mar 2015 12:38:58 -0600
Subject: [PATCH 09/39] Handle nil restricted visibility settings

Return `true` from `non_restricted_level?` when the
`restricted_visibility_levels` setting is nil.
---
 lib/gitlab/visibility_level.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index 1851e76067c..e4306bd2a56 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -35,7 +35,11 @@ module Gitlab
       end
 
       def non_restricted_level?(level)
-        ! current_application_settings.restricted_visibility_levels.include?(level)
+        if current_application_settings.restricted_visibility_levels.nil?
+          true
+        else
+          ! current_application_settings.restricted_visibility_levels.include?(level)
+        end
       end
 
       def valid_level?(level)
-- 
GitLab


From 09657f1071571ca6a2ef7dd844e3e930dcb4a27e Mon Sep 17 00:00:00 2001
From: Marin Jankovski 
Date: Wed, 18 Mar 2015 13:55:41 -0700
Subject: [PATCH 10/39] Move application setting to separate variable.

---
 lib/gitlab/visibility_level.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index e4306bd2a56..582fc759efd 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -35,10 +35,12 @@ module Gitlab
       end
 
       def non_restricted_level?(level)
-        if current_application_settings.restricted_visibility_levels.nil?
+        restricted_levels = current_application_settings.restricted_visibility_levels
+
+        if restricted_levels.nil?
           true
         else
-          ! current_application_settings.restricted_visibility_levels.include?(level)
+          !restricted_levels.include?(level)
         end
       end
 
-- 
GitLab


From 8b17fcb89715007e6877f676225fcce3bd909c83 Mon Sep 17 00:00:00 2001
From: Douwe Maan 
Date: Wed, 18 Mar 2015 16:37:29 +0100
Subject: [PATCH 11/39] Fix condensed range in MR push comment.

---
 app/models/note.rb                             | 8 ++++++--
 app/services/merge_requests/refresh_service.rb | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/app/models/note.rb b/app/models/note.rb
index 9ca3e4d7e97..649e9b4e852 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -151,7 +151,7 @@ class Note < ActiveRecord::Base
       )
     end
 
-    def create_new_commits_note(merge_request, project, author, new_commits, existing_commits = [])
+    def create_new_commits_note(merge_request, project, author, new_commits, existing_commits = [], oldrev = nil)
       total_count = new_commits.length + existing_commits.length
       commits_text = ActionController::Base.helpers.pluralize(total_count, 'commit')
       body = "Added #{commits_text}:\n\n"
@@ -161,7 +161,11 @@ class Note < ActiveRecord::Base
           if existing_commits.length == 1
             existing_commits.first.short_id
           else
-            "#{existing_commits.first.short_id}..#{existing_commits.last.short_id}"
+            if oldrev
+              "#{Commit.truncate_sha(oldrev)}...#{existing_commits.last.short_id}"
+            else
+              "#{existing_commits.first.short_id}..#{existing_commits.last.short_id}"
+            end
           end
 
         commits_text = ActionController::Base.helpers.pluralize(existing_commits.length, 'commit')
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb
index cab8a1e880e..7eef2c2d6a5 100644
--- a/app/services/merge_requests/refresh_service.rb
+++ b/app/services/merge_requests/refresh_service.rb
@@ -89,7 +89,7 @@ module MergeRequests
         end
 
         Note.create_new_commits_note(merge_request, merge_request.project,
-                                     @current_user, new_commits, existing_commits)
+                                     @current_user, new_commits, existing_commits, @oldrev)
       end
     end
 
-- 
GitLab


From e716e4377f65443bb0eb779f17b4206f01add3a4 Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets 
Date: Wed, 18 Mar 2015 14:23:06 -0700
Subject: [PATCH 12/39] Version 7.9.0.rc2

---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index 03d55a5a014..fa86dc427f2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-7.9.0.rc1
\ No newline at end of file
+7.9.0.rc2
\ No newline at end of file
-- 
GitLab


From 1667861ed2987bc3156af33700c48609b61546c8 Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets 
Date: Wed, 18 Mar 2015 17:42:53 -0700
Subject: [PATCH 13/39] Fix link to project from fork

---
 app/views/projects/show.html.haml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index 74b07395650..28a8a9f3b67 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -44,7 +44,7 @@
               %i.fa.fa-code-fork.project-fork-icon
               Forked from:
               %br
-              = link_to @project.forked_from_project.name_with_namespace, namespace_project_path(@project.namespace, @project.forked_from_project)
+              = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
 
           - unless @project.empty_repo?
             = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-block' do
-- 
GitLab


From d793de7ad7c9f9a585e5938bb153ed30c22ea985 Mon Sep 17 00:00:00 2001
From: Marin Jankovski 
Date: Wed, 18 Mar 2015 23:32:57 -0700
Subject: [PATCH 14/39] Commits in push data should always be an array.

---
 lib/gitlab/push_data_builder.rb | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/lib/gitlab/push_data_builder.rb b/lib/gitlab/push_data_builder.rb
index ea9012b8844..1e35f67ca0f 100644
--- a/lib/gitlab/push_data_builder.rb
+++ b/lib/gitlab/push_data_builder.rb
@@ -28,6 +28,12 @@ module Gitlab
         # Get latest 20 commits ASC
         commits_limited = commits.last(20)
 
+        # For performance purposes maximum 20 latest commits
+        # will be passed as post receive hook data.
+        commit_attrs = commits_limited.map do |commit|
+          commit.hook_attrs(project)
+        end
+
         type = Gitlab::Git.tag_ref?(ref) ? "tag_push" : "push"
         # Hash to be passed as post_receive_data
         data = {
@@ -49,17 +55,10 @@ module Gitlab
             git_ssh_url: project.ssh_url_to_repo,
             visibility_level: project.visibility_level
           },
-          commits: [],
+          commits: commit_attrs,
           total_commits_count: commits_count
         }
 
-        # For performance purposes maximum 20 latest commits
-        # will be passed as post receive hook data.
-        commits_limited.each do |commit|
-          data[:commits] << commit.hook_attrs(project)
-        end
-
-        data[:commits] = "" if data[:commits].count == 0
         data
       end
 
-- 
GitLab


From 1ea6b05e87bacfca0d1cbaf0c9db1833258d64c3 Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets 
Date: Thu, 19 Mar 2015 15:54:53 +0000
Subject: [PATCH 15/39] Merge branch 'rake_backup' into 'master'

Backup repo with tar instead of git bundle

Fixes gitlab/gitlab-ee#246

See merge request !1723
---
 CHANGELOG                | 1 +
 lib/backup/repository.rb | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 27b930d23a6..16f625e2480 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -77,6 +77,7 @@ v 7.9.0 (unreleased)
   - Ability to unsubscribe/subscribe to issue or merge request
   - Delete deploy key when last connection to a project is destroyed.
   - Fix invalid Atom feeds when using emoji, horizontal rules, or images (Christian Walther)
+  - Backup of repositories with tar instead of git bundle (only now are git-annex files included in the backup)
 
 v 7.8.4
   - Fix issue_tracker_id substitution in custom issue trackers
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb
index e18bc804437..dfb2da9f84e 100644
--- a/lib/backup/repository.rb
+++ b/lib/backup/repository.rb
@@ -16,7 +16,7 @@ module Backup
         if project.empty_repo?
           $progress.puts "[SKIPPED]".cyan
         else
-          cmd = %W(git --git-dir=#{path_to_repo(project)} bundle create #{path_to_bundle(project)} --all)
+          cmd = %W(tar -cf #{path_to_bundle(project)} -C #{path_to_repo(project)} .)
           output, status = Gitlab::Popen.popen(cmd)
           if status.zero?
             $progress.puts "[DONE]".green
@@ -64,7 +64,8 @@ module Backup
         project.namespace.ensure_dir_exist if project.namespace
 
         if File.exists?(path_to_bundle(project))
-          cmd = %W(git clone --bare #{path_to_bundle(project)} #{path_to_repo(project)})
+          FileUtils.mkdir_p(path_to_repo(project))
+          cmd = %W(tar -xf #{path_to_bundle(project)} -C #{path_to_repo(project)})
         else
           cmd = %W(git init --bare #{path_to_repo(project)})
         end
-- 
GitLab


From ab83fb992b70b29d92f7605d4ed66c042b56dfee Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets 
Date: Thu, 19 Mar 2015 17:21:20 +0000
Subject: [PATCH 16/39] Merge branch 'add_canceled_ci_status' into 'master'

Add canceled CI status

Fixes https://github.com/gitlabhq/gitlab-ci/issues/564

https://dev.gitlab.org/gitlab/gitlab-ci/issues/169

![Screen_Shot_2015-03-19_at_17.10.08](https://dev.gitlab.org/gitlab/gitlabhq/uploads/87f47d9fd1b1a60e0c5402eedd1a1566/Screen_Shot_2015-03-19_at_17.10.08.png)

See merge request !1729
---
 CHANGELOG                                               | 1 +
 app/assets/javascripts/merge_request.js.coffee          | 2 +-
 app/assets/stylesheets/pages/merge_requests.scss        | 6 ++++++
 app/views/projects/merge_requests/show/_mr_ci.html.haml | 6 ++++++
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 16f625e2480..543c382a8e7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -78,6 +78,7 @@ v 7.9.0 (unreleased)
   - Delete deploy key when last connection to a project is destroyed.
   - Fix invalid Atom feeds when using emoji, horizontal rules, or images (Christian Walther)
   - Backup of repositories with tar instead of git bundle (only now are git-annex files included in the backup)
+  - Add canceled status for CI
 
 v 7.8.4
   - Fix issue_tracker_id substitution in custom issue trackers
diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee
index 1fee9dc1892..10462ac073d 100644
--- a/app/assets/javascripts/merge_request.js.coffee
+++ b/app/assets/javascripts/merge_request.js.coffee
@@ -110,7 +110,7 @@ class @MergeRequest
 
   showCiState: (state) ->
     $('.ci_widget').hide()
-    allowed_states = ["failed", "running", "pending", "success"]
+    allowed_states = ["failed", "canceled", "running", "pending", "success"]
     if state in allowed_states
       $('.ci_widget.ci-' + state).show()
     else
diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss
index fe5667a587f..592b0b729f3 100644
--- a/app/assets/stylesheets/pages/merge_requests.scss
+++ b/app/assets/stylesheets/pages/merge_requests.scss
@@ -155,6 +155,12 @@
       background-color: #FAF1F1;
     }
 
+    &.ci-canceled {
+      color: $gl-warning;
+      border-color: $gl-danger;
+      background-color: #FAF5F1;
+    }
+
     &.ci-error {
       color: $gl-danger;
       border-color: $gl-danger;
diff --git a/app/views/projects/merge_requests/show/_mr_ci.html.haml b/app/views/projects/merge_requests/show/_mr_ci.html.haml
index 85a7103f3bc..ffa3f7b0e36 100644
--- a/app/views/projects/merge_requests/show/_mr_ci.html.haml
+++ b/app/views/projects/merge_requests/show/_mr_ci.html.haml
@@ -23,6 +23,12 @@
     %i.fa.fa-spinner
     Checking for CI status for #{@merge_request.last_commit_short_sha}
 
+  .ci_widget.ci-canceled{style: "display:none"}
+    %i.fa.fa-times
+    %span CI build canceled
+    for #{@merge_request.last_commit_short_sha}.
+    = link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
+
   .ci_widget.ci-error{style: "display:none"}
     %i.fa.fa-times
     %span Cannot connect to the CI server. Please check your settings and try again.
-- 
GitLab


From 68dcfabfe60c76e26bcfc29a317368eab2f02aa5 Mon Sep 17 00:00:00 2001
From: Marin Jankovski 
Date: Thu, 19 Mar 2015 12:38:24 -0700
Subject: [PATCH 17/39] Version 7.9.0.rc3

---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index fa86dc427f2..86cd47608be 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-7.9.0.rc2
\ No newline at end of file
+7.9.0.rc3
\ No newline at end of file
-- 
GitLab


From ec746368f1554ccc3f1040b331b660e188cec59f Mon Sep 17 00:00:00 2001
From: Marin Jankovski 
Date: Thu, 19 Mar 2015 17:43:21 -0700
Subject: [PATCH 18/39] Remove mention of branch to commit to.

---
 app/views/projects/_commit_button.html.haml | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/app/views/projects/_commit_button.html.haml b/app/views/projects/_commit_button.html.haml
index fd8320adb8d..35f7e7bb34b 100644
--- a/app/views/projects/_commit_button.html.haml
+++ b/app/views/projects/_commit_button.html.haml
@@ -2,8 +2,5 @@
   .commit-button-annotation
     = button_tag 'Commit Changes',
                  class: 'btn commit-btn js-commit-button btn-create'
-    .message
-      to branch
-      %strong= ref
   = link_to 'Cancel', cancel_path,
             class: 'btn btn-cancel', data: {confirm: leave_edit_message}
-- 
GitLab


From 5909e5f6b2615642e92be366649ea375c399919d Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets 
Date: Thu, 19 Mar 2015 17:57:37 -0700
Subject: [PATCH 19/39] Revert "Increase timeout for Git-over-HTTP requests."

This reverts commit 516bcabbf42d60db2ac989dce4c7187b2a1e5de9.

Conflicts:
	Gemfile
---
 Gemfile                          |  3 ---
 Gemfile.lock                     |  8 --------
 config/initializers/timeout.rb   |  8 --------
 config/unicorn.rb.example        | 20 ++++++++++++++++----
 lib/gitlab/middleware/timeout.rb | 13 -------------
 public/503.html                  | 13 -------------
 6 files changed, 16 insertions(+), 49 deletions(-)
 delete mode 100644 config/initializers/timeout.rb
 delete mode 100644 lib/gitlab/middleware/timeout.rb
 delete mode 100644 public/503.html

diff --git a/Gemfile b/Gemfile
index 08bcd85f53e..f697f09b542 100644
--- a/Gemfile
+++ b/Gemfile
@@ -180,9 +180,6 @@ gem 'mousetrap-rails'
 # Detect and convert string character encoding
 gem 'charlock_holmes'
 
-# Shutting down requests that take too long
-gem "slowpoke"
-
 gem "sass-rails", '~> 4.0.2'
 gem "coffee-rails"
 gem "uglifier"
diff --git a/Gemfile.lock b/Gemfile.lock
index 1bea70d5a0c..3fd051e29b5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -147,7 +147,6 @@ GEM
     enumerize (0.7.0)
       activesupport (>= 3.2)
     equalizer (0.0.8)
-    errbase (0.0.2)
     erubis (2.7.0)
     escape_utils (0.2.4)
     eventmachine (1.0.4)
@@ -429,7 +428,6 @@ GEM
       rack
     rack-test (0.6.3)
       rack (>= 1.0)
-    rack-timeout (0.2.0)
     rails (4.1.9)
       actionmailer (= 4.1.9)
       actionpack (= 4.1.9)
@@ -482,8 +480,6 @@ GEM
     rest-client (1.6.7)
       mime-types (>= 1.16)
     rinku (1.7.3)
-    robustly (0.0.3)
-      errbase
     rouge (1.7.4)
     rspec (2.99.0)
       rspec-core (~> 2.99.0)
@@ -566,9 +562,6 @@ GEM
       temple (~> 0.6.6)
       tilt (>= 1.3.3, < 2.1)
     slop (3.6.0)
-    slowpoke (0.0.5)
-      rack-timeout (>= 0.1.0)
-      robustly
     spinach (0.8.7)
       colorize (= 0.5.8)
       gherkin-ruby (>= 0.3.1)
@@ -776,7 +769,6 @@ DEPENDENCIES
   six
   slack-notifier (~> 1.0.0)
   slim
-  slowpoke
   spinach-rails
   spring (~> 1.3.1)
   spring-commands-rspec (= 1.0.4)
diff --git a/config/initializers/timeout.rb b/config/initializers/timeout.rb
deleted file mode 100644
index bc88595cf26..00000000000
--- a/config/initializers/timeout.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# Slowpoke extends Rack::Timeout to gracefully kill Unicorn workers so they can clean up state.
-Slowpoke.timeout = 60
-
-# The `Rack::Timeout` middleware kills requests after 60 seconds (as set above).
-# We're replacing it with our `Gitlab::Middleware::Timeout` that does the same,
-# except ignoring Git-over-HTTP requests, letting those take as long as they need.
-
-Rails.application.config.middleware.swap(Rack::Timeout, Gitlab::Middleware::Timeout)
diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example
index 3aee718097f..86a5512e761 100644
--- a/config/unicorn.rb.example
+++ b/config/unicorn.rb.example
@@ -35,10 +35,22 @@ working_directory "/home/git/gitlab" # available in 0.94.0+
 listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 1024
 listen "127.0.0.1:8080", :tcp_nopush => true
 
-# Kill workers after 1 hour.
-# A shorter timeout of 60 seconds is enforced by rack-timeout for web requests.
-# Git-over-HTTP only has the below timeout since large pulls/pushes can take a long time.
-timeout 60 * 60
+# nuke workers after 30 seconds instead of 60 seconds (the default)
+#
+# NOTICE: git push over http depends on this value.
+# If you want be able to push huge amount of data to git repository over http
+# you will have to increase this value too.
+#
+# Example of output if you try to push 1GB repo to GitLab over http.
+#   -> git push http://gitlab.... master
+#
+#   error: RPC failed; result=18, HTTP code = 200
+#   fatal: The remote end hung up unexpectedly
+#   fatal: The remote end hung up unexpectedly
+#
+# For more information see http://stackoverflow.com/a/21682112/752049
+#
+timeout 60
 
 # feel free to point this anywhere accessible on the filesystem
 pid "/home/git/gitlab/tmp/pids/unicorn.pid"
diff --git a/lib/gitlab/middleware/timeout.rb b/lib/gitlab/middleware/timeout.rb
deleted file mode 100644
index 015600392b9..00000000000
--- a/lib/gitlab/middleware/timeout.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-module Gitlab
-  module Middleware
-    class Timeout < Rack::Timeout
-      GRACK_REGEX = /[-\/\w\.]+\.git\//.freeze
-
-      def call(env)
-        return @app.call(env) if env['PATH_INFO'] =~ GRACK_REGEX
-
-        super
-      end
-    end
-  end
-end
diff --git a/public/503.html b/public/503.html
deleted file mode 100644
index efdae0f512d..00000000000
--- a/public/503.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-  Page took too long to load (503)
-  
-
-
-  

503

-

Page took too long to load.

-
-

Please contact your GitLab administrator if this problem persists.

- - -- GitLab From 86fc054e14ae6e78c6ded8a42e29f9fc45825548 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 20 Mar 2015 11:28:58 -0700 Subject: [PATCH 20/39] Fix project name overflow on dashboard --- app/assets/stylesheets/pages/dashboard.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/pages/dashboard.scss b/app/assets/stylesheets/pages/dashboard.scss index 5a543a852c2..e6d279c3517 100644 --- a/app/assets/stylesheets/pages/dashboard.scss +++ b/app/assets/stylesheets/pages/dashboard.scss @@ -28,6 +28,10 @@ font-size: 14px; line-height: 24px; + .str-truncated { + max-width: 72%; + } + a { display: block; padding: 8px 15px; -- GitLab From e494adc28446319c109bb71c1ce3a43c2f1ac3c9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 20 Mar 2015 12:34:21 -0700 Subject: [PATCH 21/39] Remove upvotes js logic since it does not work as expected anyway --- app/assets/javascripts/notes.js.coffee | 2 +- app/assets/javascripts/notes_votes.js.coffee | 20 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 app/assets/javascripts/notes_votes.js.coffee diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 90e6fd6d154..c366c98cf54 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -425,7 +425,7 @@ class @Notes @removeDiscussionNoteForm(form) updateVotes: -> - (new NotesVotes).updateVotes() + true ### Called after an attachment file has been selected. diff --git a/app/assets/javascripts/notes_votes.js.coffee b/app/assets/javascripts/notes_votes.js.coffee deleted file mode 100644 index 65c149b7886..00000000000 --- a/app/assets/javascripts/notes_votes.js.coffee +++ /dev/null @@ -1,20 +0,0 @@ -class @NotesVotes - updateVotes: -> - votes = $("#votes .votes") - notes = $("#notes-list .note .vote") - - # only update if there is a vote display - if votes.size() - upvotes = notes.filter(".upvote").size() - downvotes = notes.filter(".downvote").size() - votesCount = upvotes + downvotes - upvotesPercent = (if votesCount then (100.0 / votesCount * upvotes) else 0) - downvotesPercent = (if votesCount then (100.0 - upvotesPercent) else 0) - - # change vote bar lengths - votes.find(".bar-success").css "width", upvotesPercent + "%" - votes.find(".bar-danger").css "width", downvotesPercent + "%" - - # replace vote numbers - votes.find(".upvotes").text votes.find(".upvotes").text().replace(/\d+/, upvotes) - votes.find(".downvotes").text votes.find(".downvotes").text().replace(/\d+/, downvotes) -- GitLab From 6e4ee0df3cdf5bba2a09b77579dcc0ba24e5a521 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 20 Mar 2015 12:45:45 -0700 Subject: [PATCH 22/39] Make issue and merge request sidebar more compact * move votes block to participants * make smaller font in sidebar --- app/assets/stylesheets/pages/issuable.scss | 8 ++++- app/assets/stylesheets/pages/votes.scss | 35 ------------------- .../projects/issues/_discussion.html.haml | 12 +++---- .../projects/issues/_issue_context.html.haml | 4 +-- .../merge_requests/_discussion.html.haml | 10 +++--- app/views/votes/_votes_block.html.haml | 14 +++++--- 6 files changed, 26 insertions(+), 57 deletions(-) diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index d8d12338859..a640a4e2051 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -25,7 +25,7 @@ } .issuable-context-title { - font-size: 15px; + font-size: 14px; line-height: 1.4; margin-bottom: 5px; @@ -39,3 +39,9 @@ margin-right: 4px; } } + +.issuable-affix .context { + font-size: 13px; + + .btn { font-size: 13px; } +} diff --git a/app/assets/stylesheets/pages/votes.scss b/app/assets/stylesheets/pages/votes.scss index ba0a519dca6..dc9a7d71e8b 100644 --- a/app/assets/stylesheets/pages/votes.scss +++ b/app/assets/stylesheets/pages/votes.scss @@ -1,39 +1,4 @@ -.votes { - font-size: 13px; - line-height: 15px; - .progress { - height: 4px; - margin: 0; - .bar { - float: left; - height: 100%; - } - .bar-success { - @include linear-gradient(#62C462, #51A351); - background-color: #468847; - } - .bar-danger { - @include linear-gradient(#EE5F5B, #BD362F); - background-color: #B94A48; - } - } - .upvotes { - display: inline-block; - color: #468847; - } - .downvotes { - display: inline-block; - color: #B94A48; - } -} -.votes-block { - margin: 6px; - .downvotes { - float: right; - } -} .votes-inline { display: inline-block; margin: 0 8px; } - diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index fc3e35640dc..0d3028d50b4 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -6,11 +6,12 @@ = link_to 'Close Issue', issue_path(@issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-grouped btn-close js-note-target-close", title: "Close Issue" .row %section.col-md-9 + .votes-holder.pull-right + #votes= render 'votes/votes_block', votable: @issue .participants %span= pluralize(@issue.participants.count, 'participant') - @issue.participants.each do |participant| = link_to_member(@project, participant, name: false, size: 24) - .voting_notes#notes= render "projects/notes/notes_with_form" %aside.col-md-3 .issuable-affix @@ -20,15 +21,10 @@ %hr .context = render partial: 'issue_context', locals: { issue: @issue } - %hr - .clearfix - .votes-holder - %h6 Votes - #votes= render 'votes/votes_block', votable: @issue - if @issue.labels.any? - %hr - %h6 Labels + .issuable-context-title + %label Labels .issue-show-labels - @issue.labels.each do |label| = link_to namespace_project_issues_path(@project.namespace, @project, label_name: label.name) do diff --git a/app/views/projects/issues/_issue_context.html.haml b/app/views/projects/issues/_issue_context.html.haml index d43ce0aa293..91fe0b68371 100644 --- a/app/views/projects/issues/_issue_context.html.haml +++ b/app/views/projects/issues/_issue_context.html.haml @@ -45,5 +45,5 @@ :coffeescript $ -> new Subscription("#{toggle_subscription_namespace_project_issue_path(@issue.project.namespace, @project, @issue)}") - - \ No newline at end of file + + diff --git a/app/views/projects/merge_requests/_discussion.html.haml b/app/views/projects/merge_requests/_discussion.html.haml index 79a093dc775..eb72eaabd8b 100644 --- a/app/views/projects/merge_requests/_discussion.html.haml +++ b/app/views/projects/merge_requests/_discussion.html.haml @@ -7,6 +7,8 @@ .row %section.col-md-9 + .votes-holder.pull-right + #votes= render 'votes/votes_block', votable: @merge_request = render "projects/merge_requests/show/participants" = render "projects/notes/notes_with_form" %aside.col-md-3 @@ -17,14 +19,10 @@ %hr .context = render partial: 'projects/merge_requests/show/context', locals: { merge_request: @merge_request } - %hr - .votes-holder - %h6 Votes - #votes= render 'votes/votes_block', votable: @merge_request - if @merge_request.labels.any? - %hr - %h6 Labels + .issuable-context-title + %label Labels .merge-request-show-labels - @merge_request.labels.each do |label| = link_to namespace_project_merge_requests_path(@project.namespace, @project, label_name: label.name) do diff --git a/app/views/votes/_votes_block.html.haml b/app/views/votes/_votes_block.html.haml index 788d9065a7b..36ea6742064 100644 --- a/app/views/votes/_votes_block.html.haml +++ b/app/views/votes/_votes_block.html.haml @@ -1,6 +1,10 @@ .votes.votes-block - .progress - .progress-bar.progress-bar-success{style: "width: #{votable.upvotes_in_percent}%;"} - .progress-bar.progress-bar-danger{style: "width: #{votable.downvotes_in_percent}%;"} - .upvotes= "#{votable.upvotes} up" - .downvotes= "#{votable.downvotes} down" + .btn-group + - unless votable.upvotes.zero? + .btn.btn-sm.disabled.cgreen + %i.fa.fa-thumbs-up + = votable.upvotes + - unless votable.downvotes.zero? + .btn.btn-sm.disabled.cred + %i.fa.fa-thumbs-down + = votable.downvotes -- GitLab From d9d1dc99bcf57a2214616cb3d80144b2306f0b8f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 20 Mar 2015 13:37:37 -0700 Subject: [PATCH 23/39] Fix commits routing --- config/routes.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index e65ef30afb7..cfcc2d3c202 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -239,7 +239,7 @@ Gitlab::Application.routes.draw do resources :group_members, only: [:index, :create, :update, :destroy] do delete :leave, on: :collection end - + resource :avatar, only: [:destroy] resources :milestones, only: [:index, :show, :update] end @@ -321,7 +321,6 @@ Gitlab::Application.routes.draw do get :branches, on: :member end - resources :commits, only: [:show], constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ } resources :compare, only: [:index, :create] scope do @@ -333,6 +332,15 @@ Gitlab::Application.routes.draw do ) end + scope do + get( + '/commits/*id', + to: 'commits#show', + constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }, + as: :commits + ) + end + resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do member do -- GitLab From 7cd053b50aa347f24ffe34fe9d0e492919022e4a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 20 Mar 2015 15:33:13 -0700 Subject: [PATCH 24/39] Improve issue sidebar position --- app/assets/javascripts/issue.js.coffee | 2 +- app/assets/javascripts/merge_request.js.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/issue.js.coffee b/app/assets/javascripts/issue.js.coffee index f2753170478..bf71c144eaf 100644 --- a/app/assets/javascripts/issue.js.coffee +++ b/app/assets/javascripts/issue.js.coffee @@ -19,6 +19,6 @@ class @Issue $('.issue-details').waitForImages -> $('.issuable-affix').affix offset: top: -> - @top = $('.issue-details').outerHeight(true) + 25 + @top = ($('.issuable-affix').offset().top - 70) bottom: -> @bottom = $('.footer').outerHeight(true) diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee index 10462ac073d..09c202e42a5 100644 --- a/app/assets/javascripts/merge_request.js.coffee +++ b/app/assets/javascripts/merge_request.js.coffee @@ -23,7 +23,7 @@ class @MergeRequest $('.merge-request-details').waitForImages -> $('.issuable-affix').affix offset: top: -> - @top = $('.merge-request-details').outerHeight(true) + 91 + @top = ($('.issuable-affix').offset().top - 70) bottom: -> @bottom = $('.footer').outerHeight(true) -- GitLab From 452ffd46f3ffe8f1136b3f5abe5f000e7420db92 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 20 Mar 2015 15:34:29 -0700 Subject: [PATCH 25/39] Fix votes inline rendering --- app/views/votes/_votes_inline.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/votes/_votes_inline.html.haml b/app/views/votes/_votes_inline.html.haml index ee805474830..2cb3ae04e1a 100644 --- a/app/views/votes/_votes_inline.html.haml +++ b/app/views/votes/_votes_inline.html.haml @@ -1,9 +1,9 @@ .votes.votes-inline - unless votable.upvotes.zero? - .upvotes + %span.upvotes.cgreen + #{votable.upvotes} - unless votable.downvotes.zero? \/ - unless votable.downvotes.zero? - .downvotes + %span.downvotes.cred \- #{votable.downvotes} -- GitLab From d9415bf9c26e468ac40fb4c81ebee93c4265df1d Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Fri, 20 Mar 2015 15:54:11 -0700 Subject: [PATCH 26/39] Change the name of the key used for bitbucket importer. --- config/initializers/public_key.rb | 2 +- doc/integration/bitbucket.md | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/config/initializers/public_key.rb b/config/initializers/public_key.rb index 75d74e3625d..b70c665f80d 100644 --- a/config/initializers/public_key.rb +++ b/config/initializers/public_key.rb @@ -1,2 +1,2 @@ -path = File.expand_path("~/.ssh/id_rsa.pub") +path = File.expand_path("~/.ssh/bitbucket_isa.pub") Gitlab::BitbucketImport.public_key = File.read(path) if File.exist?(path) diff --git a/doc/integration/bitbucket.md b/doc/integration/bitbucket.md index cc6389f5aaf..d82e1f8b41b 100644 --- a/doc/integration/bitbucket.md +++ b/doc/integration/bitbucket.md @@ -2,7 +2,7 @@ Import projects from Bitbucket and login to your GitLab instance with your Bitbucket account. -To enable the Bitbucket OmniAuth provider you must register your application with Bitbucket. +To enable the Bitbucket OmniAuth provider you must register your application with Bitbucket. Bitbucket will generate an application ID and secret key for you to use. 1. Sign in to Bitbucket. @@ -19,8 +19,8 @@ Bitbucket will generate an application ID and secret key for you to use. - URL: The URL to your GitLab installation. 'https://gitlab.company.com' 1. Select "Save". -1. You should now see a Key and Secret in the list of OAuth customers. - Keep this page open as you continue configuration. +1. You should now see a Key and Secret in the list of OAuth customers. + Keep this page open as you continue configuration. 1. On your GitLab server, open the configuration file. @@ -70,13 +70,13 @@ Bitbucket will generate an application ID and secret key for you to use. 1. Restart GitLab for the changes to take effect. -On the sign in page there should now be a Bitbucket icon below the regular sign in form. -Click the icon to begin the authentication process. Bitbucket will ask the user to sign in and authorize the GitLab application. +On the sign in page there should now be a Bitbucket icon below the regular sign in form. +Click the icon to begin the authentication process. Bitbucket will ask the user to sign in and authorize the GitLab application. If everything goes well the user will be returned to GitLab and will be signed in. ## Bitbucket project import -To allow projects to be imported directly into GitLab, Bitbucket requires two extra setup steps compared to GitHub and GitLab.com. +To allow projects to be imported directly into GitLab, Bitbucket requires two extra setup steps compared to GitHub and GitLab.com. Bitbucket doesn't allow OAuth applications to clone repositories over HTTPS, and instead requires GitLab to use SSH and identify itself using your GitLab server's SSH key. @@ -95,7 +95,7 @@ To allow GitLab to connect to Bitbucket over SSH, you need to add 'bitbucket.org ```sh The authenticity of host 'bitbucket.org (207.223.240.182)' can't be established. RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40. - Are you sure you want to continue connecting (yes/no)? + Are you sure you want to continue connecting (yes/no)? ``` 1. If the fingerprint matches, type `yes` to continue connecting and have 'bitbucket.org' be added to your known hosts. @@ -104,7 +104,7 @@ To allow GitLab to connect to Bitbucket over SSH, you need to add 'bitbucket.org ### Step 2: Public key -To be able to access repositories on Bitbucket, GitLab will automatically register your public key with Bitbucket as a deploy key for the repositories to be imported. Your public key needs to be at `~/.ssh/id_rsa.pub`, which will expand to `/home/git/.ssh/id_rsa.pub` in most configurations. +To be able to access repositories on Bitbucket, GitLab will automatically register your public key with Bitbucket as a deploy key for the repositories to be imported. Your public key needs to be at `~/.ssh/bitbucket_rsa.pub`, which will expand to `/home/git/.ssh/bitbucket_rsa.pub` in most configurations. If you have that file in place, you're all set and should see the "Import projects from Bitbucket" option enabled. If you don't, do the following: @@ -114,6 +114,7 @@ If you have that file in place, you're all set and should see the "Import projec sudo -u git -H ssh-keygen ``` + When asked `Enter file in which to save the key` specify the correct path, eg. `/home/git/.ssh/bitbucket_rsa`. Make sure to use an **empty passphrase**. 2. Restart GitLab to allow it to find the new public key. -- GitLab From 3b1842f67bd0019093e7f1c01a3c8fa0de096910 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Fri, 20 Mar 2015 16:13:03 -0700 Subject: [PATCH 27/39] Fix typo. --- config/initializers/public_key.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/public_key.rb b/config/initializers/public_key.rb index b70c665f80d..e4f09a2d020 100644 --- a/config/initializers/public_key.rb +++ b/config/initializers/public_key.rb @@ -1,2 +1,2 @@ -path = File.expand_path("~/.ssh/bitbucket_isa.pub") +path = File.expand_path("~/.ssh/bitbucket_rsa.pub") Gitlab::BitbucketImport.public_key = File.read(path) if File.exist?(path) -- GitLab From 16d6f0e35b8bd3a88e3a2e2e3ae8bf98be426f85 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 20 Mar 2015 17:11:11 -0700 Subject: [PATCH 28/39] Version 7.9.0 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 86cd47608be..84c5308f033 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.9.0.rc3 \ No newline at end of file +7.9.0 \ No newline at end of file -- GitLab From 6b3cff19e953d39f2d7bcdcb474424a72d276fb6 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 23 Mar 2015 08:23:19 +0100 Subject: [PATCH 29/39] Merge pull request #8995 from MichaelAlt/patch-1 Faulty LDAP DN name escaping removed --- lib/gitlab/ldap/person.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/gitlab/ldap/person.rb b/lib/gitlab/ldap/person.rb index 3c426179375..b81f3e8e8f5 100644 --- a/lib/gitlab/ldap/person.rb +++ b/lib/gitlab/ldap/person.rb @@ -14,7 +14,6 @@ module Gitlab end def self.find_by_dn(dn, adapter) - dn = Net::LDAP::Filter.escape(dn) adapter.user('dn', dn) end -- GitLab From 325cedebe321a75594db4a97826e3742e309b37d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 23 Mar 2015 02:33:45 +0000 Subject: [PATCH 30/39] Merge branch 'fix-broken-new-project-import' into 'master' Fix OAuth2 issue importing a new project from GitHub and GitLab It appears that the GitLab OAuth2 client options were converted to strings instead of symbols when merged with the default options (i.e. `{}.merge(github_options)`). As a result, the OAuth2 defaults were being used. For example, the OAuth2 client options would have a key with `authorize_url` and `:authorize_url`, but the former was never used. As a result, the OAuth2 client would always use the wrong URL to talk to GitHub. Note that this bug should also have affected GitLab, but not Bitbucket: The OAuth client is careful to convert all keys to symbols. Closes #1268 See merge request !425 --- CHANGELOG | 28 +++++++++++++++++++ lib/gitlab/bitbucket_import/client.rb | 4 +-- lib/gitlab/github_import/client.rb | 2 +- lib/gitlab/gitlab_import/client.rb | 2 +- .../gitlab/bitbucket_import/client_spec.rb | 17 +++++++++++ spec/lib/gitlab/github_import/client_spec.rb | 16 +++++++++++ spec/lib/gitlab/gitlab_import/client_spec.rb | 16 +++++++++++ 7 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 spec/lib/gitlab/bitbucket_import/client_spec.rb create mode 100644 spec/lib/gitlab/github_import/client_spec.rb create mode 100644 spec/lib/gitlab/gitlab_import/client_spec.rb diff --git a/CHANGELOG b/CHANGELOG index 543c382a8e7..ea325d4892a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,33 @@ Please view this file on the master branch, on stable branches it's out of date. +v 7.10.0 (unreleased) + - Fix "Import projects from" button to show the correct instructions (Stan Hu) + - Fix dots in Wiki slugs causing errors (Stan Hu) + - Fix OAuth2 issue importing a new project from GitHub and GitLab (Stan Hu) + - Update poltergeist to version 1.6.0 to support PhantomJS 2.0 (Zeger-Jan van de Weg) + - Fix cross references when usernames, milestones, or project names contain underscores (Stan Hu) + - Disable reference creation for comments surrounded by code/preformatted blocks (Stan Hu) + - enable line wrapping per default and remove the checkbox to toggle it (Hannes Rosenögger) + - extend the commit calendar to show the actual commits made on a date (Hannes Rosenögger) + - Fix a link in the patch update guide + - Add a service to support external wikis (Hannes Rosenögger) + - List new commits for newly pushed branch in activity view. + - Add sidetiq gem dependency to match EE + - Add changelog, license and contribution guide links to project sidebar. + - Improve diff UI + - Fix alignment of navbar toggle button (Cody Mize) + - Identical look of selectboxes in UI + - Move "Import existing repository by URL" option to button. + - Improve error message when save profile has error. + - Passing the name of pushed ref to CI service (requires GitLab CI 7.9+) + - Add location field to user profile + - Fix print view for markdown files and wiki pages + - Improve GitLab performance when working with git repositories + - Add tag message and last commit to tag hook (Kamil Trzciński) + - Restrict permissions on backup files + - Improve oauth accounts UI in profile page + - Add ability to unlink connected accounts + v 7.9.0 (unreleased) - Add HipChat integration documentation (Stan Hu) - Update documentation for object_kind field in Webhook push and tag push Webhooks (Stan Hu) diff --git a/lib/gitlab/bitbucket_import/client.rb b/lib/gitlab/bitbucket_import/client.rb index 1e4906c9e31..5b1952b9675 100644 --- a/lib/gitlab/bitbucket_import/client.rb +++ b/lib/gitlab/bitbucket_import/client.rb @@ -62,7 +62,7 @@ module Gitlab end def find_deploy_key(project_identifier, key) - JSON.parse(api.get("/api/1.0/repositories/#{project_identifier}/deploy-keys").body).find do |deploy_key| + JSON.parse(api.get("/api/1.0/repositories/#{project_identifier}/deploy-keys").body).find do |deploy_key| deploy_key["key"].chomp == key.chomp end end @@ -92,7 +92,7 @@ module Gitlab end def bitbucket_options - OmniAuth::Strategies::Bitbucket.default_options[:client_options].dup + OmniAuth::Strategies::Bitbucket.default_options[:client_options].symbolize_keys end end end diff --git a/lib/gitlab/github_import/client.rb b/lib/gitlab/github_import/client.rb index 7fe076b333b..270cbcd9ccd 100644 --- a/lib/gitlab/github_import/client.rb +++ b/lib/gitlab/github_import/client.rb @@ -46,7 +46,7 @@ module Gitlab end def github_options - OmniAuth::Strategies::GitHub.default_options[:client_options].dup + OmniAuth::Strategies::GitHub.default_options[:client_options].symbolize_keys end end end diff --git a/lib/gitlab/gitlab_import/client.rb b/lib/gitlab/gitlab_import/client.rb index 2236439c6ce..f48ede9d067 100644 --- a/lib/gitlab/gitlab_import/client.rb +++ b/lib/gitlab/gitlab_import/client.rb @@ -71,7 +71,7 @@ module Gitlab end def gitlab_options - OmniAuth::Strategies::GitLab.default_options[:client_options].dup + OmniAuth::Strategies::GitLab.default_options[:client_options].symbolize_keys end end end diff --git a/spec/lib/gitlab/bitbucket_import/client_spec.rb b/spec/lib/gitlab/bitbucket_import/client_spec.rb new file mode 100644 index 00000000000..dd450e9967b --- /dev/null +++ b/spec/lib/gitlab/bitbucket_import/client_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe Gitlab::BitbucketImport::Client do + let(:token) { '123456' } + let(:secret) { 'secret' } + let(:client) { Gitlab::BitbucketImport::Client.new(token, secret) } + + before do + Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "bitbucket") + end + + it 'all OAuth client options are symbols' do + client.consumer.options.keys.each do |key| + expect(key).to be_kind_of(Symbol) + end + end +end diff --git a/spec/lib/gitlab/github_import/client_spec.rb b/spec/lib/gitlab/github_import/client_spec.rb new file mode 100644 index 00000000000..26618120316 --- /dev/null +++ b/spec/lib/gitlab/github_import/client_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +describe Gitlab::GithubImport::Client do + let(:token) { '123456' } + let(:client) { Gitlab::GithubImport::Client.new(token) } + + before do + Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "github") + end + + it 'all OAuth2 client options are symbols' do + client.client.options.keys.each do |key| + expect(key).to be_kind_of(Symbol) + end + end +end diff --git a/spec/lib/gitlab/gitlab_import/client_spec.rb b/spec/lib/gitlab/gitlab_import/client_spec.rb new file mode 100644 index 00000000000..c511c515474 --- /dev/null +++ b/spec/lib/gitlab/gitlab_import/client_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +describe Gitlab::GitlabImport::Client do + let(:token) { '123456' } + let(:client) { Gitlab::GitlabImport::Client.new(token) } + + before do + Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "gitlab") + end + + it 'all OAuth2 client options are symbols' do + client.client.options.keys.each do |key| + expect(key).to be_kind_of(Symbol) + end + end +end -- GitLab From cd26d79ca4531a95eb165191ec84ef86914665f4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 22 Mar 2015 22:20:20 +0000 Subject: [PATCH 31/39] Merge branch 'fix-import-from-modal' into 'master' Fix "Import projects from" button to show the correct instructions Closes #1267 See merge request !422 Conflicts: app/views/projects/new.html.haml --- app/views/projects/new.html.haml | 2 +- features/dashboard/new_project.feature | 13 ++++++++++++ features/steps/dashboard/new_project.rb | 27 +++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 features/dashboard/new_project.feature create mode 100644 features/steps/dashboard/new_project.rb diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 7fc612c0c7d..dbceec3633c 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -111,6 +111,6 @@ $ -> $('.how_to_import_link').bind 'click', (e) -> e.preventDefault() - import_modal = $(this).parent().find(".modal").show() + import_modal = $(this).next(".modal").show() $('.modal-header .close').bind 'click', -> $(".modal").hide() diff --git a/features/dashboard/new_project.feature b/features/dashboard/new_project.feature new file mode 100644 index 00000000000..431dc4ccfcb --- /dev/null +++ b/features/dashboard/new_project.feature @@ -0,0 +1,13 @@ +@dashboard +Feature: New Project +Background: + Given I sign in as a user + And I own project "Shop" + And I visit dashboard page + + @javascript + Scenario: I should see New projects page + Given I click "New project" link + Then I see "New project" page + When I click on "Import project from GitHub" + Then I see instructions on how to import from GitHub diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb new file mode 100644 index 00000000000..5e588ceb780 --- /dev/null +++ b/features/steps/dashboard/new_project.rb @@ -0,0 +1,27 @@ +class Spinach::Features::NewProject < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedProject + + step 'I click "New project" link' do + click_link "New project" + end + + step 'I see "New project" page' do + page.should have_content("Project path") + end + + step 'I click on "Import project from GitHub"' do + first('.how_to_import_link').click + end + + step 'I see instructions on how to import from GitHub' do + github_modal = first('.modal-body') + github_modal.should be_visible + github_modal.should have_content "To enable importing projects from GitHub" + + all('.modal-body').each do |element| + element.should_not be_visible unless element == github_modal + end + end +end -- GitLab From 1b23122f999980f6725ad617cde44b582b663fdc Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 23 Mar 2015 14:58:15 +0000 Subject: [PATCH 32/39] Merge branch 'fix-admin-service-template-config' into 'master' Include missing events and fix save functionality in admin service template settings form ### What does this MR do? This MR includes missing settings left out in the Admin -> Service Templates page and fixes the inability to save certain settings. ### Are there points in the code the reviewer needs to double check? No. ### Why was this MR needed? Because the service template form was broken and untested. ### What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)? #1275 Before: ![Screen_Shot_2015-03-23_at_5.53.19_AM](https://gitlab.com/stanhu/gitlab-ce/uploads/e1bff75f30a3b6ecb174d3e25c722b7e/Screen_Shot_2015-03-23_at_5.53.19_AM.png) After: ![Screen_Shot_2015-03-23_at_5.53.13_AM](https://gitlab.com/stanhu/gitlab-ce/uploads/8fada00128a3d0951b3230fefa64be92/Screen_Shot_2015-03-23_at_5.53.13_AM.png) See merge request !427 --- CHANGELOG | 1 + app/controllers/admin/services_controller.rb | 4 ++- app/views/admin/services/_form.html.haml | 13 +++++++++ features/admin/settings.feature | 7 +++++ features/steps/admin/settings.rb | 29 ++++++++++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index ea325d4892a..62fbdd25c6f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 7.10.0 (unreleased) + - Include missing events and fix save functionality in admin service template settings form (Stan Hu) - Fix "Import projects from" button to show the correct instructions (Stan Hu) - Fix dots in Wiki slugs causing errors (Stan Hu) - Fix OAuth2 issue importing a new project from GitHub and GitLab (Stan Hu) diff --git a/app/controllers/admin/services_controller.rb b/app/controllers/admin/services_controller.rb index 44a3f1379d8..76a938c5fe4 100644 --- a/app/controllers/admin/services_controller.rb +++ b/app/controllers/admin/services_controller.rb @@ -46,7 +46,9 @@ class Admin::ServicesController < Admin::ApplicationController :user_key, :device, :priority, :sound, :bamboo_url, :username, :password, :build_key, :server, :teamcity_url, :build_type, :description, :issues_url, :new_issue_url, :restrict_to_branch, - :send_from_committer_email, :disable_diffs + :send_from_committer_email, :disable_diffs, + :push_events, :tag_push_events, :note_events, :issues_events, + :merge_requests_events ]) end end diff --git a/app/views/admin/services/_form.html.haml b/app/views/admin/services/_form.html.haml index a953833b37c..18b7e8ba270 100644 --- a/app/views/admin/services/_form.html.haml +++ b/app/views/admin/services/_form.html.haml @@ -14,6 +14,11 @@ = preserve do = markdown @service.help + .form-group + = f.label :active, "Active", class: "control-label" + .col-sm-10 + = f.check_box :active + - if @service.supported_events.length > 1 .form-group = f.label :url, "Trigger", class: 'control-label' @@ -34,6 +39,14 @@ %strong Tag push events %p.light This url will be triggered when a new tag is pushed to the repository + - if @service.supported_events.include?("note") + %div + = f.check_box :note_events, class: 'pull-left' + .prepend-left-20 + = f.label :note_events, class: 'list-label' do + %strong Comments + %p.light + This url will be triggered when someone adds a comment - if @service.supported_events.include?("issue") %div = f.check_box :issues_events, class: 'pull-left' diff --git a/features/admin/settings.feature b/features/admin/settings.feature index 8fdf0575c2c..52e47307b23 100644 --- a/features/admin/settings.feature +++ b/features/admin/settings.feature @@ -7,3 +7,10 @@ Feature: Admin Settings Scenario: Change application settings When I modify settings and save form Then I should see application settings saved + + Scenario: Change Slack Service Template settings + When I click on "Service Templates" + And I click on "Slack" service + Then I check all events and submit form + And I should see service template settings saved + And I should see all checkboxes checked diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb index c2d0d2a3fa3..87d4e969ff5 100644 --- a/features/steps/admin/settings.rb +++ b/features/steps/admin/settings.rb @@ -15,4 +15,33 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps current_application_settings.home_page_url.should == 'https://about.gitlab.com/' page.should have_content 'Application settings saved successfully' end + + step 'I click on "Service Templates"' do + click_link 'Service Templates' + end + + step 'I click on "Slack" service' do + click_link 'Slack' + end + + step 'I check all events and submit form' do + page.check('Active') + page.check('Push events') + page.check('Tag push events') + page.check('Comments') + page.check('Issues events') + page.check('Merge Request events') + fill_in 'Webhook', with: "http://localhost" + click_on 'Save' + end + + step 'I should see service template settings saved' do + page.should have_content 'Application settings saved successfully' + end + + step 'I should see all checkboxes checked' do + all('input[type=checkbox]').each do |checkbox| + checkbox.should be_checked + end + end end -- GitLab From 8a61111410d539a1c9aa1719af85da49be107da5 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 23 Mar 2015 17:37:17 +0100 Subject: [PATCH 33/39] Merge pull request #9001 from vichak/master Fix #8966 Remove Milestones/Labels from project navbar when Issues disabled --- app/helpers/projects_helper.rb | 4 ++++ app/views/layouts/nav/_project.html.haml | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 2225b110651..dd0669209cf 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -146,6 +146,10 @@ module ProjectsHelper nav_tabs << feature if project.send :"#{feature}_enabled" end + if project.issues_enabled + nav_tabs << [:milestones, :labels] + end + nav_tabs.flatten end diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml index d340ab1796a..c58161c3362 100644 --- a/app/views/layouts/nav/_project.html.haml +++ b/app/views/layouts/nav/_project.html.haml @@ -44,11 +44,12 @@ %span Graphs - = nav_link(controller: :milestones) do - = link_to namespace_project_milestones_path(@project.namespace, @project), title: 'Milestones' do - %i.fa.fa-clock-o - %span - Milestones + - if project_nav_tab? :milestones + = nav_link(controller: :milestones) do + = link_to namespace_project_milestones_path(@project.namespace, @project), title: 'Milestones' do + %i.fa.fa-clock-o + %span + Milestones - if project_nav_tab? :issues = nav_link(controller: :issues) do @@ -67,11 +68,12 @@ Merge Requests %span.count.merge_counter= @project.merge_requests.opened.count - = nav_link(controller: :labels) do - = link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels' do - %i.fa.fa-tags - %span - Labels + - if project_nav_tab? :labels + = nav_link(controller: :labels) do + = link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels' do + %i.fa.fa-tags + %span + Labels - if project_nav_tab? :wiki = nav_link(controller: :wikis) do -- GitLab From b6f1f5e3b4c4dd0ab87c04cb658545942684cdb8 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 23 Mar 2015 21:21:23 +0100 Subject: [PATCH 34/39] Revert "Update gemnasium-gitlab-service gem" This reverts commit af522ede14cad4605bc7f0137ddf6950974eccce. --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3fd051e29b5..c38daf648de 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -188,7 +188,7 @@ GEM dotenv (>= 0.7) thor (>= 0.13.6) formatador (0.2.4) - gemnasium-gitlab-service (0.2.5) + gemnasium-gitlab-service (0.2.4) rugged (~> 0.21) gemojione (2.0.0) json -- GitLab From b6a5a46163c12859c60be71753055d7b9845f9bc Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 23 Mar 2015 16:47:16 +0000 Subject: [PATCH 35/39] Merge branch 'no-comment-bubble' into 'master' Don't show commit comment button when user is not signed in. Address private issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2167. See merge request !429 --- CHANGELOG | 3 +++ app/views/projects/diffs/_text_file.html.haml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 62fbdd25c6f..08bc3e9d625 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -28,6 +28,9 @@ v 7.10.0 (unreleased) - Restrict permissions on backup files - Improve oauth accounts UI in profile page - Add ability to unlink connected accounts + - Replace commits calendar with faster contribution calendar that includes issues and merge requests + - Add inifinite scroll to user page activity + - Don't show commit comment button when user is not signed in. v 7.9.0 (unreleased) - Add HipChat integration documentation (Stan Hu) diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml index b1c987563f1..e691db9c08e 100644 --- a/app/views/projects/diffs/_text_file.html.haml +++ b/app/views/projects/diffs/_text_file.html.haml @@ -16,7 +16,7 @@ - else %td.old_line = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code - - if @comments_allowed + - if @comments_allowed && can?(current_user, :write_note, @project) = link_to_new_diff_note(line_code) %td.new_line{data: {linenumber: line.new_pos}} = link_to raw(type == "old" ? " " : line.new_pos) , "##{line_code}", id: line_code -- GitLab From c91162c53eae1849bfffb479fa76868f5d11d42b Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Tue, 24 Mar 2015 15:05:30 -0700 Subject: [PATCH 36/39] Update changelog. --- CHANGELOG | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 08bc3e9d625..b782ad4c42d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,38 +1,15 @@ Please view this file on the master branch, on stable branches it's out of date. -v 7.10.0 (unreleased) +v 7.9.1 - Include missing events and fix save functionality in admin service template settings form (Stan Hu) - Fix "Import projects from" button to show the correct instructions (Stan Hu) - - Fix dots in Wiki slugs causing errors (Stan Hu) - Fix OAuth2 issue importing a new project from GitHub and GitLab (Stan Hu) - - Update poltergeist to version 1.6.0 to support PhantomJS 2.0 (Zeger-Jan van de Weg) - - Fix cross references when usernames, milestones, or project names contain underscores (Stan Hu) - - Disable reference creation for comments surrounded by code/preformatted blocks (Stan Hu) - - enable line wrapping per default and remove the checkbox to toggle it (Hannes Rosenögger) - - extend the commit calendar to show the actual commits made on a date (Hannes Rosenögger) - - Fix a link in the patch update guide - - Add a service to support external wikis (Hannes Rosenögger) - - List new commits for newly pushed branch in activity view. - - Add sidetiq gem dependency to match EE - - Add changelog, license and contribution guide links to project sidebar. - - Improve diff UI - - Fix alignment of navbar toggle button (Cody Mize) - - Identical look of selectboxes in UI - - Move "Import existing repository by URL" option to button. - - Improve error message when save profile has error. - - Passing the name of pushed ref to CI service (requires GitLab CI 7.9+) - - Add location field to user profile - - Fix print view for markdown files and wiki pages - - Improve GitLab performance when working with git repositories - - Add tag message and last commit to tag hook (Kamil Trzciński) - - Restrict permissions on backup files - - Improve oauth accounts UI in profile page - - Add ability to unlink connected accounts - - Replace commits calendar with faster contribution calendar that includes issues and merge requests - - Add inifinite scroll to user page activity + - Fix for LDAP with commas in DN + - Fix missing events and in admin Slack service template settings form (Stan Hu) - Don't show commit comment button when user is not signed in. + - Downgrade gemnasium-gitlab-service gem -v 7.9.0 (unreleased) +v 7.9.0 - Add HipChat integration documentation (Stan Hu) - Update documentation for object_kind field in Webhook push and tag push Webhooks (Stan Hu) - Fix broken email images (Hannes Rosenögger) -- GitLab From b68f9beffe8afce738eda23b1e69250fe7cd3200 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 25 Mar 2015 01:02:34 +0000 Subject: [PATCH 37/39] Merge branch 'milestone_and_labels_links' into 'master' Milestones and labels can be used even when issues are disabled. When Issues are disabled for a project Milestones and Labels can still be used for Merge Requests. See merge request !1739 --- app/helpers/projects_helper.rb | 2 +- app/views/projects/milestones/show.html.haml | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index dd0669209cf..a256f3965a3 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -146,7 +146,7 @@ module ProjectsHelper nav_tabs << feature if project.send :"#{feature}_enabled" end - if project.issues_enabled + if project.issues_enabled || project.merge_requests_enabled nav_tabs << [:milestones, :labels] end diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index 110d8967342..25cc0030965 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -60,11 +60,12 @@ Participants %span.badge= @users.count - .pull-right - = link_to new_namespace_project_issue_path(@project.namespace, @project, issue: { milestone_id: @milestone.id }), class: "btn btn-grouped", title: "New Issue" do - %i.fa.fa-plus - New Issue - = link_to 'Browse Issues', namespace_project_issues_path(@milestone.project.namespace, @milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link btn-grouped" + - if @project.issues_enabled + .pull-right + = link_to new_namespace_project_issue_path(@project.namespace, @project, issue: { milestone_id: @milestone.id }), class: "btn btn-grouped", title: "New Issue" do + %i.fa.fa-plus + New Issue + = link_to 'Browse Issues', namespace_project_issues_path(@milestone.project.namespace, @milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link btn-grouped" .tab-content .tab-pane.active#tab-issues -- GitLab From 6f6c5f18a010eb96f9e6ff98cf91e6c8a8fb6d8d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 25 Mar 2015 15:42:30 -0700 Subject: [PATCH 38/39] Version 7.9.1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 84c5308f033..ac2f3747d99 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.9.0 \ No newline at end of file +7.9.1 \ No newline at end of file -- GitLab From 20af6c43452d4b77fcf559bcb0d74c44e25b2091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20G=C3=A4rd=C3=A9n?= Date: Mon, 20 Apr 2015 14:26:47 +0200 Subject: [PATCH 39/39] Git gc as rescheduling sidekiq background job. --- CHANGELOG | 1 + Gemfile | 1 + Gemfile.lock | 6 +++++ app/services/git_gc.rb | 39 ++++++++++++++++++++++++++++ app/workers/git_gc_worker.rb | 43 +++++++++++++++++++++++++++++++ config/gitlab.yml.example | 7 +++++ config/initializers/1_settings.rb | 3 +++ config/initializers/git_gc.rb | 3 +++ 8 files changed, 103 insertions(+) create mode 100644 app/services/git_gc.rb create mode 100644 app/workers/git_gc_worker.rb create mode 100644 config/initializers/git_gc.rb diff --git a/CHANGELOG b/CHANGELOG index b782ad4c42d..4cef5b4273d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 7.9.1 + - Git gc as rescheduling sidekiq background job (Per Gärden) - Include missing events and fix save functionality in admin service template settings form (Stan Hu) - Fix "Import projects from" button to show the correct instructions (Stan Hu) - Fix OAuth2 issue importing a new project from GitHub and GitLab (Stan Hu) diff --git a/Gemfile b/Gemfile index f697f09b542..cc06b5e2e16 100644 --- a/Gemfile +++ b/Gemfile @@ -40,6 +40,7 @@ gem "browser" # Extracting information from a git repository # Provide access to Gitlab::Git library gem "gitlab_git", '~> 7.1.2' +gem 'POpen4' # Ruby/Rack Git Smart-HTTP Server Handler gem 'gitlab-grack', '~> 2.0.0.rc2', require: 'grack' diff --git a/Gemfile.lock b/Gemfile.lock index c38daf648de..f075c9f10ff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,10 @@ GEM remote: https://rubygems.org/ specs: + POpen4 (0.1.4) + Platform (>= 0.4.0) + open4 + Platform (0.4.0) RedCloth (4.2.9) ace-rails-ap (2.0.1) actionmailer (4.1.9) @@ -384,6 +388,7 @@ GEM omniauth-twitter (1.0.1) multi_json (~> 1.3) omniauth-oauth (~> 1.0) + open4 (1.3.4) org-ruby (0.9.12) rubypants (~> 0.2) orm_adapter (0.5.0) @@ -655,6 +660,7 @@ PLATFORMS ruby DEPENDENCIES + POpen4 RedCloth ace-rails-ap acts-as-taggable-on diff --git a/app/services/git_gc.rb b/app/services/git_gc.rb new file mode 100644 index 00000000000..ac5b89d922d --- /dev/null +++ b/app/services/git_gc.rb @@ -0,0 +1,39 @@ +require 'open4' + +class GitGc + + def self.cleanup + now = Time.now + log_file = "#{Rails.root}/log/git_gc.log" + File.delete(log_file) if File.exist?(log_file) + @@logger = Logger.new(log_file) + @@logger.info("Starting: git gc --auto") + repos = Dir.glob("#{Gitlab.config.gitlab_shell.repos_path}**/*.git/") + repos.each do |repo| + git_gc(repo) + r = repo.split('/') + path = r[r.count - 2] + '/' + r.last.gsub(/.git/,'') + satellite = "#{Gitlab.config.satellites.path}" + '/' + path + git_gc(satellite) if File.exists?(satellite) + end + # Next round + GitGcWorker.schedule(now + 7 * 24 * 3600 * "#{Gitlab.config.git.gc_interval_in_weeks}".to_i) + end + + private + + def self.git_gc(repo) + t0 = Time.now + `cd "#{repo}"` + pid, stdin, stdout, stderr = Open4::popen4("#{Gitlab.config.git.bin_path} gc --auto") + elapsed = (Time.now - t0).to_i + res = '' + stderr.each { |line| res << line } + if res[0] + @@logger.warn(res) + @@logger.warn("FAILED #{repo} elapsed time: #{elapsed} s") + else + @@logger.info("OK #{repo} elapsed time: #{elapsed} s") + end + end +end diff --git a/app/workers/git_gc_worker.rb b/app/workers/git_gc_worker.rb new file mode 100644 index 00000000000..7883d289cac --- /dev/null +++ b/app/workers/git_gc_worker.rb @@ -0,0 +1,43 @@ +class GitGcWorker + include Sidekiq::Worker + + def self.schedule(*args) + if !scheduled || args[0] + GitGcWorker.perform_at(args[0] || first) + end + end + + def perform + GitGc.cleanup + end + + def self.scheduled + # Sidekiq schedule stored in redis + redis = Redis.new + schedules = redis.keys.select { |k| k.to_s.include?('gitlab:schedule') } + # Only expecting one schedule for Gitlab + schedule = schedules[0] + if schedule + scheduled = redis.zrange(schedule, 0, -1).first + scheduled = scheduled && scheduled.include?('GitGcWorker') + end + scheduled + end + + private + + def self.first + now = Time.now + # Week interval in weeks + upcoming = 7 * 24 * "#{Gitlab.config.git.gc_interval_in_weeks}".to_i + # "Reset" to beginning of this day + upcoming = upcoming - now.hour + # Add or subtract to arrive at correct day + upcoming = upcoming + 24 * ("#{Gitlab.config.git.gc_day_of_week}".to_i - now.wday) + # Arrive at correct hour on correct weekday + upcoming = upcoming + "#{Gitlab.config.git.gc_hour_of_day}".to_i + # Scheduling in seconds + 3600 * upcoming + end + +end diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index a85db10e019..6f59f5421fb 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -270,6 +270,13 @@ production: &base max_size: 20971520 # 20.megabytes # Git timeout to read a commit, in seconds timeout: 10 + # Interval in weeks between garbage collections + gc_interval_in_weeks: 2 + # Day of week to run garbage collection (e.g. 6 = Sat) + gc_day_of_week: 6 + # Our of day to run garbage collection + gc_hour_of_day: 23 + # # 4. Extra customization diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 70af7a829c4..ad67c205886 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -168,6 +168,9 @@ Settings['git'] ||= Settingslogic.new({}) Settings.git['max_size'] ||= 20971520 # 20.megabytes Settings.git['bin_path'] ||= '/usr/bin/git' Settings.git['timeout'] ||= 10 +Settings.git['gc_interval_in_weeks'] ||= 2 +Settings.git['gc_day_of_week'] ||= 6 +Settings.git['gc_hour_of_day'] ||= 23 Settings['satellites'] ||= Settingslogic.new({}) Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root) diff --git a/config/initializers/git_gc.rb b/config/initializers/git_gc.rb new file mode 100644 index 00000000000..6170094bf09 --- /dev/null +++ b/config/initializers/git_gc.rb @@ -0,0 +1,3 @@ +if !$rails_rake_task + GitGcWorker.schedule +end -- GitLab