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

switch to math/rand/v2 #852

Merged
merged 3 commits into from
Oct 11, 2024
Merged

switch to math/rand/v2 #852

merged 3 commits into from
Oct 11, 2024

Conversation

libotony
Copy link
Member

@libotony libotony commented Sep 23, 2024

Description

This PR switched to math/rand/v2, which enhanced the randomness along with improved API design. Also moved the gosec action into lint.yaml. Ref https://go.dev/blog/randv2

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • New and existing E2E tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have not added any vulnerable dependencies to my code

@libotony libotony requested a review from a team as a code owner September 23, 2024 08:53
@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 62.60%. Comparing base (a0e5a44) to head (d198040).

Files with missing lines Patch % Lines
cache/rnd_cache.go 50.00% 1 Missing ⚠️
comm/peer.go 0.00% 1 Missing ⚠️
p2psrv/rpc/rpc.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #852      +/-   ##
==========================================
- Coverage   62.63%   62.60%   -0.03%     
==========================================
  Files         209      209              
  Lines       18952    18946       -6     
==========================================
- Hits        11870    11862       -8     
- Misses       5982     5983       +1     
- Partials     1100     1101       +1     

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

.github/workflows/gosec.yaml Outdated Show resolved Hide resolved
.golangci.yml Outdated Show resolved Hide resolved
@libotony
Copy link
Member Author

Consensus from after standup discussion:

The linting process should maintain the same behavior as the CI/CD pipeline, so we have two options:

  • Keep gosec in golanglint-ci and make standalone gosec action only reports warning
    Or
  • If step one is not possible, add gosec into make lint

@otherview @paologalligit

@darrenvechain
Copy link
Member

@libotony shouldn't gosec be fully configurable inside golanglint?

https://golangci-lint.run/usage/linters/#gosec

@libotony
Copy link
Member Author

@libotony shouldn't gosec be fully configurable inside golanglint?

https://golangci-lint.run/usage/linters/#gosec

#846 Added the standalone gosec action, which is updated to the latest gosec while the gosec inside golanglint-ci is falling behind.

@darrenvechain
Copy link
Member

@libotony looks like we just need to update to latest golanglint:

https://github.com/golangci/golangci-lint/blob/v1.61.0/go.mod#L95

@libotony libotony marked this pull request as draft September 26, 2024 10:09
@libotony libotony force-pushed the tony/math/rand/v2 branch 2 times, most recently from 6f8e578 to 413ca46 Compare September 26, 2024 10:45
@libotony libotony marked this pull request as ready for review September 26, 2024 10:50
darrenvechain
darrenvechain previously approved these changes Oct 8, 2024
@otherview
Copy link
Member

Consensus from after standup discussion:

The linting process should maintain the same behavior as the CI/CD pipeline, so we have two options:

  • Keep gosec in golanglint-ci and make standalone gosec action only reports warning
    Or
  • If step one is not possible, add gosec into make lint

@otherview @paologalligit

I think this got a bit muddled over the last few weeks.

AFAIR the decision was to maintain the current linter while updating it as need AND introduce a new GH action specific for gosec running at the latest version.

otherview
otherview previously approved these changes Oct 9, 2024
otherview
otherview previously approved these changes Oct 9, 2024
@libotony libotony merged commit 175050c into master Oct 11, 2024
15 checks passed
@libotony libotony deleted the tony/math/rand/v2 branch October 11, 2024 08:16
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.

5 participants