diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 00:08:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 00:08:11 +0000 |
commit | 23bc19cb73aad969c9636b8b935111645e809e54 (patch) | |
tree | 887c9e014f8345f577769db4f75315ca59853b98 /app | |
parent | c4db541c1b2c97ab1eda354ea3899489fe5c33e5 (diff) | |
download | gitlab-ce-23bc19cb73aad969c9636b8b935111645e809e54.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue | 31 | ||||
-rw-r--r-- | app/finders/releases_finder.rb | 3 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 2 | ||||
-rw-r--r-- | app/models/concerns/has_repository.rb | 9 | ||||
-rw-r--r-- | app/models/project.rb | 5 | ||||
-rw-r--r-- | app/models/snippet.rb | 3 | ||||
-rw-r--r-- | app/services/ci/create_job_artifacts_service.rb | 1 |
7 files changed, 47 insertions, 7 deletions
diff --git a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue index faaa65b1a16..a3743ded601 100644 --- a/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue +++ b/app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue @@ -1,4 +1,6 @@ <script> +import { GlSprintf, GlLink } from '@gitlab/ui'; + import settingsMixin from 'ee_else_ce/pages/projects/shared/permissions/mixins/settings_pannel_mixin'; import { s__ } from '~/locale'; import projectFeatureSetting from './project_feature_setting.vue'; @@ -19,6 +21,8 @@ export default { projectFeatureSetting, projectFeatureToggle, projectSettingRow, + GlSprintf, + GlLink, }, mixins: [settingsMixin], @@ -67,6 +71,16 @@ export default { required: false, default: '', }, + lfsObjectsExist: { + type: Boolean, + required: false, + default: false, + }, + lfsObjectsRemovalHelpPath: { + type: String, + required: false, + default: '', + }, registryHelpPath: { type: String, required: false, @@ -377,6 +391,23 @@ export default { :disabled-input="!repositoryEnabled" name="project[lfs_enabled]" /> + <p v-if="!lfsEnabled && lfsObjectsExist"> + <gl-sprintf + :message=" + s__( + 'ProjectSettings|LFS objects from this repository are still available to forks. %{linkStart}How do I remove them?%{linkEnd}', + ) + " + > + <template #link="{ content }"> + <span class="d-block"> + <gl-link :href="lfsObjectsRemovalHelpPath" target="_blank"> + {{ content }} + </gl-link> + </span> + </template> + </gl-sprintf> + </p> </project-setting-row> <project-setting-row v-if="packagesAvailable" diff --git a/app/finders/releases_finder.rb b/app/finders/releases_finder.rb index 72bf968c8ec..e58a90922a5 100644 --- a/app/finders/releases_finder.rb +++ b/app/finders/releases_finder.rb @@ -9,7 +9,8 @@ class ReleasesFinder def execute(preload: true) return Release.none unless Ability.allowed?(@current_user, :read_release, @project) - releases = @project.releases + # See https://gitlab.com/gitlab-org/gitlab/-/issues/211988 + releases = @project.releases.where.not(tag: nil) # rubocop:disable CodeReuse/ActiveRecord releases = releases.preloaded if preload releases.sorted end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index cf9f3b9e924..015f8783db5 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -603,6 +603,8 @@ module ProjectsHelper registryHelpPath: help_page_path('user/packages/container_registry/index'), lfsAvailable: Gitlab.config.lfs.enabled, lfsHelpPath: help_page_path('workflow/lfs/manage_large_binaries_with_git_lfs'), + lfsObjectsExist: project.lfs_objects.exists?, + lfsObjectsRemovalHelpPath: help_page_path('administration/lfs/manage_large_binaries_with_git_lfs', anchor: 'removing-objects-from-lfs'), pagesAvailable: Gitlab.config.pages.enabled, pagesAccessControlEnabled: Gitlab.config.pages.access_control, pagesAccessControlForced: ::Gitlab::Pages.access_control_is_forced?, diff --git a/app/models/concerns/has_repository.rb b/app/models/concerns/has_repository.rb index cc792eab2e0..d50e088944e 100644 --- a/app/models/concerns/has_repository.rb +++ b/app/models/concerns/has_repository.rb @@ -15,6 +15,15 @@ module HasRepository delegate :base_dir, :disk_path, to: :storage + class_methods do + def pick_repository_storage + # We need to ensure application settings are fresh when we pick + # a repository storage to use. + Gitlab::CurrentSettings.expire_current_application_settings + Gitlab::CurrentSettings.pick_repository_storage + end + end + def valid_repo? repository.exists? rescue diff --git a/app/models/project.rb b/app/models/project.rb index b9d8fd1e4d8..9d055cbd6c6 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -67,10 +67,7 @@ class Project < ApplicationRecord default_value_for :resolve_outdated_diff_discussions, false default_value_for :container_registry_enabled, gitlab_config_features.container_registry default_value_for(:repository_storage) do - # We need to ensure application settings are fresh when we pick - # a repository storage to use. - Gitlab::CurrentSettings.expire_current_application_settings - Gitlab::CurrentSettings.pick_repository_storage + pick_repository_storage end default_value_for(:shared_runners_enabled) { Gitlab::CurrentSettings.shared_runners_enabled } diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 90221f4e463..b6127baca90 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -288,8 +288,7 @@ class Snippet < ApplicationRecord end def repository_storage - snippet_repository&.shard_name || - Gitlab::CurrentSettings.pick_repository_storage + snippet_repository&.shard_name || self.class.pick_repository_storage end def create_repository diff --git a/app/services/ci/create_job_artifacts_service.rb b/app/services/ci/create_job_artifacts_service.rb index d207c215618..5d7d552dc5a 100644 --- a/app/services/ci/create_job_artifacts_service.rb +++ b/app/services/ci/create_job_artifacts_service.rb @@ -77,6 +77,7 @@ module Ci track_exception(error, job, params) error(error.message, :service_unavailable) rescue => error + track_exception(error, job, params) error(error.message, :bad_request) end |