Skip to content

Commit 0a3f042

Browse files
committed
Azure: fix modular push
This commit fixes the Azure's modular push by adding to the missing `ProductProperty` model to the submission request, during the building of the filtered resources on `get_modular_resources_to_publish` After re-checking the documentation and performing a manual testing it was noticed that this was the last missing piece for the modular push. Refers to SPSTRAT-633 Signed-off-by: Jonathan Gangi <[email protected]>
1 parent 6277899 commit 0a3f042

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

cloudpub/ms_azure/service.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,13 @@ def get_modular_resources_to_publish(
563563
# The following resources shouldn't be required:
564564
# -> customer-leads
565565
# -> test-drive
566-
# -> property
567566
# -> *listing*
568567
# -> reseller
569568
# -> price-and-availability-*
570569
# NOTE: The "submission" resource will be already added by the "submit_to_status" method
571570
#
572-
# With that it needs only the related "product" and "plan" resources alongisde the
573-
# updated tech_config
571+
# With that it needs only the related "product", "property" and "plan" resources alongisde
572+
# the updated tech_config
574573
product_id = tech_config.product_id
575574
plan_id = tech_config.plan_id
576575
prod_res = cast(
@@ -581,6 +580,14 @@ def get_modular_resources_to_publish(
581580
if prd.id == product_id
582581
],
583582
)[0]
583+
property = cast(
584+
List[ProductProperty],
585+
[
586+
prop
587+
for prop in self.filter_product_resources(product=product, resource="property")
588+
if prop.product_id == product_id
589+
],
590+
)[0]
584591
plan_res = cast(
585592
List[PlanSummary],
586593
[
@@ -589,7 +596,7 @@ def get_modular_resources_to_publish(
589596
if pln.id == plan_id
590597
],
591598
)[0]
592-
return [prod_res, plan_res, tech_config]
599+
return [prod_res, property, plan_res, tech_config]
593600

594601
def compute_targets(self, product_id: str) -> List[str]:
595602
"""List all the possible publishing targets order to seek data from Azure.

tests/ms_azure/test_service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,7 @@ def test_publish_live_modular_push(
19061906
submission: Dict[str, Any],
19071907
product_summary_obj: ProductSummary,
19081908
plan_summary_obj: PlanSummary,
1909+
product_property_obj: ProductProperty,
19091910
metadata_azure_obj: mock.MagicMock,
19101911
gen2_image: Dict[str, Any],
19111912
caplog: pytest.LogCaptureFixture,
@@ -1947,6 +1948,7 @@ def test_publish_live_modular_push(
19471948
expected_tc = VMIPlanTechConfig.from_json(new_tc)
19481949
expected_modular_resources = [
19491950
product_summary_obj,
1951+
product_property_obj,
19501952
plan_summary_obj,
19511953
expected_tc,
19521954
ProductSubmission.from_json(submission_preview),

0 commit comments

Comments
 (0)