diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 03:08:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 03:08:09 +0300 |
commit | 2a65a97e12a0754b9f0d91ee996a6e61e00c80c8 (patch) | |
tree | f439c93cc95a324ba7422b0b650431a628be9b07 /lib | |
parent | 2d96e61ceb1a3f26283dfba43f85d99488752296 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/job.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/need.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/needs.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/yaml_processor.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/import_export/attribute_cleaner.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/import_export/import_export.yml | 84 | ||||
-rw-r--r-- | lib/gitlab/utils/override.rb | 13 |
8 files changed, 101 insertions, 9 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 6d33cb214ee..cc95be5e3be 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1672,7 +1672,7 @@ module API expose :artifacts, using: Artifacts expose :cache, using: Cache expose :credentials, using: Credentials - expose :dependencies, using: Dependency + expose :all_dependencies, as: :dependencies, using: Dependency expose :features end end diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb index 517caabc79e..6a55b8cda57 100644 --- a/lib/gitlab/ci/config/entry/job.rb +++ b/lib/gitlab/ci/config/entry/job.rb @@ -134,7 +134,7 @@ module Gitlab entry :needs, Entry::Needs, description: 'Needs configuration for this job.', - metadata: { allowed_needs: %i[job] }, + metadata: { allowed_needs: %i[job cross_dependency] }, inherit: false entry :variables, Entry::Variables, diff --git a/lib/gitlab/ci/config/entry/need.rb b/lib/gitlab/ci/config/entry/need.rb index 61bd09fd5f3..abfffb7a5ed 100644 --- a/lib/gitlab/ci/config/entry/need.rb +++ b/lib/gitlab/ci/config/entry/need.rb @@ -6,7 +6,9 @@ module Gitlab module Entry class Need < ::Gitlab::Config::Entry::Simplifiable strategy :JobString, if: -> (config) { config.is_a?(String) } - strategy :JobHash, if: -> (config) { config.is_a?(Hash) && config.key?(:job) } + + strategy :JobHash, + if: -> (config) { config.is_a?(Hash) && config.key?(:job) && !(config.key?(:project) || config.key?(:ref)) } class JobString < ::Gitlab::Config::Entry::Node include ::Gitlab::Config::Entry::Validatable diff --git a/lib/gitlab/ci/config/entry/needs.rb b/lib/gitlab/ci/config/entry/needs.rb index 28452aaaa16..5301c453ed4 100644 --- a/lib/gitlab/ci/config/entry/needs.rb +++ b/lib/gitlab/ci/config/entry/needs.rb @@ -53,3 +53,5 @@ module Gitlab end end end + +::Gitlab::Ci::Config::Entry::Needs.prepend_if_ee('::EE::Gitlab::Ci::Config::Entry::Needs') diff --git a/lib/gitlab/ci/yaml_processor.rb b/lib/gitlab/ci/yaml_processor.rb index 8ac864eb5cf..27cd4f5fd6b 100644 --- a/lib/gitlab/ci/yaml_processor.rb +++ b/lib/gitlab/ci/yaml_processor.rb @@ -69,6 +69,7 @@ module Gitlab services: job[:services], artifacts: job[:artifacts], dependencies: job[:dependencies], + cross_dependencies: job.dig(:needs, :cross_dependency), job_timeout: job[:timeout], before_script: job[:before_script], script: job[:script], diff --git a/lib/gitlab/import_export/attribute_cleaner.rb b/lib/gitlab/import_export/attribute_cleaner.rb index 50fec9f3eb9..c8dbec7bcba 100644 --- a/lib/gitlab/import_export/attribute_cleaner.rb +++ b/lib/gitlab/import_export/attribute_cleaner.rb @@ -3,7 +3,7 @@ module Gitlab module ImportExport class AttributeCleaner - ALLOWED_REFERENCES = RelationFactory::PROJECT_REFERENCES + RelationFactory::USER_REFERENCES + %w[group_id commit_id] + ALLOWED_REFERENCES = RelationFactory::PROJECT_REFERENCES + RelationFactory::USER_REFERENCES + %w[group_id commit_id discussion_id] PROHIBITED_REFERENCES = Regexp.union(/\Acached_markdown_version\Z/, /_id\Z/, /_ids\Z/, /_html\Z/).freeze def self.clean(*args) diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml index ba1ccd77604..4f4b4c02eb9 100644 --- a/lib/gitlab/import_export/import_export.yml +++ b/lib/gitlab/import_export/import_export.yml @@ -172,24 +172,36 @@ excluded_attributes: - :external_diff - :stored_externally - :external_diff_store + - :merge_request_id + merge_request_diff_commits: + - :merge_request_diff_id merge_request_diff_files: - :diff - :external_diff_offset - :external_diff_size + - :merge_request_diff_id issues: - :milestone_id + - :moved_to_id + - :state_id + - :duplicated_to_id + - :promoted_to_epic_id merge_request: - :milestone_id - :ref_fetched - :merge_jid - :rebase_jid - :latest_merge_request_diff_id + - :head_pipeline_id + - :state_id merge_requests: - :milestone_id - :ref_fetched - :merge_jid - :rebase_jid - :latest_merge_request_diff_id + - :head_pipeline_id + - :state_id award_emoji: - :awardable_id statuses: @@ -203,6 +215,16 @@ excluded_attributes: - :artifacts_metadata_store - :artifacts_size - :commands + - :runner_id + - :trigger_request_id + - :erased_by_id + - :auto_canceled_by_id + - :stage_id + - :upstream_pipeline_id + - :resource_group_id + - :waiting_for_resource_at + sentry_issue: + - :issue_id push_event_payload: - :event_id project_badges: @@ -211,6 +233,9 @@ excluded_attributes: - :reference - :reference_html - :epic_id + - :issue_id + - :merge_request_id + - :label_id runners: - :token - :token_encrypted @@ -222,7 +247,64 @@ excluded_attributes: - :enabled service_desk_setting: - :outgoing_name - + priorities: + - :label_id + events: + - :target_id + timelogs: + - :issue_id + - :merge_request_id + notes: + - :noteable_id + - :review_id + label_links: + - :label_id + - :target_id + issue_assignees: + - :issue_id + zoom_meetings: + - :issue_id + design: + - :issue_id + designs: + - :issue_id + design_versions: + - :issue_id + actions: + - :design_id + - :version_id + links: + - :release_id + project_members: + - :source_id + metrics: + - :merge_request_id + - :pipeline_id + suggestions: + - :note_id + ci_pipelines: + - :auto_canceled_by_id + - :pipeline_schedule_id + - :merge_request_id + - :external_pull_request_id + stages: + - :pipeline_id + merge_access_levels: + - :protected_branch_id + push_access_levels: + - :protected_branch_id + unprotect_access_levels: + - :protected_branch_id + create_access_levels: + - :protected_tag_id + deploy_access_levels: + - :protected_environment_id + boards: + - :milestone_id + lists: + - :board_id + - :label_id + - :milestone_id methods: notes: - :type diff --git a/lib/gitlab/utils/override.rb b/lib/gitlab/utils/override.rb index 35aea209cb9..784a6686962 100644 --- a/lib/gitlab/utils/override.rb +++ b/lib/gitlab/utils/override.rb @@ -146,7 +146,8 @@ module Gitlab def prepended(base = nil) super - queue_verification(base) if base + # prepend can override methods, thus we need to verify it like classes + queue_verification(base, verify: true) if base end def extended(mod = nil) @@ -155,11 +156,15 @@ module Gitlab queue_verification(mod.singleton_class) if mod end - def queue_verification(base) + def queue_verification(base, verify: false) return unless ENV['STATIC_VERIFICATION'] - if base.is_a?(Class) # We could check for Class in `override` - # This could be `nil` if `override` was never called + # We could check for Class in `override` + # This could be `nil` if `override` was never called. + # We also force verification for prepend because it can also override + # a method like a class, but not the cases for include or extend. + # This includes Rails helpers but not limited to. + if base.is_a?(Class) || verify Override.extensions[self]&.add_class(base) end end |