Fix typesafe workflow#2299
Conversation
The codecov-action binding (v5.5.2) requires github-workflows-kt 3.7.0, causing an "unresolved reference: CodecovAction" compile error when the script classpath was pinned to 3.6.0.
📝 WalkthroughWalkthroughUpdated GitHub Actions Kotlin workflow scripts and generated YAML to bump github-workflows-kt to 3.7.0, upgrade action major ranges (notably actions/checkout and actions/upload-artifact), and replace some typed action imports/usages (CodeQL/Codecov) with their Untyped variants and adjusted constructor parameter names. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR updates GitHub Actions workflow dependencies to fix a failure in the typesafe workflow system. The main changes include:
The changes are necessary to fix workflow failures and maintain compatibility with the latest action versions. One minor issue was found with inconsistent version formatting in the Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 4811089 |
4811089 to
3df38e4
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/release.main.kts (1)
27-27:⚠️ Potential issue | 🔴 CriticalSame unresolved
CodecovActionissue as inbranches-and-prs.main.kts.The
@file:DependsOn, import, anduses(action = CodecovAction(...))call are identical in structure to the pattern that's already confirmed broken by the pipeline failures. This file will fail to compile for the same reason. Apply the same_Untypedfix described in thebranches-and-prs.main.ktscomment.Also applies to: 31-31, 104-109
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/release.main.kts at line 27, Replace the unresolved CodecovAction usage with the untyped variant: change the `@file`:DependsOn("codecov:codecov-action___major:[v5,v6-alpha)") / import that brings in CodecovAction and any uses(action = CodecovAction(...)) occurrences to instead reference the untyped helper (e.g., CodecovAction_Untyped) and adjust the import/dependsOn to the corresponding untyped artifact; update every occurrence of CodecovAction (including the one shown and the other occurrences in the file) to use CodecovAction_Untyped so the script compiles.
🧹 Nitpick comments (1)
.github/workflows/docs-pr.main.kts (1)
27-27: Inconsistent version range notation — upper bound7.0is missing thevprefix.Every other binding range in this PR uses a
v-prefixed upper bound (e.g.,[v5,v6-alpha),[v6,v7-alpha)). While the generated YAML confirms the resolver currently handles7.0correctly, aligning the notation would be safer and more consistent.♻️ Proposed normalisation
-@file:DependsOn("actions:upload-artifact___major:[v5,7.0)") +@file:DependsOn("actions:upload-artifact___major:[v5,v7-alpha)")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/docs-pr.main.kts at line 27, Inconsistent version-range notation: the `@file`:DependsOn annotation currently uses an upper bound "7.0" without the "v" prefix; update the dependency string `@file`:DependsOn("actions:upload-artifact___major:[v5,7.0)") to use a v-prefixed upper bound (e.g., change "7.0" to "v7.0") so it matches the other ranges like "[v5,v6-alpha)" and "[v6,v7-alpha)" and keeps notation consistent across the workflow.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/codeql-analysis.yaml:
- Line 47: The workflow currently uses "uses: 'actions/checkout@v6'" which
requires self-hosted runners >= 2.329.0; either update your self-hosted Actions
Runners to at least v2.329.0 so they can access the persisted credentials, or
change the checkout action to a lower-major release (e.g., actions/checkout@v3
or `@v2`) that is compatible with your runners; update the "uses:
'actions/checkout@v6'" entry accordingly or document the runner upgrade
requirement in the workflow repo.
In @.github/workflows/docs-pr.yaml:
- Line 54: The workflow currently uses "uses: 'actions/upload-artifact@v6'",
which requires Actions Runner ≥ 2.327.1 and Node.js 24; to avoid breaking
self-hosted runners either downgrade to a compatible version (e.g., change to
"uses: 'actions/upload-artifact@v3'") or add a clear comment/condition ensuring
self-hosted runners are upgraded to >=2.327.1, and document this requirement in
the workflow file or repo README so merges don't break CI.
---
Outside diff comments:
In @.github/workflows/release.main.kts:
- Line 27: Replace the unresolved CodecovAction usage with the untyped variant:
change the `@file`:DependsOn("codecov:codecov-action___major:[v5,v6-alpha)") /
import that brings in CodecovAction and any uses(action = CodecovAction(...))
occurrences to instead reference the untyped helper (e.g.,
CodecovAction_Untyped) and adjust the import/dependsOn to the corresponding
untyped artifact; update every occurrence of CodecovAction (including the one
shown and the other occurrences in the file) to use CodecovAction_Untyped so the
script compiles.
---
Nitpick comments:
In @.github/workflows/docs-pr.main.kts:
- Line 27: Inconsistent version-range notation: the `@file`:DependsOn annotation
currently uses an upper bound "7.0" without the "v" prefix; update the
dependency string `@file`:DependsOn("actions:upload-artifact___major:[v5,7.0)") to
use a v-prefixed upper bound (e.g., change "7.0" to "v7.0") so it matches the
other ranges like "[v5,v6-alpha)" and "[v6,v7-alpha)" and keeps notation
consistent across the workflow.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/codeql-analysis.main.kts (1)
31-32: Consider switching back to typed CodeQL bindings once available.
_Untypedvariants are the right workaround while typed bindings for[v4.32.4,v5-alpha)aren't published yet. Since neitherCodeqlActionInit_UntypednorCodeqlActionAnalyze_Untypedreceives any parameters today, there's no immediate risk. If parameters ever need to be added, though, typos in key names will go undetected until YAML generation and runtime rather than compile time.When a future
github-workflows-ktupdate ships typed wrappers for this version range, swap back to the non-_Untypedimports:♻️ Suggested future swap (once typed bindings are published)
-import io.github.typesafegithub.workflows.actions.github.CodeqlActionAnalyze_Untyped -import io.github.typesafegithub.workflows.actions.github.CodeqlActionInit_Untyped +import io.github.typesafegithub.workflows.actions.github.CodeqlActionInit +import io.github.typesafegithub.workflows.actions.github.CodeqlActionAnalyze- action = CodeqlActionInit_Untyped( + action = CodeqlActionInit(- action = CodeqlActionAnalyze_Untyped() + action = CodeqlActionAnalyze()Also applies to: 88-91, 129-131
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/codeql-analysis.main.kts around lines 31 - 32, The file currently imports CodeqlActionInit_Untyped and CodeqlActionAnalyze_Untyped as a deliberate workaround; update nothing now but add a TODO and plan: when github-workflows-kt publishes typed wrappers for the target CodeQL versions, replace imports of CodeqlActionInit_Untyped and CodeqlActionAnalyze_Untyped with their typed counterparts (CodeqlActionInit and CodeqlActionAnalyze), and remove the _Untyped usages throughout the file (also at the other occurrences noted around lines 88-91 and 129-131) to restore compile-time checking for action parameters.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.github/workflows/branches-and-prs.yaml:
- Line 38: Update the actions/checkout@v6 usage to handle the new
persist-credentials behavior and document the runner requirement: add a with:
persist-credentials: false (or explicitly set the credential behavior your job
expects) for the step that uses the symbol "uses: 'actions/checkout@v6'", and
add a short note in the workflow that self-hosted runners must be v2.329.0 or
later to run authenticated git commands from container actions (the same change
should be applied to the other checkout occurrences referenced at lines
109-111).
In @.github/workflows/codeql-analysis.yaml:
- Line 47: The workflow uses actions/checkout@v6 which requires Actions Runner
>= v2.329.0 for authenticated git commands from Docker container actions; update
the workflow file to either (a) document this requirement (add a comment near
the uses: 'actions/checkout@v6' line) and assert jobs run on GitHub-hosted
runners (runs-on: ubuntu-latest), or (b) add a guard/notice for any self-hosted
runners so maintainers know to upgrade their runner to >= v2.329.0 or switch to
a compatible checkout action; reference the uses: 'actions/checkout@v6'
occurrence when making the change.
In @.github/workflows/release.yaml:
- Line 89: Replace the incompatible actions/checkout@v6 usage with a
runner-compatible checkout action across the three checkout steps mentioned (the
occurrences with actions/checkout@v6, including the checkout in the
publish-release-docs job and the other two occurrences) so the $RUNNER_TEMP
credential mechanism works for subsequent git operations; update each
actions/checkout reference to the runner-compatible version used elsewhere
(e.g., actions/checkout@v3) or explicitly set persist-credentials: true on those
checkout steps to ensure git checkout -b and git push run correctly as ordinary
run steps.
---
Nitpick comments:
In @.github/workflows/codeql-analysis.main.kts:
- Around line 31-32: The file currently imports CodeqlActionInit_Untyped and
CodeqlActionAnalyze_Untyped as a deliberate workaround; update nothing now but
add a TODO and plan: when github-workflows-kt publishes typed wrappers for the
target CodeQL versions, replace imports of CodeqlActionInit_Untyped and
CodeqlActionAnalyze_Untyped with their typed counterparts (CodeqlActionInit and
CodeqlActionAnalyze), and remove the _Untyped usages throughout the file (also
at the other occurrences noted around lines 88-91 and 129-131) to restore
compile-time checking for action parameters.
b9223ff to
bdd5619
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/branches-and-prs.main.kts (1)
23-26: Consider opting into the 3.7.0 consistency-check checkout version feature.
github-workflows-kt3.7.0 introduced an opt-in feature where the consistency check job automatically uses theactions/checkoutversion from the classpath Maven artifact, allowing future Renovate bumps toactions:checkout___majorto propagate automatically without manual fixes. Since this PR bumps checkout to[v6,v7-alpha), opting in here would prevent the consistency check job (currently using the bundled v4) from drifting out of sync with the main workflows.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/branches-and-prs.main.kts around lines 23 - 26, The consistency-check job is still using the bundled actions/checkout v4 rather than the classpath version; update this script to opt into the github-workflows-kt 3.7.0 consistency-check checkout-version feature so the check will use the classpath actions/checkout version you declared. Concretely, enable the 3.7.0 opt-in in this file (where you have `@file`:DependsOn("io.github.typesafegithub:github-workflows-kt:3.7.0")) so the consistency-check picks up the `@file`:DependsOn("actions:checkout___major:[v6,v7-alpha)") setting instead of the bundled v4.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/branches-and-prs.main.kts:
- Around line 23-26: The consistency-check job is still using the bundled
actions/checkout v4 rather than the classpath version; update this script to opt
into the github-workflows-kt 3.7.0 consistency-check checkout-version feature so
the check will use the classpath actions/checkout version you declared.
Concretely, enable the 3.7.0 opt-in in this file (where you have
`@file`:DependsOn("io.github.typesafegithub:github-workflows-kt:3.7.0")) so the
consistency-check picks up the
`@file`:DependsOn("actions:checkout___major:[v6,v7-alpha)") setting instead of the
bundled v4.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2299 +/- ##
=========================================
Coverage 82.12% 82.12%
+ Complexity 4795 4793 -2
=========================================
Files 469 469
Lines 14958 14958
Branches 1888 1888
=========================================
Hits 12285 12285
Misses 1984 1984
Partials 689 689 🚀 New features to boost your workflow:
|
Summary by CodeRabbit