Skip to content

Commit b02a196

Browse files
committed
Release 0.7.4
Add firstErrorReferenceId in CompositeGraphResponse and CompositeResponse Signed-off-by: Gopal S Akshintala <[email protected]>
1 parent 5c80c14 commit b02a196

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ endif::[]
1818
:pmtemplates: src/integrationTest/resources/pm-templates
1919
:imagesdir: docs/images
2020
:prewrap!:
21-
:revoman-version: 0.7.3.1
21+
:revoman-version: 0.7.4
2222

2323
'''
2424

@@ -500,7 +500,7 @@ See `DiMorphicAdapter` in action from the test `compositeGraphResponseDiMorphicM
500500

501501
NOTE: If you don't configure any adapters, you can either pass the adapter at runtime using the overload `stepReport.requestInfo.get().<TypeT>getTypedTxnObj(type, customAdapters, customAdaptersForType)` or Moshi by default unmarshalls the step's request/response JSON into a generic data structures like `LinkedHashMap`
502502

503-
CAUTION: All these adapters supplied from various config methods are appended to the same Moshi instance internally. Read more about link:https://github.com/square/moshi#composing-adapters[Moshi adapter composition]. This means you don't have to supply the adapters repeatedly for the same type. This also means your adapters may get overridden unexpectedly. Keep this in mind while troubleshooting any serialize/deserialize issues. If you wish to manage Moshi yourself, you can get a copy of internal Moshi via `pokeRundown.mutableEnv.moshiReVoman().internalMoshiCopy()`.
503+
CAUTION: All these adapters supplied from various config methods per a `revUp()` execution are appended to the same Moshi instance created in that thread. Read more about link:https://github.com/square/moshi#composing-adapters[Moshi adapter composition]. This means you don't have to supply the adapters repeatedly for the same type. This also means your adapters may get overridden unexpectedly. Keep this in mind while troubleshooting any serialize/deserialize issues. If you wish to manage Moshi yourself, you can get a copy of internal Moshi via `pokeRundown.mutableEnv.moshiReVoman().internalMoshiCopy()`.
504504

505505
==== JSON Reader/Writer Utils to build Moshi adapters
506506

buildSrc/src/main/kotlin/Config.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
* ************************************************************************************************
77
*/
88
const val GROUP_ID = "com.salesforce.revoman"
9-
const val VERSION = "0.7.3.1"
9+
const val VERSION = "0.7.4"
1010
const val ARTIFACT_ID = "revoman"
1111
const val STAGING_PROFILE_ID = "1ea0a23e61ba7d"

src/main/kotlin/com/salesforce/revoman/input/json/adapters/salesforce/CompositeGraphResponse.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ data class CompositeGraphResponse(val graphs: List<Graph>) {
6363
}
6464
}
6565

66+
@Json(ignore = true)
67+
@get:JvmName("firstErrorReferenceId")
68+
val firstErrorReferenceId: String? by lazy { errorResponses.firstOrNull()?.referenceId }
69+
6670
@Json(ignore = true)
6771
@get:JvmName("firstErrorResponse")
6872
val firstErrorResponse: CompositeErrorResponse? by lazy { errorResponses.firstOrNull() }

src/main/kotlin/com/salesforce/revoman/input/json/adapters/salesforce/CompositeResponse.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ data class CompositeResponse(val compositeResponse: List<Response>) {
144144
compositeResponse.count { it.httpStatusCode in SUCCESSFUL_HTTP_STATUSES }
145145
}
146146

147+
@Json(ignore = true)
148+
@get:JvmName("firstErrorReferenceId")
149+
val firstErrorReferenceId: String? by lazy { errorResponses.firstOrNull()?.referenceId }
150+
147151
@Json(ignore = true)
148152
@get:JvmName("firstErrorResponse")
149153
val firstErrorResponse: ErrorResponse? by lazy { errorResponses.firstOrNull() }

src/main/kotlin/com/salesforce/revoman/output/report/StepReport.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
*/
88
package com.salesforce.revoman.output.report
99

10-
import arrow.core.Either.Left
11-
import arrow.core.Either.Right
1210
import com.salesforce.revoman.output.ExeType
1311
import com.salesforce.revoman.output.postman.PostmanEnvironment
1412
import com.salesforce.revoman.output.report.TxnInfo.Companion.uriPathContains
@@ -101,8 +99,6 @@ internal constructor(
10199

102100
fun <L, R> arrow.core.Either<L, R>.toVavr(): Either<L, R> = fold({ left(it) }, { right(it) })
103101

104-
fun <L, R> Either<L, R>.toArrow(): arrow.core.Either<L, R> = fold({ Left(it) }, { Right(it) })
105-
106102
@JvmStatic
107103
fun Either<out RequestFailure, TxnInfo<Request>>?.uriPathContains(path: String): Boolean =
108104
this?.fold({ false }, { it.uriPathContains(path) }) ?: false
@@ -123,7 +119,7 @@ internal constructor(
123119
}
124120

125121
override fun toString(): String =
126-
step.toString() +
122+
"$step" +
127123
when {
128124
exeFailure != null -> " =>> ❌$exeFailure\n${exeFailure.failure.stackTraceToString()}"
129125
!isHttpStatusSuccessful ->

0 commit comments

Comments
 (0)