Since Release Bundles are designed to be immutable, any modification theoretically requires creating a new Release Bundle version. For example, in a bundle containing hundreds of artifacts, upgrading a single library would traditionally require rebuilding the entire bundle from scratch.
Patching provides greater speed and flexibility by enabling you to take an existing Release Bundle v2 version and create a new version by applying specific changes to it (such as additions, removals, and replacements). Instead of redefining the entire contents of the Release Bundle, you only need to define the changes.
To patch a Release Bundle v2 version use the optional included and excluded filters in the Create Release Bundle v2 Version REST API. For example:
{
"release_bundle_name": "A",
"release_bundle_version": "3",
"sources": [
{
"source_type": "release_bundles",
"release_bundles": [
{
"project_key": "default",
"repository_key": "release-bundles-v2",
"release_bundle_name": "A",
"release_bundle_version": "2"
}
]
}
],
"filters": {
"included": [
{
"package_type": "docker"
},
{
"package_type": "generic"
}
],
"excluded": [
{
"path": "**/*.png"
}
]
}
}In the example shown above, the new version of the Release Bundle (version 3) will be based on the current version (version 2), but with the following changes:
Docker and generic packages will be included.
Any PNG files included in the current Release Bundle version will be removed.