refactor!: require the builder pattern for module initalisation#161
Merged
DDtKey merged 8 commits intotestcontainers:mainfrom Sep 25, 2024
Merged
Conversation
e4e0a17 to
6045cb7
Compare
DDtKey
reviewed
Jul 7, 2024
596faf7 to
ed7a50b
Compare
Contributor
Author
Sorry for that part. Forgot to do rustfmt after doing the (apparently missing doctests) testing run |
Contributor
Author
Contributor
|
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
This was referenced Sep 25, 2024
Closed
Merged
DDtKey
pushed a commit
that referenced
this pull request
Sep 25, 2024
## 🤖 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::CncfDistributionCncfDistribution.start()CncfDistribution::default().start()dynamodb_local::DynamoDbDynamoDb.start()DynamoDb::default().start()elasticmq::ElasticMqElasticMq.start()ElasticMq::default().start()(see #143)mongo::MongoMongo.start()Mongo::default().start()kwok::KwokClusterKwokCluster.start()KwokCluster::default().start()rabbitmq::RabbitMqRabbitMq.start()RabbitMq::default().start()redis::stack::RedisStackRedisStack.start()RedisStack::default().start()redis::standalone::RedisRedis.start()Redis::default().start()victoria_metrics::VictoriaMetricsVictoriaMetrics.start()VictoriaMetrics::default().start()