Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Conversation

seiffert
Copy link
Contributor

@seiffert seiffert commented Apr 6, 2018

This changes how new versions of already deployed services are created. Instead of creating a plain new version, the old one is cloned.

This original work was done by @joaopereiramrf in #43. I'm extracting the version cloning here, refactor it a bit and fix the tests.

@seiffert seiffert force-pushed the clone_versions branch 4 times, most recently from d775b43 to b04bf2e Compare April 9, 2018 10:06
@seiffert seiffert force-pushed the clone_versions branch 3 times, most recently from b716d1a to 98d0743 Compare April 9, 2018 12:46
@seiffert
Copy link
Contributor Author

seiffert commented Apr 9, 2018

PTAL @Jimdo/werkzeugschmiede @boris-jarkowicz

@seiffert seiffert requested a review from fstehle April 9, 2018 13:48
Copy link
Contributor Author

@seiffert seiffert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed together with @smon

actions.append("Deployed new version because settings are not up to date")
version_number = self.clone_old_version(service.id)
self.reset_version(service.id, version_number)
self.configure_version(service.id, fastly_configuration, activate_new_version, version_number)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pull out activate

if current_version is None:
self.deploy_version_with_configuration(service.id, fastly_configuration, activate_new_version)
actions.append("Deployed new version because service has no active version")
if current_version is None or service.active_version is None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add explicit branch for doing nothing

version_number = version['number']
return version['number']

def clone_old_version(self, service_id):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clone_active_version

'DELETE')
if response.status == 200:
return response.payload
else:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be simplified

@smon smon merged commit 3c2db0f into master Apr 10, 2018
@smon smon deleted the clone_versions branch April 10, 2018 16:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants