Skip to content

Oas bot 32343214600/ufw - #10410

Closed
alextiugan15 wants to merge 6 commits into
stackitcloud:oas-bot-32343214600/ufwfrom
alextiugan15:oas-bot-32343214600/ufw
Closed

Oas bot 32343214600/ufw#10410
alextiugan15 wants to merge 6 commits into
stackitcloud:oas-bot-32343214600/ufwfrom
alextiugan15:oas-bot-32343214600/ufw

Conversation

@alextiugan15

@alextiugan15 alextiugan15 commented Aug 20, 2026

Copy link
Copy Markdown

Description

relates to #1234

Checklist

  • Issue was linked above
  • No generated code was adjusted manually (check comments in file header)
  • Changelogs
    • Changelog in the root directory was adjusted (see here)
    • Changelog(s) of the service(s) were adjusted (see e.g. here)
  • VERSION file(s) of the service(s) were adjusted
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • 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)

stackit-pipeline and others added 4 commits August 19, 2026 09:54
- added ufw examples
- added ufw waiters and unit tests
# Conflicts:
#	services/ufw/go.mod
#	services/ufw/oas_commit
@alextiugan15
alextiugan15 requested a review from a team as a code owner August 20, 2026 08:27
@cgoetz-inovex

Copy link
Copy Markdown
Contributor

Metadata files:

  • generated LICENSE.md contains placeholder Copyright [yyyy] [name of copyright owner]
  • services/ufw/CHANGELOG.md missing
  • ./CHANGELOG.md missing entry for new service ufw
  • services/ufw/VERSION missing
  • services/ufw/NOTICE.txt missing

Comment thread services/ufw/v1api/wait/wait.go Outdated
Comment on lines +17 to +20
RuleStatusCreating RuleStatus = "Creating"
RuleStatusUpdating RuleStatus = "Updating"
RuleStatusPending RuleStatus = "Pending"
RuleStatusDeleting RuleStatus = "Deleting"

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.

unused constants, pls remove

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

ufw "github.com/stackitcloud/stackit-sdk-go/services/ufw/v1api"
)

type RuleStatus string

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.

would it be possible to declare RuleResponse.Status as enum with the possible values in the API spec? This would save us from using undocumented literals here and in the other SDKs

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sure, I just modified in the stackit-api repo, but I think we will need another PR in this case

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Comment thread services/ufw/v1api/wait/wait.go Outdated
if ruleResp == nil {
return "", errors.New("empty response")
}
if ruleResp.Status == 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.

out of curiosity: when would this be the case? What's the meaning of a nil Status?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

just for testing, however I removed it

return handler
}

func UpdateRuleWaitHandler(ctx context.Context, a ufw.DefaultAPI, projectId, region, ruleId string) *wait.AsyncActionHandler[ufw.RuleResponse] {

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.

function body is a duplicate of CreateRuleHandler please introduce a private createOrUpdateRuleWaitHandler function with this implementation and call it from Create... and Update....
Your intuition was correct here to create two separate functions, this gives us some flexibility in the future. With the private helper function we can keep two public funcs, in case the API evolves, but share the implementation in the meantime.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Comment thread examples/ufw/go.mod

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.

examples/ufw/go.sum missing, pleas run go mod tidy in the example dir

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sure, it's added now

- removed nil status checking
- removed unused statuses
- added a shared method for all wait handlers
@alextiugan15

Copy link
Copy Markdown
Author

Closed in favor of 10428

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.

4 participants