Skip to content

Commit 59fe20a

Browse files
committed
MINOR: regenerate models
2 parents 766889a + 76f149a commit 59fe20a

File tree

1,138 files changed

+40047
-38813
lines changed

Some content is hidden

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

1,138 files changed

+40047
-38813
lines changed

.aspell.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,23 @@ allowed:
1919
- backends
2020
- backport
2121
- bmarkovic
22+
- botmgmt
23+
- botmgtupdate
2224
- browserslist
2325
- bvue
26+
- bwlim
2427
- caniuse
2528
- casbin
2629
- chmigrate
2730
- cli
2831
- clickhouse
29-
- cnt
32+
- cnt
33+
- codebase
3034
- composable
35+
- cond
3136
- conf
3237
- config
38+
- conns
3339
- const
3440
- cpu
3541
- crd
@@ -60,21 +66,28 @@ allowed:
6066
- eslint
6167
- failsafe
6268
- fbt
69+
- fcgi
70+
- usefcgiapp
6371
- formatter
6472
- formatters
6573
- frontend
6674
- frontends
6775
- fullpage
76+
- gentype
6877
- github
6978
- gitlab
79+
- godaddy
80+
- gofumpt
7081
- gokc
7182
- golang
7283
- golangci
7384
- gorm
7485
- goroutines
7586
- govulncheck
87+
- gotoolchain
7688
- gpc
77-
- gpt
89+
- gpt
90+
- gptstr
7891
- hapee
7992
- haproxy
8093
- healthcheck
@@ -112,6 +125,7 @@ allowed:
112125
- minsize
113126
- mixin
114127
- mkdir
128+
- mpxs
115129
- multipartsearch
116130
- multiselect
117131
- mutex
@@ -151,9 +165,11 @@ allowed:
151165
- scrollbar
152166
- scss
153167
- searchselect
168+
- sig
154169
- sni
155170
- spammy
156171
- ssl
172+
- sslv
157173
- sso
158174
- struct
159175
- subnet
@@ -189,3 +205,5 @@ allowed:
189205
- yaml
190206
- async
191207
- rehaul
208+
- rebase
209+
- XXXX

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ bin/check-commit
44
bin/golangci-lint
55
bin/swagger
66
.envrc
7+
bin/go-method-gen

.gitlab-ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,17 @@ generate:
7878
tags:
7979
- go
8080
before_script:
81-
- rm -rf models/*
81+
- find models -maxdepth 1 -type f -name "*.go" -exec rm {} \;
8282
- make models
8383
script:
84-
- test -z "$(git diff 2> /dev/null)" || exit "Models are not generated, issue \`make models\` and commit the result"
84+
- |
85+
# Check for unstaged changes
86+
if ! git diff --quiet 2>/dev/null; then
87+
echo "Diff output:"
88+
git diff
89+
echo "Models are not generated. Please run \`make models\` and commit the result."
90+
exit 1
91+
fi
8592
- test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "Models generation created untracked files, cannot proceed"
8693
rules:
8794
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'

.golangci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ linters:
3838
- gci
3939
- goconst
4040
- recvcheck
41-
- tenv # deprecated
41+
- tenv # deprecated
42+
- gocritic
4243

4344
issues:
4445
exclude-files:

Makefile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PROJECT_PATH=${PWD}
22
DOCKER_HAPROXY_VERSION?=3.2
3-
SWAGGER_VERSION=v0.30.2
3+
SWAGGER_VERSION=v0.32.3
44
GO_VERSION:=${shell go mod edit -json | jq -r .Go}
55
GOLANGCI_LINT_VERSION=1.64.5
66
CHECK_COMMIT=5.2.0
@@ -33,15 +33,27 @@ spec:
3333
go run cmd/specification/*.go -file specification/haproxy-spec.yaml > specification/build/haproxy_spec.yaml
3434

3535
.PHONY: models
36-
models: gentypes spec swagger-check
36+
models: gentypes spec swagger-check go-method-gen-check
37+
rm -rf models/*.go
3738
./bin/swagger generate model --additional-initialism=FCGI -f ${PROJECT_PATH}/specification/build/haproxy_spec.yaml -r ${PROJECT_PATH}/specification/copyright.txt -m models -t ${PROJECT_PATH}
38-
rm -rf models/server_params_prepare_for_runtime.go
39-
rm -rf models/*_compare.go
40-
rm -rf models/*_compare_test.go
39+
./bin/go-method-gen --header-file=specification/copyright.txt --scan=models --debug --overrides=models/funcs/overrides.yaml && find ./generated -name "*.go" -exec cp {} ./models \; && rm -rf generated
4140
go run cmd/struct_equal_generator/*.go -l ${PROJECT_PATH}/specification/copyright.txt ${PROJECT_PATH}/models
4241
go run cmd/struct_tags_checker/*.go ${PROJECT_PATH}/models
4342
go run cmd/kubebuilder_marker_generator/*.go ${PROJECT_PATH}/models
4443
go run cmd/server_params_runtime/*.go ${PROJECT_PATH}/models
44+
go run cmd/defaults-setter/main.go ${PROJECT_PATH}/specification/build/haproxy_spec.yaml ${PROJECT_PATH}/models
45+
$(MAKE) gofumpt
46+
47+
.PHONY: go-method-gen-check
48+
go-method-gen-check:
49+
@GO_METHOD_GEN_BIN_NAME="go-method-gen"; \
50+
GO_METHOD_GEN_GITHUB="github.com/haproxytech/go-method-gen/cmd/go-method-gen@latest"; \
51+
if [ -f "$$GO_METHOD_GEN_BIN_NAME" ]; then \
52+
echo "$$GO_METHOD_GEN_BIN_NAME already installed"; \
53+
else \
54+
GOBIN=$(PWD)/bin go install $$GO_METHOD_GEN_GITHUB && \
55+
echo "$$GO_METHOD_GEN_BIN_NAME installed"; \
56+
fi
4557

4658
.PHONY: swagger-check
4759
swagger-check:

bin/swagger-check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ V=$(./swagger version | grep version | awk 'NF>1{print $NF}')
33

44
case "$V" in
55
*$SWAGGER_VERSION*) echo "swagger version $V is OK" ;;
6-
*) echo "Detected $V, Installing $SWAGGER_VERSION"; GOBIN=$(pwd) go install "github.com/go-swagger/go-swagger/cmd/swagger@$SWAGGER_VERSION" ;;
6+
*) echo "Detected $V, Installing $SWAGGER_VERSION"; GOTOOLCHAIN=go1.24.6 GOBIN=$(pwd) go install "github.com/go-swagger/go-swagger/cmd/swagger@$SWAGGER_VERSION" ;;
77
esac

0 commit comments

Comments
 (0)