Skip to content

Commit 1b7c4c9

Browse files
committed
add changelog entries
1 parent dfc8c38 commit 1b7c4c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+376
-31
lines changed

CHANGELOG.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,69 @@
1+
## Release (2025-XX-XX)
2+
- `core`: [v0.17.3](core/CHANGELOG.md#v0173)
3+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
4+
- `alb`: [v0.6.1](services/alb/CHANGELOG.md#v061)
5+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
6+
- `archiving`: [v0.2.1](services/archiving/CHANGELOG.md#v021)
7+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
8+
- `authorization`: [v0.8.1](services/authorization/CHANGELOG.md#v081)
9+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
10+
- `cdn`: [v1.3.2](services/cdn/CHANGELOG.md#v132)
11+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
12+
- `certificates`: [v1.1.1](services/certificates/CHANGELOG.md#v111)
13+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
14+
- `dns`: [v0.17.1](services/dns/CHANGELOG.md#v0171)
15+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
16+
- `git`: [v0.7.1](services/git/CHANGELOG.md#v071)
17+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
18+
- `iaas`: [v0.27.1](services/iaas/CHANGELOG.md#v0271)
19+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
20+
- `kms`: [v0.3.1](services/kms/CHANGELOG.md#v031)
21+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
22+
- `lbapplication`: [v0.5.1](services/lbapplication/CHANGELOG.md#v051)
23+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
24+
- `loadbalancer`: [v1.5.1](services/loadbalancer/CHANGELOG.md#v151)
25+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
26+
- `logme`: [v0.25.1](services/logme/CHANGELOG.md#v0251)
27+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
28+
- `mariadb`: [v0.25.1](services/mariadb/CHANGELOG.md#v0251)
29+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
30+
- `modelserving`: [v0.5.1](services/modelserving/CHANGELOG.md#v051)
31+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
32+
- `mongodbflex`: [v1.5.1](services/mongodbflex/CHANGELOG.md#v151)
33+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
34+
- `objectstorage`: [v1.3.1](services/objectstorage/CHANGELOG.md#v131)
35+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
36+
- `observability`: [v0.9.1](services/observability/CHANGELOG.md#v091)
37+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
38+
- `opensearch`: [v0.24.1](services/opensearch/CHANGELOG.md#v0241)
39+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
40+
- `postgresflex`: [v1.2.1](services/postgresflex/CHANGELOG.md#v121)
41+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
42+
- `rabbitmq`: [v0.25.1](services/rabbitmq/CHANGELOG.md#v0251)
43+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
44+
- `redis`: [v0.25.1](services/redis/CHANGELOG.md#v0251)
45+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
46+
- `resourcemanager`: [v0.17.1](services/resourcemanager/CHANGELOG.md#v0171)
47+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
48+
- `runcommand`: [v1.3.1](services/runcommand/CHANGELOG.md#v131)
49+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
50+
- `secretsmanager`: [v0.13.1](services/secretsmanager/CHANGELOG.md#v0131)
51+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
52+
- `serverbackup`: [v1.3.2](services/serverbackup/CHANGELOG.md#v132)
53+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
54+
- `serverupdate`: [v1.2.1](services/serverupdate/CHANGELOG.md#v121)
55+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
56+
- `serviceaccount`: [v0.9.1](services/serviceaccount/CHANGELOG.md#v091)
57+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
58+
- `serviceenablement`: [v1.2.2](services/serviceenablement/CHANGELOG.md#v122)
59+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
60+
- `ske`: [v1.1.1](services/ske/CHANGELOG.md#v111)
61+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
62+
- `sqlserverflex`: [v1.3.1](services/sqlserverflex/CHANGELOG.md#v131)
63+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
64+
- `stackitmarketplace`: [v1.6.1](services/stackitmarketplace/CHANGELOG.md#v161)
65+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
66+
167
## Release (2025-07-21)
268
- `alb`: [v0.6.0](services/alb/CHANGELOG.md#v060)
369
- **Feature:** Add new `LoadBalancerSecurityGroup` field to `CreateLoadBalancerPayload`, `LoadBalancer`, and `UpdateLoadBalancerPayload` models

core/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.17.3
2+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
3+
14
## v0.17.2 (2025-05-22)
25
- **Bugfix:** Access tokens generated via key flow authentication are refreshed 5 seconds before expiration to prevent timing issues with upstream systems which could lead to unexpected 401 error responses
36

core/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v0.17.3

generate.go

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"io/ioutil"
6+
"os"
7+
"path/filepath"
8+
"strconv"
9+
"strings"
10+
)
11+
12+
// incrementPatchVersion takes a version string (e.g., "v1.2.3") and returns the
13+
// version with the patch number incremented (e.g., "v1.2.4"). It expects a "v" prefix.
14+
func incrementPatchVersion(version string) (string, error) {
15+
// Ensure the version starts with 'v'
16+
if !strings.HasPrefix(version, "v") {
17+
return "", fmt.Errorf("version must start with 'v', got: %s", version)
18+
}
19+
// Remove the "v" prefix for easier parsing
20+
versionWithoutV := strings.TrimPrefix(version, "v")
21+
22+
parts := strings.Split(versionWithoutV, ".")
23+
if len(parts) != 3 {
24+
return "", fmt.Errorf("invalid version format: %s. Expected vX.Y.Z", version)
25+
}
26+
27+
// Parse major, minor, and patch versions
28+
major, err := strconv.Atoi(parts[0])
29+
if err != nil {
30+
return "", fmt.Errorf("invalid major version '%s' in %s", parts[0], version)
31+
}
32+
minor, err := strconv.Atoi(parts[1])
33+
if err != nil {
34+
return "", fmt.Errorf("invalid minor version '%s' in %s", parts[1], version)
35+
}
36+
patch, err := strconv.Atoi(parts[2])
37+
if err != nil {
38+
return "", fmt.Errorf("invalid patch version '%s' in %s", parts[2], version)
39+
}
40+
41+
// Increment the patch version
42+
newPatch := patch + 1
43+
// Format the new version back with the "v" prefix
44+
return fmt.Sprintf("v%d.%d.%d", major, minor, newPatch), nil
45+
}
46+
47+
// prependToFile reads the content of a file, prepends the new content, and writes it back.
48+
// If the file does not exist, it will be created.
49+
func prependToFile(filePath, contentToPrepend string) error {
50+
// Read existing content. If file doesn't exist, ReadFile returns an error
51+
// but we can proceed if it's an "is not exist" error.
52+
existingContent, err := ioutil.ReadFile(filePath)
53+
if err != nil && !os.IsNotExist(err) {
54+
return fmt.Errorf("error reading file %s: %w", filePath, err)
55+
}
56+
57+
// Combine new content with existing content, ensuring a newline between them
58+
// and a final newline at the end for good measure.
59+
newContent := []byte(contentToPrepend + "\n" + string(existingContent))
60+
61+
// Write the combined content back to the file. 0644 sets read/write permissions for owner,
62+
// and read-only for others.
63+
return ioutil.WriteFile(filePath, newContent, 0644)
64+
}
65+
66+
func main() {
67+
// Check if a changelog message is provided as a command-line argument
68+
if len(os.Args) < 2 {
69+
fmt.Println("Usage: go run generate.go \"<Your changelog message>\"")
70+
fmt.Println("Example: go run generate.go \"Fixed a minor bug in user authentication\"")
71+
os.Exit(1)
72+
}
73+
changelogMessage := os.Args[1] // The message for the changelog entry
74+
75+
// Define paths relative to the script's execution directory (expected to be monorepo root)
76+
rootChangelogPath := "CHANGELOG.md"
77+
servicesDirPath := "services"
78+
79+
// Get the current working directory to ensure all paths are absolute and correct
80+
cwd, err := os.Getwd()
81+
if err != nil {
82+
fmt.Printf("Error getting current working directory: %v\n", err)
83+
os.Exit(1)
84+
}
85+
86+
// Construct the full path to the services directory
87+
fullServicesDirPath := filepath.Join(cwd, servicesDirPath)
88+
89+
// Read all entries in the services directory
90+
entries, err := ioutil.ReadDir(fullServicesDirPath)
91+
if err != nil {
92+
fmt.Printf("Error reading service directory %s: %v\n", fullServicesDirPath, err)
93+
os.Exit(1)
94+
}
95+
reverseSlice(entries)
96+
97+
fmt.Println("Starting service version and changelog updates...")
98+
fmt.Println("-------------------------------------------------")
99+
100+
// Iterate over each entry found in the services directory
101+
for _, entry := range entries {
102+
// Process only directories that are not hidden (e.g., .git)
103+
if entry.IsDir() && !strings.HasPrefix(entry.Name(), ".") {
104+
serviceName := entry.Name()
105+
servicePath := filepath.Join(fullServicesDirPath, serviceName)
106+
serviceVersionFilePath := filepath.Join(servicePath, "VERSION")
107+
serviceChangelogFilePath := filepath.Join(servicePath, "CHANGELOG.md")
108+
109+
fmt.Printf("Processing service: %s\n", serviceName)
110+
111+
// 1. Read the current version from the service's VERSION file
112+
currentVersionBytes, err := ioutil.ReadFile(serviceVersionFilePath)
113+
if err != nil {
114+
fmt.Printf(" Error reading version file for %s (%s): %v. Skipping service.\n", serviceName, serviceVersionFilePath, err)
115+
continue // Move to the next service
116+
}
117+
currentVersion := strings.TrimSpace(string(currentVersionBytes))
118+
119+
// 2. Increment the patch version
120+
newVersion, err := incrementPatchVersion(currentVersion)
121+
if err != nil {
122+
fmt.Printf(" Error incrementing version for %s (current: %s): %v. Skipping service.\n", serviceName, currentVersion, err)
123+
continue // Move to the next service
124+
}
125+
fmt.Printf(" Version bumped from %s to %s\n", currentVersion, newVersion)
126+
127+
// 3. Write the new version back to the service's VERSION file
128+
err = ioutil.WriteFile(serviceVersionFilePath, []byte(newVersion), 0644)
129+
if err != nil {
130+
fmt.Printf(" Error writing new version to %s: %v. Skipping service.\n", serviceVersionFilePath, err)
131+
continue // Move to the next service
132+
}
133+
134+
// 4. Add the new changelog entry to the service's CHANGELOG.md
135+
serviceChangelogEntry := fmt.Sprintf("## %s\n - %s\n", newVersion, changelogMessage)
136+
err = prependToFile(serviceChangelogFilePath, serviceChangelogEntry)
137+
if err != nil {
138+
fmt.Printf(" Error adding changelog entry to %s: %v. Skipping service.\n", serviceChangelogFilePath, err)
139+
continue // Move to the next service
140+
}
141+
fmt.Printf(" Added changelog entry to %s\n", serviceChangelogFilePath)
142+
143+
// 5. Add the new changelog entry to the root CHANGELOG.md
144+
rootChangelogEntry := fmt.Sprintf("- `%s`: [%s](services/%s/CHANGELOG.md#%s) \n - %s", serviceName, newVersion, serviceName, strings.ReplaceAll(newVersion, ".", ""), changelogMessage)
145+
err = prependToFile(filepath.Join(cwd, rootChangelogPath), rootChangelogEntry)
146+
if err != nil {
147+
fmt.Printf(" Error adding changelog entry to root %s: %v. Skipping service.\n", filepath.Join(cwd, rootChangelogPath), err)
148+
continue // Move to the next service
149+
}
150+
fmt.Printf(" Added changelog entry to root %s\n", filepath.Join(cwd, rootChangelogPath))
151+
fmt.Println("-------------------------------------------------")
152+
}
153+
}
154+
155+
fmt.Println("\nScript finished successfully!")
156+
}
157+
158+
func reverseSlice[T any](s []T) {
159+
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
160+
s[i], s[j] = s[j], s[i]
161+
}
162+
}
163+

go.work

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use (
3030
./examples/sqlserverflex
3131
./examples/waiter
3232
./services/alb
33+
./services/archiving
3334
./services/authorization
3435
./services/cdn
3536
./services/certificates

services/alb/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.6.1
2+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
3+
14
## v0.6.0
25
- **Feature:** Add new `LoadBalancerSecurityGroup` field to `CreateLoadBalancerPayload`, `LoadBalancer`, and `UpdateLoadBalancerPayload` models
36

services/alb/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.6.0
1+
v0.6.1

services/archiving/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.2.1
2+
- **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3`
3+
14
## v0.2.0 (2025-02-21)
25
- **New:** Minimal go version is now Go 1.21
36

services/archiving/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.2.0
1+
v0.2.1

services/archiving/go.mod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module github.com/stackitcloud/stackit-sdk-go/services/archiving
2+
3+
go 1.21
4+
5+
require github.com/stackitcloud/stackit-sdk-go/core v0.17.2
6+
7+
require (
8+
github.com/golang-jwt/jwt/v5 v5.2.3 // indirect
9+
github.com/google/uuid v1.6.0 // indirect
10+
)

0 commit comments

Comments
 (0)