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

Skip pipeline if config not found #2313

Closed
wants to merge 9 commits into from
Closed

Conversation

xoxys
Copy link
Member

@xoxys xoxys commented Aug 21, 2023

Fixes: #2312

  • missing pipeline config for hook events is ignored
  • other events like restarts, manual run, etc. still throwing an error to the user

image

@xoxys
Copy link
Member Author

xoxys commented Aug 21, 2023

Don't know it that's the best way to achieve this, but it seems to be working.

@xoxys xoxys requested a review from a team August 21, 2023 19:42
@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@c67a1c2). Click here to learn what that means.
Patch has no changes to coverable lines.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2313   +/-   ##
=======================================
  Coverage        ?   40.42%           
=======================================
  Files           ?      183           
  Lines           ?    11035           
  Branches        ?        0           
=======================================
  Hits            ?     4461           
  Misses          ?     6219           
  Partials        ?      355           

☔ View full report in Codecov by Sentry.

📢 Have feedback on the report? Share it here.

Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not how we should handle it ...

i would propose a custom error and check for the error in error handling at the server/api package

@xoxys xoxys requested review from 6543 and a team August 23, 2023 07:31
@woodpecker-bot
Copy link
Collaborator

woodpecker-bot commented Aug 23, 2023

Deployment of preview was successful: https://woodpecker-ci-woodpecker-pr-2313.surge.sh

@anbraten
Copy link
Member

anbraten commented Sep 8, 2023

Could you add a note to the migration docs. Otherwise lgtm

@xoxys
Copy link
Member Author

xoxys commented Sep 8, 2023

@anbraten Sure, done.

@xoxys xoxys enabled auto-merge (squash) September 8, 2023 12:47
@lafriks
Copy link
Contributor

lafriks commented Sep 8, 2023

maybe we can skip pipelines with missing config only for non-default branches?

@xoxys
Copy link
Member Author

xoxys commented Sep 8, 2023

Can we please just merge it for now. We agreed in the issue already that there are multiple options to improve it.

@xoxys
Copy link
Member Author

xoxys commented Sep 8, 2023

Argh... @6543 this needs an approval from you as you requested the change...

pipeline.Started = time.Now().Unix()
pipeline.Finished = pipeline.Started
pipeline.Status = model.StatusError
pipeline.Error = fmt.Sprintf("pipeline definition not found in %s", repo.FullName)
pipeline.Error = err.Msg
return nil, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just add?

Suggested change
return nil, err
if pipeline.Branch != repo.Branch {
return nil, err
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just let the user control it? Why should we assume that the default branch requires a CI config for every user or setup? We can add options to disable/enable this feature later right now irgnoring it and logging an error in the backend is good enough IMO.

Copy link
Contributor

@lafriks lafriks Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for my use case, this will increase our support team work on finding out why pipelines are not working for new projects because even with current error that config was not found there were some developers that asked for help. Now it will be even harder to find that as developers won't see anything and it will just not work silently.
You are currently taking away what I need to make it how you need. Imho my proposed solution would work for both our needs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand your point but I still disagree. However not my decision, Ill leave this PR to someone else to pick up or make a decision.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But from what you wrote previously this would work also for you so this would be good middle ground that would be good and not too breaking change and later on as you said this could be improved for other cases if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't fail on missing CI config
6 participants