-
Notifications
You must be signed in to change notification settings - Fork 119
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
#892 Create release workflow #910
Conversation
Codecov Report
@@ Coverage Diff @@
## master #910 +/- ##
============================================
+ Coverage 81.29% 81.34% +0.05%
- Complexity 663 664 +1
============================================
Files 204 204
Lines 3683 3683
Branches 544 544
============================================
+ Hits 2994 2996 +2
+ Misses 394 393 -1
+ Partials 295 294 -1 |
flank-scripts/README.md
Outdated
Release Flank on GitHub | ||
|
||
Options: | ||
`--input-file` Path to release file |
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.
instead of
, consider using a GitHub Flavored Markdown Table
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.
Done 👍
b6d5110
to
0bb5cdd
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.
I am not sure if putting Command
related functions to dedicated files is necessary as long as those commands and functions are simple and take only a few lines of code. For example:
DeleteOldReleaseCommand.kt
-DeleteOldRelease.kt
DeleteOldSnapshotCommand.kt
-DeleteOldSnapshot.kt
SyncMavenCommand
-SyncMaven.kt
import flank.scripts.utils.toObject | ||
|
||
fun <V : Any, E : FuelError, E2 : Exception> Result<V, E>.mapClientError(transform: (E) -> E2) = when (this) { | ||
is Result.Success -> Result.Success(value) |
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 not just?
is Result.Success -> this
|
||
private val json by lazy { Json(JsonConfiguration.Stable) } | ||
|
||
fun <T> T.toJson(serializationStrategy: SerializationStrategy<T>) = json.stringify(serializationStrategy, this) |
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.
It is possible to do that without passing SerializationStrategy
. There is an inline version of stringify
which can resolve SerializationStrategy implicit.
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 tested it and it does not work properly for all cases. Also using it will force use to use only classes with @Serializable
annotation.
The issue is that
Can't locate argument-less serializer for class Object. For generic classes, such as lists, please provide serializer explicitly.
Also, I tested it with Any
but with same effect ...
import flank.scripts.exceptions.mapClientError | ||
import flank.scripts.exceptions.toGithubException | ||
|
||
fun deleteOldTag(tag: String, username: String, password: String) = |
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.
Rename file to DeleteOldTag.kt
to match to function name
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.
changed
|
||
override fun run() { | ||
runBlocking { | ||
withContext(Dispatchers.IO) { |
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 wondering if the changing dispatcher is necessary here.
Anyway, runBlocking
can take CoroutineContext
as the first argument, so withContext
is redundant.
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
|
||
override fun run() { | ||
runBlocking { | ||
when (val response = withContext(Dispatchers.Default) { deleteOldTag(gitTag, username, token) }) { |
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 wondering if withContext(Dispatchers.Default)
is necessary 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
0bb5cdd
to
ca6a7b4
Compare
ca6a7b4
to
265cb38
Compare
flank-scripts/src/main/kotlin/flank/scripts/exceptions/FlankScriptsExceptionMappers.kt
Outdated
Show resolved
Hide resolved
…riptsExceptionMappers.kt Co-authored-by: Jan Góral <[email protected]>
Great job 💪 |
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.
Great work 👍
Fixes #892
Test Plan
Release could be done using github actions RELEASE workflow.
Check
docs/release_process.md
andflank-scripts/README.md
for more infoChecklist