Skip to content

events: keep CodeBuildNumber exact for every int32 - #647

Open
Yeagerist0 wants to merge 1 commit into
aws:mainfrom
Yeagerist0:fix/codebuild-number-float32
Open

Yeagerist0 wants to merge 1 commit into
aws:mainfrom
Yeagerist0:fix/codebuild-number-float32

Conversation

@Yeagerist0

Copy link
Copy Markdown

CodeBuildNumber goes through float32 when it is marshalled and unmarshalled. A float32 holds integers exactly only up to 2^24, so 16777217 unmarshals as 16777216.

Switched both directions to float64, which holds every int32. The test fails on main (expected: 16777217, actual: 16777216) and passes with the change; go test ./events is green.

Disclosure: I used Claude Code to help find and write this; I reproduced the bug and ran the tests myself.

CodeBuildNumber went through float32 in both directions, which holds
integers exactly only up to 2^24. A build number above 16777216 was
silently rounded on unmarshal (16777217 became 16777216). Use float64,
which represents every int32 exactly.
@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.17%. Comparing base (4111853) to head (9288a3f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #647      +/-   ##
==========================================
+ Coverage   82.04%   82.17%   +0.13%     
==========================================
  Files          37       37              
  Lines        1487     1487              
==========================================
+ Hits         1220     1222       +2     
+ Misses        264      262       -2     
  Partials        3        3              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants