Repository navigation
feat(ci): replace action-validator with actively maintained kjanat/actionlint for GHA workflow static check - #45167
Conversation
…/actionlint` for GHA workflow static check Signed-off-by: hainenber <dotronghai96@gmail.com>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| - name: Setup Go | ||
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 |
There was a problem hiding this comment.
Suggestion: No go-version or go-version-file is supplied, so setup-go fails before the install step and this validation job never runs.
Assessment: 🟠 Major · 🔁 Occurrence: Often · 🏷️ Api mismatch
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** .github/workflows/github-action-validator.yml
**Line:** 37:38
**Comment:**
*Api Mismatch: No `go-version` or `go-version-file` is supplied, so `setup-go` fails before the install step and this validation job never runs.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #45167 +/- ##
=======================================
Coverage 85.92% 85.92%
=======================================
Files 3122 3122
Lines 216903 216903
Branches 51423 51423
=======================================
+ Hits 186380 186381 +1
+ Misses 27106 27105 -1
Partials 3417 3417
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| - name: Test docs-deploy freshness gate | ||
| run: bash .github/workflows/scripts/check-docs-deploy-freshness.test.sh | ||
| - name: Static check for GHA workflows | ||
| run: actionlint |
There was a problem hiding this comment.
As written, actionlint runs ShellCheck over every run: block and this repo doesn't pass that baseline: the validate-all-ghas job on this head exits 1 here with ~49 ShellCheck diagnostics (e.g. SC2086 in docker.yml/chromatic.yml, an SC1072 error in release.yml:42) plus a real one at superset-frontend.yml:113, where needs.frontend-build isn't in report-coverage's needs. Because the zizmor step comes after this one, a red lint also stops the security audit from running at all. Is the intent to land the ShellCheck/workflow fixes in this PR, or to start with something like actionlint -shellcheck= (or an -ignore list) and tighten later?
There was a problem hiding this comment.
Let's have all ShellCheck fixes landing in this PR, we definitely needs a good revamp against increasingly dangerous supply chain risks out there.
There was a problem hiding this comment.
Thanks. At this head the actionlint step still exits non-zero, which also keeps the zizmor step from running, so this stays open until the fixes are pushed. Can you ping here once they are in?
There was a problem hiding this comment.
Done, all addressed in fd613e5. I had to ignore the lint issues with Node 12 for pr-lint-action and cached-dependencies submoduled action since the only migration is to update them to Node LTS and/or migrate away to a ASF-whitelisted one.
|
|
||
| - name: Test docs-deploy freshness gate | ||
| run: bash .github/workflows/scripts/check-docs-deploy-freshness.test.sh | ||
| - name: Static check for GHA workflows |
There was a problem hiding this comment.
This narrows what gets validated: the deleted script checked every tracked .github/workflows/* and .github/actions/* YAML file, whereas actionlint only follows workflows and the local actions they reference, and doesn't lint a composite action's own action.yml. A broken or unreferenced composite action could now merge with a green job. Is that coverage loss acceptable, or should the composite actions get a separate check?
There was a problem hiding this comment.
I'll check if there is an option to handle composite actions as well
There was a problem hiding this comment.
Understood. Until a check covers the standalone composite actions, a broken action.yml that no workflow references can merge with a green job. Can you share what you find once you've looked at the options?
There was a problem hiding this comment.
Unfortunately, this feature only lands at v2. I guess we'll need to wait a bit until said version is released.
|
Move this back to draft as I'm a bit occupied |
Signed-off-by: hainenber <dotronghai96@gmail.com>
rusackas
left a comment
There was a problem hiding this comment.
Thanks @hainenber, nice to see the ShellCheck cleanup land alongside the linter swap. The report-coverage needs fix and the stray quote in release.yml are good catches.
Couple of things before this goes in... A few of the new quotes change behavior rather than just quieting ShellCheck. PLATFORM_ARG holds --platform linux/amd64 (two words), so quoting it hands supersetbot a single argument, and the quoted git tag -d "$(...)" breaks as soon as there's more than one trigger- tag. Suggestions inline for both.
Also, I'm a little wary of installing the linter from a personal fork through a vanity import path, pinned by tag only. Is there something we need from kjanat/actionlint that upstream rhysd/actionlint doesn't have yet?
GitHub shows conflicts, and the validator workflow has moved a fair bit on master, so CI hasn't run on the latest commit. Would you mind rebasing so we can see actionlint pass?
| if env -u DOCKERHUB_TOKEN supersetbot docker \ | ||
| "$PUSH_OR_LOAD" \ | ||
| --preset "$BUILD_PRESET" \ | ||
| --context "$BUILD_CONTEXT" \ | ||
| --context-ref "$BUILD_CONTEXT_REF" \ | ||
| --extra-flags "$EXTRA_FLAGS" \ | ||
| $PLATFORM_ARG; then | ||
| "$PLATFORM_ARG"; then |
There was a problem hiding this comment.
PLATFORM_ARG is --platform linux/amd64 (or two --platform pairs on master pushes) per scripts/docker-build-plan.sh, so it needs to word-split. Maybe keep these two unquoted and silence SC2086 here?
| if env -u DOCKERHUB_TOKEN supersetbot docker \ | |
| "$PUSH_OR_LOAD" \ | |
| --preset "$BUILD_PRESET" \ | |
| --context "$BUILD_CONTEXT" \ | |
| --context-ref "$BUILD_CONTEXT_REF" \ | |
| --extra-flags "$EXTRA_FLAGS" \ | |
| $PLATFORM_ARG; then | |
| "$PLATFORM_ARG"; then | |
| # shellcheck disable=SC2086 # PUSH_OR_LOAD and PLATFORM_ARG are flag lists that must word-split | |
| if env -u DOCKERHUB_TOKEN supersetbot docker \ | |
| $PUSH_OR_LOAD \ | |
| --preset "$BUILD_PRESET" \ | |
| --context "$BUILD_CONTEXT" \ | |
| --context-ref "$BUILD_CONTEXT_REF" \ | |
| --extra-flags "$EXTRA_FLAGS" \ | |
| $PLATFORM_ARG; then |
There was a problem hiding this comment.
Thanks Evan but unfortunately I can't commit your suggestion here due to it being made from deleted lines :(
Either way, I've addressed in 3a7403c8e12b391fddb6e1cd6577f603dc6b7736
I do share this wariness with you, Evan. However, the upstream has been almost abandoned and many newly introduced GHA syntaxes like |
…active-maintained-alternative Signed-off-by: hainenber <dotronghai96@gmail.com>
…branch Signed-off-by: hainenber <dotronghai96@gmail.com>
e01d965 to
3a7403c
Compare
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
…upersetbot_dry_run` Signed-off-by: hainenber <dotronghai96@gmail.com>
…active-maintained-alternative
Signed-off-by: hainenber <dotronghai96@gmail.com>
feat(ci): replace
action-validatorwith actively maintainedkjanat/actionlintfor GHA workflow static checkSUMMARY
Very much self-titled as we're moving from
action-validatorto a more actively maintainedkjaneat/actionlintthat also support for newer GHA syntax suchparallelkeyword.This PR also removes a seemingly unused
bump-python-packageworkflow.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
Green CI
ADDITIONAL INFORMATION