diff options
21 files changed, 194 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG index 1aab904f117..2eec1d6a503 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,21 @@ Please view this file on the master branch, on stable branches it's out of date. v 7.11.0 (unreleased) + - Make Reply-To config apply to change e-mail confirmation and other Devise notifications (Stan Hu) + - Add application setting to restrict user signups to e-mail domains (Stan Hu) + - Don't allow a merge request to be merged when its title starts with "WIP". + - Add a page title to every page. + - Allow primary email to be set to an email that you've already added. + - Fix Error 500 when searching Wiki pages (Stan Hu) + - Get Gitorious importer to work again. - Fix clone URL field and X11 Primary selection (Dmitry Medvinsky) - Ignore invalid lines in .gitmodules - + - Fix broken file browsing with relative submodule in personal projects (Stan Hu) + - Fix DB error when trying to tag a repository (Stan Hu) + - Add "Reply quoting selected text" shortcut key (`r`) + - Fix bug causing `@whatever` inside an issue's first code block to be picked up as a user mention. + - Fix bug causing `@whatever` inside an inline code snippet (backtick-style) to be picked up as a user mention. - - - @@ -12,6 +24,30 @@ v 7.11.0 (unreleased) - v 7.10.0 (unreleased) + - Show Atom feed buttons everywhere where applicable. + - Add project activity atom feed. + - Don't crash when an MR from a fork has a cross-reference comment from the target project on of its commits. + - Include commit comments in MR from a forked project. + - Fix adding new group members from admin area + - Add default project and snippet visibility settings to the admin web UI. + - Show incompatible projects in Google Code import status (Stan Hu) + - Fix bug where commit data would not appear in some subdirectories (Stan Hu) + - Unescape branch names in compare commit (Stan Hu) + - + - + - Fix bug where commit data would not appear in some subdirectories (Stan Hu) + - Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu) + - Move snippets UI to fluid layout + - Improve UI for sidebar. Increase separation between navigation and content + - Improve new project command options (Ben Bodenmiller) + - Prevent sending empty messages to HipChat (Chulki Lee) + - Improve UI for mobile phones on dashboard and project pages + - Add room notification and message color option for HipChat + +v 7.10.2 + - Fix CI links on MR page + +v 7.10.0 - Ignore submodules that are defined in .gitmodules but are checked in as directories. - Allow projects to be imported from Google Code. - Remove access control for uploaded images to fix broken images in emails (Hannes Rosenögger) diff --git a/app/controllers/import/gitorious_controller.rb b/app/controllers/import/gitorious_controller.rb index 6067a87ee04..c121d2de7cb 100644 --- a/app/controllers/import/gitorious_controller.rb +++ b/app/controllers/import/gitorious_controller.rb @@ -6,7 +6,7 @@ class Import::GitoriousController < Import::BaseController def callback session[:gitorious_repos] = params[:repos] - redirect_to status_import_gitorious_url + redirect_to status_import_gitorious_path end def status diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb index 146808fa562..e1a8a5b6fa3 100644 --- a/app/controllers/projects/compare_controller.rb +++ b/app/controllers/projects/compare_controller.rb @@ -1,3 +1,5 @@ +require 'addressable/uri' + class Projects::CompareController < Projects::ApplicationController # Authorize before_filter :require_non_empty_project @@ -7,8 +9,8 @@ class Projects::CompareController < Projects::ApplicationController end def show - base_ref = params[:from] - head_ref = params[:to] + base_ref = Addressable::URI.unescape(params[:from]) + head_ref = Addressable::URI.unescape(params[:to]) compare_result = CompareService.new.execute( current_user, diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb index a3bc64c010e..f8a96516e61 100644 --- a/app/helpers/wiki_helper.rb +++ b/app/helpers/wiki_helper.rb @@ -6,6 +6,8 @@ module WikiHelper case wiki_page when Symbol wiki_page + when String + wiki_page else wiki_page.slug end diff --git a/app/models/project_services/gitlab_ci_service.rb b/app/models/project_services/gitlab_ci_service.rb index 0f9838a575d..f6f75cae8e7 100644 --- a/app/models/project_services/gitlab_ci_service.rb +++ b/app/models/project_services/gitlab_ci_service.rb @@ -43,7 +43,7 @@ class GitlabCiService < CiService end def commit_status_path(sha, ref) - project_url + "/refs/#{ref}/commits/#{sha}/status.json?token=#{token}" + URI::encode(project_url + "/refs/#{ref}/commits/#{sha}/status.json?token=#{token}") end def get_ci_build(sha, ref) @@ -90,7 +90,7 @@ class GitlabCiService < CiService end def build_page(sha, ref) - project_url + "/refs/#{ref}/commits/#{sha}" + URI::encode(project_url + "/refs/#{ref}/commits/#{sha}") end def builds_path diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml index 14996dcd6a2..427f38018b0 100644 --- a/app/views/admin/groups/show.html.haml +++ b/app/views/admin/groups/show.html.haml @@ -60,7 +60,7 @@ = form_tag members_update_admin_group_path(@group), id: "new_project_member", class: "bulk_import", method: :put do %div - = users_select_tag(:user_ids, multiple: true, email_user: true) + = users_select_tag(:user_ids, multiple: true, email_user: true, scope: :all) %div.prepend-top-10 = select_tag :access_level, options_for_select(GroupMember.access_level_roles), class: "project-access-select select2" %hr diff --git a/config/routes.rb b/config/routes.rb index 744a99feded..e08ef6fc048 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -433,7 +433,7 @@ Gitlab::Application.routes.draw do member do # tree viewer logs get 'logs_tree', constraints: { id: Gitlab::Regex.git_reference_regex } - get 'logs_tree/:path' => 'refs#logs_tree', as: :logs_file, constraints: { + get 'logs_tree/*path' => 'refs#logs_tree', as: :logs_file, constraints: { id: Gitlab::Regex.git_reference_regex, path: /.*/ } diff --git a/db/migrate/20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb b/db/migrate/20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb new file mode 100644 index 00000000000..4ca676f6c72 --- /dev/null +++ b/db/migrate/20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb @@ -0,0 +1,20 @@ +# This migration comes from acts_as_taggable_on_engine (originally 2) +class AddMissingUniqueIndices < ActiveRecord::Migration + def self.up + add_index :tags, :name, unique: true + + remove_index :taggings, :tag_id + remove_index :taggings, [:taggable_id, :taggable_type, :context] + add_index :taggings, + [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type], + unique: true, name: 'taggings_idx' + end + + def self.down + remove_index :tags, :name + + remove_index :taggings, name: 'taggings_idx' + add_index :taggings, :tag_id + add_index :taggings, [:taggable_id, :taggable_type, :context] + end +end diff --git a/db/migrate/20150425164649_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb b/db/migrate/20150425164649_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb new file mode 100644 index 00000000000..8edb5080781 --- /dev/null +++ b/db/migrate/20150425164649_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb @@ -0,0 +1,15 @@ +# This migration comes from acts_as_taggable_on_engine (originally 3) +class AddTaggingsCounterCacheToTags < ActiveRecord::Migration + def self.up + add_column :tags, :taggings_count, :integer, default: 0 + + ActsAsTaggableOn::Tag.reset_column_information + ActsAsTaggableOn::Tag.find_each do |tag| + ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings) + end + end + + def self.down + remove_column :tags, :taggings_count + end +end diff --git a/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb b/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb new file mode 100644 index 00000000000..71f2d7f4330 --- /dev/null +++ b/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from acts_as_taggable_on_engine (originally 4) +class AddMissingTaggableIndex < ActiveRecord::Migration + def self.up + add_index :taggings, [:taggable_id, :taggable_type, :context] + end + + def self.down + remove_index :taggings, [:taggable_id, :taggable_type, :context] + end +end diff --git a/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb b/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb new file mode 100644 index 00000000000..bfb06bc7cda --- /dev/null +++ b/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from acts_as_taggable_on_engine (originally 5) +# This migration is added to circumvent issue #623 and have special characters +# work properly +class ChangeCollationForTagNames < ActiveRecord::Migration + def up + if ActsAsTaggableOn::Utils.using_mysql? + execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;") + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 189bd536626..aa481698534 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -431,13 +431,16 @@ ActiveRecord::Schema.define(version: 20150429002313) do t.datetime "created_at" end - add_index "taggings", ["tag_id"], name: "index_taggings_on_tag_id", using: :btree + add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree create_table "tags", force: true do |t| - t.string "name" + t.string "name" + t.integer "taggings_count", default: 0 end + add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree + create_table "users", force: true do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false diff --git a/features/project/project.feature b/features/project/project.feature index 3e1fd54bee8..ae28312a69a 100644 --- a/features/project/project.feature +++ b/features/project/project.feature @@ -55,3 +55,10 @@ Feature: Project Then I should see project "Forum" README And I visit project "Shop" page Then I should see project "Shop" README + + Scenario: I tag a project + When I visit edit project "Shop" page + Then I should see project settings + And I add project tags + And I save project + Then I should see project tags diff --git a/features/search.feature b/features/search.feature index def21e00923..1608e824671 100644 --- a/features/search.feature +++ b/features/search.feature @@ -44,3 +44,9 @@ Feature: Search Then I should see "Foo" link in the search results And I should not see "Bar" link in the search results + Scenario: I should see Wiki blobs + And project has Wiki content + When I click project "Shop" link + And I search for "Wiki content" + And I click "Wiki" link + Then I should see "test_wiki" link in the search results diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index d39c8e7d2db..f14396bcfff 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -94,4 +94,12 @@ class Spinach::Features::Project < Spinach::FeatureSteps page.should have_link 'README.md' page.should have_content 'testme' end + + step 'I add project tags' do + fill_in 'Tags', with: 'tag1, tag2' + end + + step 'I should see project tags' do + expect(find_field('Tags').value).to eq 'tag1, tag2' + end end diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb index bb93e582a1f..717132da45d 100644 --- a/features/steps/project/wiki.rb +++ b/features/steps/project/wiki.rb @@ -159,6 +159,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps page.should have_content('History for') end + step 'I search for Wiki content' do + fill_in "Search in this project", with: "wiki_content" + click_button "Search" + end + def wiki @project_wiki = ProjectWiki.new(project, current_user) end diff --git a/features/steps/search.rb b/features/steps/search.rb index 6f0e038c4d6..8197cd410aa 100644 --- a/features/steps/search.rb +++ b/features/steps/search.rb @@ -18,6 +18,11 @@ class Spinach::Features::Search < Spinach::FeatureSteps click_button "Search" end + step 'I search for "Wiki content"' do + fill_in "dashboard_search", with: "content" + click_button "Search" + end + step 'I click "Issues" link' do within '.search-filter' do click_link 'Issues' @@ -36,6 +41,12 @@ class Spinach::Features::Search < Spinach::FeatureSteps end end + step 'I click "Wiki" link' do + within '.search-filter' do + click_link 'Wiki' + end + end + step 'I should see "Shop" project link' do page.should have_link "Shop" end @@ -66,4 +77,13 @@ class Spinach::Features::Search < Spinach::FeatureSteps step 'I should not see "Bar" link in the search results' do find(:css, '.search-results').should_not have_link 'Bar' end + + step 'I should see "test_wiki" link in the search results' do + find(:css, '.search-results').should have_link 'test_wiki.md' + end + + step 'project has Wiki content' do + @wiki = ::ProjectWiki.new(project, current_user) + @wiki.create_page("test_wiki", "Some Wiki content", :markdown, "first commit") + end end diff --git a/lib/gitlab/gitorious_import/client.rb b/lib/gitlab/gitorious_import/client.rb index 8cdc3d4afae..1fa89dba448 100644 --- a/lib/gitlab/gitorious_import/client.rb +++ b/lib/gitlab/gitorious_import/client.rb @@ -14,7 +14,7 @@ module Gitlab end def repos - @repos ||= repo_names.map { |full_name| Repository.new(full_name) } + @repos ||= repo_names.map { |full_name| GitoriousImport::Repository.new(full_name) } end def repo(id) diff --git a/spec/controllers/projects/compare_controller_spec.rb b/spec/controllers/projects/compare_controller_spec.rb new file mode 100644 index 00000000000..23e1566b8f3 --- /dev/null +++ b/spec/controllers/projects/compare_controller_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe Projects::CompareController do + let(:project) { create(:project) } + let(:user) { create(:user) } + let(:ref_from) { "improve%2Fawesome" } + let(:ref_to) { "feature" } + + before do + sign_in(user) + project.team << [user, :master] + end + + it 'compare should show some diffs' do + get(:show, namespace_id: project.namespace.to_param, + project_id: project.to_param, from: ref_from, to: ref_to) + + expect(response).to be_success + expect(assigns(:diffs).length).to be >= 1 + expect(assigns(:commits).length).to be >= 1 + end +end diff --git a/spec/lib/extracts_path_spec.rb b/spec/lib/extracts_path_spec.rb index ac602eac154..05bcebaa3a2 100644 --- a/spec/lib/extracts_path_spec.rb +++ b/spec/lib/extracts_path_spec.rb @@ -2,6 +2,8 @@ require 'spec_helper' describe ExtractsPath do include ExtractsPath + include RepoHelpers + include Rails.application.routes.url_helpers let(:project) { double('project') } @@ -11,6 +13,20 @@ describe ExtractsPath do project.stub(path_with_namespace: 'gitlab/gitlab-ci') end + describe '#assign_ref' do + let(:ref) { sample_commit[:id] } + let(:params) { {path: sample_commit[:line_code_path], ref: ref} } + + before do + @project = create(:project) + end + + it "log tree path should have no escape sequences" do + assign_ref_vars + expect(@logs_path).to eq("/#{@project.path_with_namespace}/refs/#{ref}/logs_tree/files/ruby/popen.rb") + end + end + describe '#extract_ref' do it "returns an empty pair when no @project is set" do @project = nil diff --git a/spec/models/project_services/gitlab_ci_service_spec.rb b/spec/models/project_services/gitlab_ci_service_spec.rb index 6a557d839ca..d3bbd6174ec 100644 --- a/spec/models/project_services/gitlab_ci_service_spec.rb +++ b/spec/models/project_services/gitlab_ci_service_spec.rb @@ -40,10 +40,12 @@ describe GitlabCiService do describe :commit_status_path do it { expect(@service.commit_status_path("2ab7834c", 'master')).to eq("http://ci.gitlab.org/projects/2/refs/master/commits/2ab7834c/status.json?token=verySecret")} + it { expect(@service.commit_status_path("issue#2", 'master')).to eq("http://ci.gitlab.org/projects/2/refs/master/commits/issue%232/status.json?token=verySecret")} end describe :build_page do it { expect(@service.build_page("2ab7834c", 'master')).to eq("http://ci.gitlab.org/projects/2/refs/master/commits/2ab7834c")} + it { expect(@service.build_page("issue#2", 'master')).to eq("http://ci.gitlab.org/projects/2/refs/master/commits/issue%232")} end end |