Skip to content

Commit 8f34bf2

Browse files
committed
chore: bump Go to 1.26.4 and centralize CLI build in integration tests
- Bump go to 1.26.4 and update GoBaseImage accordingly - Use go 1.25.0 for integration go test as lowest version for compatibility - Move CLI build out of individual tests into shared buildOpenFeatureCLI - Bump golangci-lint to v2.12.2 and fix linter issues - Fix test/README.md and update new-generator.md Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
1 parent c2688a7 commit 8f34bf2

17 files changed

Lines changed: 125 additions & 111 deletions

File tree

.github/workflows/pr-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
fetch-depth: 0
2525
- uses: actions/setup-go@v5
2626
with:
27-
go-version-file: 'go.mod'
27+
go-version-file: "go.mod"
2828
- name: Check Go formatting
2929
run: |
3030
unformatted=$(go fmt ./...)
@@ -48,4 +48,4 @@ jobs:
4848
- name: golangci-lint
4949
uses: golangci/golangci-lint-action@v9
5050
with:
51-
version: v2.7.1
51+
version: v2.12.2

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ help:
1919
@echo " fmt - Format Go code"
2020
@echo " ci - Run all CI checks locally (fmt, lint, test, verify-generate)"
2121

22+
# Tool versions
23+
GOLANGCI_LINT_VERSION := v2.12.2
24+
2225
# Build variables
2326
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
2427
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
@@ -105,7 +108,7 @@ lint:
105108
@echo "Running golangci-lint..."
106109
@if ! command -v golangci-lint &> /dev/null; then \
107110
echo "Installing golangci-lint..."; \
108-
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.1; \
111+
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION); \
109112
fi
110113
@golangci-lint run
111114
@echo "Linting completed successfully!"
@@ -115,7 +118,7 @@ lint-fix:
115118
@echo "Running golangci-lint with auto-fix..."
116119
@if ! command -v golangci-lint &> /dev/null; then \
117120
echo "Installing golangci-lint..."; \
118-
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.1; \
121+
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION); \
119122
fi
120123
@golangci-lint run --fix
121124
@echo "Linting with auto-fix completed successfully!"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/open-feature/cli
22

3-
go 1.25.0
3+
go 1.26.4
44

55
require (
66
dagger.io/dagger v0.20.6

internal/generators/csharp/csharp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func toCSharpDict(value any) string {
6969
for _, key := range keys {
7070
val := assertedMap[key]
7171

72-
builder.WriteString(fmt.Sprintf(".Set(%q, %s)", key, formatNestedValue(val)))
72+
fmt.Fprintf(&builder, ".Set(%q, %s)", key, formatNestedValue(val))
7373
}
7474
builder.WriteString(".Build())")
7575

internal/generators/golang/golang.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func toMapLiteral(value any) string {
9090
}
9191
val := assertedMap[key]
9292

93-
builder.WriteString(fmt.Sprintf(`%q: %s`, key, formatNestedValue(val)))
93+
fmt.Fprintf(&builder, `%q: %s`, key, formatNestedValue(val))
9494
}
9595

9696
builder.WriteString("}")

internal/generators/java/java.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func toMapLiteral(value any) string {
7373
}
7474
val := assertedMap[key]
7575

76-
builder.WriteString(fmt.Sprintf("%q, %s", key, formatNestedValue(val)))
76+
fmt.Fprintf(&builder, "%q, %s", key, formatNestedValue(val))
7777
}
7878
builder.WriteString(")")
7979

internal/generators/python/python.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func toPythonDict(value any) string {
9898
}
9999
val := assertedMap[key]
100100

101-
builder.WriteString(fmt.Sprintf(`%q: %s`, key, formatNestedValue(val)))
101+
fmt.Fprintf(&builder, `%q: %s`, key, formatNestedValue(val))
102102
}
103103

104104
builder.WriteString("}")

internal/manifest/compare.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ func getKnownFlagProperties() map[string]bool {
6868

6969
// Extract fields from BaseFlag struct
7070
t := reflect.TypeFor[BaseFlag]()
71-
for i := range t.NumField() {
72-
field := t.Field(i)
71+
for field := range t.Fields() {
7372
jsonTag := field.Tag.Get("json")
7473
if jsonTag != "" {
7574
// Extract field name from json tag (e.g., "flagType,omitempty" -> "flagType")

internal/manifest/validate.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,10 @@ func FormatValidationError(issues []ValidationError) string {
199199
if flagType == "" {
200200
flagType = "missing"
201201
}
202-
sb.WriteString(fmt.Sprintf(
203-
"- flagType: %s\n flagPath: %s\n errors:\n ~ %s\n \tSuggestions:\n \t- flagType: boolean\n \t- defaultValue: true\n\n",
202+
fmt.Fprintf(&sb, "- flagType: %s\n flagPath: %s\n errors:\n ~ %s\n \tSuggestions:\n \t- flagType: boolean\n \t- defaultValue: true\n\n",
204203
flagType,
205204
path,
206-
strings.Join(entry.messages, "\n ~ "),
207-
))
205+
strings.Join(entry.messages, "\n ~ "))
208206
}
209207
return sb.String()
210208
}

renovate.json

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
{
66
"customType": "regex",
77
"description": "Update the GoBaseImage constant when a newer golang Docker image is available",
8-
"managerFilePatterns": [
9-
"test/integration/integration.go"
10-
],
8+
"managerFilePatterns": ["test/integration/integration.go"],
119
"matchStrings": [
1210
"GoBaseImage = \"golang:(?<currentValue>\\d+\\.\\d+(?:\\.\\d+)?)-alpine\""
1311
],
@@ -18,17 +16,32 @@
1816
{
1917
"customType": "regex",
2018
"description": "Update minimum Go version mentioned in README and CONTRIBUTING",
21-
"managerFilePatterns": [
22-
"README.md",
23-
"CONTRIBUTING.md"
24-
],
19+
"managerFilePatterns": ["README.md", "CONTRIBUTING.md"],
2520
"matchStrings": [
2621
"Go >= (?<currentValue>\\d+\\.\\d+(?:\\.\\d+)?)",
2722
"Go (?<currentValue>\\d+\\.\\d+(?:\\.\\d+)?) or later"
2823
],
2924
"depNameTemplate": "go",
3025
"datasourceTemplate": "golang-version",
3126
"extractVersionTemplate": "^(?<version>\\d+\\.\\d+)"
27+
},
28+
{
29+
"customType": "regex",
30+
"managerFilePatterns": ["Makefile"],
31+
"matchStrings": [
32+
"GOLANGCI_LINT_VERSION\\s*:?=\\s*(?<currentValue>v?\\d+\\.\\d+\\.\\d+)"
33+
],
34+
"depNameTemplate": "golangci/golangci-lint",
35+
"datasourceTemplate": "github-releases"
36+
},
37+
{
38+
"customType": "regex",
39+
"managerFilePatterns": [".github/workflows/pr-lint.yml"],
40+
"matchStrings": [
41+
"uses:\\s*golangci/golangci-lint-action@v\\d+[\\s\\S]*?version:\\s*(?<currentValue>v?\\d+\\.\\d+\\.\\d+)"
42+
],
43+
"depNameTemplate": "golangci/golangci-lint",
44+
"datasourceTemplate": "github-releases"
3245
}
3346
],
3447
"packageRules": [
@@ -37,6 +50,10 @@
3750
"matchDatasources": ["docker", "golang-version"],
3851
"matchPackageNames": ["golang", "go"],
3952
"groupName": "go toolchain"
53+
},
54+
{
55+
"matchDepNames": ["golangci/golangci-lint"],
56+
"groupName": "golangci-lint"
4057
}
4158
]
4259
}

0 commit comments

Comments
 (0)