Status: Not started
Data size constants are expressed as raw arithmetic (6 * 1024 * 1024) and flags accept raw byte counts (--max-grpc-message-size=6291456). This is error-prone and hard to read.
Add a small utility (or adopt an existing lib like github.com/c2h5oh/datasize) that provides:
- Named constants:
datasize.MB(6) instead of 6 * 1024 * 1024
- String parsing for flags:
--max-grpc-message-size=6MB instead of raw bytes
- Similar ergonomics to the
time package's time.Duration / time.ParseDuration
Current usage: defaultMaxGRPCMessageSize in controllers/packagerevisions/pkg/controllers/packagerevision/config.go. More usages likely as the codebase grows (DB limits, PRR size thresholds, etc).
Acceptance Criteria:
- Data size constants use named helpers (e.g.
datasize.MB(6))
- Flags accept human-readable strings (e.g.
6MB, 512KB)
- Existing
--max-grpc-message-size flag updated
Status: Not started
Data size constants are expressed as raw arithmetic (
6 * 1024 * 1024) and flags accept raw byte counts (--max-grpc-message-size=6291456). This is error-prone and hard to read.Add a small utility (or adopt an existing lib like
github.com/c2h5oh/datasize) that provides:datasize.MB(6)instead of6 * 1024 * 1024--max-grpc-message-size=6MBinstead of raw bytestimepackage'stime.Duration/time.ParseDurationCurrent usage:
defaultMaxGRPCMessageSizeincontrollers/packagerevisions/pkg/controllers/packagerevision/config.go. More usages likely as the codebase grows (DB limits, PRR size thresholds, etc).Acceptance Criteria:
datasize.MB(6))6MB,512KB)--max-grpc-message-sizeflag updated