Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(metadata): fix V2 API int overflow error on 32bit ARM build #2872

Merged
merged 1 commit into from
Nov 6, 2020
Merged

fix(metadata): fix V2 API int overflow error on 32bit ARM build #2872

merged 1 commit into from
Nov 6, 2020

Conversation

weichou1229
Copy link
Member

Fix #2870

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/master/.github/Contributing.md.

What is the current behavior?

Golang build failed with 32bits ARCH

Issue Number: #2870

What is the new behavior?

Since 32bits ARCH only support 2,147,483,647 as the maximum positive signed integer, so use math.MaxInt32 instead of the math.MaxUint32.

Does this PR introduce a breaking change?

  • Yes
  • No

New Imports

  • Yes
  • No

Specific Instructions

Are there any specific instructions or things that should be known prior to reviewing?

Other information

@codecov-io
Copy link

codecov-io commented Nov 5, 2020

Codecov Report

Merging #2872 into master will increase coverage by 0.79%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2872      +/-   ##
==========================================
+ Coverage   39.33%   40.12%   +0.79%     
==========================================
  Files         166      172       +6     
  Lines       13961    14246     +285     
==========================================
+ Hits         5491     5716     +225     
- Misses       8140     8163      +23     
- Partials      330      367      +37     
Impacted Files Coverage Δ
internal/core/data/init.go 0.00% <0.00%> (ø)
internal/pkg/v2/infrastructure/redis/event.go 0.00% <0.00%> (ø)
internal/pkg/v2/infrastructure/redis/reading.go 0.00% <0.00%> (ø)
...al/security/config/command/proxy/oauth2/command.go 72.72% <0.00%> (ø)
...l/security/config/command/proxy/deluser/command.go 74.19% <0.00%> (ø)
...ernal/security/config/command/proxy/tls/command.go 100.00% <0.00%> (ø)
internal/security/config/command/help/command.go 100.00% <0.00%> (ø)
...l/security/config/command/proxy/adduser/command.go 59.77% <0.00%> (ø)
...ernal/security/config/command/proxy/jwt/command.go 77.77% <0.00%> (ø)
internal/core/data/v2/application/event.go 65.44% <0.00%> (+7.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 471572d...00fac37. Read the comment docs.

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

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

you need to also modify event.go

Since 32bits ARCH only support 2,147,483,647 as the maximum positive signed integer, so use math.MaxInt32 instead of the math.MaxUint32.

Fix #2870

Signed-off-by: weichou <weichou1229@gmail.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
66.7% 66.7% Duplication

@weichou1229
Copy link
Member Author

No problem, modified.

@weichou1229 weichou1229 requested a review from cloudxxx8 November 6, 2020 08:36
@cloudxxx8
Copy link
Member

recheck

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

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

LGTM

@cloudxxx8 cloudxxx8 merged commit e390d2e into edgexfoundry:master Nov 6, 2020
@weichou1229 weichou1229 deleted the issue-2870 branch July 15, 2021 03:32
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.

Overflows int errors on 32bit ARM build after v1.2.2-dev.79
3 participants