From c4201f103662f5ff9eb064890a10352ec03bc495 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 18 Apr 2018 12:55:24 +0100 Subject: Added changes count to web IDE folder #44846 --- app/assets/javascripts/ide/components/repo_file.vue | 13 +++++++++++-- app/assets/javascripts/ide/stores/getters.js | 3 +++ app/assets/stylesheets/pages/repo.scss | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/ide/components/repo_file.vue b/app/assets/javascripts/ide/components/repo_file.vue index 3b5068d4910..965a49d98cf 100644 --- a/app/assets/javascripts/ide/components/repo_file.vue +++ b/app/assets/javascripts/ide/components/repo_file.vue @@ -1,5 +1,5 @@ + + diff --git a/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue b/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue index 9c003aa9f8a..8f5d0bee107 100644 --- a/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue +++ b/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue @@ -1,7 +1,7 @@ @@ -82,6 +85,7 @@ data-container="body" data-placement="left" :title="participantLabel" + @click="onClickCollapsedIcon" > { + vm = mountComponent(Participants, { + loading: false, + participants: PARTICIPANT_LIST, + numberOfLessParticipants: 2, + }); + spyOn(vm, '$emit'); + + const participantsIconEl = vm.$el.querySelector('.sidebar-collapsed-icon'); + + participantsIconEl.click(); + expect(vm.$emit).toHaveBeenCalledWith('toggleSidebar'); + }); }); }); -- cgit v1.2.1 From feb25e5993fd10283cadcbda9591f81d0271c8cd Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Tue, 1 May 2018 03:05:58 +0300 Subject: Add padding to profile description --- app/views/users/show.html.haml | 2 +- changelogs/unreleased/add-padding-to-profile-description.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/add-padding-to-profile-description.yml diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 4bf01ecb48c..d35ddf3eb39 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -35,7 +35,7 @@ = link_to avatar_icon_for_user(@user, 400), target: '_blank', rel: 'noopener noreferrer' do = image_tag avatar_icon_for_user(@user, 90), class: "avatar s90", alt: '' - .user-info + .user-info.prepend-left-default.append-right-default .cover-title = @user.name diff --git a/changelogs/unreleased/add-padding-to-profile-description.yml b/changelogs/unreleased/add-padding-to-profile-description.yml new file mode 100644 index 00000000000..4628a10eb3f --- /dev/null +++ b/changelogs/unreleased/add-padding-to-profile-description.yml @@ -0,0 +1,5 @@ +--- +title: Add padding to profile description +merge_request: 18663 +author: George Tsiolis +type: changed -- cgit v1.2.1 From bf790c26c58e214c27132e7a54fdf4a4cc77bdaf Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 3 May 2018 13:39:20 +0200 Subject: Use factory in specs for ProjectCiCdSettings --- spec/factories/project_ci_cd_settings.rb | 10 ++++++++++ spec/factories/projects.rb | 8 +------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 spec/factories/project_ci_cd_settings.rb diff --git a/spec/factories/project_ci_cd_settings.rb b/spec/factories/project_ci_cd_settings.rb new file mode 100644 index 00000000000..2e85b54e245 --- /dev/null +++ b/spec/factories/project_ci_cd_settings.rb @@ -0,0 +1,10 @@ +FactoryBot.define do + factory :project_ci_cd_setting do + project + + initialize_with do + # ci_cd_settings are automatically created when a project is created + project&.ci_cd_settings || new + end + end +end diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index aed5eab8044..e0e72e7f2ce 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -14,6 +14,7 @@ FactoryBot.define do # Associations namespace creator { group ? create(:user) : namespace&.owner } + ci_cd_settings strategy: :build, factory: :project_ci_cd_setting, project: nil transient do # Nest Project Feature attributes @@ -23,10 +24,6 @@ FactoryBot.define do issues_access_level ProjectFeature::ENABLED merge_requests_access_level ProjectFeature::ENABLED repository_access_level ProjectFeature::ENABLED - - # we can't assign the delegated `#ci_cd_settings` attributes directly, as the - # `#ci_cd_settings` relation needs to be created first - group_runners_enabled nil end after(:create) do |project, evaluator| @@ -51,9 +48,6 @@ FactoryBot.define do end project.group&.refresh_members_authorized_projects - - # assign the delegated `#ci_cd_settings` attributes after create - project.reload.group_runners_enabled = evaluator.group_runners_enabled unless evaluator.group_runners_enabled.nil? end trait :public do -- cgit v1.2.1 From 6c1a12edfcf54193a839ee0a7d5fe0f824f15cbe Mon Sep 17 00:00:00 2001 From: Lukas Eipert Date: Thu, 3 May 2018 14:31:32 +0200 Subject: ensure users are signed out properly in user_uses_slash_commands_spec.rb See https://gitlab.com/gitlab-org/gitlab-ce/issues/45970 --- spec/features/issues/user_uses_slash_commands_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/features/issues/user_uses_slash_commands_spec.rb b/spec/features/issues/user_uses_slash_commands_spec.rb index ddd64fa1412..fd0aa6cf3a3 100644 --- a/spec/features/issues/user_uses_slash_commands_spec.rb +++ b/spec/features/issues/user_uses_slash_commands_spec.rb @@ -161,6 +161,7 @@ feature 'Issues > User uses quick actions', :js do before do target_project.add_master(user) + gitlab_sign_out sign_in(user) visit project_issue_path(project, issue) end @@ -220,6 +221,7 @@ feature 'Issues > User uses quick actions', :js do before do target_project.add_master(user) + gitlab_sign_out sign_in(user) visit project_issue_path(project, issue) end -- cgit v1.2.1 From af15b6f0e144762a38591c53b970e312c35fe65f Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 3 May 2018 14:37:01 +0200 Subject: Fix Project#group_runners_enabled as it was doing nothing --- app/models/project.rb | 7 ++++++- app/models/project_ci_cd_setting.rb | 2 +- app/services/ci/register_job_service.rb | 5 ++++- spec/services/ci/register_job_service_spec.rb | 28 ++++++++++++++++----------- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index 8abbb92da62..50c404c300a 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -234,7 +234,7 @@ class Project < ActiveRecord::Base has_many :custom_attributes, class_name: 'ProjectCustomAttribute' has_many :project_badges, class_name: 'ProjectBadge' - has_one :ci_cd_settings, class_name: 'ProjectCiCdSetting' + has_one :ci_cd_settings, class_name: 'ProjectCiCdSetting', inverse_of: :project, autosave: true accepts_nested_attributes_for :variables, allow_destroy: true accepts_nested_attributes_for :project_feature, update_only: true @@ -331,6 +331,11 @@ class Project < ActiveRecord::Base scope :with_issues_available_for_user, ->(current_user) { with_feature_available_for_user(:issues, current_user) } scope :with_merge_requests_enabled, -> { with_feature_enabled(:merge_requests) } + scope :with_group_runners_enabled, -> do + joins(:ci_cd_settings) + .where(project_ci_cd_settings: { group_runners_enabled: true }) + end + enum auto_cancel_pending_pipelines: { disabled: 0, enabled: 1 } chronic_duration_attr :build_timeout_human_readable, :build_timeout, default: 3600 diff --git a/app/models/project_ci_cd_setting.rb b/app/models/project_ci_cd_setting.rb index 9f10a93148c..588cced5781 100644 --- a/app/models/project_ci_cd_setting.rb +++ b/app/models/project_ci_cd_setting.rb @@ -1,5 +1,5 @@ class ProjectCiCdSetting < ActiveRecord::Base - belongs_to :project + belongs_to :project, inverse_of: :ci_cd_settings # The version of the schema that first introduced this model/table. MINIMUM_SCHEMA_VERSION = 20180403035759 diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb index 8f8a5fbb2b0..a7d8ad93f38 100644 --- a/app/services/ci/register_job_service.rb +++ b/app/services/ci/register_job_service.rb @@ -91,7 +91,10 @@ module Ci def builds_for_group_runner hierarchy_groups = Gitlab::GroupHierarchy.new(runner.groups).base_and_descendants projects = Project.where(namespace_id: hierarchy_groups) - new_builds.where(project: projects.without_deleted.with_builds_enabled).order('created_at ASC') + .with_group_runners_enabled + .with_builds_enabled + .without_deleted + new_builds.where(project: projects).order('created_at ASC') end def running_builds_for_shared_runners diff --git a/spec/services/ci/register_job_service_spec.rb b/spec/services/ci/register_job_service_spec.rb index 256d0027d72..8063bc7e1ac 100644 --- a/spec/services/ci/register_job_service_spec.rb +++ b/spec/services/ci/register_job_service_spec.rb @@ -2,13 +2,13 @@ require 'spec_helper' module Ci describe RegisterJobService do - let!(:project) { create :project, shared_runners_enabled: false } - let!(:group) { create :group } - let!(:pipeline) { create :ci_pipeline, project: project } - let!(:pending_job) { create :ci_build, pipeline: pipeline } - let!(:shared_runner) { create :ci_runner, is_shared: true } - let!(:specific_runner) { create :ci_runner, is_shared: false } - let!(:group_runner) { create :ci_runner, groups: [group], runner_type: :group_type } + set(:group) { create(:group) } + set(:project) { create(:project, group: group, shared_runners_enabled: false, group_runners_enabled: false) } + set(:pipeline) { create(:ci_pipeline, project: project) } + let!(:shared_runner) { create(:ci_runner, is_shared: true) } + let!(:specific_runner) { create(:ci_runner, is_shared: false) } + let!(:group_runner) { create(:ci_runner, groups: [group], runner_type: :group_type) } + let!(:pending_job) { create(:ci_build, pipeline: pipeline) } before do specific_runner.assign_to(project) @@ -152,7 +152,7 @@ module Ci context 'disallow when builds are disabled' do before do - project.update(shared_runners_enabled: true) + project.update(shared_runners_enabled: true, group_runners_enabled: true) project.project_feature.update_attribute(:builds_access_level, ProjectFeature::DISABLED) end @@ -162,7 +162,13 @@ module Ci it { expect(build).to be_nil } end - context 'and uses specific runner' do + context 'and uses group runner' do + let(:build) { execute(group_runner) } + + it { expect(build).to be_nil } + end + + context 'and uses project runner' do let(:build) { execute(specific_runner) } it { expect(build).to be_nil } @@ -171,7 +177,7 @@ module Ci context 'allow group runners' do before do - project.update!(group_runners_enabled: true, group: group) + project.update!(group_runners_enabled: true) end context 'for multiple builds' do @@ -230,7 +236,7 @@ module Ci context 'disallow group runners' do before do - project.update(group_runners_enabled: false) + project.update!(group_runners_enabled: false) end context 'group runner' do -- cgit v1.2.1 From 351a79369376663a6dd3e43bec31597d8544f9d7 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Tue, 1 May 2018 07:28:05 +0200 Subject: update omniauth-github ~> 1.1.1 to ~> 1.3 --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 7a18fab2058..36d0d73c5e6 100644 --- a/Gemfile +++ b/Gemfile @@ -41,7 +41,7 @@ gem 'omniauth-auth0', '~> 2.0.0' gem 'omniauth-azure-oauth2', '~> 0.0.9' gem 'omniauth-cas3', '~> 1.1.4' gem 'omniauth-facebook', '~> 4.0.0' -gem 'omniauth-github', '~> 1.1.1' +gem 'omniauth-github', '~> 1.3' gem 'omniauth-gitlab', '~> 1.0.2' gem 'omniauth-google-oauth2', '~> 0.5.3' gem 'omniauth-kerberos', '~> 0.3.0', group: :kerberos diff --git a/Gemfile.lock b/Gemfile.lock index 87ee15e9e76..7fd49417c71 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -546,9 +546,9 @@ GEM omniauth (~> 1.2) omniauth-facebook (4.0.0) omniauth-oauth2 (~> 1.2) - omniauth-github (1.1.2) - omniauth (~> 1.0) - omniauth-oauth2 (~> 1.1) + omniauth-github (1.3.0) + omniauth (~> 1.5) + omniauth-oauth2 (>= 1.4.0, < 2.0) omniauth-gitlab (1.0.2) omniauth (~> 1.0) omniauth-oauth2 (~> 1.0) @@ -1114,7 +1114,7 @@ DEPENDENCIES omniauth-azure-oauth2 (~> 0.0.9) omniauth-cas3 (~> 1.1.4) omniauth-facebook (~> 4.0.0) - omniauth-github (~> 1.1.1) + omniauth-github (~> 1.3) omniauth-gitlab (~> 1.0.2) omniauth-google-oauth2 (~> 0.5.3) omniauth-kerberos (~> 0.3.0) -- cgit v1.2.1 From 0ae300578139c0e71e8748b6106f673e4b3d19c8 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 3 May 2018 14:54:08 +0200 Subject: Order builds by id instead of created_at in RegisterJobService --- app/services/ci/register_job_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb index a7d8ad93f38..4291631913a 100644 --- a/app/services/ci/register_job_service.rb +++ b/app/services/ci/register_job_service.rb @@ -85,7 +85,7 @@ module Ci end def builds_for_project_runner - new_builds.where(project: runner.projects.without_deleted.with_builds_enabled).order('created_at ASC') + new_builds.where(project: runner.projects.without_deleted.with_builds_enabled).order('id ASC') end def builds_for_group_runner @@ -94,7 +94,7 @@ module Ci .with_group_runners_enabled .with_builds_enabled .without_deleted - new_builds.where(project: projects).order('created_at ASC') + new_builds.where(project: projects).order('id ASC') end def running_builds_for_shared_runners -- cgit v1.2.1 From 794ac6c5421e04056dfd336559786fb166c9fa0a Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 3 May 2018 15:38:55 +0200 Subject: Revert "Use factory in specs for ProjectCiCdSettings" This reverts commit bf790c26c58e214c27132e7a54fdf4a4cc77bdaf. --- spec/factories/project_ci_cd_settings.rb | 10 ---------- spec/factories/projects.rb | 8 +++++++- 2 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 spec/factories/project_ci_cd_settings.rb diff --git a/spec/factories/project_ci_cd_settings.rb b/spec/factories/project_ci_cd_settings.rb deleted file mode 100644 index 2e85b54e245..00000000000 --- a/spec/factories/project_ci_cd_settings.rb +++ /dev/null @@ -1,10 +0,0 @@ -FactoryBot.define do - factory :project_ci_cd_setting do - project - - initialize_with do - # ci_cd_settings are automatically created when a project is created - project&.ci_cd_settings || new - end - end -end diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index e0e72e7f2ce..aed5eab8044 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -14,7 +14,6 @@ FactoryBot.define do # Associations namespace creator { group ? create(:user) : namespace&.owner } - ci_cd_settings strategy: :build, factory: :project_ci_cd_setting, project: nil transient do # Nest Project Feature attributes @@ -24,6 +23,10 @@ FactoryBot.define do issues_access_level ProjectFeature::ENABLED merge_requests_access_level ProjectFeature::ENABLED repository_access_level ProjectFeature::ENABLED + + # we can't assign the delegated `#ci_cd_settings` attributes directly, as the + # `#ci_cd_settings` relation needs to be created first + group_runners_enabled nil end after(:create) do |project, evaluator| @@ -48,6 +51,9 @@ FactoryBot.define do end project.group&.refresh_members_authorized_projects + + # assign the delegated `#ci_cd_settings` attributes after create + project.reload.group_runners_enabled = evaluator.group_runners_enabled unless evaluator.group_runners_enabled.nil? end trait :public do -- cgit v1.2.1 From ec5489838a90d4997c72a19ea25dd9da4e307642 Mon Sep 17 00:00:00 2001 From: Brett Walker Date: Thu, 3 May 2018 14:58:43 +0000 Subject: Output some useful information when running the rails console --- changelogs/unreleased/bw-add-console-message.yml | 5 +++++ config/initializers/console_message.rb | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 changelogs/unreleased/bw-add-console-message.yml create mode 100644 config/initializers/console_message.rb diff --git a/changelogs/unreleased/bw-add-console-message.yml b/changelogs/unreleased/bw-add-console-message.yml new file mode 100644 index 00000000000..7994f7caced --- /dev/null +++ b/changelogs/unreleased/bw-add-console-message.yml @@ -0,0 +1,5 @@ +--- +title: Output some useful information when running the rails console +merge_request: 18697 +author: +type: added diff --git a/config/initializers/console_message.rb b/config/initializers/console_message.rb new file mode 100644 index 00000000000..536ab337d85 --- /dev/null +++ b/config/initializers/console_message.rb @@ -0,0 +1,10 @@ +# rubocop:disable Rails/Output +if defined?(Rails::Console) + # note that this will not print out when using `spring` + justify = 15 + puts "-------------------------------------------------------------------------------------" + puts " Gitlab:".ljust(justify) + "#{Gitlab::VERSION} (#{Gitlab::REVISION})" + puts " Gitlab Shell:".ljust(justify) + Gitlab::Shell.new.version + puts " #{Gitlab::Database.adapter_name}:".ljust(justify) + Gitlab::Database.version + puts "-------------------------------------------------------------------------------------" +end -- cgit v1.2.1 From dd74237ddc8bef97e45757caf2e91f157e7dd7d2 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 3 May 2018 17:08:06 +0200 Subject: Split migration to add and index namespaces.runners_token --- db/migrate/20170906133745_add_runners_token_to_groups.rb | 10 +--------- ...20180503150427_add_index_to_namespaces_runners_token.rb | 14 ++++++++++++++ db/schema.rb | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb diff --git a/db/migrate/20170906133745_add_runners_token_to_groups.rb b/db/migrate/20170906133745_add_runners_token_to_groups.rb index 54d0fddd5e3..852f4cba670 100644 --- a/db/migrate/20170906133745_add_runners_token_to_groups.rb +++ b/db/migrate/20170906133745_add_runners_token_to_groups.rb @@ -3,15 +3,7 @@ class AddRunnersTokenToGroups < ActiveRecord::Migration DOWNTIME = false - disable_ddl_transaction! - - def up + def change add_column :namespaces, :runners_token, :string - - add_concurrent_index :namespaces, :runners_token, unique: true - end - - def down - remove_column :namespaces, :runners_token end end diff --git a/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb b/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb new file mode 100644 index 00000000000..d6c4a5c432c --- /dev/null +++ b/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb @@ -0,0 +1,14 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddIndexToNamespacesRunnersToken < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def change + add_concurrent_index :namespaces, :runners_token, unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index c88d6f3f9e9..177ad0bf23e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180430143705) do +ActiveRecord::Schema.define(version: 20180503150427) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" -- cgit v1.2.1 From b8abe0c980d12a48dc7b25cb8f3d560b89b5dcd2 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 3 May 2018 17:09:16 +0200 Subject: Remove unnecessary disable transaction in add_ci_runner_namespaces --- db/migrate/20170301101006_add_ci_runner_namespaces.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/db/migrate/20170301101006_add_ci_runner_namespaces.rb b/db/migrate/20170301101006_add_ci_runner_namespaces.rb index 7e7df2f4d22..deaf03e928b 100644 --- a/db/migrate/20170301101006_add_ci_runner_namespaces.rb +++ b/db/migrate/20170301101006_add_ci_runner_namespaces.rb @@ -3,8 +3,6 @@ class AddCiRunnerNamespaces < ActiveRecord::Migration DOWNTIME = false - disable_ddl_transaction! - def change create_table :ci_runner_namespaces do |t| t.integer :runner_id -- cgit v1.2.1 From 52e8f61195fbe413c029dac4913e671789244299 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 3 May 2018 16:59:58 +0200 Subject: Change the docs license to CC BY-SA As discussed in https://gitlab.com/gitlab-org/gitlab-ce/issues/42891 --- CONTRIBUTING.md | 4 ++++ LICENSE | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0f97e779129..4f5d19ce2ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,6 +9,10 @@ terms. [DCO + License](https://gitlab.com/gitlab-org/dco/blob/master/README.md) +All Documentation content that resides under the [doc/ directory](/doc) of this +repository is licensed under Creative Commons: +[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). + _This notice should stay as the first item in the CONTRIBUTING.md file._ --- diff --git a/LICENSE b/LICENSE index a76372fad2c..a42e07dfe91 100644 --- a/LICENSE +++ b/LICENSE @@ -4,4 +4,9 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- + +All Documentation content that resides under the doc/ directory of this +repository is licensed under Creative Commons: CC BY-SA 4.0. -- cgit v1.2.1 From 15b10c344b1b909b2a90331926aa4082cd86045b Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 3 May 2018 17:15:32 +0200 Subject: Dont remove duplicates in Runner.owned_or_shared since its not necessary --- app/models/ci/runner.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 2dfd038d5a8..23078f1c3ed 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -40,7 +40,10 @@ module Ci } scope :owned_or_shared, -> (project_id) do - union = Gitlab::SQL::Union.new([belonging_to_project(project_id), belonging_to_parent_group_of_project(project_id), shared]) + union = Gitlab::SQL::Union.new( + [belonging_to_project(project_id), belonging_to_parent_group_of_project(project_id), shared], + remove_duplicates: false + ) from("(#{union.to_sql}) ci_runners") end -- cgit v1.2.1 From cb49d68c4fe565cc4fdc3a326c45e3ded548cd24 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 3 May 2018 17:17:01 +0200 Subject: Use smallint for runner_type since its an enum --- db/migrate/20180430101916_add_runner_type_to_ci_runners.rb | 2 +- db/schema.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20180430101916_add_runner_type_to_ci_runners.rb b/db/migrate/20180430101916_add_runner_type_to_ci_runners.rb index 8c8009f28fb..42409349b75 100644 --- a/db/migrate/20180430101916_add_runner_type_to_ci_runners.rb +++ b/db/migrate/20180430101916_add_runner_type_to_ci_runners.rb @@ -4,6 +4,6 @@ class AddRunnerTypeToCiRunners < ActiveRecord::Migration DOWNTIME = false def change - add_column :ci_runners, :runner_type, :integer + add_column :ci_runners, :runner_type, :smallint end end diff --git a/db/schema.rb b/db/schema.rb index 177ad0bf23e..a37e6edc8d1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -480,7 +480,7 @@ ActiveRecord::Schema.define(version: 20180503150427) do t.integer "access_level", default: 0, null: false t.string "ip_address" t.integer "maximum_timeout" - t.integer "runner_type" + t.integer "runner_type", limit: 2 end add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree -- cgit v1.2.1 From 8e7b12aeaed2b67bf4dfafa0c95a09e6a8620a8a Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 3 May 2018 10:45:13 -0500 Subject: Remove a warning from spec/features/admin/admin_users_spec.rb --- spec/features/admin/admin_users_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 8f0a3611052..8fc57f4b4c3 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -285,7 +285,7 @@ describe "Admin::Users" do it "lists group projects" do within(:css, '.append-bottom-default + .panel') do expect(page).to have_content 'Group projects' - expect(page).to have_link group.name, admin_group_path(group) + expect(page).to have_link group.name, href: admin_group_path(group) end end -- cgit v1.2.1 From 322b5d129c3bebee10fedc1e908ce9aa4b7c23a0 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 3 May 2018 10:45:28 -0500 Subject: Use limited_counter_with_delimiter in the admin user list tabs This drastically reduces page load times at gitlab.com scale. --- app/views/admin/users/index.html.haml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 0ef4b71f4fe..10b8bf5d565 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -42,31 +42,31 @@ = nav_link(html_options: { class: active_when(params[:filter].nil?) }) do = link_to admin_users_path do Active - %small.badge= number_with_delimiter(User.active.count) + %small.badge= limited_counter_with_delimiter(User.active) = nav_link(html_options: { class: active_when(params[:filter] == 'admins') }) do = link_to admin_users_path(filter: "admins") do Admins - %small.badge= number_with_delimiter(User.admins.count) + %small.badge= limited_counter_with_delimiter(User.admins) = nav_link(html_options: { class: "#{active_when(params[:filter] == 'two_factor_enabled')} filter-two-factor-enabled" }) do = link_to admin_users_path(filter: 'two_factor_enabled') do 2FA Enabled - %small.badge= number_with_delimiter(User.with_two_factor.count) + %small.badge= limited_counter_with_delimiter(User.with_two_factor) = nav_link(html_options: { class: "#{active_when(params[:filter] == 'two_factor_disabled')} filter-two-factor-disabled" }) do = link_to admin_users_path(filter: 'two_factor_disabled') do 2FA Disabled - %small.badge= number_with_delimiter(User.without_two_factor.count) + %small.badge= limited_counter_with_delimiter(User.without_two_factor) = nav_link(html_options: { class: active_when(params[:filter] == 'external') }) do = link_to admin_users_path(filter: 'external') do External - %small.badge= number_with_delimiter(User.external.count) + %small.badge= limited_counter_with_delimiter(User.external) = nav_link(html_options: { class: active_when(params[:filter] == 'blocked') }) do = link_to admin_users_path(filter: "blocked") do Blocked - %small.badge= number_with_delimiter(User.blocked.count) + %small.badge= limited_counter_with_delimiter(User.blocked) = nav_link(html_options: { class: active_when(params[:filter] == 'wop') }) do = link_to admin_users_path(filter: "wop") do Without projects - %small.badge= number_with_delimiter(User.without_projects.count) + %small.badge= limited_counter_with_delimiter(User.without_projects) %ul.flex-list.content-list - if @users.empty? -- cgit v1.2.1 From ed9b285b0e1bbbfe88f685cdebd22227f37b97b9 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 3 May 2018 18:02:38 +0200 Subject: Fix constants in backfill_runner_type_for_ci_runners_post_migrate.rb --- ...0430143705_backfill_runner_type_for_ci_runners_post_migrate.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb b/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb index 9186a729a40..38af5aae924 100644 --- a/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb +++ b/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb @@ -3,17 +3,17 @@ class BackfillRunnerTypeForCiRunnersPostMigrate < ActiveRecord::Migration DOWNTIME = false - PROJECT_RUNNER_TYPE = 1 - INSTANCE_RUNNER_TYPE = 3 + INSTANCE_RUNNER_TYPE = 1 + PROJECT_RUNNER_TYPE = 3 disable_ddl_transaction! def up - update_column_in_batches(:ci_runners, :runner_type, PROJECT_RUNNER_TYPE) do |table, query| + update_column_in_batches(:ci_runners, :runner_type, INSTANCE_RUNNER_TYPE) do |table, query| query.where(table[:is_shared].eq(true)).where(table[:runner_type].eq(nil)) end - update_column_in_batches(:ci_runners, :runner_type, INSTANCE_RUNNER_TYPE) do |table, query| + update_column_in_batches(:ci_runners, :runner_type, PROJECT_RUNNER_TYPE) do |table, query| query.where(table[:is_shared].eq(false)).where(table[:runner_type].eq(nil)) end end -- cgit v1.2.1 From 829441dcbccf79e5bb8c9c3d7486a81e6a3dbfe4 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Wed, 4 Apr 2018 16:56:14 +0200 Subject: Update grape-entity 0.6.0 -> 0.7.1 --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 7a18fab2058..932b4ccc94e 100644 --- a/Gemfile +++ b/Gemfile @@ -90,7 +90,7 @@ gem 'github-linguist', '~> 5.3.3', require: 'linguist' # API gem 'grape', '~> 1.0' -gem 'grape-entity', '~> 0.6.0' +gem 'grape-entity', '~> 0.7.1' gem 'rack-cors', '~> 1.0.0', require: 'rack/cors' # Disable strong_params so that Mash does not respond to :permitted? diff --git a/Gemfile.lock b/Gemfile.lock index 87ee15e9e76..b1912671665 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -366,8 +366,8 @@ GEM rack (>= 1.3.0) rack-accept virtus (>= 1.0.0) - grape-entity (0.6.0) - activesupport + grape-entity (0.7.1) + activesupport (>= 4.0) multi_json (>= 1.3.2) grape-route-helpers (2.1.0) activesupport @@ -1073,7 +1073,7 @@ DEPENDENCIES google-protobuf (= 3.5.1) gpgme grape (~> 1.0) - grape-entity (~> 0.6.0) + grape-entity (~> 0.7.1) grape-route-helpers (~> 2.1.0) grape_logging (~> 1.7) grpc (~> 1.11.0) -- cgit v1.2.1 From e50bed7eff276eac2dc1fbb86bddb04d9dd9e70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 3 May 2018 18:15:48 +0200 Subject: Fix lambda arguments in Grape entities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- lib/api/entities.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 75d56b82424..1619c1a09ee 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -149,11 +149,11 @@ module API expose_url(api_v4_projects_path(id: project.id)) end - expose :issues, if: -> (*args) { issues_available?(*args) } do |project| + expose :issues, if: -> (project, options) { issues_available?(project, options) } do |project| expose_url(api_v4_projects_issues_path(id: project.id)) end - expose :merge_requests, if: -> (*args) { mrs_available?(*args) } do |project| + expose :merge_requests, if: -> (project, options) { mrs_available?(project, options) } do |project| expose_url(api_v4_projects_merge_requests_path(id: project.id)) end -- cgit v1.2.1 From 11f38dd12abedf17c09098170de295ce0b533d3b Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Fri, 4 May 2018 07:25:36 +0200 Subject: Make add_index_to_namespaces_runners_token migration reversible --- .../20180503150427_add_index_to_namespaces_runners_token.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb b/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb index d6c4a5c432c..4c4e576d49f 100644 --- a/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb +++ b/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb @@ -8,7 +8,13 @@ class AddIndexToNamespacesRunnersToken < ActiveRecord::Migration disable_ddl_transaction! - def change + def up add_concurrent_index :namespaces, :runners_token, unique: true end + + def down + if index_exists?(:namespaces, :runners_token, unique: true) + remove_index :namespaces, :runners_token + end + end end -- cgit v1.2.1 From 7f107539ab78c120b99c10570ccc5301c14c035f Mon Sep 17 00:00:00 2001 From: Winnie Hellmann Date: Fri, 4 May 2018 07:42:44 +0000 Subject: Clarify location of Vue templates --- doc/development/fe_guide/style_guide_js.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/development/fe_guide/style_guide_js.md b/doc/development/fe_guide/style_guide_js.md index 677168937c7..04dfe418dbe 100644 --- a/doc/development/fe_guide/style_guide_js.md +++ b/doc/development/fe_guide/style_guide_js.md @@ -310,7 +310,7 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation. })); ``` -1. Don not use a singleton for the service or the store +1. Do not use a singleton for the service or the store ```javascript // bad class Store { @@ -328,9 +328,11 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation. } } ``` +1. Use `.vue` for Vue templates. Do not use `%template` in HAML. #### Naming -1. **Extensions**: Use `.vue` extension for Vue components. + +1. **Extensions**: Use `.vue` extension for Vue components. Do not use `.js` as file extension ([#34371]). 1. **Reference Naming**: Use PascalCase for their instances: ```javascript // bad @@ -364,6 +366,8 @@ Please check this [rules][eslint-plugin-vue-rules] for more documentation. ``` +[#34371]: https://gitlab.com/gitlab-org/gitlab-ce/issues/34371 + #### Alignment 1. Follow these alignment styles for the template method: 1. With more than one attribute, all attributes should be on a new line: -- cgit v1.2.1 From b570bd464426d948c847111e3ad9415d8ba4325d Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Thu, 3 May 2018 16:00:01 +0300 Subject: Inform the user when there are no project import options available --- app/views/projects/new.html.haml | 4 ++++ ...m-the-user-when-there-are-no-project-import-options-available.yml | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 changelogs/unreleased/inform-the-user-when-there-are-no-project-import-options-available.yml diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index b66e0559603..81e6129ccda 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -105,6 +105,10 @@ %hr = render "shared/import_form", f: f = render 'new_project_fields', f: f, project_name_id: "import-url-name" + - else + .nothing-here-block + %h4 No import options available + %p Contact an administrator to enable options for importing your project. .save-project-loader.hide .center diff --git a/changelogs/unreleased/inform-the-user-when-there-are-no-project-import-options-available.yml b/changelogs/unreleased/inform-the-user-when-there-are-no-project-import-options-available.yml new file mode 100644 index 00000000000..c14f21fc644 --- /dev/null +++ b/changelogs/unreleased/inform-the-user-when-there-are-no-project-import-options-available.yml @@ -0,0 +1,5 @@ +--- +title: Inform the user when there are no project import options available +merge_request: 18716 +author: George Tsiolis +type: changed -- cgit v1.2.1 From 337ceb17a405f5136a7499f4580d8cd81061f580 Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Fri, 4 May 2018 11:33:29 +0300 Subject: Move import project pane to a separate partial --- app/views/projects/_import_project_pane.html.haml | 51 +++++++++++++++++++++++ app/views/projects/new.html.haml | 49 +--------------------- 2 files changed, 52 insertions(+), 48 deletions(-) create mode 100644 app/views/projects/_import_project_pane.html.haml diff --git a/app/views/projects/_import_project_pane.html.haml b/app/views/projects/_import_project_pane.html.haml new file mode 100644 index 00000000000..4bee6cb97eb --- /dev/null +++ b/app/views/projects/_import_project_pane.html.haml @@ -0,0 +1,51 @@ +- active_tab = local_assigns.fetch(:active_tab, 'blank') +- f = local_assigns.fetch(:f) + +.project-import.row + .col-lg-12 + .form-group.import-btn-container.clearfix + = f.label :visibility_level, class: 'label-light' do #the label here seems wrong + Import project from + .import-buttons + - if gitlab_project_import_enabled? + .import_gitlab_project.has-tooltip{ data: { container: 'body' } } + = link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit' do + = icon('gitlab', text: 'GitLab export') + %div + - if github_import_enabled? + = link_to new_import_github_path, class: 'btn js-import-github' do + = icon('github', text: 'GitHub') + %div + - if bitbucket_import_enabled? + = link_to status_import_bitbucket_path, class: "btn import_bitbucket #{'how_to_import_link' unless bitbucket_import_configured?}" do + = icon('bitbucket', text: 'Bitbucket') + - unless bitbucket_import_configured? + = render 'bitbucket_import_modal' + %div + - if gitlab_import_enabled? + = link_to status_import_gitlab_path, class: "btn import_gitlab #{'how_to_import_link' unless gitlab_import_configured?}" do + = icon('gitlab', text: 'GitLab.com') + - unless gitlab_import_configured? + = render 'gitlab_import_modal' + %div + - if google_code_import_enabled? + = link_to new_import_google_code_path, class: 'btn import_google_code' do + = icon('google', text: 'Google Code') + %div + - if fogbugz_import_enabled? + = link_to new_import_fogbugz_path, class: 'btn import_fogbugz' do + = icon('bug', text: 'Fogbugz') + %div + - if gitea_import_enabled? + = link_to new_import_gitea_path, class: 'btn import_gitea' do + = custom_icon('go_logo') + Gitea + %div + - if git_import_enabled? + %button.btn.js-toggle-button.js-import-git-toggle-button{ type: "button", data: { toggle_open_class: 'active' } } + = icon('git', text: 'Repo by URL') + .col-lg-12 + .js-toggle-content.toggle-import-form{ class: ('hide' if active_tab != 'import') } + %hr + = render "shared/import_form", f: f + = render 'new_project_fields', f: f, project_name_id: "import-url-name" diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 81e6129ccda..5beaa3c6d23 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -57,54 +57,7 @@ .tab-pane.import-project-pane.js-toggle-container{ id: 'import-project-pane', class: active_when(active_tab == 'import'), role: 'tabpanel' } = form_for @project, html: { class: 'new_project' } do |f| - if import_sources_enabled? - .project-import.row - .col-lg-12 - .form-group.import-btn-container.clearfix - = f.label :visibility_level, class: 'label-light' do #the label here seems wrong - Import project from - .import-buttons - - if gitlab_project_import_enabled? - .import_gitlab_project.has-tooltip{ data: { container: 'body' } } - = link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit' do - = icon('gitlab', text: 'GitLab export') - %div - - if github_import_enabled? - = link_to new_import_github_path, class: 'btn js-import-github' do - = icon('github', text: 'GitHub') - %div - - if bitbucket_import_enabled? - = link_to status_import_bitbucket_path, class: "btn import_bitbucket #{'how_to_import_link' unless bitbucket_import_configured?}" do - = icon('bitbucket', text: 'Bitbucket') - - unless bitbucket_import_configured? - = render 'bitbucket_import_modal' - %div - - if gitlab_import_enabled? - = link_to status_import_gitlab_path, class: "btn import_gitlab #{'how_to_import_link' unless gitlab_import_configured?}" do - = icon('gitlab', text: 'GitLab.com') - - unless gitlab_import_configured? - = render 'gitlab_import_modal' - %div - - if google_code_import_enabled? - = link_to new_import_google_code_path, class: 'btn import_google_code' do - = icon('google', text: 'Google Code') - %div - - if fogbugz_import_enabled? - = link_to new_import_fogbugz_path, class: 'btn import_fogbugz' do - = icon('bug', text: 'Fogbugz') - %div - - if gitea_import_enabled? - = link_to new_import_gitea_path, class: 'btn import_gitea' do - = custom_icon('go_logo') - Gitea - %div - - if git_import_enabled? - %button.btn.js-toggle-button.js-import-git-toggle-button{ type: "button", data: { toggle_open_class: 'active' } } - = icon('git', text: 'Repo by URL') - .col-lg-12 - .js-toggle-content.toggle-import-form{ class: ('hide' if active_tab != 'import') } - %hr - = render "shared/import_form", f: f - = render 'new_project_fields', f: f, project_name_id: "import-url-name" + = render 'import_project_pane', f: f, active_tab: active_tab - else .nothing-here-block %h4 No import options available -- cgit v1.2.1 From 1d74a0e93a8d60b44bc02e4eef8175f5c2170232 Mon Sep 17 00:00:00 2001 From: Fabio Busatto Date: Fri, 4 May 2018 09:48:53 +0000 Subject: Resolve "Reconcile project templates with Auto DevOps" --- ...reconcile-project-templates-with-auto-devops.yml | 5 +++++ lib/gitlab/project_template.rb | 6 +++--- vendor/project_templates/express.tar.gz | Bin 5608 -> 4866 bytes vendor/project_templates/rails.tar.gz | Bin 25004 -> 25151 bytes vendor/project_templates/spring.tar.gz | Bin 50938 -> 49430 bytes 5 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelogs/unreleased/36762-reconcile-project-templates-with-auto-devops.yml diff --git a/changelogs/unreleased/36762-reconcile-project-templates-with-auto-devops.yml b/changelogs/unreleased/36762-reconcile-project-templates-with-auto-devops.yml new file mode 100644 index 00000000000..8169b18f875 --- /dev/null +++ b/changelogs/unreleased/36762-reconcile-project-templates-with-auto-devops.yml @@ -0,0 +1,5 @@ +--- +title: Reconcile project templates with Auto DevOps +merge_request: 18737 +author: +type: changed diff --git a/lib/gitlab/project_template.rb b/lib/gitlab/project_template.rb index ae136202f0c..08f6a54776f 100644 --- a/lib/gitlab/project_template.rb +++ b/lib/gitlab/project_template.rb @@ -25,9 +25,9 @@ module Gitlab end TEMPLATES_TABLE = [ - ProjectTemplate.new('rails', 'Ruby on Rails', 'Includes an MVC structure, gemfile, rakefile, and .gitlab-ci.yml file, along with many others, to help you get started.', 'https://gitlab.com/gitlab-org/project-templates/rails'), - ProjectTemplate.new('spring', 'Spring', 'Includes an MVC structure, mvnw, pom.xml, and .gitlab-ci.yml file to help you get started.', 'https://gitlab.com/gitlab-org/project-templates/spring'), - ProjectTemplate.new('express', 'NodeJS Express', 'Includes an MVC structure and .gitlab-ci.yml file to help you get started.', 'https://gitlab.com/gitlab-org/project-templates/express') + ProjectTemplate.new('rails', 'Ruby on Rails', 'Includes an MVC structure, Gemfile, Rakefile, along with many others, to help you get started.', 'https://gitlab.com/gitlab-org/project-templates/rails'), + ProjectTemplate.new('spring', 'Spring', 'Includes an MVC structure, mvnw and pom.xml to help you get started.', 'https://gitlab.com/gitlab-org/project-templates/spring'), + ProjectTemplate.new('express', 'NodeJS Express', 'Includes an MVC structure to help you get started.', 'https://gitlab.com/gitlab-org/project-templates/express') ].freeze class << self diff --git a/vendor/project_templates/express.tar.gz b/vendor/project_templates/express.tar.gz index 06093deb459..8dd5fa36987 100644 Binary files a/vendor/project_templates/express.tar.gz and b/vendor/project_templates/express.tar.gz differ diff --git a/vendor/project_templates/rails.tar.gz b/vendor/project_templates/rails.tar.gz index 85cc1b6bb78..89337dc5c31 100644 Binary files a/vendor/project_templates/rails.tar.gz and b/vendor/project_templates/rails.tar.gz differ diff --git a/vendor/project_templates/spring.tar.gz b/vendor/project_templates/spring.tar.gz index e98d3ce7b8f..31c90d0820f 100644 Binary files a/vendor/project_templates/spring.tar.gz and b/vendor/project_templates/spring.tar.gz differ -- cgit v1.2.1 From 3fe555a751274538390b3f61b2cc5ff576d62785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Carlb=C3=A4cker?= Date: Fri, 4 May 2018 10:45:20 +0000 Subject: Add note about rebase/squash duplication in Gitaly --- lib/gitlab/git/repository.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 84d37f77fbb..2ec720a93b9 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -20,6 +20,9 @@ module Gitlab GIT_ALTERNATE_OBJECT_DIRECTORIES_RELATIVE ].freeze SEARCH_CONTEXT_LINES = 3 + # In https://gitlab.com/gitlab-org/gitaly/merge_requests/698 + # We copied these two prefixes into gitaly-go, so don't change these + # or things will break! (REBASE_WORKTREE_PREFIX and SQUASH_WORKTREE_PREFIX) REBASE_WORKTREE_PREFIX = 'rebase'.freeze SQUASH_WORKTREE_PREFIX = 'squash'.freeze GITALY_INTERNAL_URL = 'ssh://gitaly/internal.git'.freeze @@ -1671,10 +1674,14 @@ module Gitlab end end + # This function is duplicated in Gitaly-Go, don't change it! + # https://gitlab.com/gitlab-org/gitaly/merge_requests/698 def fresh_worktree?(path) File.exist?(path) && !clean_stuck_worktree(path) end - + + # This function is duplicated in Gitaly-Go, don't change it! + # https://gitlab.com/gitlab-org/gitaly/merge_requests/698 def clean_stuck_worktree(path) return false unless File.mtime(path) < 15.minutes.ago -- cgit v1.2.1 From 8cbabe43be4def12b2bbfdd02f66137cbd2a4851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Carlb=C3=A4cker?= Date: Fri, 4 May 2018 11:27:08 +0000 Subject: Update repository.rb --- lib/gitlab/git/repository.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 2ec720a93b9..60ce8cfc195 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -1679,7 +1679,7 @@ module Gitlab def fresh_worktree?(path) File.exist?(path) && !clean_stuck_worktree(path) end - + # This function is duplicated in Gitaly-Go, don't change it! # https://gitlab.com/gitlab-org/gitaly/merge_requests/698 def clean_stuck_worktree(path) -- cgit v1.2.1