diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-10 15:08:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-10 15:08:59 +0300 |
commit | 7351a484d79236b7e9d47c86f2fcc970b7ae10b0 (patch) | |
tree | 651b5fca7ea0460e3ce7c687cfa9e3a3b37eefc8 /lib | |
parent | b4ded0ba7b4d2cdbed5b1f331cf2083a25ee4d7c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/background_migration/backfill_project_settings.rb | 18 | ||||
-rw-r--r-- | lib/gitlab/ci/pipeline/seed/deployment.rb | 10 | ||||
-rw-r--r-- | lib/gitlab/ci/status/build/failed.rb | 7 |
3 files changed, 32 insertions, 3 deletions
diff --git a/lib/gitlab/background_migration/backfill_project_settings.rb b/lib/gitlab/background_migration/backfill_project_settings.rb new file mode 100644 index 00000000000..7d7f19e1fda --- /dev/null +++ b/lib/gitlab/background_migration/backfill_project_settings.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Gitlab + module BackgroundMigration + # Backfill project_settings for a range of projects + class BackfillProjectSettings + def perform(start_id, end_id) + ActiveRecord::Base.connection.execute <<~SQL + INSERT INTO project_settings (project_id, created_at, updated_at) + SELECT projects.id, now(), now() + FROM projects + WHERE projects.id BETWEEN #{start_id} AND #{end_id} + ON CONFLICT (project_id) DO NOTHING; + SQL + end + end + end +end diff --git a/lib/gitlab/ci/pipeline/seed/deployment.rb b/lib/gitlab/ci/pipeline/seed/deployment.rb index 8c90f03cb1d..cc63fb4c609 100644 --- a/lib/gitlab/ci/pipeline/seed/deployment.rb +++ b/lib/gitlab/ci/pipeline/seed/deployment.rb @@ -24,8 +24,14 @@ module Gitlab # non-environment job. return unless deployment.valid? && deployment.environment.persisted? - deployment.cluster_id = - deployment.environment.deployment_platform&.cluster_id + if cluster_id = deployment.environment.deployment_platform&.cluster_id + # double write cluster_id until 12.9: https://gitlab.com/gitlab-org/gitlab/issues/202628 + deployment.cluster_id = cluster_id + deployment.deployment_cluster = ::DeploymentCluster.new( + cluster_id: cluster_id, + kubernetes_namespace: deployment.environment.deployment_namespace + ) + end # Allocate IID for deployments. # This operation must be outside of transactions of pipeline creations. diff --git a/lib/gitlab/ci/status/build/failed.rb b/lib/gitlab/ci/status/build/failed.rb index 910d93f54ce..0915a98a0fa 100644 --- a/lib/gitlab/ci/status/build/failed.rb +++ b/lib/gitlab/ci/status/build/failed.rb @@ -18,7 +18,12 @@ module Gitlab archived_failure: 'archived failure', unmet_prerequisites: 'unmet prerequisites', scheduler_failure: 'scheduler failure', - data_integrity_failure: 'data integrity failure' + data_integrity_failure: 'data integrity failure', + invalid_bridge_trigger: 'downstream pipeline trigger definition is invalid', + downstream_bridge_project_not_found: 'downstream project could not be found', + insufficient_bridge_permissions: 'no permissions to trigger downstream pipeline', + bridge_pipeline_is_child_pipeline: 'creation of child pipeline not allowed from another child pipeline', + downstream_pipeline_creation_failed: 'downstream pipeline can not be created' }.freeze private_constant :REASONS |