diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 21:08:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 21:08:57 +0000 |
commit | a6c2be7cd20a9515b347e72d63c5b47bb9b79457 (patch) | |
tree | 568212b4debeb2a35bb1133209b98e1468d9ee85 /app | |
parent | 74a2d57b337034cfdcd719615e4da06643b69114 (diff) | |
download | gitlab-ce-a6c2be7cd20a9515b347e72d63c5b47bb9b79457.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/graphql/mutations/issues/update.rb | 20 | ||||
-rw-r--r-- | app/models/lfs_object.rb | 1 | ||||
-rw-r--r-- | app/services/projects/lfs_pointers/lfs_link_service.rb | 4 | ||||
-rw-r--r-- | app/services/projects/update_pages_service.rb | 4 |
4 files changed, 23 insertions, 6 deletions
diff --git a/app/graphql/mutations/issues/update.rb b/app/graphql/mutations/issues/update.rb index 119bc51e4a4..4a21df98898 100644 --- a/app/graphql/mutations/issues/update.rb +++ b/app/graphql/mutations/issues/update.rb @@ -5,7 +5,25 @@ module Mutations class Update < Base graphql_name 'UpdateIssue' - # Add arguments here instead of creating separate mutations + argument :title, + GraphQL::STRING_TYPE, + required: false, + description: copy_field_description(Types::IssueType, :title) + + argument :description, + GraphQL::STRING_TYPE, + required: false, + description: copy_field_description(Types::IssueType, :description) + + argument :due_date, + Types::TimeType, + required: true, + description: copy_field_description(Types::IssueType, :due_date) + + argument :confidential, + GraphQL::BOOLEAN_TYPE, + required: true, + description: copy_field_description(Types::IssueType, :confidential) def resolve(project_path:, iid:, **args) issue = authorized_find!(project_path: project_path, iid: iid) diff --git a/app/models/lfs_object.rb b/app/models/lfs_object.rb index 48c971194c6..6a86aebae39 100644 --- a/app/models/lfs_object.rb +++ b/app/models/lfs_object.rb @@ -11,6 +11,7 @@ class LfsObject < ApplicationRecord scope :with_files_stored_locally, -> { where(file_store: LfsObjectUploader::Store::LOCAL) } scope :with_files_stored_remotely, -> { where(file_store: LfsObjectUploader::Store::REMOTE) } + scope :for_oids, -> (oids) { where(oid: oids) } validates :oid, presence: true, uniqueness: true diff --git a/app/services/projects/lfs_pointers/lfs_link_service.rb b/app/services/projects/lfs_pointers/lfs_link_service.rb index a05c76f5e85..39cd553261f 100644 --- a/app/services/projects/lfs_pointers/lfs_link_service.rb +++ b/app/services/projects/lfs_pointers/lfs_link_service.rb @@ -25,7 +25,6 @@ module Projects private - # rubocop: disable CodeReuse/ActiveRecord def link_existing_lfs_objects(oids) linked_existing_objects = [] iterations = 0 @@ -33,7 +32,7 @@ module Projects oids.each_slice(BATCH_SIZE) do |oids_batch| # Load all existing LFS Objects immediately so we don't issue an extra # query for the `.any?` - existent_lfs_objects = LfsObject.where(oid: oids_batch).load + existent_lfs_objects = LfsObject.for_oids(oids_batch).load next unless existent_lfs_objects.any? rows = existent_lfs_objects @@ -49,7 +48,6 @@ module Projects linked_existing_objects end - # rubocop: enable CodeReuse/ActiveRecord def log_lfs_link_results(lfs_objects_linked_count, iterations) Gitlab::Import::Logger.info( diff --git a/app/services/projects/update_pages_service.rb b/app/services/projects/update_pages_service.rb index 8b23f610ad1..59389a0fa65 100644 --- a/app/services/projects/update_pages_service.rb +++ b/app/services/projects/update_pages_service.rb @@ -27,7 +27,7 @@ module Projects @status.run! raise InvalidStateError, 'missing pages artifacts' unless build.artifacts? - raise InvalidStateError, 'pages are outdated' unless latest? + raise InvalidStateError, 'build SHA is outdated for this ref' unless latest? # Create temporary directory in which we will extract the artifacts make_secure_tmp_dir(tmp_path) do |archive_path| @@ -36,7 +36,7 @@ module Projects # Check if we did extract public directory archive_public_path = File.join(archive_path, PUBLIC_DIR) raise InvalidStateError, 'pages miss the public folder' unless Dir.exist?(archive_public_path) - raise InvalidStateError, 'pages are outdated' unless latest? + raise InvalidStateError, 'build SHA is outdated for this ref' unless latest? deploy_page!(archive_public_path) success |