Skip to content

Oas bot 32696593591/ufw - #10628

Open
alextiugan15 wants to merge 13 commits into
stackitcloud:oas-bot-32696593591/ufwfrom
alextiugan15:oas-bot-32696593591/ufw
Open

Oas bot 32696593591/ufw#10628
alextiugan15 wants to merge 13 commits into
stackitcloud:oas-bot-32696593591/ufwfrom
alextiugan15:oas-bot-32696593591/ufw

Conversation

@alextiugan15

@alextiugan15 alextiugan15 commented Aug 24, 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 12 commits August 19, 2026 09:54
- added ufw examples
- added ufw waiters and unit tests
# Conflicts:
#	services/ufw/go.mod
#	services/ufw/oas_commit
- removed nil status checking
- removed unused statuses
- added a shared method for all wait handlers
# Conflicts:
#	services/ufw/go.mod
#	services/ufw/oas_commit
#	services/ufw/v1api/model_rule_response.go
# Conflicts:
#	services/ufw/go.mod
#	services/ufw/oas_commit
#	services/ufw/v1api/model_rule_response.go
@alextiugan15
alextiugan15 requested a review from a team as a code owner August 24, 2026 07:22
@alextiugan15 alextiugan15 mentioned this pull request Aug 24, 2026
11 tasks
@cgoetz-inovex

Copy link
Copy Markdown
Contributor
  • 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 CHANGELOG.md
- `v1api`: **Improvement:** Add validation for `Description` field
- `ufw`:
- [v1.0.0](services/ufw/CHANGELOG.md#v100)
- **New:** STACKIT UFW service

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
- **New:** STACKIT UFW service
- **New:** STACKIT Unified Firewall (UFW) service

Comment thread services/ufw/VERSION
@@ -0,0 +1 @@
v1.0.0 No newline at end of file

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.

Do we really want to start with v1? Other services mostly start with v0.1.0

Comment thread services/ufw/CHANGELOG.md
@@ -0,0 +1,3 @@
## v1.0.0
- **New:** STACKIT UFW service

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
- **New:** STACKIT UFW service
- **New:** STACKIT Unified Firewall (UFW) service

Comment thread examples/ufw/ufw.go
region := "eu01" // Region where the resources will be created
projectId := "PROJECT_ID" // UUID of your STACKIT project
instanceId := "INSTANCE_ID" // UUID of the instance to which the firewall rule will be attached
productType := "PRODUCT_TYPE" // Type of the instance to which the firewall rule will be attached (e.g. "redis", but you can get them from provider-options route)

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.

Is the product type not limited to Edge Cloud for the beginning? If yes, I would prefer that edge is mentioned in the example instead of redis.

return ruleWaitHandler(ctx, a, projectId, region, ruleId, nil, []int{http.StatusNotFound})
}

func ruleWaitHandler(ctx context.Context, a ufw.DefaultAPI, projectId, region, ruleId string, activeStates []ufw.RuleResponseStatus, deleteHttpErrorStatusCodes []int) *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.

Can you rename this function to sth like createOrUpdateRuleWaitHandler to keep the standard implementation of SDK. We try to follow this naming convention since some time.

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.

func createOrUpdateInstanceWaitHandler(ctx context.Context, client logme.DefaultAPI, projectId, region, instanceId string) *wait.AsyncActionHandler[logme.Instance] {

for example

}
}

func TestCreateRuleWaitHandler(t *testing.T) {

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.

You can combine create and update tests into one. e.g

func TestCreateOrUpdateInstanceWaitHandler(t *testing.T) {

Just need to pay attention to the handlers part.

handlers := map[string]func(context.Context, logme.DefaultAPI, string, string, string) *wait.AsyncActionHandler[logme.Instance]{

Comment thread examples/ufw/ufw.go
}

createdFirewallRuleId := createdFirewallRule.RefId
fmt.Printf("Created firewall rule with ID: %s\n", *createdFirewallRuleId)

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.

This message is a bit misleading. Actually here the creation is triggered and waiter starts.
So we should write sth like [UFW] Triggered creation of firewall rule with ID.....

Comment thread examples/ufw/ufw.go
return nil, err
}

fmt.Printf("Updated firewall rule with ID: %s\n", *updatedFirewallRule.RefId)

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
fmt.Printf("Updated firewall rule with ID: %s\n", *updatedFirewallRule.RefId)
fmt.Printf("[UFW] Triggered update of firewall rule with ID: %s\n", *updatedFirewallRule.RefId)

Comment thread examples/ufw/ufw.go
return err
}

fmt.Printf("Deleted firewall rule with ID: %s\n", ruleId)

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
fmt.Printf("Deleted firewall rule with ID: %s\n", ruleId)
fmt.Printf("[UFW] Triggered deletion of firewall rule with ID: %s\n", ruleId)

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.

5 participants