-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fixed serializer so Empty Guid and Zero timespan won't get serialized #3794
Conversation
Also refactored the code for serializer wherever applicable
This reverts commit 3ed2ffb.
Warning Rate limit exceeded@Maheshkale447 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 10 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe updates involve introducing a new LUTConfig configuration file, modifying code formatting preferences, enhancing serialization logic, and restructuring test files and project configurations. These changes focus on improving build and test processes, code maintainability, and namespace organization. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range and nitpick comments (4)
Ginger/GingerCoreCommonTest/DevelopmentTimeTest/DevelopmentTimeForBFTest.cs (4)
Line range hint
16-26
: Consider Using a Stopwatch for Accurate TimingCurrently, the method uses
Thread.Sleep
and manual time checks. Consider using aStopwatch
for more accurate and reliable timing measurements in tests.+ Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); - Thread.Sleep(1000); + stopwatch.Stop(); + Assert.IsTrue(stopwatch.ElapsedMilliseconds >= 1000);
Line range hint
31-41
: Redundant Thread.Sleep CallsThe use of
Thread.Sleep
in unit tests can lead to inefficient tests and should be minimized or replaced with more appropriate timing/assertion mechanisms.Consider using mocking frameworks to simulate timing behaviors or other approaches that do not rely on real-time delays.
Line range hint
46-56
: Inconsistent Timing MechanismSimilar to previous methods, consider refactoring to use
Stopwatch
for consistent and accurate timing checks across all tests.+ Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); - Thread.Sleep(1000); + stopwatch.Stop(); + Assert.IsTrue(stopwatch.ElapsedMilliseconds >= 1000);
Line range hint
61-71
: Avoid Direct Thread.Sleep in TestsDirect use of
Thread.Sleep
can make tests flaky and slow. Consider alternatives for simulating or controlling time in unit tests.Explore using
Task.Delay
with asynchronous test methods or other time manipulation techniques.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- Ginger/Ginger.lutconfig (1 hunks)
- Ginger/GingerCoreCommon/.editorconfig (1 hunks)
- Ginger/GingerCoreCommon/Repository/NewRepositorySerializer.cs (30 hunks)
- Ginger/GingerCoreCommonTest/DevelopmentTimeTest/DevelopmentTimeForBFTest.cs (1 hunks)
- Ginger/GingerCoreCommonTest/GingerCoreCommonTest.csproj (1 hunks)
Files skipped from review due to trivial changes (3)
- Ginger/Ginger.lutconfig
- Ginger/GingerCoreCommon/.editorconfig
- Ginger/GingerCoreCommonTest/GingerCoreCommonTest.csproj
Additional comments not posted (2)
Ginger/GingerCoreCommonTest/DevelopmentTimeTest/DevelopmentTimeForBFTest.cs (1)
11-11
: Namespace Adjustment ApprovedThe namespace change from
GingerCoreCommonTest.DevelopmentTimeTest
toGingerCoreCommonTest
is logical for broadening the scope of the class. This aligns with the PR objectives and summary.Ginger/GingerCoreCommon/Repository/NewRepositorySerializer.cs (1)
62-62
: Constant Declaration ApprovedDeclaring
UTF8_ENCODING
as a constant is a good practice for maintainability and reusability of the code.
…on/Ginger into BugFix/EmptyGuid
Also refactored the code for serializer wherever applicable
Thank you for your contribution.
Before submitting this PR, please make sure:
Summary by CodeRabbit
New Features
Enhancements
Refactor
.editorconfig
file as a linked item in the test project for consistent code formatting.Style