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

feat: add build to life cycle hooks #2653

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevenh
Copy link
Collaborator

@stevenh stevenh commented Jul 17, 2024

Add pre and post build life cycle hooks so the user can see when an image build is occurring and what it's tag is.

Refactor combineContainerHooks to support additional fields automatically.

Reduce overhead of hook error handling by starting with an nil error slice and use append to allocate only if needed, in other words assume the happy path by default hence minimising allocations.

Minimise code used in hook handling by using helper methods.

Eliminate unused / shadowed parameters from defaultPreCreateHook.

GetRepo and GetTag now return a consistent UUID if the Repo or Tag field aren't set by setting their values. This was needed to enable the output of the image we're going to build in the log.

Copy link

netlify bot commented Jul 17, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 90afc8b
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/66973113ed534b0008291271
😎 Deploy Preview https://deploy-preview-2653--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@stevenh stevenh force-pushed the feat/build-lifecycle branch 2 times, most recently from b68d4a3 to 6384301 Compare July 17, 2024 02:43
Add pre and post build life cycle hooks so the user can see when an image
build is occurring and what it's tag is.

Refactor combineContainerHooks to support additional fields automatically.

Reduce overhead of hook error handling by starting with an nil error
slice and use append to allocate only if needed, in other words assume
the happy path by default hence minimising allocations.

Minimise code used in hook handling by using helper methods.

Eliminate unused / shadowed parameters from defaultPreCreateHook.

GetRepo and GetTag now return a consistent UUID if the Repo or Tag field
aren't set by setting their values. This was needed to enable the output
of the image we're going to build in the log.
@stevenh stevenh marked this pull request as ready for review July 17, 2024 02:52
@stevenh stevenh requested a review from a team as a code owner July 17, 2024 02:52
@mdelapenya
Copy link
Member

For this one, we have docs documenting the lifecycle hooks here: https://golang.testcontainers.org/features/creating_container/#lifecycle-hooks could you also update that? 🙏

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.

2 participants