Skip to content

chore: make random sequence resolver more random #80

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

Merged
merged 1 commit into from
Apr 30, 2025

Conversation

godruoyi
Copy link
Owner

@godruoyi godruoyi commented Apr 30, 2025

  1. The default workId and datacenterId will be randomly between 0 and 31 if not set.
  2. A more random algorithm is used to generate sequence numbers in the RandomSequenceResolver.

This is a breaking change as we have updated the default behavior when creating a Snowflake instance.

@godruoyi godruoyi requested a review from Copilot April 30, 2025 07:47
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the README documentation to improve clarity in the instructions regarding Snowflake and Sonyflake usage, with a special focus on the new random sequence resolver feature.

  • Corrected phrasing for better grammatical clarity.
  • Added an example code snippet to demonstrate setting up the random sequence resolver.
  • Reordered and renumbered the usage steps for consistency.
Files not reviewed (7)
  • src/RandomSequenceResolver.php: Language not supported
  • src/Snowflake.php: Language not supported
  • tests/FileLockResolverTest.php: Language not supported
  • tests/PredisSequenceResolverTest.php: Language not supported
  • tests/RandomSequenceResolverTest.php: Language not supported
  • tests/RedisSequenceResolverTest.php: Language not supported
  • tests/SwooleSequenceResolverTest.php: Language not supported

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.16%. Comparing base (dec895d) to head (21c07b7).
Report is 7 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #80      +/-   ##
============================================
+ Coverage     98.71%   99.16%   +0.44%     
- Complexity       91       94       +3     
============================================
  Files             7        8       +1     
  Lines           234      240       +6     
============================================
+ Hits            231      238       +7     
+ Misses            3        2       -1     

☔ View full report in Codecov by Sentry.
📢 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.

@godruoyi godruoyi added the Ready to release Ready to push to master and then publish a new version label Apr 30, 2025
@godruoyi godruoyi merged commit f0dbd16 into master Apr 30, 2025
6 checks passed
@godruoyi godruoyi deleted the godruoyi/make-random-resolver-more-random branch April 30, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to release Ready to push to master and then publish a new version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants