Skip to content

Commit

Permalink
lint and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-cross committed Apr 23, 2024
1 parent 448b607 commit b5c871a
Show file tree
Hide file tree
Showing 49 changed files with 12,371 additions and 420 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ linters:
- gochecknoinits
- goconst
- gocyclo
- godot
- gofmt
- goimports
- goprintffuncname
Expand Down
1 change: 0 additions & 1 deletion cmd/meroxa/global/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func GetMeroxaTenantUser() string {
// getEnvVal returns the value of either the first existing key specified in keys, or defaultVal if none were present.
func getEnvVal(keys []string, defaultVal string) string {
for _, key := range keys {

if Config != nil {
// First tries to return the value from the meroxa configuration file
if val := Config.GetString(key); val != "" {
Expand Down
3 changes: 1 addition & 2 deletions cmd/meroxa/global/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ const (
UserFeatureFlagsEnv = "USER_FEATURE_FLAGS"
UserInfoUpdatedAtEnv = "USER_INFO_UPDATED_AT"
TenantEmailAddress = "TENANT_EMAIL_ADDRESS"
// TenantPassword = "TENANT_PASSWORD"
TenantURL = "TENANT_URL"
TenantURL = "TENANT_URL"

defaultClientTimeout = time.Second * 10
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/meroxa/root/apps/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type Application struct {
State string `json:"state"`
ApplicationSpec string `json:"stream_tech"`
Config string `json:"config"`
PipelineFilenames string `json:"pipeline_filenames"`
PipelineFilenames string `json:"pipeline_filename"`
PipelineEnriched string `json:"pipeline_enriched"`
PipelineOriginal string `json:"pipeline_original"`

Expand Down Expand Up @@ -166,7 +166,7 @@ func (*Apps) SubCommands() []*cobra.Command {
}
}

func RetrieveApplicationByNameOrID(ctx context.Context, client global.BasicClient, nameOrID, path string) (*Applications, error) {
func RetrieveApplicationByNameOrID(ctx context.Context, client global.BasicClient, nameOrID string) (*Applications, error) {
apps := Applications{}
if nameOrID != "" {
a := &url.Values{}
Expand Down
7 changes: 5 additions & 2 deletions cmd/meroxa/root/apps/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,14 @@ func (d *Deploy) Execute(ctx context.Context) error {

d.path, err = GetPath(d.flags.Path)
if err != nil {
return err
return fmt.Errorf("error getting conduit app path - %s", err)
}

var buf bytes.Buffer
d.gzipConduitApp(d.path, &buf)
err = d.gzipConduitApp(d.path, &buf)
if err != nil {
return fmt.Errorf("error zipping conduit app repository - %s", err)
}

dFile := fmt.Sprintf("conduit-%s.tar.gz", uuid.NewString())
fileToWrite, err := os.OpenFile(dFile, os.O_CREATE|os.O_RDWR, os.FileMode(0o777)) //nolint:gomnd
Expand Down
5 changes: 1 addition & 4 deletions cmd/meroxa/root/apps/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ meroxa apps describe NAME `,
}

func (d *Describe) Execute(ctx context.Context) error {
apps := &Applications{}
var err error

apps, err = RetrieveApplicationByNameOrID(ctx, d.client, d.args.nameOrUUID, d.flags.Path)
apps, err := RetrieveApplicationByNameOrID(ctx, d.client, d.args.nameOrUUID)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit b5c871a

Please sign in to comment.