Skip to content

Commit

Permalink
feat(connectors): Add environments (#221)
Browse files Browse the repository at this point in the history
* feat(connectors): Add environments

* lint

* review comments

* updated meroxa-go

* identifier instead of bespoke

* chore: Update to latest meroxa-go

* feat: Show connector UUID

* chore: Update docs

Co-authored-by: Raúl Barroso <[email protected]>
  • Loading branch information
janelletavares and raulb authored Dec 1, 2021
1 parent 1bdfdeb commit 074fe3e
Show file tree
Hide file tree
Showing 60 changed files with 168 additions and 89 deletions.
8 changes: 8 additions & 0 deletions cmd/meroxa/root/connectors/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ func getConnectors(pipelineID int) []*meroxa.Connector {
return connectors
}

func getConnectorsWithEnvironment(pipelineID int) []*meroxa.Connector {
var connectors []*meroxa.Connector
c := utils.GenerateConnectorWithEnvironment(pipelineID, "", "my-env")
connectors = append(connectors, &c)
return connectors
}

func TestListConnectorsFlags(t *testing.T) {
expectedFlags := []struct {
name string
Expand Down Expand Up @@ -74,6 +81,7 @@ func TestListConnectorsExecution(t *testing.T) {
logger := log.NewTestLogger()

connectors := getConnectors(1)
connectors = append(connectors, getConnectorsWithEnvironment(1)...)

client.
EXPECT().
Expand Down
2 changes: 1 addition & 1 deletion cmd/meroxa/root/pipelines/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (c *Create) Execute(ctx context.Context) error {

if c.flags.Environment != "" {
env = c.flags.Environment
p.Environment = &meroxa.PipelineEnvironment{}
p.Environment = &meroxa.EnvironmentIdentifier{}

_, err := uuid.Parse(c.flags.Environment)

Expand Down
4 changes: 2 additions & 2 deletions cmd/meroxa/root/pipelines/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ func TestCreatePipelineWithEnvironmentExecution(t *testing.T) {

pi := &meroxa.CreatePipelineInput{
Name: pName,
Environment: &meroxa.PipelineEnvironment{Name: env},
Environment: &meroxa.EnvironmentIdentifier{Name: env},
}

p := &meroxa.Pipeline{
ID: 1,
Name: pName,
Environment: &meroxa.PipelineEnvironment{
Environment: &meroxa.EnvironmentIdentifier{
UUID: "2560fbcc-b9ee-461a-a959-fa5656422dc2",
Name: env,
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/meroxa/root/resources/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (c *Create) Execute(ctx context.Context) error {
}

if c.flags.Environment != "" {
input.Environment = &meroxa.ResourceEnvironment{}
input.Environment = &meroxa.EnvironmentIdentifier{}
env = c.flags.Environment

_, err := uuid.Parse(c.flags.Environment)
Expand Down
4 changes: 2 additions & 2 deletions cmd/meroxa/root/resources/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func TestCreateResourceExecutionWithEnvironmentName(t *testing.T) {
URL: "https://foo.url",
Credentials: nil,
Metadata: nil,
Environment: &meroxa.ResourceEnvironment{
Environment: &meroxa.EnvironmentIdentifier{
Name: cr.Environment.Name,
},
}
Expand Down Expand Up @@ -218,7 +218,7 @@ func TestCreateResourceExecutionWithEnvironmentUUID(t *testing.T) {
URL: "https://foo.url",
Credentials: nil,
Metadata: nil,
Environment: &meroxa.ResourceEnvironment{
Environment: &meroxa.EnvironmentIdentifier{
UUID: cr.Environment.UUID,
},
}
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-api.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-auth-login.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-auth-logout.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-auth-whoami.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-auth.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-billing.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-completion.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-config-describe.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-config.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-connect.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-connectors-create.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-connectors-describe.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-connectors-list.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-connectors-logs.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-connectors-remove.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-connectors-update.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-connectors.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-endpoints-create.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-endpoints-describe.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-endpoints-list.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-endpoints-remove.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-endpoints.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-login.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-logout.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-open-billing.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-open.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-pipelines-create.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-pipelines-describe.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-pipelines-list.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-pipelines-remove.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-pipelines-update.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-pipelines.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-resources-create.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-resources-describe.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-resources-list.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-resources-remove.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-resources-rotate-tunnel-key.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-resources-update.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-resources-validate.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-resources.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-transforms-list.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-transforms.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-version.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa-whoami.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion etc/man/man1/meroxa.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.nh
.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual"
.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual"

.SH NAME
.PP
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/manifoldco/promptui v0.8.0
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-runewidth v0.0.10 // indirect
github.com/meroxa/meroxa-go v0.0.0-20211129120745-db529ae4ef81
github.com/meroxa/meroxa-go v0.0.0-20211201105336-fe1f1bcf8764
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20170819232839-0fbfe93532da
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4
github.com/rivo/uniseg v0.2.0 // indirect
Expand Down
Loading

0 comments on commit 074fe3e

Please sign in to comment.