Skip to content

Conversation

@devanshcache
Copy link

@devanshcache devanshcache commented Nov 26, 2025

Description

Intake is composed of three components:

  • Intake Runners: dedicated, isolated runtime data ingestion environment
  • Intakes: a specific data stream or topic within an Intake Runner
  • Intake Users: provides secure access credentials for your applications to connect to your Intake.

Intake runner has already been merged reference (#952) this PR is continuation of the one of two components of Intake (ticket)

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@devanshcache devanshcache requested a review from a team as a code owner November 26, 2025 14:43
@devanshcache devanshcache changed the title Onboard Intake: introduce Intake Onboard Intake(2/3): introduce Intake Nov 26, 2025
func NewCmd(p *params.CmdParams) *cobra.Command {
cmd := &cobra.Command{
Use: "create",
Short: "Creates a new Intake",
Copy link
Member

Choose a reason for hiding this comment

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

Just for my understanding: What is an "intake"? Is it kind of an instance (like it is for managed databases)?

Because I would maybe suggest something like stackit beta intake instance create then...


for _, tt := range tests {
t.Run(tt.description, func(t *testing.T) {
p := print.NewPrinter()
Copy link
Member

Choose a reason for hiding this comment

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

Please use our new testutil funcs testutil.TestParseInput or testutil.TestParseInputWithAdditionalFlags to save us and yourself all the boilerplate code here.

See #1033 for reference.

// TestParseInput centralizes the logic to test a combination of inputs (arguments, flags) for a cobra command
func TestParseInput[T any](t *testing.T, cmdFactory func(*types.CmdParams) *cobra.Command, parseInputFunc func(*print.Printer, *cobra.Command, []string) (T, error), expectedModel T, argValues []string, flagValues map[string]string, isValid bool) {
TestParseInputWithAdditionalFlags(t, cmdFactory, parseInputFunc, expectedModel, argValues, flagValues, map[string][]string{}, isValid)
}
// TestParseInputWithAdditionalFlags centralizes the logic to test a combination of inputs (arguments, flags) for a cobra command.
// It allows to pass multiple instances of a single flag to the cobra command using the `additionalFlagValues` parameter.
func TestParseInputWithAdditionalFlags[T any](t *testing.T, cmdFactory func(*types.CmdParams) *cobra.Command, parseInputFunc func(*print.Printer, *cobra.Command, []string) (T, error), expectedModel T, argValues []string, flagValues map[string]string, additionalFlagValues map[string][]string, isValid bool) {
p := print.NewPrinter()

Copy link
Member

Choose a reason for hiding this comment

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

Or is there any reason why you're not using it? Then please tell me, so we can fix potential issues 😅


for _, tt := range tests {
t.Run(tt.description, func(t *testing.T) {
p := print.NewPrinter()
Copy link
Member

Choose a reason for hiding this comment

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

same here, please use the testutil func


for _, tt := range tests {
t.Run(tt.description, func(t *testing.T) {
p := print.NewPrinter()
Copy link
Member

Choose a reason for hiding this comment

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

same here, please use the testutil func


for _, tt := range tests {
t.Run(tt.description, func(t *testing.T) {
p := print.NewPrinter()
Copy link
Member

Choose a reason for hiding this comment

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

same here, please use the testutil func


for _, tt := range tests {
t.Run(tt.description, func(t *testing.T) {
testutils.TestParseInput(t, NewCmd, parseInput, tt.expectedModel, tt.argValues, tt.flagValues, tt.isValid)
Copy link
Member

Choose a reason for hiding this comment

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

Why are you using the testutils.TestParseInput func here but not for your other implementations? 😅

This is the way, please use it everywhere.

}

if !model.AssumeYes {
prompt := fmt.Sprintf("Are you sure you want to create an Intake for project %q?", projectLabel)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
prompt := fmt.Sprintf("Are you sure you want to create an Intake for project %q?", projectLabel)
prompt := fmt.Sprintf("Are you sure you want to create an Intake instance for project %q?", projectLabel)

In case it's an instance, I would phrase it like this

if model.Async {
operationState = "Triggered deletion of"
}
p.Printer.Info("%s stackit Intake instance %s \n", operationState, model.IntakeId)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
p.Printer.Info("%s stackit Intake instance %s \n", operationState, model.IntakeId)
p.Printer.Outputf("%s stackit Intake instance %s \n", operationState, model.IntakeId)

p.Printer.Info would log to stderr, p.Printer.Outputf logs to stdout. I guess you want log to stdout here 😅

@rubenhoenle
Copy link
Member

@devanshcache please note: All of this also applies to #1126

@rubenhoenle rubenhoenle self-assigned this Dec 5, 2025
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.

2 participants