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

Added Shell Plugin for Yugabyte #322

Merged
merged 2 commits into from
Oct 18, 2023
Merged

Added Shell Plugin for Yugabyte #322

merged 2 commits into from
Oct 18, 2023

Conversation

parthiv11
Copy link
Contributor

@parthiv11 parthiv11 commented Jun 27, 2023

Overview

Added Yugabyte Shell Plugin Similar to Postgres

  • Created a new plugin
  • Improved an existing plugin
  • Fixed a bug in an existing plugin
  • Improved contributor utilities or experience

Related Issue(s)

How To Test

Changelog

Additional information

@parthiv11 parthiv11 marked this pull request as ready for review June 27, 2023 13:23
@arunsathiya arunsathiya added waiting-on-reviewer signals that a certain PR is waiting for a review from a 1Password team member hashnode hackathon Ideas and inspiration for the hackathon running from June 1st - June 30th labels Jun 27, 2023
@arunsathiya arunsathiya self-requested a review June 27, 2023 13:51
Copy link
Contributor

@AndyTitu AndyTitu left a comment

Choose a reason for hiding this comment

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

@parthiv11 This PR looks really good! I just have a couple of questions

plugins/yugabytedb/database_credentials.go Show resolved Hide resolved
plugins/yugabytedb/database_credentials.go Show resolved Hide resolved
@parthiv11
Copy link
Contributor Author

parthiv11 commented Jun 29, 2023

@AndyTitu can i use both file and env provisioners?

if yes then how?

@hculea
Copy link
Member

hculea commented Jun 30, 2023

@parthiv11 You can do this by using a custom provisioner (have a look at ngrok for an example). To add an envvar to the provisioned output, you should be able to call out.AddEnvVar.

Copy link
Contributor

@arunsathiya arunsathiya left a comment

Choose a reason for hiding this comment

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

This looks like a generally good start, thank you for your contribution @parthiv11. I noticed that YugabyteDB can be connect using ycqlsh too:

https://docs.yugabyte.com/preview/admin/

Could we build support for it too, since both of these executables seem to offer connectivity to YugabyteDB clusters. If you need examples of multi-executable shell plugins, OpenAI is a good example that supports the openai executable, and oaieval and oaievalset too.

I am also leaning towards building support for connectivity to the Yugabyte platform itself, which seems to be yb-admin here:

https://docs.yugabyte.com/preview/admin/

Not sure if any of the other CLI programs are related to Yugabyte platform connectivity.

Example of us supporting both the database connectivity and platform connectivity are redis and mongoDB:

I understand this is all increasing the complexity, but don't hesitate to ping us if you are unclear on anything. We are happy to help.

plugins/yugabytedb/database_credentials.go Outdated Show resolved Hide resolved
plugins/yugabytedb/provisioner.go Outdated Show resolved Hide resolved
@arunsathiya
Copy link
Contributor

I should also note that I have NOT functionally tested this because I am on a Apple Silicon MacBook and I am having troubles getting ysqlsh working. It doesn't seem to be available for ARM actually, so I tried with Rosetta enabled, but that has another problem that Homebrew should be installed at another path:

Receiving objects: 100% (1539888/1539888), 403.54 MiB | 35.25 MiB/s, done.
Resolving deltas: 100% (1082554/1082554), done.
Tapped 3 commands and 6742 formulae (7,110 files, 467.8MB).
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
    arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.
zsh: command not found: ysqlsh

@parthiv11 could you help us with some screenshots, videos or textual output of the shell plugin in action? That'd tremendously help us review faster.

@arunsathiya arunsathiya added in-progress this PR is being worked on/comments are in the process of being addressed by the contributor and removed waiting-on-reviewer signals that a certain PR is waiting for a review from a 1Password team member labels Jul 6, 2023
@arunsathiya arunsathiya self-requested a review July 6, 2023 22:21
Copy link
Contributor

@arunsathiya arunsathiya left a comment

Choose a reason for hiding this comment

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

Hi again @parthiv11, I am wondering if we could help you with anything in getting this PR over to the finish line? Let us know and we can help you!

@arunsathiya arunsathiya self-requested a review July 11, 2023 12:09
@parthiv11
Copy link
Contributor Author

I will try to make it as fast as possible

@parthiv11
Copy link
Contributor Author

parthiv11 commented Jul 13, 2023

Is there any way to change permission for file generated by op cli ?

@arunsathiya
Copy link
Contributor

Is there any way to change permission for file generated by op cli ?

Could you elaborate a bit more on this part? Are you referring to the temp file provisioner and what's happening at the moment?

@parthiv11
Copy link
Contributor Author

When I generate a .pgpass file , i need to set permission 600 to it ,for it to work

How can I do it?

@parthiv11
Copy link
Contributor Author

parthiv11 commented Jul 14, 2023

Getting this warning: WARNING: password file "/home/kali/.pgpass" is not a plain file
And asking for password in prompt as .pgpass needs to have 600 permission

@parthiv11
Copy link
Contributor Author

simplescreenrecorder-2023-07-15_11.44.15.mp4

@arunsathiya arunsathiya added waiting-on-reviewer signals that a certain PR is waiting for a review from a 1Password team member and removed in-progress this PR is being worked on/comments are in the process of being addressed by the contributor labels Jul 24, 2023
@parthiv11 parthiv11 force-pushed the yugabyte branch 2 times, most recently from 4972659 to b578627 Compare July 30, 2023 17:50
Copy link
Contributor

@AndyTitu AndyTitu left a comment

Choose a reason for hiding this comment

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

In the end this seems to be working nicely with just the env vars. I'm approving for that functionality

@AndyTitu AndyTitu added waiting-on-sec-review and removed waiting-on-reviewer signals that a certain PR is waiting for a review from a 1Password team member labels Aug 30, 2023
@SimonBarendse
Copy link
Member

Hi @parthiv11, appreciate your contribution! 🙌 The code is almost ready to be merged. All you need to do is sign your commits. You can follow the instructions below to sign your commits.


⚠️ This PR contains unsigned commits. To get your PR merged, please sign those commits (git commit -S --amend --no-edit) and force push them to this branch (git push --force-with-lease).

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with gpg:

  1. Generate a GPG key
  2. Add the GPG key to your GitHub account
  3. Configure git to use your GPG key for commit signing
Sign commits with ssh-agent

Follow the steps below to set up commit signing with ssh-agent:

  1. Generate an SSH key and add it to ssh-agent
  2. Add the SSH key to your GitHub account
  3. Configure git to use your SSH key for commit signing
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process.

Learn how to use 1Password to sign your commits.

Watch the demo

Let us know if you have any questions or run into issues signing your commits. We're here to help.

@SimonBarendse SimonBarendse added the in-progress this PR is being worked on/comments are in the process of being addressed by the contributor label Sep 22, 2023
@parthiv11
Copy link
Contributor Author

@SimonBarendse Done

@accraw accraw merged commit 6f8040b into 1Password:main Oct 18, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashnode hackathon Ideas and inspiration for the hackathon running from June 1st - June 30th in-progress this PR is being worked on/comments are in the process of being addressed by the contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants