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

refactor(cockroachdb): to use request driven options #2883

Merged
merged 22 commits into from
Dec 2, 2024

Conversation

stevenh
Copy link
Collaborator

@stevenh stevenh commented Nov 8, 2024

Refactor cockroachdb module to to use request driven options simplifying the flow.

Clean up tests eliminating the use of suite which significantly speeds up test runs.

Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 51f572d
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/674d9817dac141000812e5f8
😎 Deploy Preview https://deploy-preview-2883--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 refactor/cockroachdb branch 4 times, most recently from fbfb05c to 6dc9c5c Compare November 8, 2024 02:29
@stevenh
Copy link
Collaborator Author

stevenh commented Nov 8, 2024

This should be split out into components if we want to go down this route.

@stevenh stevenh marked this pull request as ready for review November 22, 2024 15:54
@stevenh stevenh requested a review from a team as a code owner November 22, 2024 15:54
@stevenh stevenh marked this pull request as draft November 22, 2024 15:54
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did an initial pass and the overall feedback is positive. I detected the following possible chunks of separate PRs, please tell me what you think:

  1. wait.walk for traversing multi strategies
  2. wait for TLS
  3. cockroachdb refactor

I think it would be much clearer for the review, but also for the release notes, as consumers would discover the new wait strategies as part of it.

modules/cockroachdb/data/cluster_defaults.sql Show resolved Hide resolved
modules/cockroachdb/options.go Show resolved Hide resolved
wait/tls.go Outdated Show resolved Hide resolved
wait/tls_test.go Outdated Show resolved Hide resolved
wait/walk_test.go Outdated Show resolved Hide resolved
wait/walk.go Outdated Show resolved Hide resolved
wait/walk_test.go Outdated Show resolved Hide resolved
wait/walk_test.go Outdated Show resolved Hide resolved
wait/walk_test.go Outdated Show resolved Hide resolved
@stevenh
Copy link
Collaborator Author

stevenh commented Nov 22, 2024

I did an initial pass and the overall feedback is positive. I detected the following possible chunks of separate PRs, please tell me what you think:

  1. wait.walk for traversing multi strategies
  2. wait for TLS
  3. cockroachdb refactor

I think it would be much clearer for the review, but also for the release notes, as consumers would discover the new wait strategies as part of it.

That's pretty much my thought's too, which is why I've left in draft.

@stevenh stevenh force-pushed the refactor/cockroachdb branch from 158644d to 83a7838 Compare November 22, 2024 18:39
@stevenh stevenh force-pushed the refactor/cockroachdb branch 2 times, most recently from df5766a to 81290cb Compare November 27, 2024 14:54
@stevenh stevenh marked this pull request as ready for review November 27, 2024 17:07
@stevenh stevenh requested a review from mdelapenya November 28, 2024 23:19
mdelapenya
mdelapenya previously approved these changes Dec 2, 2024
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Just a few comments, minor ones.

modules/cockroachdb/cockroachdb.go Show resolved Hide resolved
modules/cockroachdb/data/cluster_defaults.sql Show resolved Hide resolved
@stevenh
Copy link
Collaborator Author

stevenh commented Dec 2, 2024

@mdelapenya I've added clarification to the Run method about what version is supported. I tested all the way back to v22.2.0, which was the first version which introduced the init_success file creation once the cluster init has completed.

martskins and others added 15 commits December 2, 2024 11:20
Simplify the connection handling in cockroachdb so that ConnectionString
can be used without the user doing extra work to handle TLS if enabled.

Deprecate TLSConfig which is no longer needed separately.

BREAKING_CHANGE: This now returns a registered connection string so is
no longer compatible with pgx.ParseConfig, use ConnectionConfig for this
use case instead.
Refactor cockroachdb module to to use request driven options,
simplifying the flow.
Various fixes and remove the ability to configure certs using the
default generated ones instead.
Add the missing data file and remove unused constants.
Extract TLS certificate wait strategy into a dedicated wait type so it
can be reused.

Implement walk method which can be used to identify wait strategies in
a request chain.

Use embed to simplify wait test loading of certs.
Remove the now unused customizer.
Fix lint style issue for blank line.
Clarified the impact of run defaults.
@stevenh stevenh force-pushed the refactor/cockroachdb branch from 0a185ed to 51f572d Compare December 2, 2024 11:20
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdelapenya mdelapenya self-assigned this Dec 2, 2024
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Dec 2, 2024
@mdelapenya mdelapenya merged commit c28f0f8 into main Dec 2, 2024
122 checks passed
@mdelapenya mdelapenya deleted the refactor/cockroachdb branch December 2, 2024 13:01
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Dec 5, 2024
* main:
  fix: container binds syntax (testcontainers#2899)
  refactor(cockroachdb): to use request driven options (testcontainers#2883)
  chore(deps): bump actions/setup-go from 5.0.0 to 5.1.0 (testcontainers#2904)
  chore(deps): bump ossf/scorecard-action from 2.3.1 to 2.4.0 (testcontainers#2903)
  chore(deps): bump test-summary/action from 2.3 to 2.4 (testcontainers#2902)
  feat(wait): strategy walk (testcontainers#2895)
  feat(wait): tls strategy (testcontainers#2896)
mdelapenya added a commit to mtellis2/testcontainers-go that referenced this pull request Dec 11, 2024
* main: (234 commits)
  chore(ci): add Github labels based on PR title (testcontainers#2914)
  chore(gha): Use official setup-docker-action (testcontainers#2913)
  chore(ci): enforce conventional commits syntax in PR titles (testcontainers#2911)
  feat(nats): WithConfigFile - pass a configuration file to nats server (testcontainers#2905)
  chore: enable implicit default logger only in testing with -v (testcontainers#2877)
  fix: container binds syntax (testcontainers#2899)
  refactor(cockroachdb): to use request driven options (testcontainers#2883)
  chore(deps): bump actions/setup-go from 5.0.0 to 5.1.0 (testcontainers#2904)
  chore(deps): bump ossf/scorecard-action from 2.3.1 to 2.4.0 (testcontainers#2903)
  chore(deps): bump test-summary/action from 2.3 to 2.4 (testcontainers#2902)
  feat(wait): strategy walk (testcontainers#2895)
  feat(wait): tls strategy (testcontainers#2896)
  docs: better contribution guidelines (testcontainers#2893)
  fix(influxdb): Respect custom waitStrategy (testcontainers#2845)
  fix: only upload to sonar on ubuntu-latest (testcontainers#2891)
  fix: build artifact name properly (testcontainers#2890)
  fix: do not run sonar upload when ryuk is disabled (testcontainers#2889)
  fix: update GH actions for uploading/downloading artifacts (testcontainers#2888)
  feat(ci): Enable master moby with rootless (testcontainers#2880)
  fix(redpanda): temporary file use
  ...
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Dec 13, 2024
* main:
  feat(gcloud)!: add support to seed data when using RunBigQueryContainer (testcontainers#2523)
  security(deps): bump golang.org/x/crypto from 0.28.0 to 0.31.0 (testcontainers#2916)
  chore(ci): add Github labels based on PR title (testcontainers#2914)
  chore(gha): Use official setup-docker-action (testcontainers#2913)
  chore(ci): enforce conventional commits syntax in PR titles (testcontainers#2911)
  feat(nats): WithConfigFile - pass a configuration file to nats server (testcontainers#2905)
  chore: enable implicit default logger only in testing with -v (testcontainers#2877)
  fix: container binds syntax (testcontainers#2899)
  refactor(cockroachdb): to use request driven options (testcontainers#2883)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that do not impact the existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants