-
Notifications
You must be signed in to change notification settings - Fork 144
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
Fix serialization of pinned and vetoed fields #1377
Fix serialization of pinned and vetoed fields #1377
Conversation
71b6b15
to
e657d99
Compare
...rc/test/kotlin/com/netflix/spinnaker/keel/serialization/BooleanPropertySerializationTests.kt
Outdated
Show resolved
Hide resolved
@@ -610,7 +610,6 @@ abstract class ArtifactRepositoryTests<T : ArtifactRepository> : JUnit5Minutests | |||
) | |||
expect { | |||
that(envArtifactSummary).isNotNull() | |||
that(envArtifactSummary?.isPinned).isTrue() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to keep the same functionality, should we add here (and below, if I understand the change correctly):
that(envArtifactSummary?.pinned).isNotNull()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next line does an isEqualTo
on the same field so testing it's not null explicitly doesn't really add anything.
e657d99
to
08371c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks fine to me, but it looks like it's just removing some unused fields from the API payload. I don't understand how the presence of those fields could have broken the UI. @erikmunson, can you provide some insight here?
There was a change made in a recent version of Jackson so that those field definitions conflict. It started serializing The change in behavior seems to have be prompted by this issue: FasterXML/jackson-module-kotlin#80 unfortunately the "fix" was a breaking change. The only way I could successfully get both properties to serialize was to annotate each twice with |
🤮 |
@erikmunson does this look like the format that will un-fuck the environments view? |
Yep looks right to me - thanks for getting it resolved! I'm hopeful there is a way to prevent backend folks from having to deal with this property overriding business in the future 🤞 |
Yeah, I think I'm going to raise an issue on the jackson-module-kotlin repo |
…oyment Locations plugin Merge in SPKR/keel-nflx from ~AJORDENS/keel-nflx:feature/deployment-locations to main Squashed commit of the following: commit fe0da5a04c395184ffebe378801645d5464280b9 Author: Adam Jordens <[email protected]> Date: Thu May 12 18:00:10 2022 -0700 feat(workload-locations): Initial Workload Locations plugin _(not really a plugin but it does only depend on `keel-api`)_ This PR introduces a new `SubmittedEnvironmentPreProcessor` interface allowing for a submitted environment to be manipulated prior to deserialization. The simplistic current implementation does support the basic flow of going from workload type to location. It will be extended to allow non-standand vpc/subnets to be chosen. Resources are preprocessed during deserialization and locations are set where not already specified. See test cases for usage. Things we may want to consider: * Support for multiple accounts in a `SubnetAwareLocations` (or `locations` being a `List<SubnetAwareLocations>`) * Support for multiple cloud providers (eg. a workload type that supports both aws and titus) * ... To disable, set the following FP to false: `keel.plugins.workload-locations.enabled` commit 4b664ddcefb274cba6cae7c45afc53ae9cf40f43 Author: Adam Jordens <[email protected]> Date: Thu May 12 17:48:21 2022 -0700 feat(deployment-locations): Static metadata for use when translating from workload types - `spinnaker_subnets` and `spinnaker_vpcs` come directly from Spinnaker APIs. - `spinnaker_accounts` are handcrafted but based on `clouddriver.yml`. - `location_sets` and `workload_types` are new concepts supporting the abstraction. While static metadata makes for quick experimentation, it's expected that this data will be moved to S3 or Infra API eventually (or perhaps the entire translation will be moved to an external service). (cherry picked from commit e728461ae17c89547aaffd243615f622378f2f3d)
…oyment Locations plugin Merge in SPKR/keel-nflx from ~AJORDENS/keel-nflx:feature/deployment-locations to main Squashed commit of the following: commit fe0da5a04c395184ffebe378801645d5464280b9 Author: Adam Jordens <[email protected]> Date: Thu May 12 18:00:10 2022 -0700 feat(workload-locations): Initial Workload Locations plugin _(not really a plugin but it does only depend on `keel-api`)_ This PR introduces a new `SubmittedEnvironmentPreProcessor` interface allowing for a submitted environment to be manipulated prior to deserialization. The simplistic current implementation does support the basic flow of going from workload type to location. It will be extended to allow non-standand vpc/subnets to be chosen. Resources are preprocessed during deserialization and locations are set where not already specified. See test cases for usage. Things we may want to consider: * Support for multiple accounts in a `SubnetAwareLocations` (or `locations` being a `List<SubnetAwareLocations>`) * Support for multiple cloud providers (eg. a workload type that supports both aws and titus) * ... To disable, set the following FP to false: `keel.plugins.workload-locations.enabled` commit 4b664ddcefb274cba6cae7c45afc53ae9cf40f43 Author: Adam Jordens <[email protected]> Date: Thu May 12 17:48:21 2022 -0700 feat(deployment-locations): Static metadata for use when translating from workload types - `spinnaker_subnets` and `spinnaker_vpcs` come directly from Spinnaker APIs. - `spinnaker_accounts` are handcrafted but based on `clouddriver.yml`. - `location_sets` and `workload_types` are new concepts supporting the abstraction. While static metadata makes for quick experimentation, it's expected that this data will be moved to S3 or Infra API eventually (or perhaps the entire translation will be moved to an external service). (cherry picked from commit e728461ae17c89547aaffd243615f622378f2f3d)
Fixes serialization of fields in artifact/environment summary. Instead of boolean fields and objects now there are just the objects.