From 830780d6cf7a3be710f87b90bb458fcb9d11b019 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 5 Jun 2024 15:48:02 +0200 Subject: [PATCH] beps/0009: add conflict resolution Signed-off-by: Patrik Oldsberg --- beps/0009-plugin-metadata/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/beps/0009-plugin-metadata/README.md b/beps/0009-plugin-metadata/README.md index 366a042e46..ce66e64416 100644 --- a/beps/0009-plugin-metadata/README.md +++ b/beps/0009-plugin-metadata/README.md @@ -135,7 +135,16 @@ The `backstage.pluginPackage` field is required when publishing a package with a ## Design Details -_-_ +### Package Relationships Conflict Resolution + +Conflicts in the defined metadata are handled as follows: + +- The union of all `pluginPackages` is always used. If there are multiple packages defined for the same role, conflicts are resolved using the `backstage.moved` field if possible, but otherwise all packages are rejected. +- All plugin packages with references to each other must have the same `pluginId`, or they are all rejected. +- A module must have the same `pluginId` as the plugin it is a module for, or it is rejected. +- If the role of a package does not match the definition in the `pluginPackages` field, the package is rejected. + +When metadata is "rejected" the consumer should either throw an error, or treat the conflicted fields as if they do not exist. ### References & Prior Art