From 8026d420c9a0ffa3f6393c38487d12b3315efa73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 14 Jan 2016 17:14:20 +0100 Subject: Document new API pagination headers --- doc/api/README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/doc/api/README.md b/doc/api/README.md index c3401bcbc9d..953138cb374 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -149,7 +149,30 @@ When listing resources you can pass the following parameters: - `page` (default: `1`) - page number - `per_page` (default: `20`, max: `100`) - number of items to list per page -[Link headers](http://www.w3.org/wiki/LinkHeader) are send back with each response. These have `rel` prev/next/first/last and contain the relevant URL. Please use these instead of generating your own URLs. +### `Link` header + +[Link headers](http://www.w3.org/wiki/LinkHeader) are sent back with each response. These have `rel` prev/next/first/last and contain the relevant URL. Please use these instead of generating your own URLs. + +Example of `Link` header (line breaks added for clarity): +``` +$ curl -I -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" \ +https://gitlab.example.com/api/v3/projects/gitlab-org/gitlab-ce/issues/1/notes?per_page=1&page=2 + +Link: ; rel="prev", +; rel="next", +; rel="first", +; rel="last" +``` + +### Other pagination headers + +Additional pagination headers are also sent back: +- `X-Total`: number of items returned in this page +- `X-Total-Pages`: total number of pages of items +- `X-Per-Page`: number of items per page +- `X-Page`: index of the current page (starting at 1) +- `X-Next-Page`: index of the next page +- `X-Prev-Page`: index of the previous page ## id vs iid -- cgit v1.2.1 From c12bd5474e7c6caa9a2af4287cf25e84b47a6b74 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Sat, 16 Jan 2016 10:14:13 -0500 Subject: Search title was getting clipped horizontally. Fixed by adding height to search title css. --- app/assets/stylesheets/pages/search.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/pages/search.scss b/app/assets/stylesheets/pages/search.scss index 3aaa96da609..bdcf1897522 100644 --- a/app/assets/stylesheets/pages/search.scss +++ b/app/assets/stylesheets/pages/search.scss @@ -3,6 +3,10 @@ border-bottom: 1px solid #DDD; padding-bottom: 15px; margin-bottom: 15px; + + .term { + height: 22px; + } } } -- cgit v1.2.1 From 182cc843b02a6773b8650b4e0f2e42a099bef0bd Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Fri, 15 Jan 2016 16:04:48 +0100 Subject: Remove leading comma when user is the only one to award that emoji Fixes #9073 --- CHANGELOG | 1 + app/assets/javascripts/awards_handler.coffee | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a15bbfbc49e..15b7f6b0d6f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -58,6 +58,7 @@ v 8.4.0 (unreleased) - Import GitHub wiki into GitLab - Add reporters ability to download and browse build artifacts (Andrew Johnson) - Autofill referring url in message box when reporting user abuse. (Josh Frye) + - Remove leading comma on award emoji when the user is the first to award the emoji (Zeger-Jan van de Weg) v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) diff --git a/app/assets/javascripts/awards_handler.coffee b/app/assets/javascripts/awards_handler.coffee index 619abb1fb07..8b7e0723f6f 100644 --- a/app/assets/javascripts/awards_handler.coffee +++ b/app/assets/javascripts/awards_handler.coffee @@ -19,7 +19,7 @@ class @AwardsHandler @addAwardToEmojiBar(emoji) $(".emoji-menu").hide() - + addAwardToEmojiBar: (emoji) -> @addEmojiToFrequentlyUsedList(emoji) @@ -66,9 +66,14 @@ class @AwardsHandler addMeToAuthorList: (emoji) -> award_block = @findEmojiIcon(emoji).parent() - authors = award_block.attr("data-original-title").split(", ") + authors = _.compact(award_block.attr("data-original-title").split(", ")) authors.push("me") - award_block.attr("title", authors.join(", ")) + + if authors.length == 1 + award_block.attr("title", "me") + else + award_block.attr("title", authors.join(", ")) + @resetTooltip(award_block) resetTooltip: (award) -> @@ -78,7 +83,7 @@ class @AwardsHandler setTimeout (-> award.tooltip() ), 200 - + createEmoji: (emoji) -> emojiCssClass = @resolveNameToCssClass(emoji) -- cgit v1.2.1 From 4a76f9217a7aba54ac5e57f12d9d8b448f225557 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Mon, 18 Jan 2016 10:55:25 +0100 Subject: Clean up pagination documentation [ci skip] - Fix heading names - Fix curl example - Use full request output - Use table for the extra headers --- doc/api/README.md | 55 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/doc/api/README.md b/doc/api/README.md index 953138cb374..64169885cd4 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -149,30 +149,53 @@ When listing resources you can pass the following parameters: - `page` (default: `1`) - page number - `per_page` (default: `20`, max: `100`) - number of items to list per page -### `Link` header +### Pagination Link header -[Link headers](http://www.w3.org/wiki/LinkHeader) are sent back with each response. These have `rel` prev/next/first/last and contain the relevant URL. Please use these instead of generating your own URLs. +[Link headers](http://www.w3.org/wiki/LinkHeader) are sent back with each +response. They have `rel` set to prev/next/first/last and contain the relevant +URL. Please use these links instead of generating your own URLs. -Example of `Link` header (line breaks added for clarity): +In the cURL example below, we limit the output to 3 items per page (`per_page=3`) +and we request the second page (`page=2`) of [comments](notes.md) of the issue +with ID `8` which belongs to the project with ID `8`: + +```bash +curl -I -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/8/issues/8/notes?per_page=3&page=2 ``` -$ curl -I -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" \ -https://gitlab.example.com/api/v3/projects/gitlab-org/gitlab-ce/issues/1/notes?per_page=1&page=2 -Link: ; rel="prev", -; rel="next", -; rel="first", -; rel="last" +The response will then be: + +``` +HTTP/1.1 200 OK +Cache-Control: no-cache +Content-Length: 1103 +Content-Type: application/json +Date: Mon, 18 Jan 2016 09:43:18 GMT +Link: ; rel="prev", ; rel="next", ; rel="first", ; rel="last" +Status: 200 OK +Vary: Origin +X-Next-Page: 3 +X-Page: 2 +X-Per-Page: 3 +X-Prev-Page: 1 +X-Request-Id: 732ad4ee-9870-4866-a199-a9db0cde3c86 +X-Runtime: 0.108688 +X-Total: 8 +X-Total-Pages: 3 ``` ### Other pagination headers -Additional pagination headers are also sent back: -- `X-Total`: number of items returned in this page -- `X-Total-Pages`: total number of pages of items -- `X-Per-Page`: number of items per page -- `X-Page`: index of the current page (starting at 1) -- `X-Next-Page`: index of the next page -- `X-Prev-Page`: index of the previous page +Additional pagination headers are also sent back. + +| Header | Description | +| ------ | ----------- | +| `X-Total` | The total number of items | +| `X-Total-Pages` | The total number of pages | +| `X-Per-Page` | The number of items per page | +| `X-Page` | The index of the current page (starting at 1) | +| `X-Next-Page` | The index of the next page | +| `X-Prev-Page` | The index of the previous page | ## id vs iid -- cgit v1.2.1 From 8c4210e676c3c02b4dd506988dba090faa6f9ca3 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 18 Jan 2016 11:54:22 +0100 Subject: Added metrics instrumentation for all finders --- config/initializers/metrics.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb index 52ace27b7ae..b1fe36dc21c 100644 --- a/config/initializers/metrics.rb +++ b/config/initializers/metrics.rb @@ -55,6 +55,12 @@ if Gitlab::Metrics.enabled? config.instrument_methods(const) if const.is_a?(Module) end + + Dir[Rails.root.join('app', 'finders', '*.rb')].each do |path| + const = File.basename(path, '.rb').camelize.constantize + + config.instrument_instance_methods(const) + end end GC::Profiler.enable -- cgit v1.2.1 From 021d4ebdb8833915ee0de3c191bc7716a265b90a Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 18 Jan 2016 12:03:17 +0100 Subject: Replaced "td" with "th" in the Sherlock SQL list --- app/views/sherlock/transactions/_queries.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/sherlock/transactions/_queries.html.haml b/app/views/sherlock/transactions/_queries.html.haml index b7e0162e80d..b8d93e9ff45 100644 --- a/app/views/sherlock/transactions/_queries.html.haml +++ b/app/views/sherlock/transactions/_queries.html.haml @@ -8,7 +8,7 @@ %tr %th= t('sherlock.time') %th= t('sherlock.query') - %td + %th %tbody - @transaction.sorted_queries.each do |query| %tr -- cgit v1.2.1 From d6a8021ea11c97a8b65f8693a7afe1cb7216295b Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 18 Jan 2016 12:16:55 +0100 Subject: Scope issue projects to a Group when possible When using IssuableFinder with a Group we can greatly reduce the amount of projects operated on (due to not including all public/internal projects) by simply passing it down to the ProjectsFinder class. This reduces the timings of the involved queries from roughly 300 ms to roughly 20 ms. Fixes gitlab-org/gitlab-ce#4071, gitlab-org/gitlab-ce#3707 --- app/finders/issuable_finder.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 4d56b48e3f8..0a4192e6bac 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -81,7 +81,8 @@ class IssuableFinder elsif current_user && params[:authorized_only].presence && !current_user_related? @projects = current_user.authorized_projects.reorder(nil) else - @projects = ProjectsFinder.new.execute(current_user).reorder(nil) + @projects = ProjectsFinder.new.execute(current_user, group: group). + reorder(nil) end end -- cgit v1.2.1 From 2723dea6673b061dae2c266318727f9fd5aed8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 18 Jan 2016 12:35:30 +0100 Subject: Ensure Gravatar host looks like an actual host --- CHANGELOG | 1 + config/initializers/1_settings.rb | 22 ++++++++++++------- spec/initializers/settings_spec.rb | 44 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 spec/initializers/settings_spec.rb diff --git a/CHANGELOG b/CHANGELOG index a15bbfbc49e..e3a1bc5d9f9 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 8.4.0 (unreleased) + - Ensure Gravatar host looks like an actual host - Add pagination headers to already paginated API resources - Properly generate diff of orphan commits, like the first commit in a repository - Improve the consistency of commit titles, branch names, tag names, issue/MR titles, on their respective project pages diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index d625a909bf1..04a7c16ebde 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -9,13 +9,8 @@ class Settings < Settingslogic gitlab.port.to_i == (gitlab.https ? 443 : 80) end - # get host without www, thanks to http://stackoverflow.com/a/6674363/1233435 - def get_host_without_www(url) - url = CGI.escape(url) - uri = URI.parse(url) - uri = URI.parse("http://#{url}") if uri.scheme.nil? - host = uri.host.downcase - host.start_with?('www.') ? host[4..-1] : host + def host_without_www(url) + host(url).sub('www.', '') end def build_gitlab_ci_url @@ -87,6 +82,17 @@ class Settings < Settingslogic custom_port ] end + + # Extract the host part of the given +url+. + def host(url) + url = url.downcase + url = "http://#{url}" unless url.start_with?('http') + + # Get rid of the path so that we don't even have to encode it + url_without_path = url.sub(%r{(https?://[^\/]+)/?.*}, '\1') + + URI.parse(url_without_path).host + end end end @@ -228,7 +234,7 @@ Settings['gravatar'] ||= Settingslogic.new({}) Settings.gravatar['enabled'] = true if Settings.gravatar['enabled'].nil? Settings.gravatar['plain_url'] ||= 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon' Settings.gravatar['ssl_url'] ||= 'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon' -Settings.gravatar['host'] = Settings.get_host_without_www(Settings.gravatar['plain_url']) +Settings.gravatar['host'] = Settings.host_without_www(Settings.gravatar['plain_url']) # # Cron Jobs diff --git a/spec/initializers/settings_spec.rb b/spec/initializers/settings_spec.rb new file mode 100644 index 00000000000..e58f2c80e95 --- /dev/null +++ b/spec/initializers/settings_spec.rb @@ -0,0 +1,44 @@ +require_relative '../../config/initializers/1_settings' + +describe Settings, lib: true do + + describe '#host_without_www' do + context 'URL with protocol' do + it 'returns the host' do + expect(Settings.host_without_www('http://foo.com')).to eq 'foo.com' + expect(Settings.host_without_www('http://www.foo.com')).to eq 'foo.com' + expect(Settings.host_without_www('http://secure.foo.com')).to eq 'secure.foo.com' + expect(Settings.host_without_www('http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon')).to eq 'gravatar.com' + + expect(Settings.host_without_www('https://foo.com')).to eq 'foo.com' + expect(Settings.host_without_www('https://www.foo.com')).to eq 'foo.com' + expect(Settings.host_without_www('https://secure.foo.com')).to eq 'secure.foo.com' + expect(Settings.host_without_www('https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon')).to eq 'secure.gravatar.com' + end + end + + context 'URL without protocol' do + it 'returns the host' do + expect(Settings.host_without_www('foo.com')).to eq 'foo.com' + expect(Settings.host_without_www('www.foo.com')).to eq 'foo.com' + expect(Settings.host_without_www('secure.foo.com')).to eq 'secure.foo.com' + expect(Settings.host_without_www('www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon')).to eq 'gravatar.com' + end + + context 'URL with user/port' do + it 'returns the host' do + expect(Settings.host_without_www('bob:pass@foo.com:8080')).to eq 'foo.com' + expect(Settings.host_without_www('bob:pass@www.foo.com:8080')).to eq 'foo.com' + expect(Settings.host_without_www('bob:pass@secure.foo.com:8080')).to eq 'secure.foo.com' + expect(Settings.host_without_www('bob:pass@www.gravatar.com:8080/avatar/%{hash}?s=%{size}&d=identicon')).to eq 'gravatar.com' + + expect(Settings.host_without_www('http://bob:pass@foo.com:8080')).to eq 'foo.com' + expect(Settings.host_without_www('http://bob:pass@www.foo.com:8080')).to eq 'foo.com' + expect(Settings.host_without_www('http://bob:pass@secure.foo.com:8080')).to eq 'secure.foo.com' + expect(Settings.host_without_www('http://bob:pass@www.gravatar.com:8080/avatar/%{hash}?s=%{size}&d=identicon')).to eq 'gravatar.com' + end + end + end + end + +end -- cgit v1.2.1 From 4472c07f8149251a755138a9d2910e819bb555c4 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 18 Jan 2016 16:06:03 +0100 Subject: Use gitlab-workhorse 0.6.0 --- GITLAB_WORKHORSE_VERSION | 2 +- doc/update/8.3-to-8.4.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GITLAB_WORKHORSE_VERSION b/GITLAB_WORKHORSE_VERSION index 7d8568351b4..a918a2aa18d 100644 --- a/GITLAB_WORKHORSE_VERSION +++ b/GITLAB_WORKHORSE_VERSION @@ -1 +1 @@ -0.5.4 +0.6.0 diff --git a/doc/update/8.3-to-8.4.md b/doc/update/8.3-to-8.4.md index 1cbeab3eca3..604939cd733 100644 --- a/doc/update/8.3-to-8.4.md +++ b/doc/update/8.3-to-8.4.md @@ -48,7 +48,7 @@ which should already be on your system from GitLab 8.1. ```bash cd /home/git/gitlab-workhorse sudo -u git -H git fetch --all -sudo -u git -H git checkout 0.5.4 +sudo -u git -H git checkout 0.6.0 sudo -u git -H make ``` -- cgit v1.2.1 From 9f03ae8c91e2026c65346ab68c3cd737ab2e3c94 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 18 Jan 2016 12:38:21 -0500 Subject: Update CHANGELOG and VERSION for 8.5.0-pre --- CHANGELOG | 2 ++ VERSION | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e3a1bc5d9f9..96da0cde9e3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. +v 8.5.0 (unreleased) + v 8.4.0 (unreleased) - Ensure Gravatar host looks like an actual host - Add pagination headers to already paginated API resources diff --git a/VERSION b/VERSION index ce669730119..ffec98087cb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.4.0.pre +8.5.0-pre -- cgit v1.2.1 From 13f0ea12e3b99a59c3387aa2646a8b84220ba4a4 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 18 Jan 2016 10:18:16 +0100 Subject: Improve ux in builds artifacts browser --- .../projects/artifacts/_tree_directory.html.haml | 6 +++-- app/views/projects/artifacts/_tree_file.html.haml | 10 ++++----- app/views/projects/artifacts/browse.html.haml | 26 +++++++++++++--------- features/project/builds/artifacts.feature | 2 +- features/steps/project/builds/artifacts.rb | 4 ++-- 5 files changed, 27 insertions(+), 21 deletions(-) diff --git a/app/views/projects/artifacts/_tree_directory.html.haml b/app/views/projects/artifacts/_tree_directory.html.haml index 5b87d55efd5..e4b7979949c 100644 --- a/app/views/projects/artifacts/_tree_directory.html.haml +++ b/app/views/projects/artifacts/_tree_directory.html.haml @@ -1,7 +1,9 @@ -%tr{ class: 'tree-item' } +- path_to_directory = browse_namespace_project_build_artifacts_path(@project.namespace, @project, @build, path: directory.path) + +%tr.tree-item{ 'data-link' => path_to_directory} %td.tree-item-file-name = tree_icon('folder', '755', directory.name) %span.str-truncated - = link_to directory.name, browse_namespace_project_build_artifacts_path(@project.namespace, @project, @build, path: directory.path) + = link_to directory.name, path_to_directory %td %td diff --git a/app/views/projects/artifacts/_tree_file.html.haml b/app/views/projects/artifacts/_tree_file.html.haml index 92c1648f726..3dfc09cc495 100644 --- a/app/views/projects/artifacts/_tree_file.html.haml +++ b/app/views/projects/artifacts/_tree_file.html.haml @@ -1,11 +1,11 @@ -%tr{ class: 'tree-item' } +- path_to_file = file_namespace_project_build_artifacts_path(@project.namespace, @project, @build, path: file.path) + +%tr.tree-item{ 'data-link' => path_to_file } %td.tree-item-file-name = tree_icon('file', '664', file.name) %span.str-truncated - = file.name + = link_to file.name, path_to_file %td = number_to_human_size(file.metadata[:size], precision: 2) %td - = link_to file_namespace_project_build_artifacts_path(@project.namespace, @project, @build, path: file.path), - class: 'btn btn-xs btn-default artifact-download' do - = icon('download') + = number_to_human_size(file.metadata[:zipped], precision: 2) diff --git a/app/views/projects/artifacts/browse.html.haml b/app/views/projects/artifacts/browse.html.haml index 1add7ef6bfb..9dc7b2c2e1f 100644 --- a/app/views/projects/artifacts/browse.html.haml +++ b/app/views/projects/artifacts/browse.html.haml @@ -1,24 +1,28 @@ - page_title 'Artifacts', "#{@build.name} (##{@build.id})", 'Builds' = render 'projects/builds/header_title' -#tree-holder.tree-holder - .gray-content-block.top-block.clearfix - .pull-right - = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, @build), - class: 'btn btn-default' do - = icon('download') - Download artifacts archive +.top-block.gray-content-block.clearfix + .pull-right + = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, @build), + class: 'btn btn-default' do + = icon('download') + Download artifacts archive -%div.tree-content-holder - .table-holder - %table.table.tree-table.table-striped +.tree-holder + %div.tree-content-holder + %table.table.tree-table %thead %tr %th Name %th Size - %th Download + %th Compressed to = render partial: 'tree_directory', collection: @entry.directories(parent: true), as: :directory = render partial: 'tree_file', collection: @entry.files, as: :file - if @entry.empty? .center Empty + +:javascript + $(document).on('click', 'tr[data-link]', function(e) { + window.location = this.dataset.link; + }); diff --git a/features/project/builds/artifacts.feature b/features/project/builds/artifacts.feature index 7a7dbb71b18..4f68e44fd77 100644 --- a/features/project/builds/artifacts.feature +++ b/features/project/builds/artifacts.feature @@ -49,5 +49,5 @@ Feature: Project Builds Artifacts And recent build has artifacts metadata available When I visit recent build summary page And I click artifacts browse button - And I click download button for a file within build artifacts + And I click a link to file within build artifacts Then download of a file extracted from build artifacts should start diff --git a/features/steps/project/builds/artifacts.rb b/features/steps/project/builds/artifacts.rb index f2c87da4717..25f2f4e837c 100644 --- a/features/steps/project/builds/artifacts.rb +++ b/features/steps/project/builds/artifacts.rb @@ -63,8 +63,8 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps end end - step 'I click download button for a file within build artifacts' do - page.within('.tree-table') { first('.artifact-download').click } + step 'I click a link to file within build artifacts' do + page.within('.tree-table') { find_link('ci_artifacts.txt').click } end step 'download of a file extracted from build artifacts should start' do -- cgit v1.2.1 From c7fe3c846ac98daa5057c4299d2d414b1d95df49 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 18 Jan 2016 10:18:47 +0100 Subject: Update build artifacts metadata fixture to 0.0.2 --- spec/fixtures/ci_build_artifacts_metadata.gz | Bin 415 -> 461 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/spec/fixtures/ci_build_artifacts_metadata.gz b/spec/fixtures/ci_build_artifacts_metadata.gz index fe9d4c8c661..e6d17e4595d 100644 Binary files a/spec/fixtures/ci_build_artifacts_metadata.gz and b/spec/fixtures/ci_build_artifacts_metadata.gz differ -- cgit v1.2.1 From 121866a3f27f976b24ef37c99964429974414343 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 18 Jan 2016 10:21:15 +0100 Subject: Add Changelog entry for improvements in builds artifacts browser --- CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 9c242cb44a8..18ccd56dec9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -62,10 +62,11 @@ v 8.4.0 (unreleased) - Add reporters ability to download and browse build artifacts (Andrew Johnson) - Autofill referring url in message box when reporting user abuse. (Josh Frye) - Remove leading comma on award emoji when the user is the first to award the emoji (Zeger-Jan van de Weg) + - Add build artifacts browser + - Improve UX in builds artifacts browser v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) - - Add build artifacts browser v 8.3.3 - Preserve CE behavior with JIRA integration by only calling API if URL is set -- cgit v1.2.1 From ab33b93daee12b1e33bf6b961de0860e5be465b3 Mon Sep 17 00:00:00 2001 From: Drew Blessing Date: Mon, 18 Jan 2016 19:18:35 +0000 Subject: Move entry `Fix: As an admin, cannot add oneself as a member to a group/project` --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 9c242cb44a8..c0b2b75b7eb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -113,6 +113,7 @@ v 8.3.0 - Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera) - Add rake tasks for git repository maintainance (Zeger-Jan van de Weg) - Fix 500 error when update group member permission + - Fix: As an admin, cannot add oneself as a member to a group/project - Trim leading and trailing whitespace of milestone and issueable titles (Jose Corcuera) - Recognize issue/MR/snippet/commit links as references - Backport JIRA features from EE to CE @@ -174,7 +175,6 @@ v 8.2.2 - Fix Error 500 when viewing user's personal projects from admin page (Stan Hu) - Fix: Raw private snippets access workflow - Prevent "413 Request entity too large" errors when pushing large files with LFS - - Fix: As an admin, cannot add oneself as a member to a group/project - Fix invalid links within projects dashboard header - Make current user the first user in assignee dropdown in issues detail page (Stan Hu) - Fix: duplicate email notifications on issue comments -- cgit v1.2.1 From b76bfe35c76084f17a7c017192049b793f70b9b1 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Mon, 18 Jan 2016 14:13:21 +0100 Subject: Add limit change for 'data' column in 'events' when using MySQL --- db/migrate/limits_to_mysql.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb index 2b7afae6d7c..14d7e84d856 100644 --- a/db/migrate/limits_to_mysql.rb +++ b/db/migrate/limits_to_mysql.rb @@ -6,5 +6,6 @@ class LimitsToMysql < ActiveRecord::Migration change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647 change_column :snippets, :content, :text, limit: 2147483647 change_column :notes, :st_diff, :text, limit: 2147483647 + change_column :events, :data, :text, limit: 2147483647 end end -- cgit v1.2.1 From d1c474ae6aa98e281cdc46da183a0c29a324ba31 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Mon, 18 Jan 2016 15:52:26 +0100 Subject: Add information about PostgreSQL<>MySQL 'text' type differences into to installation docs --- doc/install/database_mysql.md | 19 +++++++++++++++++++ doc/update/README.md | 1 + 2 files changed, 20 insertions(+) diff --git a/doc/install/database_mysql.md b/doc/install/database_mysql.md index 513ad69ec26..4a2c699129d 100644 --- a/doc/install/database_mysql.md +++ b/doc/install/database_mysql.md @@ -52,3 +52,22 @@ We do not recommend using MySQL due to various issues. For example, case [(in)se mysql> \q # You are done installing the database and can go back to the rest of the installation. + +## MySQL strings limits + +After installation or upgrade is done, remember to run `add_limits_mysql` rake task: + +``` +bundle exec rake add_limits_mysql +``` + +The `text` type in MySQL have different size limit than `text` type in PostgreSQL. In MySQL `text` columns are limited +to ~65kB, where in PostgreSQL `text` columns are limited up to ~1GB! + +`add_limits_mysql` rake task converts some important `text` columns in GitLab database to `longtext` which can persist +up to 4GB characters (may be less if the value contains multibyte characters). + +Details can be found in [PostgreSQL manual][postgres-text-type] and in [MySQL manual][mysql-text-types]. + +[postgres-text-type]: http://www.postgresql.org/docs/9.1/static/datatype-character.html +[mysql-text-types]: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html diff --git a/doc/update/README.md b/doc/update/README.md index 0472537eeb5..46aec4885e2 100644 --- a/doc/update/README.md +++ b/doc/update/README.md @@ -14,3 +14,4 @@ Depending on the installation method and your GitLab version, there are multiple ## Miscellaneous - [MySQL to PostgreSQL](mysql_to_postgresql.md) guides you through migrating your database from MySQL to PostgreSQL. +- [MySQL installation guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md) contains additional informations about configuring GitLab to work with MySQL database. -- cgit v1.2.1 From f386a4bd158964a70c6a68531d75cdc74bd32881 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Mon, 18 Jan 2016 15:54:16 +0100 Subject: Update CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 18ccd56dec9..7f1ce169389 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -64,6 +64,7 @@ v 8.4.0 (unreleased) - Remove leading comma on award emoji when the user is the first to award the emoji (Zeger-Jan van de Weg) - Add build artifacts browser - Improve UX in builds artifacts browser + - Add MySQL limit migration for `data` column in `events` table v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) -- cgit v1.2.1 From a7daf33bc5d33d496456adb017b55094b917e718 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Mon, 18 Jan 2016 19:10:16 +0100 Subject: Modify CHANGELOG entry [ci skip] --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7f1ce169389..d1b5bef6b3d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -64,7 +64,7 @@ v 8.4.0 (unreleased) - Remove leading comma on award emoji when the user is the first to award the emoji (Zeger-Jan van de Weg) - Add build artifacts browser - Improve UX in builds artifacts browser - - Add MySQL limit migration for `data` column in `events` table + - Change type of `data` column in `events` table when using MySQL v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) -- cgit v1.2.1 From ea44742b47bcb9dec75ba73793b1235863f04728 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Mon, 18 Jan 2016 15:58:15 -0500 Subject: Fix positioning issues with browse files button Issue is that in Firefox clipboard is blocking the browse files from moving all the way to the right. Move clipboard up 1px into -1px to unblock browse files --- app/assets/stylesheets/pages/commits.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss index 800df95cff3..818fd03e2ae 100644 --- a/app/assets/stylesheets/pages/commits.scss +++ b/app/assets/stylesheets/pages/commits.scss @@ -36,6 +36,10 @@ li.commit { line-height: 20px; margin-bottom: 2px; + .btn-clipboard { + margin-top: -1px; + } + .notes_count { float: right; margin-right: 10px; -- cgit v1.2.1 From a936a1021ffbea04e363d3890a0eb34b470dfef3 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Mon, 18 Jan 2016 19:39:31 -0200 Subject: Update devise to version 3.5.4 --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index a9a8bed1064..072f7a9fcc8 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ gem "mysql2", '~> 0.3.16', group: :mysql gem "pg", '~> 0.18.2', group: :postgres # Authentication libraries -gem 'devise', '~> 3.5.3' +gem 'devise', '~> 3.5.4' gem 'devise-async', '~> 0.9.0' gem 'doorkeeper', '~> 2.2.0' gem 'omniauth', '~> 1.2.2' diff --git a/Gemfile.lock b/Gemfile.lock index f1bba7f437e..a14fdbeed23 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -157,7 +157,7 @@ GEM activerecord (>= 3.2.0, < 5.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - devise (3.5.3) + devise (3.5.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) @@ -614,7 +614,7 @@ GEM thor (>= 0.18.1, < 2.0) rainbow (2.0.0) raindrops (0.15.0) - rake (10.4.2) + rake (10.5.0) raphael-rails (2.1.2) rb-fsevent (0.9.6) rb-inotify (0.9.5) @@ -648,8 +648,8 @@ GEM request_store (1.2.1) rerun (0.11.0) listen (~> 3.0) - responders (2.1.0) - railties (>= 4.2.0, < 5) + responders (2.1.1) + railties (>= 4.2.0, < 5.1) rest-client (1.8.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) @@ -911,7 +911,7 @@ DEPENDENCIES d3_rails (~> 3.5.0) database_cleaner (~> 1.4.0) default_value_for (~> 3.0.0) - devise (~> 3.5.3) + devise (~> 3.5.4) devise-async (~> 0.9.0) devise-two-factor (~> 2.0.0) diffy (~> 3.0.3) -- cgit v1.2.1 From 402feec6ddd96880921ad37a931db7c96fd48be0 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 18 Jan 2016 16:53:33 -0500 Subject: Update MySQL docs [ci skip] --- CHANGELOG | 2 +- doc/install/database_mysql.md | 19 +++++++++++-------- doc/update/README.md | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d1b5bef6b3d..9e9d66fb7f0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -64,7 +64,7 @@ v 8.4.0 (unreleased) - Remove leading comma on award emoji when the user is the first to award the emoji (Zeger-Jan van de Weg) - Add build artifacts browser - Improve UX in builds artifacts browser - - Change type of `data` column in `events` table when using MySQL + - Increase default size of `data` column in `events` table when using MySQL v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) diff --git a/doc/install/database_mysql.md b/doc/install/database_mysql.md index 4a2c699129d..e51ff5a5de2 100644 --- a/doc/install/database_mysql.md +++ b/doc/install/database_mysql.md @@ -8,7 +8,7 @@ We do not recommend using MySQL due to various issues. For example, case [(in)se # Install the database packages sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev - + # Ensure you have MySQL version 5.5.14 or later mysql --version @@ -31,7 +31,7 @@ We do not recommend using MySQL due to various issues. For example, case [(in)se # Ensure you can use the InnoDB engine which is necessary to support long indexes # If this fails, check your MySQL config files (e.g. `/etc/mysql/*.cnf`, `/etc/mysql/conf.d/*`) for the setting "innodb = off" mysql> SET storage_engine=INNODB; - + # Create the GitLab production database mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; @@ -55,19 +55,22 @@ We do not recommend using MySQL due to various issues. For example, case [(in)se ## MySQL strings limits -After installation or upgrade is done, remember to run `add_limits_mysql` rake task: +After installation or upgrade, remember to run the `add_limits_mysql` Rake task: ``` bundle exec rake add_limits_mysql ``` -The `text` type in MySQL have different size limit than `text` type in PostgreSQL. In MySQL `text` columns are limited -to ~65kB, where in PostgreSQL `text` columns are limited up to ~1GB! +The `text` type in MySQL has a different size limit than the `text` type in +PostgreSQL. In MySQL `text` columns are limited to ~65kB, whereas in PostgreSQL +`text` columns are limited up to ~1GB! -`add_limits_mysql` rake task converts some important `text` columns in GitLab database to `longtext` which can persist -up to 4GB characters (may be less if the value contains multibyte characters). +The `add_limits_mysql` Rake task converts some important `text` columns in the +GitLab database to `longtext` columns, which can persist values of up to 4GB +(sometimes less if the value contains multibyte characters). -Details can be found in [PostgreSQL manual][postgres-text-type] and in [MySQL manual][mysql-text-types]. +Details can be found in the [PostgreSQL][postgres-text-type] and +[MySQL][mysql-text-types] manuals. [postgres-text-type]: http://www.postgresql.org/docs/9.1/static/datatype-character.html [mysql-text-types]: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html diff --git a/doc/update/README.md b/doc/update/README.md index 46aec4885e2..109d5de3fa2 100644 --- a/doc/update/README.md +++ b/doc/update/README.md @@ -14,4 +14,4 @@ Depending on the installation method and your GitLab version, there are multiple ## Miscellaneous - [MySQL to PostgreSQL](mysql_to_postgresql.md) guides you through migrating your database from MySQL to PostgreSQL. -- [MySQL installation guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md) contains additional informations about configuring GitLab to work with MySQL database. +- [MySQL installation guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md) contains additional information about configuring GitLab to work with a MySQL database. -- cgit v1.2.1 From 1133251f0883f137ddd2154507fe5f83c5894117 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Mon, 18 Jan 2016 19:51:48 -0500 Subject: Reduce margin to fit dropdowns Fixes #10747 --- app/assets/stylesheets/framework/filters.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/framework/filters.scss b/app/assets/stylesheets/framework/filters.scss index 8e6922c9231..b7638c86bfa 100644 --- a/app/assets/stylesheets/framework/filters.scss +++ b/app/assets/stylesheets/framework/filters.scss @@ -1,5 +1,5 @@ .filter-item { - margin-right: 15px; + margin-right: 6px; } @media (min-width: 800px) { -- cgit v1.2.1 From bddef293d666c4b3933b93b017ae49bdf18b234f Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Mon, 18 Jan 2016 22:43:04 -0200 Subject: Ensure that doesn't have pending migrations when running the specs --- .gitlab-ci.yml | 4 ++-- lib/gitlab/current_settings.rb | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c23a7a3bf0e..ac8390074f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ before_script: - touch log/application.log - touch log/test.log - bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}" - - bundle exec rake db:reset db:create RAILS_ENV=test + - RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load db:migrate spec:feature: script: @@ -118,7 +118,7 @@ flay: - mysql bundler:audit: - script: + script: - "bundle exec bundle-audit update" - "bundle exec bundle-audit check" tags: diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb index 7f938780ab1..ea054255820 100644 --- a/lib/gitlab/current_settings.rb +++ b/lib/gitlab/current_settings.rb @@ -39,7 +39,6 @@ module Gitlab end use_db && ActiveRecord::Base.connection.active? && - !ActiveRecord::Migrator.needs_migration? && ActiveRecord::Base.connection.table_exists?('application_settings') rescue ActiveRecord::NoDatabaseError -- cgit v1.2.1 From 96440042a904274b88afc25eddd46c2722482427 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Mon, 18 Jan 2016 22:44:15 -0200 Subject: Raise an error on page load if there are pending migrations on dev env --- config/environments/development.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/environments/development.rb b/config/environments/development.rb index 257c163720a..689694a3480 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -16,6 +16,9 @@ Rails.application.configure do # Print deprecation notices to the Rails logger config.active_support.deprecation = :log + # Raise an error on page load if there are pending migrations + config.active_record.migration_error = :page_load + # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin -- cgit v1.2.1