Skip to content

feat(env): Add FloatSetting with validations#18596

Merged
vikin91 merged 4 commits intomasterfrom
piotr/float-setting
Jan 21, 2026
Merged

feat(env): Add FloatSetting with validations#18596
vikin91 merged 4 commits intomasterfrom
piotr/float-setting

Conversation

@vikin91
Copy link
Contributor

@vikin91 vikin91 commented Jan 21, 2026

Description

Add FloatSetting with bounds, allow-list, and finite-value validation plus unit tests for parsing and edge cases so float env vars behave consistently with IntegerSetting and invalid inputs fall back to defaults.

Sparked as an idea in this comment by @mtodor .

AI-assisted: FloatSetting implementation and initial tests were drafted by AI; test inputs and case selection were reviewed and adjusted by the user. User manually reviewed the entire code.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

  • CI only

Add FloatSetting with validation and format parsing tests to mirror IntegerSetting behavior and document unsupported b-format inputs.

User request: "Implement something similar for the float setting" (plus follow-up test adjustments).
AI-assisted: implementation and tests drafted by AI, reviewed/adjusted by user.
@rhacs-bot
Copy link
Contributor

rhacs-bot commented Jan 21, 2026

Images are ready for the commit at 373de89.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.10.x-841-g373de89e7e.

Copy link
Contributor

@lvalerom lvalerom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I left a few non-blocking comments.

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 85.36585% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.15%. Comparing base (3faf751) to head (373de89).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
pkg/env/floatsetting.go 85.36% 10 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18596      +/-   ##
==========================================
+ Coverage   49.13%   49.15%   +0.02%     
==========================================
  Files        2651     2652       +1     
  Lines      199075   199206     +131     
==========================================
+ Hits        97808    97913     +105     
- Misses      93850    93876      +26     
  Partials     7417     7417              
Flag Coverage Δ
go-unit-tests 49.15% <85.36%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vikin91 vikin91 enabled auto-merge (squash) January 21, 2026 15:39
@vikin91 vikin91 merged commit 306246a into master Jan 21, 2026
93 of 99 checks passed
@vikin91 vikin91 deleted the piotr/float-setting branch January 21, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants