Skip to content

feat(sca): onboard service command - #1632

Open
JYisus wants to merge 18 commits into
stackitcloud:mainfrom
JYisus:feat/list-applications
Open

JYisus wants to merge 18 commits into
stackitcloud:mainfrom
JYisus:feat/list-applications

Conversation

@JYisus

@JYisus JYisus commented Sep 29, 2026 •

Copy link
Copy Markdown

Description

relates to #1234

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)

@JYisus
JYisus requested a review from a team as a code owner September 29, 2026 08:27

@SerseusWasTaken SerseusWasTaken left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please also move the implementation to a alpha package, similar like the beta package exists, since the API is still in alpha

Comment thread internal/cmd/sca/application/create-from-payload/create_from_payload.go Outdated
Comment on lines +129 to +137
payloadValue := flags.FlagToStringPointer(p, cmd, payloadFlag)
var payload *sca.CreateApplicationPayload
if payloadValue != nil {
payload = &sca.CreateApplicationPayload{}
err := json.Unmarshal([]byte(*payloadValue), payload)
if err != nil {
return nil, fmt.Errorf("enconde payload: %w", err)
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

docs state default payload is used when none is set - this is not the case

Comment thread internal/cmd/sca/application/update-from-payload/update-from-payload.go Outdated
Comment thread internal/cmd/alpha/sca/application/create/create.go
Comment thread internal/cmd/alpha/sca/application/update/update.go
Comment thread internal/cmd/sca/application/update/update.go Outdated
Comment thread internal/cmd/alpha/sca/application/create/create.go
Comment thread internal/cmd/sca/application/create/create.go Outdated
Comment thread internal/cmd/alpha/sca/application/list/list.go
@SerseusWasTaken SerseusWasTaken added the needs-work PR needs work from author. label Oct 1, 2026
@JYisus
JYisus requested a review from SerseusWasTaken October 5, 2026 16:36
Comment thread internal/cmd/alpha/sca/application/create/create.go Outdated
Comment thread internal/cmd/alpha/sca/application/update/update.go Outdated
Comment thread internal/cmd/alpha/sca/application/describe/describe.go Outdated
Comment thread internal/cmd/alpha/sca/application/describe/describe.go Outdated
Comment thread internal/cmd/alpha/alpha.go Outdated
Comment thread internal/cmd/alpha/sca/application/create/create.go Outdated
Comment thread internal/cmd/alpha/sca/application/update/update.go Outdated
Comment thread internal/pkg/services/sca/utils/utils.go Outdated
Comment thread internal/cmd/alpha/sca/application/update-from-payload/update-from-payload.go Outdated
@JYisus
JYisus requested a review from SerseusWasTaken October 6, 2026 12:10

@SerseusWasTaken SerseusWasTaken left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

last few nitpicks from my side, sorry! i'll hand this over to second review now

Comment on lines +141 to +149
// Call API
req, err := buildRequest(ctx, model, apiClient, current)
if err != nil {
return err
}
resp, err := req.Execute()
if err != nil {
return fmt.Errorf("update application: %w", err)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

update misses prompt before actually updating

Comment on lines +127 to +132
// Call API
req := buildRequest(ctx, model, apiClient)
resp, err := req.Execute()
if err != nil {
return fmt.Errorf("create application: %w", err)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please also add a prompt here before creating the resource

@cgoetz-inovex

Copy link
Copy Markdown
Contributor

@JYisus, thanks for your contribution. One general comment:
Please run make generate-docs currently CI would fail because no docs.

network := &sca.Network{}

if model.Public != nil {
network.PublicIngress = *model.Public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

field PublicIngress booljson:"publicIngress" of Network type
this defaults to false. So when creating an application with publicIngress: true, port: 8080 and the running an update, setting just the port publicIngress: false will be sent

found := false
updatedRules := make([]sca.ScaleRule, 0, len(current))

var httpRule *sca.HttpScaleRule

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd move this into the loop, subsequent iterations can observe the value of httpRule from previous iterations.

Comment on lines +194 to +200
if model.Commands != nil {
containers[0].Command = model.Commands
}

if model.Args != nil {
containers[0].Args = model.Args
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

these assignments have no effect, maybe updateContainer = true is missing? They mutate the containers argument, but call sites of this function only use the return value

Comment on lines +266 to +271
if model.ScalingType == nil &&
model.Instances == nil &&
model.MinInstances == nil &&
model.MaxInstances == nil &&
model.RPS == nil &&
model.Concurrency == nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

model.ScaleToZero is used in buildAutoscalingConfig, which is called from this function. I'd suspect that application update --scale-to-zero=true would have no effect.

Comment on lines +145 to +146
if len(c.Command) > 0 {
cArgs = strings.Join(c.Args, " ")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
if len(c.Command) > 0 {
cArgs = strings.Join(c.Args, " ")
if len(c.Args) > 0 {
cArgs = strings.Join(c.Args, " ")

looks like copy paste error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain:Serverless needs-work PR needs work from author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants