Repository navigation
fix(cli): distinguish undelivered /v1/limits quota fields from zero - #59
Open
grapedev-bot wants to merge 1 commit into
Open
grapedev-bot wants to merge 1 commit into
grapedev-bot wants to merge 1 commit into
Conversation
go-sdk records whether maxTunnelBandwidthBytesPerSecond, maxHttpRequestsPerMinutePerPort and maxConnectionsPerPort were present in the /v1/limits response and exposes Has* accessors, so an omitted field is no longer indistinguishable from an explicit 0. Exported fields are unchanged. The CLI now renders an omitted field as 'not provided by server' (未下发) instead of 0, a negative value as unlimited (不限制), and keeps 0 and positive values as returned. Adds decode and render regression tests for the omitted, zero, positive and unlimited cases, and syncs en/zh api.md, cli.md and quota-and-debug with the field semantics.
Collaborator
Author
This branch has not been deployed
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.
Summary
go-sdk:Limitsnow records whethermaxTunnelBandwidthBytesPerSecond,maxHttpRequestsPerMinutePerPortandmaxConnectionsPerPortwere present in the/v1/limitsresponse, exposed viaHasMaxTunnelBandwidth(),HasMaxHTTPRequestsPerMinutePerPort()andHasMaxConnectionsPerPort(). Exported fields, names and types are unchanged, so existing callers keep working.devbridge limits: an omitted field is rendered asnot provided by server(未下发) instead of0 B/s/0;-1renders asunlimited(不限制); an explicit0and positive values are shown as returned (bandwidth still converted to5 MB/sstyle).NotProvided/Unlimitedentries for en and zh.go-sdk/limits_test.gocovers decode of omitted / explicit-zero / positive / null payloads;cli/cmd/limits_test.goasserts the rendered rows for omitted / zero / positive / unlimited responses.reference/api.md,reference/cli.mdandguide/quota-and-debug.mddescribe the omitted /0/-1semantics and note that server-side delivery is an external dependency.Out of scope
Restoring the three fields in the
/v1/limitsserver response: this repository has no bridge server code, tracked separately.Testing
Both suites pass. Manual render check: omitted fields print
not provided by server/ 未下发,-1printsunlimited/ 不限制,5242880prints5 MB/s.Refs #57