woodpecker-ci / woodpecker

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

Don't parse forge config files multiple times if no error occured #4272

Closed pat-s closed 3 weeks ago

pat-s commented 3 weeks ago

fix #4264 introduced in #3699

This applies to all forges. Currently, all config files are fetched three times from the forge. As this takes a while for gitlab.com, this resulted in an overall timeout error of > 10s for the webhook processing.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 26.52%. Comparing base (9a76233) to head (76fe3c9). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4272 +/- ## ======================================= Coverage 26.51% 26.52% ======================================= Files 377 377 Lines 27448 27447 -1 ======================================= + Hits 7279 7280 +1 + Misses 19504 19503 -1 + Partials 665 664 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

anbraten commented 3 weeks ago

Nice catch. Seems to be introduced by https://github.com/woodpecker-ci/woodpecker/pull/371 from +3years ago 🙈 Could you try to add a test checking this on f.On("File") with sth like .Times(1) or by changing it to .Once()

6543 commented 3 weeks ago

tested with and without tests -> it's covered now :tada:

6543 commented 3 weeks ago

-> #4273

woodpecker-bot commented 3 weeks ago

Tearing down https://woodpecker-ci-woodpecker-pr-4272.surge.sh