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 ecdysis to Conduit CLI #1983

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

feat: add ecdysis to Conduit CLI #1983

wants to merge 29 commits into from

Conversation

raulb
Copy link
Member

@raulb raulb commented Nov 19, 2024

Description

Fixes #1981

⚠️ Remove support for pipelines.exit-on-error (announced here)

Quick checks

  • I have followed the Code Guidelines.
  • There is no other pull request for the same update/change.
  • I have written unit tests.
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

@raulb raulb marked this pull request as ready for review November 21, 2024 15:34
@raulb raulb requested a review from a team as a code owner November 21, 2024 15:34
@raulb raulb marked this pull request as draft November 21, 2024 16:28
@raulb raulb marked this pull request as ready for review November 26, 2024 12:28
cmd/conduit/root/root.go Outdated Show resolved Hide resolved
cmd/conduit/root/root.go Outdated Show resolved Hide resolved
// Root flags -------------------------------------------------------------

// Database configuration
DBType string `long:"db.type" usage:"database type; accepts badger,postgres,inmemory,sqlite"`
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT about moving these tags to Conduit's Config struct? It looks like that would make the Config struct the single source of truth. It should then be possible to build the flags by just traversing the Config fields. Also, when building the config.yaml file in the InitCommand, we would have everything in the config struct (name, usage, and values).

Btw, even if we find that this is possible and useful, IMO it can be done in a different PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +78 to +93
for i := 0; i < v.NumField(); i++ {
field := t.Field(i)
fieldValue := v.Field(i)

if fieldValue.Kind() == reflect.Struct {
embedStructYAML(fieldValue, field, cfgYAML)
} else {
value := fmt.Sprintf("%v", fieldValue.Interface())
usage := field.Tag.Get("usage")
longName := field.Tag.Get("long")

if longName != "" {
cfgYAML.Insert(longName, value, usage)
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This loop is actually the embedStructYAML() function or maybe I'm missing a difference?

}

// provide a simplified version
if c.flags.Source == defaultSource {
Copy link
Contributor

@hariso hariso Nov 27, 2024

Choose a reason for hiding this comment

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

I'm thinking, what if someone would like to configure a generator source himself? Maybe generator the demo source, only if a source was not provided?


is.True(foundFlag != nil)

if foundFlag != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Tiny nitpick: we don't need this check, because the above line with is.True() will abort the test if it's not true.

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.

Integrate ecdysis with existing CLI
2 participants