Skip to content

Add a database plugin to enable account management in the Couchbase NOSQL Database#1

Merged
tomhjp merged 44 commits into
hashicorp:masterfrom
fhitchen:master
Jul 29, 2020
Merged

Add a database plugin to enable account management in the Couchbase NOSQL Database#1
tomhjp merged 44 commits into
hashicorp:masterfrom
fhitchen:master

Conversation

@fhitchen
Copy link
Copy Markdown
Contributor

@fhitchen fhitchen commented Jun 17, 2020

Hi,
I have updated the plugin to support versions prior to the latest 6.5.0 version of Couchbase and incorporated suggestions from their engineering team regarding the use of the gocb SDK.

To do is to add support for provisioning accounts that use the group roles supported by Couchbase. I don't think this will be difficult, but haven't got around to it yet. **Note:**This has been done. Also need to add a few utilities to create test accounts and buckets in the off the shelf Couchbase Docker image rather than rely on the modified personal copy.

I was unable to think of a way to add a more sophisticated static role password rotation test, I hope you don't mind.

@kalafut kalafut requested a review from tomhjp July 14, 2020 05:07
Copy link
Copy Markdown
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

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

Hi @fhitchen, thanks for the fantastic contribution! Overall this looks really good, and it's great to see such good documentation and test coverage too.

I've left quite a few comments, but a lot are minor Go idioms/linting/naming etc. The main things I'd like to get sorted before landing this are:

  • Context timeouts respected
  • logrus -> hclog
  • The docker image and its ports used in the tests
  • And a few places where defer will improve the robustness

Please let me know if you need any further support or when you're ready for more reviews. Thanks!

Comment thread couchbase_test.go Outdated
Comment thread connection_producer.go Outdated
Comment thread connection_producer.go Outdated
Comment thread couchbase.go Outdated
Comment thread couchbase.go Outdated
Comment thread README.md Outdated
Comment thread connection_producer.go
Comment thread couchbase.go Outdated
Comment thread couchbase_test.go Outdated
Comment thread couchbase-database-plugin/main.go
Comment thread couchbase_test.go Outdated
@fhitchen
Copy link
Copy Markdown
Contributor Author

fhitchen commented Jul 23, 2020 via email

Copy link
Copy Markdown
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

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

Looking good! Thanks for addressing all the feedback. Not many comments left from me, mostly just some tidying up.

Comment thread .circleci/config.yml Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread connection_producer.go
Comment thread couchbase.go Outdated
Comment thread couchbase_test.go Outdated
Comment thread couchbase_test.go Outdated
Comment thread couchbase_test.go Outdated
@tomhjp tomhjp requested review from catsby and jasonodonnell and removed request for catsby July 27, 2020 10:31
Copy link
Copy Markdown
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

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

LGTM! Just two tiny things to tidy up.

There was a surprising flake in the CI here (hopefully you can see that?) but it hasn't happened again in 5 retries. Future PRs should have the CI run automatically now that the repo has been set up in our CI plan.

Comment thread couchbase_test.go
Comment thread cmd/couchbase-database-plugin/main.go Outdated
@tomhjp tomhjp merged commit c5ae555 into hashicorp:master Jul 29, 2020
@fhitchen
Copy link
Copy Markdown
Contributor Author

fhitchen commented Jul 29, 2020

I think the flakiness is due to the hard coded timeout in the connection_producer Connection method. I should have replaced it with the Context based timeout. I pumped up the CPU load on my old Linux box and have managed to reproduce 2 failures as it waits for the cluster to be ready after connecting.

I should fork the hashicorp repo now to make this change?

Also, will someone update the main hashicorp documentation to add couchbase to the secret engines -> database documentation?

Yup, with the Connection method using a Context and the default timeout upped from 5 seconds to 20 seconds, the testing flakiness is resolved. I have run the test for several hours on one of the older database versions (they are much slower) and did not see a single failure.

@tomhjp
Copy link
Copy Markdown
Contributor

tomhjp commented Jul 30, 2020

I think the flakiness is due to the hard coded timeout in the connection_producer Connection method. I should have replaced it with the Context based timeout. I pumped up the CPU load on my old Linux box and have managed to reproduce 2 failures as it waits for the cluster to be ready after connecting.

Yup, with the Connection method using a Context and the default timeout upped from 5 seconds to 20 seconds, the testing flakiness is resolved. I have run the test for several hours on one of the older database versions (they are much slower) and did not see a single failure.

That's great! Thanks for looking into that.

I should fork the hashicorp repo now to make this change?

That would be great. Hopefully if you make a fresh fork and PR, the CI should work properly this time too as it has been set up prior to the PR creation.

Also, will someone update the main hashicorp documentation to add couchbase to the secret engines -> database documentation?

Yep, I've got a few follow up tasks to get it integrated and packaged with vault releases, one of which is documentation. You'll see a bit of activity from me soon on these pieces.

@tomhjp tomhjp mentioned this pull request Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants