I'm not even exactly sure how to report this: ``` ...
# github-workflows-kt
l
I'm not even exactly sure how to report this:
Copy code
... types from <https://raw.githubusercontent.com/gradle/gradle-build-action/v2//action-types.yaml>
  ... types from <https://raw.githubusercontent.com/typesafegithub/github-actions-typing-catalog/main/typings/gradle/gradle-build-action/v2//action-types.yml>
java.lang.IllegalArgumentException: Request contains invalid properties:
Available: [gradle-version, gradle-executable, build-root-directory, cache-disabled, cache-read-only, cache-write-only, cache-overwrite-existing, gradle-home-cache-includes, gradle-home-cache-excludes, arguments, generate-job-summary, dependency-graph, gradle-home-cache-strict-match, workflow-job-context, gradle-home-cache-cleanup, github-token]
Invalid:   [artifact-retention-days]
        at io.github.typesafegithub.workflows.actionbindinggenerator.GenerationKt.checkPropertiesAreValid(Generation.kt:86)
        at io.github.typesafegithub.workflows.actionbindinggenerator.GenerationKt.generateBinding(Generation.kt:52)
        at io.github.typesafegithub.workflows.actionbindinggenerator.GenerationKt.generateBinding$default(Generation.kt:40)
        at io.github.typesafegithub.workflows.actionbindinggenerator.GenerateActionBindingsCliHelperKt.generateActionBindings(GenerateActionBindingsCliHelper.kt:39)
        at Generate_action_bindings_main.<init>(generate-action-bindings.main.kts:6)
When running
Copy code
#!/usr/bin/env kotlin
@file:DependsOn("io.github.typesafegithub:action-binding-generator:1.6.0")

import io.github.typesafegithub.workflows.actionbindinggenerator.generateActionBindings

generateActionBindings(args)
on Petals
v
That was added to both sides a couple of days ago. Maybe something is cached and the other not?
p
@LeoColman I think the problem may be in the cached action.yml. If you attached some more log lines (before fetching the typings), we could confirm it
Ok, got this - found a bug (hopefully it's the one you observe 😁). Thanks for reporting @LeoColman! I'll fix it within several days. As a mitigation on your side, please remove
build/action-yaml
and
build/action-types-yaml
. The GitHub Actions runs aren't affected because the cache stste is not stored anywhere between the runs.
github workflows kt 1
I decided to remove caching altogether (at least for now, in the current form), it creates too much problems compared to benefits. This change will enter the next release this Friday, I guess there's no need to release a patch version outside of the schedule since there's an easy workaround
👍 1
l
No problem! I'm still in early adopter team! blob sunglasses
kodee happy 1
thank you color 1
p
One by one, we're gonna catch 'em all (bugs) :D
🫶 1
@LeoColman just to make sure: has the workaround done the job?
l
Yes. Resetting
build
makes it work again
It's still generating Java V3 instead of V4, for some reason
p
do you have a reproducer I can try out locally?
l
Petals App, I suppose
It's where I'm trying to run. I'm running on a blank copy of
main
Copy code
RegularAction<SetupJava.Outputs>("actions", "setup-java", _customVersion ?: "v4")
It's generating the right v4, it seems
But it's putting v3 on the yaml
If I just ship it to Github without the change to v3 it works
It's something still locally kept
Copy code
... from cache: build/action-yaml/actions-setup-java-v4.yml
  ... types from <https://raw.githubusercontent.com/actions/setup-java/v4//action-types.yml>
  ... types from <https://raw.githubusercontent.com/actions/setup-java/v4//action-types.yaml>
  ... types from <https://raw.githubusercontent.com/typesafegithub/github-actions-typing-catalog/main/typings/actions/setup-java/v4//action-types.yml>
It gets the right version when running
generate-action-bindings.main.kts
p
Try purging the Kotlin Script cache
Or making a dummy change in the workflow script and rerunning it
👍 1
l
I'm not sure how to purge KTS cache tho
l
Making a dummy change works
Interestingly, undoing my dummy change breaks it again
v
Yes, because it then is taken from the cache again
👍 1
l
In GitHub it has no issues, but as it is I'm 'able' to commit a bad workflow file @Piotr Krzemiński
p
The consistency check job should catch it, isn't it failing?
v
Read the last bulletpoint here: https://github.com/spockframework/spock/blob/8e2af28d3dd5c2f0d8340e5df16c9fd254992936/.github/workflows/README.adoc, that should make the problem pretty clear and provide mitigation strategies
👍 1
l
Yes, it catches it. The problem is that it's inconsistent with what is locally available. For instance, I have to remove the
v4
->
v3
from the commit, or else it fails in the consistency check
v
My message was for you @LeoColman if that wasn't clear 🙂
👍 1
❤️ 1
l
Spock is using workflows-kts!
Cooool!
I'm a #kotest guy, but I love spock 😄
v
Not yet, waiting for Leonard to finally accept and merge it. That's just the state of the file in my PR
👍 2
p
@LeoColman LMK if there's still something actionable on me :) unfortunately we need to deal with some rough edges on the Kotlin side. I tried to fix this bug with importing myself, but after reading the current code I gave up and just created a reproducing unit test in the Kotlin repo
👍 1
Once Kotlin 2.0 is out, I'm going to remind the Kotlin team to revisit several bugs related to Kotlin scripting
👍 1
👍🏼 1
l
As an actionable action, maybe add to the documentation this kind of problem - if it's not already there - with the workarounds as well
Also requesting people to +1 the ticket, but I think you've done it already 😛
p
I'm thinking about adding a FAQ section in the docs that would include e. g. this problem. Regarding requesting +1s, yeah, I don't want to be too pushy. I'll include links to YouTrack in the FAQ
👍 1
Feel free to add a comment here with anything that you think would be worth describing in the FAQ, like non-obvious design/behavior, known issues or anything problematic from your PoV
👍 1