Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completely remove stage_preview feature #9

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/pubtools/_marketplacesvm/cloud_providers/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ def _publish(
push_item: AmiPushItem,
nochannel: bool,
overwrite: bool = False,
preview_only=False,
**kwargs,
) -> Tuple[AmiPushItem, Any]:
"""
Expand Down
10 changes: 1 addition & 9 deletions src/pubtools/_marketplacesvm/cloud_providers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def _publish(
push_item: T,
nochannel: bool,
overwrite: bool = False,
preview_only: bool = False,
**kwargs,
) -> Tuple[T, Any]:
"""
Expand All @@ -136,9 +135,6 @@ def _publish(
overwrite (bool, optional)
Whether to replace every image in the product with the given one or not.
Defaults to ``False``
preview_only (bool, optional)
Whether to publish with the final state as "preview" instead of "live"
when applicable.
"""

#
Expand Down Expand Up @@ -230,7 +226,6 @@ def publish(
push_item: T,
nochannel: bool,
overwrite: bool = False,
preview_only: bool = False,
**kwargs,
) -> Tuple[T, Any]:
"""
Expand All @@ -244,13 +239,10 @@ def publish(
set to `False`.
overwrite (bool, optional)
Whether set only the requested image and erase everything else or not.
preview_only (bool, optional)
Whether to publish with the final state as "preview" instead of "live"
when applicable.
Returns:
object: The publish result data.
"""
pi, res = self._publish(push_item, nochannel, overwrite, preview_only, **kwargs)
pi, res = self._publish(push_item, nochannel, overwrite, **kwargs)
return self._post_publish(pi, res, nochannel, **kwargs)


Expand Down
4 changes: 0 additions & 4 deletions src/pubtools/_marketplacesvm/cloud_providers/ms_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ def _publish(
push_item: VHDPushItem,
nochannel: bool,
overwrite: bool = False,
preview_only: bool = False,
**kwargs,
) -> Tuple[VHDPushItem, Any]:
"""
Expand All @@ -284,8 +283,6 @@ def _publish(
overwrite (bool, optional)
Whether to replace every image in the product with the given one or not.
Defaults to ``False``
preview_only (bool, optional)
Whether to publish with the final state as "preview" instead of "live"
"""
if not push_item.disk_version:
push_item = evolve(push_item, disk_version=self._generate_disk_version(push_item))
Expand All @@ -305,7 +302,6 @@ def _publish(
"destination": destination,
"keepdraft": nochannel,
"overwrite": overwrite,
"preview_only": preview_only,
}
metadata = AzurePublishMetadata(**publish_metadata_kwargs)
res = self.publish_svc.publish(metadata)
Expand Down
1 change: 0 additions & 1 deletion tests/cloud_providers/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def _publish(
push_item: T,
nochannel: bool,
overwrite: bool = False,
preview_only: bool = False,
**kwargs,
) -> Tuple[T, Any]:
return push_item, True
Expand Down
1 change: 0 additions & 1 deletion tests/cloud_providers/test_provider_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ def test_publish(
"destination": azure_push_item.dest[0],
"keepdraft": False,
"overwrite": False,
"preview_only": False,
}
meta_obj = MagicMock(**metadata)
mock_metadata.return_value = meta_obj
Expand Down
2 changes: 1 addition & 1 deletion tests/combined_push/test_combined_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _upload(self, push_item, custom_tags=None, **kwargs):
def _pre_publish(self, push_item, **kwargs):
return push_item, kwargs

def _publish(self, push_item, nochannel, overwrite, preview_only, **kwargs):
def _publish(self, push_item, nochannel, overwrite, **kwargs):
return push_item, nochannel


Expand Down
2 changes: 1 addition & 1 deletion tests/community_push/test_community_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _upload(self, push_item, custom_tags=None, **kwargs):
def _pre_publish(self, push_item, **kwargs):
return push_item, kwargs

def _publish(self, push_item, nochannel, overwrite, preview_only):
def _publish(self, push_item, nochannel, overwrite, **kwargs):
return push_item, nochannel


Expand Down
8 changes: 4 additions & 4 deletions tests/push/test_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _upload(self, push_item, custom_tags=None, **kwargs):
def _pre_publish(self, push_item, **kwargs):
return push_item, kwargs

def _publish(self, push_item, nochannel, overwrite, preview_only, **kwargs):
def _publish(self, push_item, nochannel, overwrite, **kwargs):
return push_item, nochannel


Expand Down Expand Up @@ -112,7 +112,7 @@ def _upload(self, push_item, custom_tags=None, **kwargs):
def _pre_publish(self, push_item, **kwargs):
return push_item, kwargs

def _publish(self, push_item, nochannel, overwrite, preview_only, **kwargs):
def _publish(self, push_item, nochannel, overwrite, **kwargs):
# This log will allow us to identify whether the image_id is the expected
self.log.debug(f"Pushing {push_item.name} with image: {push_item.image_id}")
return push_item, nochannel
Expand Down Expand Up @@ -192,7 +192,7 @@ def _upload(self, push_item, custom_tags=None, **kwargs):
def _pre_publish(self, push_item, **kwargs):
return push_item, kwargs

def _publish(self, push_item, nochannel, overwrite, preview_only, **kwargs):
def _publish(self, push_item, nochannel, overwrite, **kwargs):
# This log will allow us to identify whether the sas_uri is the expected
self.log.debug(f"Pushing {push_item.name} with image: {push_item.sas_uri}")
return push_item, nochannel
Expand Down Expand Up @@ -448,7 +448,7 @@ def test_push_item_fail_publish(
"""Test a push which fails on publish for AWS."""

class FakePublish(FakeCloudProvider):
def _publish(self, push_item, nochannel, overwrite, preview_only, **kwargs):
def _publish(self, push_item, nochannel, overwrite, **kwargs):
raise Exception("Random exception")

mock_cloud_instance.return_value = FakePublish()
Expand Down
Loading