Repository navigation
feat: upgrade platform-go to v10.0.0 - #1
Merged
Merged
Conversation
Bump github.com/primandproper/platform-go from v7.1.1 to v10.0.0 and adapt to the two breaking API changes: - config.LoadFromJSONFile now takes a context.Context as its first argument; LoadFromFile threads its existing ctx through. - logging.LevelsEqual is gone. Level is now a string-backed value type, so == compares the level directly; the assertions it backed become assert.Equal. v10 also relaxed logging validation, which invalidated the premise of two tests. ServiceName is now required only for the providers that export telemetry (otelslog), and the empty provider remains the documented opt-out into noop logging -- so neither a slog config omitting a service name nor a zero Config fails validation any more. Both tests now use an unrecognized provider, which v10 rejects outright rather than silently disabling logging, and a new test pins the permissive behavior so it stays deliberate. The LoadFromFile doc comment no longer promises the old rule. The regenerated config/*.json shrink because v10 marks the pillar sub-configs omitempty, so zero-valued tracing/metrics/profiling blocks stop serializing. Both files still round-trip through LoadFromFile and the env-var overlay still wins over file values. Also switch Render's two loops to indexing. gocritic's rangeValCopy flagged the 40-byte Environment copy against the configured 32-byte threshold; this was failing on main before this upgrade and is fixed here so the build lands lint-clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades
github.com/primandproper/platform-gofrom v7.1.1 → v10.0.0.Breaking API changes
config.LoadFromJSONFilenow takes acontext.Context.LoadFromFilethreads its existingctxthrough.logging.LevelsEqualis gone.Levelis now a string-backed value type, so==compares the level directly — the six assertions it backed becomeassert.Equal/assert.Equalf.Behavior change worth a look
v10 relaxed logging validation, which invalidated the premise of two tests:
ServiceNameis now required only for providers that export telemetry (otelslog).So neither a slog config omitting a service name nor a zero
Configfails validation any more. Both tests now use an unrecognized provider (which v10 rejects outright), and a new test pins the permissive behavior so it stays deliberate rather than accidental. TheLoadFromFiledoc comment no longer promises the old rule.config/*.jsonspecify a service name — but it's worth knowing before rolling out.Regenerated configs
config/localdev.jsonandconfig/production.jsonshrink because v10 marks the pillar sub-configsomitempty, so zero-valuedtracing/metrics/profilingblocks stop serializing. Semantically identical: empty pillars still resolve to noop.Drive-by lint fix
Render's two loops now index instead of copying the 40-byteEnvironmentper iteration, satisfying gocritic'srangeValCopyagainst the repo's configured 32-byte threshold. This was already failing onmainbefore this upgrade (verified by linting the v7 baseline); fixed here so the branch lands lint-clean.Verification
make build,make test— passmake lint— 0 issues, shellcheck cleanmake configs— idempotentversionbare, with--config config/localdev.json(debug logs), and with--config config/production.json(quiet at info); confirmedTEMPLATE_GO_OBSERVABILITY_LOGGING_LEVELstill overrides the file.🤖 Generated with Claude Code