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 support for InfluxDB shell Plugin #332

Closed
wants to merge 3 commits into from

Conversation

bala-ceg
Copy link
Contributor

@bala-ceg bala-ceg commented Jun 29, 2023

Overview

Added support for influx cli to store the influx environmental variables

Closes #311

Type of change

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

How To Test

bseetharaman@EXT-C02D27NHMD6M ~ % influx bucket
########################################################################################
# WARNING: 'influxdb' is not from the official registry.                               #
# Only proceed if you are the developer of 'influxdb'.                                 #
# Otherwise, delete the file at /Users/bseetharaman/.config/op/plugins/local/influxdb. #
########################################################################################
? Locate your InfluxDB Database Credentials: InfluxDB Database Credentials (Personal)

NAME:
   influx bucket - Bucket management commands

USAGE:
   influx bucket command [command options] [arguments...]

COMMANDS:
   create          Create bucket
   delete          Delete bucket
   list, find, ls  List buckets
   update, set     Update bucket

OPTIONS:
   --help, -h  show help
   
bseetharaman@EXT-C02D27NHMD6M ~ % influx bucket ls
########################################################################################
# WARNING: 'influxdb' is not from the official registry.                               #
# Only proceed if you are the developer of 'influxdb'.                                 #
# Otherwise, delete the file at /Users/bseetharaman/.config/op/plugins/local/influxdb. #
########################################################################################
ID			Name		Retention	Shard group duration	Organization ID		Schema Type
70c0800c8694cf95	_monitoring	168h0m0s	n/a			716490b51c18261c	implicit
1118b01e3b00234e	_tasks		72h0m0s		n/a			716490b51c18261c	implicit
bafeabd992325253	mindsdb		720h0m0s	n/a			716490b51c18261c	implicit
bseetharaman@EXT-C02D27NHMD6M ~ % 


Additional information

@arunsathiya arunsathiya self-requested a review June 29, 2023 19:26
@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 29, 2023
@techcraver
Copy link
Contributor

Nice! Don't forget to also write an accompanying blog post on Hashnode with the tags 1Password and BuildWith1Password (not just putting #1Password in the text - but use the Hashnode tags in the CMS. :)

The full instructions are here.

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 is a good start, @bala-ceg. Thank you for your contribution! I have a couple of minor comments to address below, including building support for config file importer.

I am also reviewing how big InfluxDB OSS and InfluxDB Cloud differ, and whether we should build support for both in the same shell plugin. That'd be similar to redis and mongoDB:

I'll followup once I have more to share, but if you are familiar with InfluxDB OSS and InfluxDB Cloud, and on how the CLI interacts with the two, I'd love to hear from you. That'd help me jumpstart the whole process. Thank you!

plugins/influxdb/influx.go Outdated Show resolved Hide resolved
plugins/influxdb/plugin.go Outdated Show resolved Hide resolved
plugins/influxdb/database_credentials.go Show resolved Hide resolved
plugins/influxdb/database_credentials.go Outdated Show resolved Hide resolved
NeedsAuth: needsauth.IfAll(
needsauth.NotForHelpOrVersion(),
needsauth.NotWithoutArgs(),
needsauth.NotWhenContainsArgs("config"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's see authentication for version and completion. Commands like backup and restore are specific to InfluxDB OSS and InfluxDB Cloud, but I am still figuring out whether we should exclude them entirely or build support for InfluxDB OSS too. I'll followup here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have not done any changes to this comment. My assumption we are supporting only influxdb cloud at this moment via shell plugin

@arunsathiya arunsathiya self-requested a review July 6, 2023 16:29
@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
@techcraver
Copy link
Contributor

hey @bala-ceg We'd love to partner with you to get this over the finish line!

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 @bala-ceg, I have been researching a bit about InfluxDB Cloud and InfluxDB OSS. At this time, let's move forward with supporting InfluxDB Cloud 2.0, which the PR does now, and we'll figure out adding support for InfluxDB OSS in the future.

With this said, could we help you with anything in addressing the pending feedback on this PR?

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

Thanks, Arun. I will address this change by sometime tomorrow

@bala-ceg
Copy link
Contributor Author

bala-ceg commented Jul 19, 2023

Hi @techcraver @arunsathiya, made the review changes.
pls let me know if anything else is required

I apologise for the delay

@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 19, 2023
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.

Functionally tested and code changes look good to me. Approving in the spirit of reaching the finish line for this PR, but we'll need to address the config file importer before we release the plugin:

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.

code lgtm.

but we'll need to address the config file importer before we release the plugin:

I think the config file importer should not be a blocker for releasing this plugin, as it already has a valid importer set up. It is indeed a nice-to-have and it's great that we created a separate issue for it!

@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

SimonBarendse commented Sep 22, 2023

Hi @bala-ceg, 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
@accraw accraw mentioned this pull request Oct 20, 2023
@accraw
Copy link
Contributor

accraw commented Oct 24, 2023

Complete with #392

@accraw accraw closed this Oct 24, 2023
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.

New plugin: InfluxDB
6 participants