Skip to content

Commit 22d63f5

Browse files
committed
Add attribute "marketplace_title" to VMIRelease
This commit introduces a new optional parameter on `VMIRelease` and `AmiRelease` models called `marketplace_title` which is going to be used by the pubtool as the marketplace "version title" whenever it's set, by overriding the usual version title which the pubtool was going to compute. This is required for some layered products which requires a specialized templating title instead of the one generated by the pubtool. With this, it will be possible to transport the template via the VMIPushItem from the source to the pubtooling which will format it into the apropriate value for the marketaplace. Refers to SPSTRAT-116
1 parent d9ab92c commit 22d63f5

File tree

8 files changed

+14
-0
lines changed

8 files changed

+14
-0
lines changed

src/pushsource/_impl/model/ami.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def _from_data(cls, data):
2727
"base_version": data.get("base_version") or None,
2828
"variant": data.get("variant") or None,
2929
"type": data.get("type") or None,
30+
"marketplace_title": data.get("marketplace_title") or None,
3031
}
3132
return cls(**kwargs)
3233

src/pushsource/_impl/model/vms.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ class VMIRelease(object):
5454
type = attr.ib(type=str, default=None, validator=optional_str)
5555
"""Release type, typically "ga" or "beta"."""
5656

57+
marketplace_title = attr.ib(type=str, default=None, validator=optional_str)
58+
"""Customer facing title or title template for the marketplace release. It supports any
59+
variable named after the attributes from this class, except itself.
60+
61+
Example:
62+
"7.4 Update {version} on RHEL {base_version} {date}-{respin}"."""
63+
5764

5865
@attr.s()
5966
class VMIPushItem(PushItem):

tests/baseline/cases/staged-simple-ami-bc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ items:
3434
base_product: null
3535
base_version: null
3636
date: 2020-05-11
37+
marketplace_title: null
3738
product: Fake-Product
3839
respin: 1
3940
type: ga

tests/baseline/cases/staged-simple-ami-bootmode.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ items:
3030
base_product: null
3131
base_version: null
3232
date: 2020-05-11
33+
marketplace_title: null
3334
product: Fake-Product
3435
respin: 1
3536
type: ga

tests/baseline/cases/staged-simple-ami-uefi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ items:
3030
base_product: null
3131
base_version: null
3232
date: 2020-05-11
33+
marketplace_title: null
3334
product: Fake-Product
3435
respin: 1
3536
type: ga

tests/baseline/cases/staged-simple-ami.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ items:
3030
base_product: null
3131
base_version: null
3232
date: 2020-05-11
33+
marketplace_title: null
3334
product: Fake-Product
3435
respin: 1
3536
type: ga

tests/staged/data/simple_ami/staged.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ payload:
1616
product: Fake-Product
1717
respin: 1
1818
type: ga
19+
marketplace_title: "Fake marketplace title"
1920
variant: Fake-Variant
2021
version: Fake-Version
2122
root_device: /dev/sda1

tests/staged/data/simple_ami_with_bc/staged.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ payload:
1818
type: ga
1919
variant: Fake-Variant
2020
version: Fake-Version
21+
marketplace_title: "Fake marketplace title"
2122
marketplace_entity_type: AMIProduct
2223
recommended_instance_type: t2.micro
2324
usage_instructions: fake usage instructions

0 commit comments

Comments
 (0)