woodpecker-ci / woodpecker

Woodpecker is a simple yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
3.88k stars 345 forks source link

cli exec fail on warning linting error but it should only be logged #3821

Closed 6543 closed 7 hours ago

6543 commented 1 week ago

woodpecker version: v2.6.0

cli exec with this config:

steps:
  - name: echo
    image: dummy
    commands: echo ja

we get:

8:38PM DBG cli/common/hooks.go:38 > Checking for updates ...
8:38PM DBG cli/update/updater.go:25 > Current version: next-1f21033432
8:38PM DBG cli/update/updater.go:28 > Skipping update check for development & next versions
8:38PM DBG cli/common/hooks.go:49 > No update required
8:38PM FTL cmd/cli/main.go:27 > error running cli error="[bad_habit] Please set an event filter for all steps or the whole workflow on all items of the when block"

I expect the cli to not fail just lock the error - as error type is bad_habit

Originally posted by @6543 in https://github.com/woodpecker-ci/woodpecker/issues/3820#issuecomment-2184150465

6543 commented 1 week ago

-> to simulate what server+agent would do

anbraten commented 11 hours ago

Running go run ./cmd/cli/ lint test.yml with the provided config returns:

🔥 jo.yml has warnings / errors:
   ⚠️  Please set an event filter for all steps or the whole workflow on all items of the when block

with exit code 0 in my case.

6543 commented 11 hours ago

Yes and now try to exec it

anbraten commented 11 hours ago

Just noticed that 😅 Fix is almost done 😉