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

feat: Add bucket schema management commands #52

Merged
merged 10 commits into from
May 5, 2021
Merged

Conversation

stuartcarnie
Copy link
Contributor

@stuartcarnie stuartcarnie commented Apr 28, 2021

This PR extends the tool with commands to manage explicit schema buckets per #51.

Changes include:

  • Modified the bucket create command to allow specifying a schema-type of either implicit (default) or explicit
  • Modified the bucket list command to show the schemaType property as a new column, Schema Type
  • Added a new bucket-schema command, with the following sub-commands:
    • create to create a new measurement schema for an existing explicit schema bucket;
    • update to add new columns to an existing measurement schema; and
    • list to find and print information about existing measurement schemas.

@stuartcarnie stuartcarnie self-assigned this Apr 28, 2021
@stuartcarnie stuartcarnie changed the base branch from main to dm-port-bucket-7 April 28, 2021 22:27
@stuartcarnie stuartcarnie force-pushed the sgc/issues/51 branch 4 times, most recently from 6495cdf to c16c348 Compare April 29, 2021 09:04
@stuartcarnie stuartcarnie changed the base branch from dm-port-bucket-7 to sgc/experiments April 29, 2021 09:23
@stuartcarnie stuartcarnie force-pushed the sgc/experiments branch 2 times, most recently from f0ac72e to 01dd763 Compare April 29, 2021 23:02
@stuartcarnie stuartcarnie force-pushed the sgc/issues/51 branch 2 times, most recently from dfa8b54 to 178c072 Compare April 30, 2021 09:02
cmd/influx/measurement_schema.go Outdated Show resolved Hide resolved
cmd/influx/measurement_schema.go Outdated Show resolved Hide resolved
cmd/influx/measurement_schema.go Outdated Show resolved Hide resolved
"github.com/influxdata/influx-cli/v2/internal"
"github.com/urfave/cli/v2"
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to move our existing global flag vars out of main.go and into this file?

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 think you could move the variables to this package and leave the bindings in main – that keeps with your mantra of leaving urfave logic in cmd

columns.csv Outdated Show resolved Hide resolved
internal/cmd/measurement_schema/client.go Outdated Show resolved Hide resolved
internal/cmd/measurement_schema/client.go Outdated Show resolved Hide resolved
internal/cmd/measurement_schema/client.go Outdated Show resolved Hide resolved
internal/cmd/measurement_schema/client.go Outdated Show resolved Hide resolved
internal/cmd/measurement_schema/client.go Outdated Show resolved Hide resolved
@stuartcarnie
Copy link
Contributor Author

stuartcarnie commented May 3, 2021

NOTE: I've modified the script to reference the updated spec via https://github.com/influxdata/openapi/tree/sgc/issues/9672 to validate this PR via CI. I've opened influxdata/openapi#34 for review and will remove the last commit when it merges to main

@stuartcarnie stuartcarnie marked this pull request as ready for review May 3, 2021 08:33
Copy link
Contributor

@danxmoran danxmoran left a comment

Choose a reason for hiding this comment

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

This can rebase against main

cmd/influx/bucket.go Show resolved Hide resolved
cmd/influx/measurement_schema.go Outdated Show resolved Hide resolved
cmd/influx/measurement_schema.go Outdated Show resolved Hide resolved
cmd/influx/measurement_schema.go Outdated Show resolved Hide resolved
etc/generate-openapi.sh Outdated Show resolved Hide resolved
internal/cmd/measurement_schema/client.go Outdated Show resolved Hide resolved
internal/cmd/measurement_schema/client.go Outdated Show resolved Hide resolved
internal/cmd/measurement_schema/client.go Outdated Show resolved Hide resolved
internal/cmd/measurement_schema/client.go Outdated Show resolved Hide resolved
internal/cmd/measurement_schema/client.go Outdated Show resolved Hide resolved
etc/generate-openapi.sh Outdated Show resolved Hide resolved
Base automatically changed from sgc/experiments to main May 3, 2021 21:19
@stuartcarnie
Copy link
Contributor Author

This can rebase against main

Not sure what happened, but however sgc/experimental was merged to main caused the branches to diverge, so I had to cherry pick all the individual commits. 🤷🏻

@stuartcarnie stuartcarnie force-pushed the sgc/issues/51 branch 2 times, most recently from 58dfb3d to 26f16ef Compare May 3, 2021 23:02
@stuartcarnie
Copy link
Contributor Author

Hi @danxmoran – let me know if there are still any outstanding questions you have. I've added a number of unit tests for all the bucket-schema commands.

Copy link
Contributor

@danxmoran danxmoran left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @stuartcarnie! Exciting to see a cloud-focused feature land early.

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.

Add commands for managing explicit bucket schemas
2 participants