-
Notifications
You must be signed in to change notification settings - Fork 27
Update SDK to add SnapshotParametersDefinition in uploaded artifact #255
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2.2.0.dev1 | ||
| 3.0.0.dev0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2.2.0.dev1 | ||
| 3.0.0.dev0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2.2.0.dev1 | ||
| 3.0.0.dev0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2.2.0.dev1 | ||
| 3.0.0.dev0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,6 +121,7 @@ def _internal_direct_pre_snapshot(self, request): | |
| from generated.definitions import RepositoryDefinition | ||
| from generated.definitions import LinkedSourceDefinition | ||
| from generated.definitions import SourceConfigDefinition | ||
| from generated.definitions import SnapshotParametersDefinition | ||
|
|
||
| # | ||
| # While linked.pre_snapshot() is not a required operation, this should | ||
|
|
@@ -141,10 +142,14 @@ def _internal_direct_pre_snapshot(self, request): | |
| json.loads(request.repository.parameters.json)) | ||
| source_config = SourceConfigDefinition.from_dict( | ||
| json.loads(request.source_config.parameters.json)) | ||
| snapshot_parameters = SnapshotParametersDefinition.from_dict( | ||
| json.loads(request.snapshot_parameters.parameters.json)) | ||
|
|
||
| self.pre_snapshot_impl(direct_source=direct_source, | ||
| repository=repository, | ||
| source_config=source_config) | ||
| self.pre_snapshot_impl( | ||
| direct_source=direct_source, | ||
| repository=repository, | ||
| source_config=source_config, | ||
| optional_snapshot_parameters=snapshot_parameters) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I love the idea of putting the word "optional" right in the argument name here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haha it was your idea! so thank you 🥇
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was?? I have no memory of this. |
||
|
|
||
| direct_pre_snapshot_response = platform_pb2.DirectPreSnapshotResponse() | ||
| direct_pre_snapshot_response.return_value.CopyFrom( | ||
|
|
@@ -173,6 +178,7 @@ def _internal_direct_post_snapshot(self, request): | |
| from generated.definitions import LinkedSourceDefinition | ||
| from generated.definitions import SourceConfigDefinition | ||
| from generated.definitions import SnapshotDefinition | ||
| from generated.definitions import SnapshotParametersDefinition | ||
|
|
||
| def to_protobuf(snapshot): | ||
| parameters = common_pb2.PluginDefinedObject() | ||
|
|
@@ -196,10 +202,14 @@ def to_protobuf(snapshot): | |
| json.loads(request.repository.parameters.json)) | ||
| source_config = SourceConfigDefinition.from_dict( | ||
| json.loads(request.source_config.parameters.json)) | ||
| snapshot_parameters = SnapshotParametersDefinition.from_dict( | ||
| json.loads(request.snapshot_parameters.parameters.json)) | ||
|
|
||
| snapshot = self.post_snapshot_impl(direct_source=direct_source, | ||
| repository=repository, | ||
| source_config=source_config) | ||
| snapshot = self.post_snapshot_impl( | ||
| direct_source=direct_source, | ||
| repository=repository, | ||
| source_config=source_config, | ||
| optional_snapshot_parameters=snapshot_parameters) | ||
|
|
||
| # Validate that this is a SnapshotDefinition object | ||
| if not isinstance(snapshot, SnapshotDefinition): | ||
|
|
@@ -266,10 +276,11 @@ def _internal_staged_pre_snapshot(self, request): | |
| snapshot_parameters = SnapshotParametersDefinition.from_dict( | ||
| json.loads(request.snapshot_parameters.parameters.json)) | ||
|
|
||
| self.pre_snapshot_impl(staged_source=staged_source, | ||
| repository=repository, | ||
| source_config=source_config, | ||
| snapshot_parameters=snapshot_parameters) | ||
| self.pre_snapshot_impl( | ||
| staged_source=staged_source, | ||
| repository=repository, | ||
| source_config=source_config, | ||
| optional_snapshot_parameters=snapshot_parameters) | ||
|
|
||
| response = platform_pb2.StagedPreSnapshotResponse() | ||
| response.return_value.CopyFrom(platform_pb2.StagedPreSnapshotResult()) | ||
|
|
@@ -337,7 +348,7 @@ def to_protobuf(snapshot): | |
| staged_source=staged_source, | ||
| repository=repository, | ||
| source_config=source_config, | ||
| snapshot_parameters=snapshot_parameters) | ||
| optional_snapshot_parameters=snapshot_parameters) | ||
|
|
||
| # Validate that this is a SnapshotDefinition object | ||
| if not isinstance(snapshot, SnapshotDefinition): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2.2.0.dev1 | ||
| 3.0.0.dev0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| @plugin.linked.post_snapshot() | ||
| def linked_post_snapshot(direct_source, repository, source_config): | ||
| def linked_post_snapshot(direct_source, repository, source_config, | ||
| optional_snapshot_parameters): | ||
| return SnapshotDefinition() |
Uh oh!
There was an error while loading. Please reload this page.