-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/test #9
Feature/test #9
Conversation
2957e3e
to
4990844
Compare
would |
4990844
to
87efd21
Compare
done |
87efd21
to
5bad8ca
Compare
maybe a more "natural" way to avoid forgetting |
so just a shorthand for |
buildSrc/settings.gradle
Outdated
@@ -0,0 +1 @@ | |||
rootProject.name = 'backend_buildSrc' |
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.
why backend
?
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.
overlooked this. renamed
buildSrc/src/main/kotlin/Versions.kt
Outdated
@@ -0,0 +1,29 @@ | |||
object VersionsBackend { |
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.
Why backend
?
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.
totally forgot to remove the actual sources. in the buildSrc. buildSrc is needed becasue dokka only works from plugins (such as our conventions, or buildSrc) for multi-module projects)
buildSrc/src/main/kotlin/Versions.kt
Outdated
const val attestation = "2.1.3" | ||
const val jose = "9.25.6" | ||
|
||
object spring { |
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.
why do we need spring dependency declarations here?
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.
removed
artifactVersion = 1.8.0 |
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.
Non-snapshot version on development
?
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.
i really should rename the default branch to main
and create a proper development branch. Will do after squashing and merging this.
My issue with this proposal is that it makes it easy to accidentally expose a
Both will be rethrowing fatal exceptions, but only has it in its name. I don't see how to solve that issue, because even if we rename |
i thought the intent of |
Yes it is and this is what it does. What is the issue? |
I don't think using it internally is safe if forgetting |
(That was the thought process behind my suggestion for a |
Fair point, but how to not make the API confusing? |
thinking about how the IDE behaves, autocomplete, etc. maybe |
maybe |
I went with |
@@ -268,7 +268,7 @@ inline fun <R, T : R> KmmResult<T>.recoverCatching(block: (error: Throwable) -> | |||
/** | |||
* Non-fatal-only-catching version of stdlib's [runCatching], directly returning a [KmmResult] -- | |||
* Re-throws any fatal exceptions, such as `OutOfMemoryError`. Relies on [Arrow](https://arrow-kt.io)'s | |||
* [nonFatalOrThrow](https://apidocs.arrow-kt.io/arrow-core/arrow.core/non-fatal-or-throw.html) internally. | |||
* [nonFatalOrThrow](https://apidocs.arrow-kt.io/arrow-core/arrow.core/non-fatal-or-throw.html) logic. |
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 doesn't make it clear that Arrow is not a dependency imo, and where we took the list from doesn't really matter enough that we'd put it in the docs.
How about A list of fatal exceptions is [here](https://github.com/a-sit-plus/KmmResult/tree/main/bla/blub).
?
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.
I want to give credit, where credit is due. how about "Mirrors Arrow's logic"
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.
if you link to our source for nonFatalOrThrow
, the comment there references arrow; is that not enough?
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.
I'm gonna go with re-iplements Arrow's logic to avoid a dependency on Arrow for a single function.
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.
sounds good to me
expect inline fun Throwable.nonFatalOrThrow(): Throwable | ||
|
||
/** | ||
* Helper to effectively convert stdlib's [runCatching] to behave like KmmResults Non-fatal-only [catching]. I.e. any |
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.
KmmResult's
, apostrophe
* Throws any fatal exceptions. This is a re-implementation taken from Arrow's | ||
* [`nonFatalOrThrow`](https://apidocs.arrow-kt.io/arrow-core/arrow.core/non-fatal-or-throw.html) – | ||
* not because it is bad, it is actually pretty much perfect. | ||
* However, the arrow dependency triggered an obscure IDEA bug, resulting in `NoClasDefFoundErrors` instead of correct | ||
* behaviour. * We therefore removed the dependency and added the functionality directly to KmmResult. | ||
* | ||
* Please note that this was never a problem building anything that depended on KmmResult, it only made debugging | ||
* in IDEA a nightmare. |
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 feels like far too much exposition for an apidoc comment
/** | ||
* Non-fatal-only-catching version of stdlib's [runCatching], returning a [Result] -- | ||
* Re-throws any fatal exceptions, such as `OutOfMemoryError`. Relies on [Arrow](https://arrow-kt.io)'s | ||
* [nonFatalOrThrow](https://apidocs.arrow-kt.io/arrow-core/arrow.core/non-fatal-or-throw.html) logic. |
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.
same point as with catching
* Non-fatal-only-catching version of stdlib's [runCatching] (calling the specified function [block] with `this` value | ||
* as its receiver), directly returning a [Result] -- | ||
* Re-throws any fatal exceptions, such as `OutOfMemoryError`. Relies on [Arrow](https://arrow-kt.io)'s | ||
* [nonFatalOrThrow](https://apidocs.arrow-kt.io/arrow-core/arrow.core/non-fatal-or-throw.html) logic. |
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.
same
- migrate to dokka 2 for documentation - multi-module project setup - introduce `kmmresult-test`, featuring - `result should succeed` - `result shouldNot succeed` - `result shouldSucceedWith expectedValue` - `result.shouldSucceed()` returning the contained value - remove Arrow dependency and import arrow's list of Fatal exceptions directly into our code - Introduce `Result.nonFatalOrThrow` to mimic KmmResult's non-fatal-only behaviour, but without the object instantiation overhead - Introduce `carchingUnwrapped`, which mimics KmmResult's non-fatal-only behaviour, but without the object instantiation overhead
- migrate to dokka 2 for documentation - multi-module project setup - introduce `kmmresult-test`, featuring - `result should succeed` - `result shouldNot succeed` - `result shouldSucceedWith expectedValue` - `result.shouldSucceed()` returning the contained value - remove Arrow dependency and import arrow's list of Fatal exceptions directly into our code - Introduce `Result.nonFatalOrThrow` to mimic KmmResult's non-fatal-only behaviour, but without the object instantiation overhead - Introduce `carchingUnwrapped`, which mimics KmmResult's non-fatal-only behaviour, but without the object instantiation overhead
kmmresult-test
, enablingresult should succeed
result shouldNot succeed
result shouldSucceedWith expectedValue