Conversation
|
@geigerj0 Sorry, I now recognized that this PR was set to ready to early. What happened is that I was working on it over on I then came back to it a few months later and thought it was ready when I ported it over, but did not really check my work. My bad, sorry for having you look for such glaring issues, that I should have caught. I think I was blinded by the tests all passing. |
| # 4. Optionally: `make generate-fakes` to update the fakes as well. | ||
| .PHONY: go-mod-tidy | ||
| go-mod-tidy: ./go.mod ./go.sum ${go_deps_without_fakes} | ||
| go-mod-tidy: ./go.mod ./go.sum ${go_deps_without_fakes} ## run go mod tidy |
There was a problem hiding this comment.
do you find these comments helpful? 🤷
There was a problem hiding this comment.
Yes, they are part of 9f2770a and this how it looks like:
$ make help
build build the app
check run linting, build and tests
clean clean up build artifacts
deploy Deploy the app to Cloud Foundry, requires the CONFIG env variable to be pointing to the acceptance test config file
generate-fakes generate Go code (fakes, clients from OpenAPI specs)
go-mod-tidy run go mod tidy
help Show this help
lint-fix run linting with auto-fix
start start the app locally in a cflinuxfs5 container
test run tests
WDYT?
| go_deps_without_fakes = $(shell find . -type f -name '*.go' \ | ||
| | grep --invert-match --regexp='${app-fakes-dir}') | ||
|
|
||
| .PHONY: help |
There was a problem hiding this comment.
something broke the build 👀
There was a problem hiding this comment.
Hmm, it seems the Go 1.25 update came in through renovate already ...
| @@ -1,75 +1,53 @@ | |||
| module code.cloudfoundry.org/app-autoscaler-release/src/acceptance/assets/app/go_app | |||
| } | ||
| c.JSON(http.StatusOK, gin.H{"utilization": utilisation, "minutes": minutes}) | ||
| if err := writeJSON(w, http.StatusOK, JSONResponse{"utilization": utilisation, "minutes": minutes}); err != nil { | ||
| slog.Error("Failed to write JSON response", slog.Any("error", err)) |
There was a problem hiding this comment.
why not using the logger that got already passed to the func?
| slog.Error("Failed to write JSON response", slog.Any("error", err)) | |
| logger.Error("Failed to write JSON response", slog.Any("error", err)) |
# Issue As an app-autoscaler developer I want to have as few dependencies as possible So that I don't have to watch out for so many vulnerabilities in unmaintained dependencies. # Fix - As we already have two HTTP libraries (gorilla/mux and net/http) get rid of a third one for the test app (gin). - As we already have two log libraries (lager and slog) get rid of a third one for the test app (zap). # AI Disclaimer Prompted by the committer, most of the work was done by GitHub Copilot.
# Issue The package names still referenced the old `app-autoscaler-release` repo. # Fix Adapt to the new location
# Issue
The app was responding to every GET request with a successful request, regardless of path
# Fix
Use `/{$}` to match root path "/" exactly, see https://pkg.go.dev/net/http#hdr-Patterns-ServeMux
# Issue Having to read through `Makefile` to understand which targets are available is cumbersome. # Fix add some self-documentation which can be shown with the default `help` target.
# Issue The stop endpoint was inadvertently renamed. # Fix Rename it back.
# Issue otel was updated inadvertently # Fix revert otel to previous version
|



Issue
As an app-autoscaler developer
I want to have as few dependencies as possible
So that I don't have to watch out for so many vulnerabilities in
unmaintained dependencies.
Fix
rid of a third one for the test app (gin).
third one for the test app (zap).
AI Disclaimer
Prompted by the committer, most of the work was done by GitHub copilot.