Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve bad habit warning without when block #3773

Open
3 tasks done
neuschaefer opened this issue Jun 8, 2024 · 4 comments
Open
3 tasks done

Improve bad habit warning without when block #3773

neuschaefer opened this issue Jun 8, 2024 · 4 comments
Labels
enhancement improve existing features good first issue Likely to be an easy fix

Comments

@neuschaefer
Copy link

Component

web-ui

Describe the bug

I have a simple workflow in which I did not specify any when block. Woodpecker produces the following lint, which mentions a when block:

when

Steps to reproduce

steps:
  build:
    image: debian:12
    commands:
      - apt-get update && apt-get install -y git cmake ninja-build g++ gcc-arm-none-eabi python3
      - cmake -B build -G Ninja -DPICO_SDK_PATH=pico-sdk
      - ninja -C build

Expected behavior

  • The lint does not mention "the when block" when there is none
  • The lint (or another one) may offer appropriate guidance for adding a good when block, but that's a different problem then what the lint message currently implies

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"2.5.0"}

Additional context

I reworded this issue a few times, because my original goal was to clone a repo non-recursively, and it wasn't entirely clear to me from the documentation, how to do this.

I found #3607, which discusses a similar issue, and I'm not sure if the next version of Woodpecker might perhaps fix what I described. I have not installed woodpecker-next because that would be another project of multiple hours.

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Checked that the bug isn't fixed in the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
@neuschaefer neuschaefer added the bug Something isn't working label Jun 8, 2024
@qwerty287
Copy link
Contributor

If you didn't know yet, there's a more detailed description of this in the docs: https://woodpecker-ci.org/docs/usage/linter#event-filter-for-all-steps

@neuschaefer
Copy link
Author

If you didn't know yet, there's a more detailed description of this in the docs: https://woodpecker-ci.org/docs/usage/linter#event-filter-for-all-steps

I saw the page, but both the message and the longer documentation section are still very confusing because they (seem to) assume (wrongly) that I have a when block.

@qwerty287
Copy link
Contributor

Do you have a better suggestion?

@neuschaefer
Copy link
Author

Do you have a better suggestion?

  • If there is a when block, keep the message as is
  • If there is no when block, suggest adding a when block in the first place. Something like: "Please consider adding a when block with an event filter". It can link to the same documentation page, I guess

@qwerty287 qwerty287 added enhancement improve existing features good first issue Likely to be an easy fix and removed bug Something isn't working labels Jun 15, 2024
@qwerty287 qwerty287 changed the title Bogusly worded lint: "Please set an event filter for all steps or the whole workflow on all items of the when block" Improve bad habit warning without when block Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve existing features good first issue Likely to be an easy fix
Projects
None yet
Development

No branches or pull requests

2 participants