You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Environment API Spark]: Compute MergedEnvironmentConfig etag using Objects.hash (#5812)
* Making imlelmetaion consistent with ruby api implemetation
- Use `getEnvironments` method instead of `getAllMergedEnvironments` to
get all environment for index call.
- Use `getEnvironmentConfig` instead of `getMergedEnvironmentforDisplay`
to find environment by name.
* Calculate md5 using object hash.
- This is done as Environment coming from config repo represeted using
MergedEnvironmentConfig object and caculating etag for none config
entity is not supported by entity hashing service.
- Here we have used `Objects.hash(...)` which generates identical hash
for same valued objects.
* Fixed indentation of code.
* Sort the EnvironmentConfigs by name to guaranty the order in the response as well as for Etag computation
Copy file name to clipboardExpand all lines: api/api-environments-v2/src/main/java/com/thoughtworks/go/apiv2/environments/EnvironmentsControllerV2.java
Copy file name to clipboardExpand all lines: api/api-environments-v2/src/main/java/com/thoughtworks/go/apiv2/environments/representers/EnvironmentRepresenter.java
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -60,11 +60,11 @@ public static EnvironmentConfig fromJSON(JsonReader jsonReader) {
Copy file name to clipboardExpand all lines: api/api-environments-v2/src/main/java/com/thoughtworks/go/apiv2/environments/representers/EnvironmentsRepresenter.java
Copy file name to clipboardExpand all lines: api/api-environments-v2/src/main/java/com/thoughtworks/go/apiv2/environments/representers/PatchEnvironmentRequestRepresenter.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -50,9 +50,9 @@ public static PatchEnvironmentRequest fromJSON(JsonReader jsonReader) {
Copy file name to clipboardExpand all lines: api/api-environments-v2/src/main/java/com/thoughtworks/go/apiv2/environments/representers/PipelineRepresenter.java
Copy file name to clipboardExpand all lines: api/api-environments-v2/src/test/groovy/com/thoughtworks/go/apiv2/environments/EnvironmentsControllerV2Test.groovy
+33-42Lines changed: 33 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ class EnvironmentsControllerV2Test implements SecurityServiceTrait, ControllerTr
Copy file name to clipboardExpand all lines: api/api-environments-v2/src/test/groovy/com/thoughtworks/go/apiv2/environments/representers/AgentRepresenterTest.groovy
0 commit comments