Commit 51425e91 authored by Alex Pooley's avatar Alex Pooley

Merge branch...

Merge branch '336012-forked-project-should-include-original-external-authorization-classification-label' into 'master'

Include original project classification in forked projects

See merge request gitlab-org/gitlab!67769
parents 682a7aa4 f8066950
...@@ -61,7 +61,8 @@ module Projects ...@@ -61,7 +61,8 @@ module Projects
# initializing the project, as that would cause a foreign key constraint # initializing the project, as that would cause a foreign key constraint
# exception. # exception.
relations_block: -> (project) { build_fork_network_member(project) }, relations_block: -> (project) { build_fork_network_member(project) },
skip_disk_validation: skip_disk_validation skip_disk_validation: skip_disk_validation,
external_authorization_classification_label: @project.external_authorization_classification_label
} }
if @project.avatar.present? && @project.avatar.image? if @project.avatar.present? && @project.avatar.image?
......
...@@ -28,7 +28,8 @@ RSpec.describe Projects::ForkService do ...@@ -28,7 +28,8 @@ RSpec.describe Projects::ForkService do
namespace: @from_namespace, namespace: @from_namespace,
star_count: 107, star_count: 107,
avatar: avatar, avatar: avatar,
description: 'wow such project') description: 'wow such project',
external_authorization_classification_label: 'classification-label')
@to_user = create(:user) @to_user = create(:user)
@to_namespace = @to_user.namespace @to_namespace = @to_user.namespace
@from_project.add_user(@to_user, :developer) @from_project.add_user(@to_user, :developer)
...@@ -66,6 +67,7 @@ RSpec.describe Projects::ForkService do ...@@ -66,6 +67,7 @@ RSpec.describe Projects::ForkService do
it { expect(to_project.description).to eq(@from_project.description) } it { expect(to_project.description).to eq(@from_project.description) }
it { expect(to_project.avatar.file).to be_exists } it { expect(to_project.avatar.file).to be_exists }
it { expect(to_project.ci_config_path).to eq(@from_project.ci_config_path) } it { expect(to_project.ci_config_path).to eq(@from_project.ci_config_path) }
it { expect(to_project.external_authorization_classification_label).to eq(@from_project.external_authorization_classification_label) }
# This test is here because we had a bug where the from-project lost its # This test is here because we had a bug where the from-project lost its
# avatar after being forked. # avatar after being forked.
......
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