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

Don't fail on missing CI config #2312

Closed
5 tasks done
xoxys opened this issue Aug 21, 2023 · 17 comments · Fixed by #2949
Closed
5 tasks done

Don't fail on missing CI config #2312

xoxys opened this issue Aug 21, 2023 · 17 comments · Fixed by #2949
Labels
bug Something isn't working server

Comments

@xoxys
Copy link
Member

xoxys commented Aug 21, 2023

Component

server

Describe the bug

Not necessarily all branches of a repository are intended to have a CI config. But branches without a CI config will always create an error in the UI.

image

In the past, I was able to work around this issue by adding [skip ci] to all commits to branches without a CI config. This is now also broken, see #2216.

My suggestion would be to simply ignore missing CI configurations, or at least not create a failed pipeline in the UI. Alternatively, users should have the option to ignore branches. A common example would be github-pages branches, where only page artifacts are published and no CI configuration.

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"next-06d1f3c92e"}

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • 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]
  • Check that this is a concrete bug. For Q&A join our Discord Chat Server or the Matrix room.
@xoxys xoxys added bug Something isn't working server labels Aug 21, 2023
@6543
Copy link
Member

6543 commented Aug 21, 2023

Hmm you could add a noop ignore all pipeline to those branches ...

@xoxys
Copy link
Member Author

xoxys commented Aug 21, 2023

Yeah but for e.g. the gh pages this file will also be published... Not bad but ugly and I really think there should be a way to ignore branches.

@anbraten
Copy link
Member

Comparing to other CI systems it is normally ignoring webhooks as long as there is no config, so I think it would be fine if woodpecker does so as well. We have to check if it could be a breaking change for someone however

@lafriks
Copy link
Contributor

lafriks commented Aug 21, 2023

problem with this is that it can give correct hint when you have misnamed pipeline definition file or forgot to commit it. imho it would be better to have option to configure this. At least in gitea there is option in webhooks to configure to not send events on specific branches, looks like GH does not have it

@6543
Copy link
Member

6543 commented Aug 22, 2023

and why we me and @anbraten don't use a lot of configs via the repo settings is, that the pipeline config should be a single source of truth and represent the state of the pipeline. if we move to much outside of that config it does not do this anymore ... and so it's not versioned/documented etc... anymore

@xoxys
Copy link
Member Author

xoxys commented Aug 22, 2023

I don't have strong feelings how to handle it, as mentioned in the initial post a config option would be fine (at least for me) as well. But to me #2216 would be breaking change as it is changing the behavior and leads to a lot of errors in the UI as I have a docs branch which does not have a CI config in nearly all of my repos.

@6543
Copy link
Member

6543 commented Aug 22, 2023

added the label breaking to it for now

@xoxys
Copy link
Member Author

xoxys commented Aug 28, 2023

I would like to get this fixed. Do we need a config option for this? Then I'll add it to the existing PR, otherwise can someone review?

@anbraten
Copy link
Member

problem with this is that it can give correct hint when you have misnamed pipeline definition file or forgot to commit it.

So summarizing:

  • it would be fine to simply ignore webhooks if no config is available
  • we need a way to show at least repo admins in woodpecker that a webhook was somehow triggered but ignored (maybe by adding a log to the repo settings showing ignored webhooks, could be used for Audit Log #1574 as well)
  • we need to consider how this works in terms of special config files for RFC: pipeline compile workflow/(step) #2254 (we could simply require the user to set the config file in that case)

@xoxys
Copy link
Member Author

xoxys commented Aug 30, 2023

Is it required to do all at once? Or can we merge the ignore missing config pr and improve the rest in dedicated PRs?

@xoxys
Copy link
Member Author

xoxys commented Sep 5, 2023

As I would like to switch to the current next release, can we please add the ability to ignore missing CI configurations, one way or another? If the proposed PR is not sufficient, can you please add what is missing to address this issue?

I understand that we might want to improve it to give a hint in the UI as well (the error is already logged on the server side) but removing the last option to bypass this problem without a single alternative is not good either.

@anbraten
Copy link
Member

anbraten commented Sep 6, 2023

As all other CI systems are not listening if there is no config file, I guess its fine for woodpecker to do so for now as well, so from my side we could for now just ignore it and add the log-view / notification / ... later on

@xoxys
Copy link
Member Author

xoxys commented Sep 6, 2023

Thanks. I would appreciate an Approval for the PR in this case.

@Andre601
Copy link
Contributor

Andre601 commented Sep 8, 2023

I believe the CI should not run anything if there is no file. Tho, maybe have an option to toggle this for those people who want this behaviour for some reason?

I for my part dislike this behaviour as it creates failed runs where there shouldn't be one to begin with. That combined with the CI now apparently ignoring [SKIP CI] in such cases is just frustrating to deal with since apparently the when option is ignored too (I've set a when to only trigger on master branch, yet it triggers on others too)?

@xoxys
Copy link
Member Author

xoxys commented Sep 8, 2023

Configurations are read per branch. If your pages branch has no .woodpecker config a when filter from the main/default branch doesn't matter.

@anbraten
Copy link
Member

anbraten commented Dec 14, 2023

Recently started using a pretty large project with Woodpecker and experiencing this again. I get errors for a lot of branches, PRs, ... all of them because there is no Woodpecker config. I guess skipping those pipeline as almost all other CI systems do it would be the best here.

@6543
Copy link
Member

6543 commented Dec 14, 2023

Ok so i would say: if the forge report no found we ignore, if its any other error we show error config fetch failed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server
Projects
None yet
5 participants