chore: Add WithAcceptLicenseAgreement(bool) to container builder#1370
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…se-agreement-to-module-container-builder
|
Should this be implemented in the MsSql module too? Currently, |
|
@0xced Yes, I know the MSSQL module is still left. I did not change it because I am uncertain of the best way to transition to the new API without causing a breaking change (interfering with developers; ensuring that developers are aware of the change in advance). |
|
@HofmeisterAn how about toggeling an internal flag with the license-acceptance method and writing warnings on build, if the flag suggests, that the license was not explicitly accepted or declined. Of course thr plan to enforce explicit license acceptance should go into the changelog, too. I don't see, that there is a 100% option, but this should reach most |
What does this PR do?
This PR introduces a new container builder method
WithAcceptLicenseAgreement(bool), which provides a base implementation and makes it easier for developers to implement modules that require license agreements.Basically, modules need to override the following and call
ValidateLicenseAgreement()in theirBuild()method. I expect modules to overrideWithAcceptLicenseAgreement(bool)and include proper documentation that references the relevant license information.Why is it important?
Recent module PRs include more and more modules that require license agreements. Previously, the code to check license acceptance was always copied manually. This PR simplifies the implementation of license acceptance, reduces code duplication, and ensures a consistent pattern across all modules.
Related issues
-