feat: Add global build pre- and post-hooks #9047
Conversation
|
Note for reviewers: I am a bit lost on the testing strategy. What's more, creating a new version introduced a ton of changes -- is that ok? |
740d30e to
171099e
Compare
|
Rebased to latest |
|
Hi @ar3s3ru skaffold/pkg/skaffold/hooks/render_test.go Lines 1 to 75 in 88e1c17 |
Codecov Report
@@ Coverage Diff @@
## main #9047 +/- ##
==========================================
- Coverage 70.48% 63.34% -7.14%
==========================================
Files 515 626 +111
Lines 23150 32188 +9038
==========================================
+ Hits 16317 20390 +4073
- Misses 5776 10255 +4479
- Partials 1057 1543 +486
... and 430 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
A similar pr for render phase hook |
|
Hey @ericzzzzzzz, thanks for the pointers, it does look very similar indeed. I'll take a stab at it later and ping you once I have something ready 🙏🏻 |
171099e to
77b944e
Compare
|
Hi @ar3s3ru Could you fix the linting issues? You can use |
|
@ericzzzzzzz done, last commit should've fixed it. |
|
Hey @ericzzzzzzz I see the unit tests are failing for linux. Seems to be a race condition non correlated to my changes. How do you suggest to move forward? Open to anything to speed up merging this PR 🙏🏻 |
Description
This PR adds the possibility of running pre- and post-hooks for the Build phase of a Pipeline.
The implementation is done by leveraging the pre-existing
build.PipelineBuilderinterface, using a wrapper that extendsPreBuildandPostBuildmethods, to avoid significant changes to the pre-existing code.User facing changes
This PR adds the new functionality by introducing a new
build.hooksfield in the configuration.Due to the new configuration field, I've created a new version,
v4beta7, as specified in the contribution guidelines.This is a
skaffold buildrun from a slightly modified version ofexamples/getting-started/skaffold.yaml:Here is the output, which shows how the new
build.hooksis behaving: