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

add couchbase module #876

Merged
merged 32 commits into from Mar 9, 2023
Merged

add couchbase module #876

merged 32 commits into from Mar 9, 2023

Conversation

alihanyalcin
Copy link
Contributor

@alihanyalcin alihanyalcin commented Feb 25, 2023

What does this PR do?

This module initialize couchbase cluster and create buckets for testing purposes. Similar to testcontainers-java couchbase module

Why is it important?

In java projects, it is really easy to write integration tests for couchbase. So, this module has nearly all functionality supported in testcontainers-java couchbase module.

Related issues

@alihanyalcin alihanyalcin requested a review from a team as a code owner February 25, 2023 21:06
@netlify
Copy link

netlify bot commented Feb 25, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit abef3b2
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/64097fcb7ea1b50008b01a65
😎 Deploy Preview https://deploy-preview-876--testcontainers-go.netlify.app/modules
📱 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 settings.

Copy link
Collaborator

@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 added a few minor comments fixing what #877 caused, but it's amazing you used the code generation tool for the module 👏

I'm going to start the review today, and want to double check with the rest of the team for commonalities with other implementations (e.g. Java). Did you use it by any case as the reference implementation for Go?

Other than that, thanks for the initial PR, I will be pinging you with questions though it.

The first ping is regarding the docs: as the module is a more elaborated than an example one, I'd recommend extending the docs, like in the LocalStack module (https://golang.testcontainers.org/modules/localstack/) where we expand on the API; or in the upcoming Apache Pulsar module (still in PR stage): https://deploy-preview-872--testcontainers-go.netlify.app/modules/pulsar/

docs/modules/couchbase.md Outdated Show resolved Hide resolved
docs/modules/couchbase.md Outdated Show resolved Hide resolved
.github/workflows/module-couchbase.yml Outdated Show resolved Hide resolved
.github/workflows/module-couchbase.yml Outdated Show resolved Hide resolved
.github/workflows/module-couchbase.yml Outdated Show resolved Hide resolved
modules/couchbase/tools/tools.go Outdated Show resolved Hide resolved
@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label Feb 27, 2023
@mdelapenya mdelapenya self-assigned this Feb 27, 2023
.github/dependabot.yml Outdated Show resolved Hide resolved
wait/http.go Outdated Show resolved Hide resolved
@alihanyalcin
Copy link
Contributor Author

alihanyalcin commented Mar 2, 2023

Hi @mdelapenya, I added requested tests and Couchbase documentation.

.github/dependabot.yml Outdated Show resolved Hide resolved
Copy link
Collaborator

@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 left a few minor comments regarding methods belonging to the container struct.

Other than that, once discussed, this PR LGTM, as it matches the Java implementation. Possibly @eddumelendez can verify the Java part.

modules/couchbase/couchbase.go Show resolved Hide resolved
modules/couchbase/couchbase.go Show resolved Hide resolved
modules/couchbase/go.mod Outdated Show resolved Hide resolved
Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

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

LGTM regarding to the actual status in tc-java. I've left one comment which I think could avoid breaking changes in the future for Go implementation. Consider it as a nice to have :)

Comment on lines 288 to 291
storageMode := "forestdb"
if c.config.isEnterprise {
storageMode = "memory_optimized"
}
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be great to consider this in the new Go implementation

Copy link
Collaborator

Choose a reason for hiding this comment

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

@alihanyalcin do you think we can contribute that part? As this module will fall under the next release lifecycle, we could merge this PR as is, and you could do what @eddumelendez suggests in a follow-up. Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, I have contributed the requested section. BTW, the enterprise edition of the Couchbase Server supports both the Plasma and Memory Optimized storage engines, while the community edition only supports the ForestDB storage engine.

https://docs.couchbase.com/server/current/rest-api/post-settings-indexes.html

Copy link
Collaborator

@mdelapenya mdelapenya Mar 8, 2023

Choose a reason for hiding this comment

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

Thanks for getting it so fast! We cannot be experts in all the supported technologies so we are more than thankful for seeing this kind of improvements 👏👏👏

@sonarcloud
Copy link

sonarcloud bot commented Mar 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Collaborator

@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.

It took a while, but I think this PR LGTM

Thanks @alihanyalcin for your support and your time during the review. 🙇

@mdelapenya mdelapenya merged commit f90c104 into testcontainers:main Mar 9, 2023
@lmitelman
Copy link

lmitelman commented Mar 9, 2023

@mdelapenya @eddumelendez A new vulnerability was found in the crypto dependency, which is used by testcontainers!

I strongly recommend bumping that dependency, as SonarQube and other tools do not let pipelines through!

Vulnerability #1: GO-2023-1621
  The ScalarMult and ScalarBaseMult methods of the P256 Curve may
  return an incorrect result if called with some specific
  unreduced scalars (a scalar larger than the order of the curve).
  This does not impact usages of crypto/ecdsa or crypto/ecdh.

  More info: https://pkg.go.dev/vuln/GO-2023-1621

  Standard library
    Found in: crypto/internal/nistec@go1.20.1
    Fixed in: crypto/internal/nistec@go1.20.2

@mdelapenya
Copy link
Collaborator

@lmitelman could you open a separate report for this? We'll label with security to address it asap

Thanks for reporting it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or new behaviors on the existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement couchbase module
4 participants