<@UBBFK40RZ> <@UU2J0PJ81> since you use github-wor...
# github-workflows-kt
p
@Nikky @Jilles van Gurp since you use github-workflows-kt internally, I'd be interested to learn more on how you use it, e.g.: • how many scripts you maintain • how many developers touch the scripts using github-workflows-kt • what's the biggest/an average reduction in lines of code YAML vs. Kotlin script (I know that # of lines is a poor indicator in general, short scripts can be super-complex, but just curious about this metric) • biggest win on what wasn't possible with YAML, but you managed to achieve with the library • any other interesting feedback, modulo what was already shared in the above thread? • are you fine with the current cadence of releases (monthly, before it was every two weeks)? • is there a feature (features) that you'd like to see in the lib? is it already tracked in GitHub issues? • do you use any actions not via type-safe bindings? like "meh, let's not add it to the lib, and use the unsafe variant or have the type-safe binding coded ourselves"?
n
will compile this data shortly
🙌 1
p
thanks, no rush 🙂 just curious
added some more at the bottom
n
we have
appleboy/ssh-action
and i keep meaning to sub,it typings for this.. but never have the time
👌 1
p
☝️ I guess this is the one that got dropped in the lib because it doesn't have a major version?
n
it does have a 1.x, but not v1 annoyingly
p
does it? i don't see it here: https://github.com/appleboy/ssh-action/tags
n
you are right.. it has a 1.x but no v1 annoyingly
I'm planning to support
v1.2.3
kind of versioning with Maven-based artifacts, it's much easier than with bundled bindings
❤️ 2
n
in our backend project we have
630
lines of kotlin (including 200 lines of wrapper for appleboy/ssh-action) creating
438
lines of yaml (3 scripts for 4 workflows) in our frontend we have
223
lines of kotlin creating
226
lines of yaml (2 scripts for 3 workflows) so yeah its much more about how readable and maintainable a kotlin script is compared to the mess of yaml lots of multi line calls with named variables adds lots of lines mainly me and the other backend dev touching the scripts biggest win? the ability to generate multiple workflows with little variations in a loop as for the release schedule? we generally did not touch the workflows all that often until we needed to and then updating and migrating stuff, updating actions, making this process low friction is very appreciated cannot think of any features we are lacking, i usually bring those up in the channel on the github we are happy with not having to touch workflows too often...
j
Quick answer, I have about 5 projects where I use this. Mostly the code savings are not really the point; the point is type safety and staying up to date. The way we maintain this is periodically bumping the version number and then fixing deprecations. We have a few more complicated workflows that get generated. Release frequency is fine. The point for me would be minimizing the work. Hitting alt enter on deprecated things is nice. Value add: • awareness of new upstream versions for various actions, these things never get updated in many projects • if the compiler says ok, it probably is -> less failed builds because of stupid syntax errors • easy discovery of parameters with autocomplete • we use a lot of shell commands for things not covered by plugins with the commands in strings • being able to use kotlin functions, if else logic, etc. I don't really have any new features I'd want.
+what @Nikky said (we are on the same project)
p
cool, thanks! one follow-up: do you use the consistency check job (enabled by default)? if not, how do you ensure the YAML is consistent with the script?
n
yes, we have the consistency checks enabled on all scripts
👍 1
p
Do you also have a job that isn't triggered on each push, e. g. a job for releasing on tag push or a scheduled job? I wonder how you ensure YAML consistency here
n
currently all jobs we have are set up as push triggers afaik
👍 1
p
Did you have a chance to try out Kotlin logic in a step? Maybe you have a nice use case in your workflows to get rid of bash: https://github.com/typesafegithub/github-actions-typing-catalog/blob/b9c0a7d8422c42329c4dfb3652ea8008bdb551fd/.github/workflows/update-metadata.main.kts#L36
n
not yet, i will keep it in mind and see if we can improve readability using it
👍 1
but we generally mostly deal with really long gcloud commands.. which would not help much to wrap in kotlin code
p
theoretically you could use GCP Java library
n
yeah, but i'd rather not rip that all apart again when it works just fine
👍 1