From 631744a0740ea35cad9bb4094ee85f318ac1b72f Mon Sep 17 00:00:00 2001 From: Jonathan Gangi Date: Tue, 8 Oct 2024 10:09:45 -0300 Subject: [PATCH] Community: Allow a better handle of Release Type This commit enhances the `release.type` definition by allowing it to be null whenever `ga` or `beta` is not meant to be set. With this change, the `release.type` behavior will be executed as follow: - If `--beta` is passed on cmd line or in the StArMap mappings it will set the value to "beta" - Otherwise, if the value "ga" is set on StArMap mappings it will set `release.type` to "ga" - Else: the `release.type` will be null and not used in the AMI name. Refers to SPSTRAT-417 --- .../_marketplacesvm/tasks/community_push/command.py | 5 ++++- .../_marketplacesvm/tasks/community_push/items.py | 13 +++++++++++-- tests/community_push/test_community_push.py | 1 + ...do_community_push_different_sharing_accounts.txt | 4 ++-- .../test_do_community_push_major_minor.txt | 2 +- .../test_do_community_push_offline_starmap.txt | 4 ++-- ...est_do_community_push_overridden_destination.txt | 10 +++++++--- ...do_community_push_skip_houly_sap_ha[RHEL_HA].txt | 2 +- ...est_do_community_push_skip_houly_sap_ha[SAP].txt | 2 +- 9 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/pubtools/_marketplacesvm/tasks/community_push/command.py b/src/pubtools/_marketplacesvm/tasks/community_push/command.py index b11c47b..4e211f0 100644 --- a/src/pubtools/_marketplacesvm/tasks/community_push/command.py +++ b/src/pubtools/_marketplacesvm/tasks/community_push/command.py @@ -305,10 +305,13 @@ def enrich_mapped_items( for dest in mrobj.destinations: pi = mapped_item.get_push_item_for_destination(dest) log.debug("Mapped push item for %s: %s", storage_account, pi) - beta = self.args.beta or str(pi.release.type) == "beta" + r = dest.meta.get("release") or {} + r_type = str(r.get("type", "")).lower() + beta = self.args.beta or r_type == "beta" epi = enrich_push_item( pi, dest, + ga=r_type == "ga", beta=beta, require_bc=self._REQUIRE_BC, billing_config=mapped_item.starmap_query_entity.billing_code_config, diff --git a/src/pubtools/_marketplacesvm/tasks/community_push/items.py b/src/pubtools/_marketplacesvm/tasks/community_push/items.py index efa421c..23aeef5 100644 --- a/src/pubtools/_marketplacesvm/tasks/community_push/items.py +++ b/src/pubtools/_marketplacesvm/tasks/community_push/items.py @@ -122,6 +122,7 @@ def _fix_arm64_arch(push_item: AmiPushItem) -> AmiPushItem: def enrich_push_item( push_item: AmiPushItem, destination: Destination, + ga: bool, beta: bool, require_bc: bool = True, billing_config: Optional[BILLING_CONFIG] = None, @@ -134,8 +135,10 @@ def enrich_push_item( The push item to enrich with the missing values destination: The destination with all required information to enrich the push item. + ga: + Whether the release type is "ga" or not. beta: - Whether the release type is "beta" or not ("ga") + Whether the release type is "beta" or not. require_bc: Whether the billing_codes are required (True) or not (False). Defaults to True. @@ -161,7 +164,13 @@ def enrich_push_item( pi = _fix_arm64_arch(pi) # Set the release type - rel_type = "beta" if beta else "ga" + r = destination.meta.get("release") or {} + if beta: + rel_type = "beta" + elif ga: + rel_type = "ga" + else: + rel_type = None rel = evolve(pi.release, type=rel_type) pi = evolve(pi, release=rel) diff --git a/tests/community_push/test_community_push.py b/tests/community_push/test_community_push.py index 3b32e0a..b6a4b2d 100644 --- a/tests/community_push/test_community_push.py +++ b/tests/community_push/test_community_push.py @@ -254,6 +254,7 @@ def test_do_community_push_overridden_destination( }, "billing-code-config": starmap_ami_billing_config, "cloud": "aws", + "meta": {"release": {"type": "ga"}}, "name": "sample-product", "workflow": "community", } diff --git a/tests/logs/community_push/test_community_push/test_do_community_push_different_sharing_accounts.txt b/tests/logs/community_push/test_community_push/test_do_community_push_different_sharing_accounts.txt index f4e7fd2..fc56a33 100644 --- a/tests/logs/community_push/test_community_push/test_do_community_push_different_sharing_accounts.txt +++ b/tests/logs/community_push/test_community_push/test_do_community_push_different_sharing_accounts.txt @@ -31,7 +31,7 @@ [ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access [ DEBUG] Matched billing rule sample-access for sample_product_test.raw [ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['fake-destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='fake-destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['fake-destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type=None), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='fake-destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) [ INFO] Adding push item "ami_pushitem" with destination "fake-destination-access" and type "access" to the queue. [ INFO] Loading accounts from StArMap: ['first_account', 'second_account'] [ DEBUG] Loaded the following accounts as "accounts": ['first_account', 'second_account'] @@ -65,7 +65,7 @@ [ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access [ DEBUG] Matched billing rule sample-access for sample_product_test.raw [ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['fake-destination2-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='fake-destination2', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='anotherprovider', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['fake-destination2-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type=None), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='fake-destination2', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='anotherprovider', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) [ INFO] Adding push item "ami_pushitem" with destination "fake-destination2-access" and type "access" to the queue. [ INFO] Loading accounts from StArMap: ['third_account', 'fourth_account'] [ DEBUG] Loaded the following accounts as "accounts": ['third_account', 'fourth_account'] diff --git a/tests/logs/community_push/test_community_push/test_do_community_push_major_minor.txt b/tests/logs/community_push/test_community_push/test_do_community_push_major_minor.txt index f86df7c..eeef1ac 100644 --- a/tests/logs/community_push/test_community_push/test_do_community_push_major_minor.txt +++ b/tests/logs/community_push/test_community_push/test_do_community_push_major_minor.txt @@ -26,7 +26,7 @@ [ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. [ DEBUG] Mapped push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={}, id=None, architecture='x86_64', destination='fake-destination-access', overwrite=False, restrict_version=False, restrict_major=2, restrict_minor=2, provider='awstest', tags=None)], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region=None, virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) [ WARNING] BILLING CODES REQUIREMENT IS CURRENTLY DISABLED! -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['fake-destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='fake-destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['fake-destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type=None), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='fake-destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) [ INFO] Adding push item "ami_pushitem" with destination "fake-destination-access" and type "access" to the queue. [ WARNING] No accounts definition in StArMap, leaving the defaults from credentials. [ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. diff --git a/tests/logs/community_push/test_community_push/test_do_community_push_offline_starmap.txt b/tests/logs/community_push/test_community_push/test_do_community_push_offline_starmap.txt index 43df5e1..bfc3115 100644 --- a/tests/logs/community_push/test_community_push/test_do_community_push_offline_starmap.txt +++ b/tests/logs/community_push/test_community_push/test_do_community_push_offline_starmap.txt @@ -29,7 +29,7 @@ [ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access [ DEBUG] Matched billing rule sample-access for sample_product_test.raw [ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) -[ DEBUG] Enriched push item for aws-na: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['new_aws-na_destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='new_aws-na_destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Enriched push item for aws-na: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['new_aws-na_destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type=None), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='new_aws-na_destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) [ INFO] Adding push item "ami_pushitem" with destination "new_aws-na_destination-access" and type "access" to the queue. [ WARNING] No accounts definition in StArMap, leaving the defaults from credentials. [ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. @@ -62,7 +62,7 @@ [ DEBUG] Matched billing rule sample-hourly for sample_product_test.raw [ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type hourly [ DEBUG] Billing codes for ami_pushitem: ['bp-6fa54006'] (Hourly2) -[ DEBUG] Enriched push item for aws-emea: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['new_aws-emea_destination-hourly'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region='new_aws-emea_destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Hourly2', codes=['bp-6fa54006']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=True, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Enriched push item for aws-emea: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['new_aws-emea_destination-hourly'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type=None), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region='new_aws-emea_destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Hourly2', codes=['bp-6fa54006']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=True, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) [ INFO] Adding push item "ami_pushitem" with destination "new_aws-emea_destination-hourly" and type "hourly" to the queue. [ WARNING] No accounts definition in StArMap, leaving the defaults from credentials. [ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. diff --git a/tests/logs/community_push/test_community_push/test_do_community_push_overridden_destination.txt b/tests/logs/community_push/test_community_push/test_do_community_push_overridden_destination.txt index 43df5e1..6c9de18 100644 --- a/tests/logs/community_push/test_community_push/test_do_community_push_overridden_destination.txt +++ b/tests/logs/community_push/test_community_push/test_do_community_push_overridden_destination.txt @@ -1,7 +1,9 @@ [ INFO] Loading items from koji:https://fakekoji.com?vmi_build=ami_build [ INFO] Retrieving the mappings for ami_pushitem from https://starmap-example.com using the community workflow. -[ INFO] starmap query returned for ami_pushitem : {"name": "sample-product", "version": "7.0", "query_response": {"meta": null, "name": "sample-product", "billing_code_config": {"sample-hourly": {"codes": ["bp-6fa54006"], "image_name": "sample_product", "image_types": ["hourly"], "name": "Hourly2"}, "sample-access": {"codes": ["bp-63a5400a"], "image_name": "sample_product", "image_types": ["access"], "name": "Access2"}}, "cloud": "aws", "workflow": "community", "mappings": {"aws-na": {"meta": {}, "destinations": [{"meta": {}, "id": null, "architecture": null, "destination": "new_aws-na_destination-access", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "provider": "awstest", "tags": null}], "provider": "awstest"}, "aws-emea": {"meta": {}, "destinations": [{"meta": {}, "id": null, "architecture": null, "destination": "new_aws-emea_destination-hourly", "overwrite": true, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "provider": "awstest", "tags": null}], "provider": "awstest"}}}} +[ INFO] starmap query returned for ami_pushitem : {"name": "sample-product", "version": "7.0", "query_response": {"meta": {"release": {"type": "ga"}}, "name": "sample-product", "billing_code_config": {"sample-hourly": {"codes": ["bp-6fa54006"], "image_name": "sample_product", "image_types": ["hourly"], "name": "Hourly2"}, "sample-access": {"codes": ["bp-63a5400a"], "image_name": "sample_product", "image_types": ["access"], "name": "Access2"}}, "cloud": "aws", "workflow": "community", "mappings": {"aws-na": {"meta": {"release": {"type": "ga"}}, "destinations": [{"meta": {"release": {"type": "ga"}}, "id": null, "architecture": null, "destination": "new_aws-na_destination-access", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "provider": "awstest", "tags": null}], "provider": "awstest"}, "aws-emea": {"meta": {"release": {"type": "ga"}}, "destinations": [{"meta": {"release": {"type": "ga"}}, "id": null, "architecture": null, "destination": "new_aws-emea_destination-hourly", "overwrite": true, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "provider": "awstest", "tags": null}], "provider": "awstest"}}}} [ INFO] Processing the storage account aws-na +[ DEBUG] Merging original release information with data from StArMap +[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'} [ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.description, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset. @@ -24,7 +26,7 @@ [ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws-na: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={}, id=None, architecture=None, destination='new_aws-na_destination-access', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, provider='awstest', tags=None)], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region=None, virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Mapped push item for aws-na: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'release': {'type': 'ga'}}, id=None, architecture=None, destination='new_aws-na_destination-access', overwrite=False, restrict_version=False, restrict_major=None, restrict_minor=None, provider='awstest', tags=None)], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region=None, virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) [ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type access [ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access [ DEBUG] Matched billing rule sample-access for sample_product_test.raw @@ -35,6 +37,8 @@ [ WARNING] No sharing_accounts definition in StArMap, leaving the defaults from credentials. [ WARNING] No snapshot_accounts definition in StArMap, leaving the defaults from credentials. [ INFO] Processing the storage account aws-emea +[ DEBUG] Merging original release information with data from StArMap +[ DEBUG] Creating a VMIRelease object with {'product': 'sample_product', 'date': datetime.datetime(2023, 12, 12, 0, 0), 'arch': 'x86_64', 'respin': 1, 'version': '7.0', 'base_product': 'sample_base', 'base_version': '1.0', 'variant': 'variant', 'type': 'ga'} [ WARNING] Missing information for the attribute ami_pushitem.build, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.description, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.boot_mode, leaving it unset. @@ -57,7 +61,7 @@ [ WARNING] Missing information for the attribute ami_pushitem.version_title, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.security_groups, leaving it unset. [ WARNING] Missing information for the attribute ami_pushitem.access_endpoint_url, leaving it unset. -[ DEBUG] Mapped push item for aws-emea: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={}, id=None, architecture=None, destination='new_aws-emea_destination-hourly', overwrite=True, restrict_version=False, restrict_major=None, restrict_minor=None, provider='awstest', tags=None)], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region=None, virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Mapped push item for aws-emea: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=[Destination(meta={'release': {'type': 'ga'}}, id=None, architecture=None, destination='new_aws-emea_destination-hourly', overwrite=True, restrict_version=False, restrict_major=None, restrict_minor=None, provider='awstest', tags=None)], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='sample-product', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='sample_product', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='hourly', region=None, virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=None, release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type=None, image_id=None, public_image=None, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) [ DEBUG] Attempting to match billing rule sample-hourly to sample_product_test.raw type hourly [ DEBUG] Matched billing rule sample-hourly for sample_product_test.raw [ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type hourly diff --git a/tests/logs/community_push/test_community_push/test_do_community_push_skip_houly_sap_ha[RHEL_HA].txt b/tests/logs/community_push/test_community_push/test_do_community_push_skip_houly_sap_ha[RHEL_HA].txt index 0b10f7b..d8c0078 100644 --- a/tests/logs/community_push/test_community_push/test_do_community_push_skip_houly_sap_ha[RHEL_HA].txt +++ b/tests/logs/community_push/test_community_push/test_do_community_push_skip_houly_sap_ha[RHEL_HA].txt @@ -29,7 +29,7 @@ [ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access [ DEBUG] Matched billing rule sample-access for sample_product_test.raw [ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['fake-destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='RHEL_HA', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='fake-destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['fake-destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='RHEL_HA', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type=None), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='fake-destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) [ WARNING] Skipping upload of '/foo/bar/sample_product_test.raw' for 'fake-destination-access' as the image is expected to be pushed only to hourly destinations [ ERROR] No push item was processed. [ INFO] Collecting results diff --git a/tests/logs/community_push/test_community_push/test_do_community_push_skip_houly_sap_ha[SAP].txt b/tests/logs/community_push/test_community_push/test_do_community_push_skip_houly_sap_ha[SAP].txt index 49937da..2805b44 100644 --- a/tests/logs/community_push/test_community_push/test_do_community_push_skip_houly_sap_ha[SAP].txt +++ b/tests/logs/community_push/test_community_push/test_do_community_push_skip_houly_sap_ha[SAP].txt @@ -29,7 +29,7 @@ [ DEBUG] Attempting to match billing rule sample-access to sample_product_test.raw type access [ DEBUG] Matched billing rule sample-access for sample_product_test.raw [ DEBUG] Billing codes for ami_pushitem: ['bp-63a5400a'] (Access2) -[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['fake-destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='SAP', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type='ga'), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='fake-destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) +[ DEBUG] Enriched push item for aws_storage: AmiPushItem(name='ami_pushitem', state='PENDING', src='/foo/bar/sample_product_test.raw', dest=['fake-destination-access'], md5sum=None, sha256sum=None, origin=None, build=None, build_info=KojiBuildInfo(name='test-build', version='7.0', release='20230101', id=None), signing_key=None, release=AmiRelease(product='SAP', date=datetime.datetime(2023, 12, 12, 0, 0), arch='x86_64', respin=1, version='7.0', base_product='sample_base', base_version='1.0', variant='variant', type=None), description='', boot_mode=None, marketplace_title_template=None, marketplace_name=None, type='access', region='fake-destination', virtualization='hvm', volume='/dev/sda1', root_device=None, sriov_net_support=None, ena_support=None, uefi_support=None, billing_codes=AmiBillingCodes(name='Access2', codes=['bp-63a5400a']), release_notes=None, usage_instructions=None, recommended_instance_type=None, marketplace_entity_type='awstest', image_id=None, public_image=False, scanning_port=None, user_name=None, version_title=None, security_groups=[], access_endpoint_url=None) [ WARNING] Skipping upload of '/foo/bar/sample_product_test.raw' for 'fake-destination-access' as the image is expected to be pushed only to hourly destinations [ ERROR] No push item was processed. [ INFO] Collecting results