-
Notifications
You must be signed in to change notification settings - Fork 43
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
refactor!: require the builder pattern for module initalisation #161
refactor!: require the builder pattern for module initalisation #161
Conversation
e4e0a17
to
6045cb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use refactor
instead of chore
here
Thank you for the PR! ❤️
596faf7
to
ed7a50b
Compare
Sorry for that part. Forgot to do rustfmt after doing the (apparently missing doctests) testing run |
It's definitely not related to this PR and seems flaky - yes. For some reason, I think it happens only on Need to address this but in separate PR for sure |
…nt and encourages the builder pattern
ed7a50b
to
54c2d9f
Compare
## 🤖 New release * `testcontainers-modules`: 0.10.0 -> 0.11.0 (⚠️ API breaking changes) ###⚠️ `testcontainers-modules` breaking changes ``` --- failure unit_struct_changed_kind: unit struct changed kind --- Description: A public unit struct has been changed to a normal (curly-braces) struct, which cannot be constructed using the same struct literal syntax. ref: rust-lang/cargo#10871 impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.35.0/src/lints/unit_struct_changed_kind.ron Failed in: struct DynamoDb in /tmp/.tmpSZARLK/testcontainers-rs-modules-community/src/dynamodb_local/mod.rs:8 struct KwokCluster in /tmp/.tmpSZARLK/testcontainers-rs-modules-community/src/kwok/mod.rs:36 struct CncfDistribution in /tmp/.tmpSZARLK/testcontainers-rs-modules-community/src/cncf_distribution/mod.rs:30 struct Redis in /tmp/.tmpSZARLK/testcontainers-rs-modules-community/src/redis/standalone.rs:37 struct RabbitMq in /tmp/.tmpSZARLK/testcontainers-rs-modules-community/src/rabbitmq/mod.rs:33 struct ElasticMq in /tmp/.tmpSZARLK/testcontainers-rs-modules-community/src/elasticmq/mod.rs:7 struct VictoriaMetrics in /tmp/.tmpSZARLK/testcontainers-rs-modules-community/src/victoria_metrics/mod.rs:36 struct RedisStack in /tmp/.tmpSZARLK/testcontainers-rs-modules-community/src/redis/stack.rs:35 ``` <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.11.0] - 2024-09-25 ### Bug Fixes - Update version to fix crashes in CI ([#219](#219)) - [**breaking**] Make EULA acception explicit ([#218](#218)) ### Documentation - Add docs for the ganachecli module ([#190](#190)) ### Features - Add ability to enable properties-config for testcontainers - [**breaking**] Update testcontainers to `0.23.0` ([#216](#216)) ### Miscellaneous Tasks - Update redis requirement from 0.26.0 to 0.27.2 ([#211](#211)) - Exclude all-features test run ([#174](#174)) - Update async-nats requirement from 0.35.0 to 0.36.0 ([#206](#206)) ### Refactor - [**breaking**] Require the builder pattern for module initalisation ([#161](#161)) ### Testing - Correct password usage <!-- generated by git-cliff --> </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR makes sure that the way structs are constructed is consistent and encourages the builder pattern.
It is based on this question: #156 (comment)
For the changelog:
We now require you to use the builder pattern (instead of some structs being unit structs) for all modules.
This ensures that if we add a field in the future that this will not break your existing code.
This change is breaking for these modules:
cncf_distribution::CncfDistribution
CncfDistribution.start()
CncfDistribution::default().start()
dynamodb_local::DynamoDb
DynamoDb.start()
DynamoDb::default().start()
elasticmq::ElasticMq
ElasticMq.start()
ElasticMq::default().start()
(see #143)mongo::Mongo
Mongo.start()
Mongo::default().start()
kwok::KwokCluster
KwokCluster.start()
KwokCluster::default().start()
rabbitmq::RabbitMq
RabbitMq.start()
RabbitMq::default().start()
redis::stack::RedisStack
RedisStack.start()
RedisStack::default().start()
redis::standalone::Redis
Redis.start()
Redis::default().start()
victoria_metrics::VictoriaMetrics
VictoriaMetrics.start()
VictoriaMetrics::default().start()