Plan import is blocked to prevent deleting your plan notifications silently with Bamboo Specs
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
要約
When pushing a Bamboo Spec to the Bamboo Server and the plan already exists with notifications, Bamboo Specs will stop the push and report the following exception:
com.atlassian.bamboo.specs.api.exceptions.BambooSpecsPublishingException: An error occurred while publishing plan BAMBOO-SPEC: Plan import is blocked to prevent deleting your plan notifications silently. If you are confident that you want to delete all plan notifications, use com.atlassian.bamboo.specs.api.builders.plan.Plan.noNotifications method explicitly
環境
Prior to the Bamboo version 7.0
原因
The publish has found an existing plan with the same key as the plan you are trying to publish and this plan has notifications configured which would be entirely removed by the definition you're publishing. As a safe-guard against this silent notification deletion, Bamboo Specs validation is stopping the publish.
回避策
オプション 1
Upgrade to Bamboo version 7.0 or later where this validation has been removed. Simply not specifying any notifications will result in all notifications being removed from the plan. If you want to retain existing notifications, make sure they are defined within your Bamboo Spec.
オプション 2
If you are sure you want to remove all notifications from the existing plan (and that you're publishing to the correct plan key), you can add .noNotifications()
to your Plan object in the Spec to override the validation.
例:
Plan plan = new Plan(new Project()
.key(new BambooKey("SPEC"))
.name("SPEC"),
"RSS",
new BambooKey("RSS"))
.noNotifications()
.pluginConfigurations(new ConcurrentBuilds()
.useSystemWideDefault(false)
.maximumNumberOfConcurrentBuilds(4))
.stages(new Stage("Default Stage")
(...)