Commit 9a784bcf authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents a8d04c5f 866465f6
---
title: Update merge train documentation
merge_request: 32218
author:
type: changed
---
title: Prevent empty external authorization classification labels from overriding
the default label
merge_request: 32517
author: Will Chandler
type: fixed
......@@ -61,6 +61,20 @@ CAUTION: **Warning:**
Make sure your `gitlab-ci.yml` file is [configured properly for pipelines for merge requests](../index.md#configuring-pipelines-for-merge-requests),
otherwise pipelines for merged results won't run and your merge requests will be stuck in an unresolved state.
## Automatic pipeline cancelation
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/12996) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.3.
GitLab CI can detect the presence of redundant pipelines,
and will cancel them automatically in order to conserve CI resources.
When a user merges a merge request immediately within an ongoing merge
train, the train will be reconstructed, as it will recreate the expected
post-merge commit and pipeline. In this case, the merge train may already
have pipelines running against the previous expected post-merge commit.
These pipelines are considered redundant and will be automatically
canceled.
## Troubleshooting
### Pipelines for merged results not created even with new change pushed to merge request
......
......@@ -107,7 +107,7 @@ module Gitlab
def project_params
@project_params ||= begin
attrs = json_params.merge(override_params).merge(visibility_level)
attrs = json_params.merge(override_params).merge(visibility_level, external_label)
# Cleaning all imported and overridden params
Gitlab::ImportExport::AttributeCleaner.clean(relation_hash: attrs,
......@@ -135,6 +135,13 @@ module Gitlab
{ 'visibility_level' => level }
end
def external_label
label = override_params['external_authorization_classification_label'].presence ||
json_params['external_authorization_classification_label'].presence
{ 'external_authorization_classification_label' => label }
end
# Given a relation hash containing one or more models and its relationships,
# loops through each model and each object from a model type and
# and assigns its correspondent attributes hash from +tree_hash+
......
......@@ -512,6 +512,24 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
expect(Milestone.find_by_title('Group-level milestone').iid).to eq(2)
end
end
context 'with external authorization classification labels' do
it 'converts empty external classification authorization labels to nil' do
project.create_import_data(data: { override_params: { external_authorization_classification_label: "" } })
restored_project_json
expect(project.external_authorization_classification_label).to be_nil
end
it 'preserves valid external classification authorization labels' do
project.create_import_data(data: { override_params: { external_authorization_classification_label: "foobar" } })
restored_project_json
expect(project.external_authorization_classification_label).to eq("foobar")
end
end
end
describe '#restored_project' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment