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

v3.6.1 #64

Merged
merged 3 commits into from
Nov 25, 2024
Merged

v3.6.1 #64

merged 3 commits into from
Nov 25, 2024

Conversation

Afischbacher
Copy link
Owner

No description provided.

Modified the `Total` property in `PlayerRealtimeStatisticsFilterResult` to have a default value of 0. Changed `HitsPer60` and `TakeawaysPer60` in `PlayerRealtimeStatisticsResult` to nullable doubles. Updated several properties in `PlayerStatisticsResult` from non-nullable to nullable types, including `GameWinningGoals`, `GamesPlayed`, `Goals`, `OvertimeGoals`, `PenaltyMinutes`, `Points` (int to int?) and `PointsPerGame` (decimal to decimal?). Changed `Total` in `PlayerTimeOnIceStatisticsFilterResult` from int to int?. Updated multiple properties in `PlayerTimeOnIceStatisticsResult` from non-nullable to nullable types, including `EvTimeOnIce`, `GamesPlayed`, `OtTimeOnIce`, `PpTimeOnIce`, `SeasonId`, `ShTimeOnIce`, `Shifts`, `TimeOnIce` (int to int?) and `EvTimeOnIcePerGame`, `OtTimeOnIcePerOtGame`, `PpTimeOnIcePerGame`, `ShTimeOnIcePerGame`, `ShiftsPerGame` (double to double?).
Updated the version number from 3.6.0 to 3.6.1 in the following files:
- Nhl.Api.Common.csproj
- Nhl.Api.Domain.csproj
- Nhl.Api.Tests.csproj
- Nhl.Api.csproj
Changed SeasonId in PlayerTimeOnIceStatisticsResult from int? to int.
This ensures SeasonId always has a valid integer value, preventing
potential null reference issues in the code.
Copy link
Contributor

coderabbitai bot commented Nov 25, 2024

📝 Walkthrough

Walkthrough

The pull request includes updates across several project files, primarily focusing on incrementing the version number from 3.6.0 to 3.6.1 in multiple .csproj files. Additionally, it modifies several properties in the PlayerRealtimeStatisticsResult, PlayerStatisticsResult, and PlayerTimeOnIceStatisticsResult classes, changing their data types from non-nullable to nullable to allow for the representation of absent data.

Changes

File Path Change Summary
Nhl.Api.Common/Nhl.Api.Common.csproj Version updated from 3.6.0 to 3.6.1.
Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs Properties HitsPer60 and TakeawaysPer60 changed from double to double?.
Nhl.Api.Domain/Models/Statistics/PlayerStatisticsFilterResult.cs Properties GameWinningGoals, GamesPlayed, Goals, OvertimeGoals, PenaltyMinutes, Points, and PointsPerGame changed from int/decimal to int?/decimal?.
Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs Properties EvTimeOnIce, EvTimeOnIcePerGame, OtTimeOnIce, OtTimeOnIcePerOtGame, PpTimeOnIce, PpTimeOnIcePerGame, ShTimeOnIce, ShTimeOnIcePerGame, and TimeOnIce changed from non-nullable to nullable types.
Nhl.Api.Domain/Nhl.Api.Domain.csproj Version updated from 3.6.0 to 3.6.1. Removed compile and embedded resource entries from various model directories.
Nhl.Api.Tests/Nhl.Api.Tests.csproj Version updated from 3.6.0 to 3.6.1.
Nhl.Api/Nhl.Api.csproj Version updated from 3.6.0 to 3.6.1.

Possibly related PRs

  • v3.4.2 #56: The changes in this PR involve updating the version number in the Nhl.Api.Common.csproj file, which is directly related to the version update in the main PR's Nhl.Api.Common.csproj.
  • v3.5.0 #60: Similar to the main PR, this PR also updates the version number in the Nhl.Api.csproj file, indicating a consistent versioning approach across multiple project files.

Poem

In the land of stats, where players play,
We changed some numbers in a clever way.
Nullable now, they can be shy,
With version bumps, we reach for the sky!
Hops and skips, our code’s in tune,
Celebrating changes, we dance to the moon! 🐇✨


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs (1)

Line range hint 33-141: Consider updating documentation for nullable properties

While the changes to make these properties nullable are appropriate, consider updating the XML documentation comments to indicate that these values can be null and under what circumstances (e.g., "Can be null if the player had no even-strength time on ice or if the data is unavailable").

Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs (1)

Line range hint 77-78: Consider making GiveawaysPer60 nullable for consistency

The GiveawaysPer60 property is still non-nullable while similar per60 statistics properties (BlockedShotsPer60, HitsPer60, TakeawaysPer60) are nullable. Consider making this property nullable as well for consistency.

- public double GiveawaysPer60 { get; set; }
+ public double? GiveawaysPer60 { get; set; }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4ad27d0 and 056cdf8.

📒 Files selected for processing (7)
  • Nhl.Api.Common/Nhl.Api.Common.csproj (1 hunks)
  • Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs (2 hunks)
  • Nhl.Api.Domain/Models/Statistics/PlayerStatisticsFilterResult.cs (3 hunks)
  • Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs (5 hunks)
  • Nhl.Api.Domain/Nhl.Api.Domain.csproj (1 hunks)
  • Nhl.Api.Tests/Nhl.Api.Tests.csproj (1 hunks)
  • Nhl.Api/Nhl.Api.csproj (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • Nhl.Api.Common/Nhl.Api.Common.csproj
  • Nhl.Api.Domain/Nhl.Api.Domain.csproj
  • Nhl.Api.Tests/Nhl.Api.Tests.csproj
  • Nhl.Api/Nhl.Api.csproj
🔇 Additional comments (8)
Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs (6)

33-33: LGTM: Even strength time properties are now nullable

The change to make EvTimeOnIce and EvTimeOnIcePerGame nullable is appropriate as these statistics might not be available for all scenarios.

Also applies to: 39-39


57-57: LGTM: Overtime properties are now nullable

Making OtTimeOnIce and OtTimeOnIcePerOtGame nullable is logical since not all games go to overtime.

Also applies to: 63-63


81-81: LGTM: Power play properties are now nullable

The change to make PpTimeOnIce and PpTimeOnIcePerGame nullable is appropriate as not all games will have power play situations.

Also applies to: 87-87


99-99: LGTM: Short-handed properties are now nullable

Making ShTimeOnIce and ShTimeOnIcePerGame nullable aligns with the other special team statistics changes.

Also applies to: 105-105


141-141: LGTM: Total time property is now nullable

Making TimeOnIce nullable is consistent with the other time-related property changes.

Let's verify that all time-related properties in the codebase are consistently nullable:

✅ Verification successful

The previous ast-grep patterns might have been too strict. Let's use ripgrep to find any mentions of TimeOnIce properties with surrounding context to verify the consistency of nullability.


All time-related properties are consistently nullable in the codebase

The search results confirm that all time-on-ice related properties in the PlayerTimeOnIceStatisticsFilterResult class are consistently nullable, including:

  • TimeOnIce
  • EvTimeOnIce
  • OtTimeOnIce
  • PpTimeOnIce
  • ShTimeOnIce
  • TimeOnIcePerGame
  • TimeOnIcePerShift

The only non-nullable time-on-ice property found is in TeamSeasonStatistics class, which is a different context and not related to player statistics.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining non-nullable time-on-ice properties
ast-grep --pattern 'public int TimeOnIce { get; set; }'
ast-grep --pattern 'public double TimeOnIce { get; set; }'

Length of output: 118


Script:

#!/bin/bash
# Search for any time-on-ice properties with broader pattern matching
rg -i "timeonice" -A 1 -B 1

Length of output: 31084


Line range hint 33-141: Verify data consumers handle null values

These changes make the model more accurate but could potentially break existing consumers that aren't prepared to handle null values.

Let's check for direct property access that might need null checking:

Consider:

  1. Adding validation or default value handling in the property getters
  2. Documenting the breaking change in release notes
  3. Providing migration guidance for consumers
✅ Verification successful

Let me gather more information about the usage of these nullable properties by checking for any direct property access in test files and implementations.


Let me try one more search pattern to find any direct usage of these properties:


Let me try one final search with the PCRE2 flag to find direct property usage:


Nullable time-on-ice properties are safe to introduce

Based on the codebase analysis, making these properties nullable is safe because:

  1. The properties are only used in API responses through PlayerTimeOnIceStatisticsFilterResult
  2. The model is properly decorated with JSON attributes for serialization/deserialization
  3. No direct property access or calculations were found in the codebase that could be affected by null values
  4. The only usages are in API contracts where null values are already expected and handled
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for direct property access that might need null checking
rg -t cs "\.EvTimeOnIce|\.PpTimeOnIce|\.ShTimeOnIce|\.OtTimeOnIce|\.TimeOnIce"

Length of output: 1217


Script:

#!/bin/bash
# Search for test assertions or property usage in test files
rg -t cs "Assert.*\.(?:EvTimeOnIce|PpTimeOnIce|ShTimeOnIce|OtTimeOnIce|TimeOnIce)[^P]" -A 2

# Search for implementations that might be affected
ast-grep --pattern 'var $_ = $$.TimeOnIce'
ast-grep --pattern '$$.TimeOnIce = $_'

Length of output: 179


Script:

#!/bin/bash
# Search for any usage of these properties in the codebase
rg -t cs "(?<!\.Get)TimeOnIce\W" -A 2

# Also check if there are any consumers of this model
rg -t cs "PlayerTimeOnIceStatisticsFilterResult" -A 2

Length of output: 2844


Script:

#!/bin/bash
# Search for any usage of these properties in the codebase with PCRE2
rg -t cs --pcre2 "(?<!\.Get)TimeOnIce\W" -A 2

# Also check for any serialization/deserialization usage
rg -t cs "JsonConvert.*PlayerTimeOnIceStatisticsFilterResult" -A 2

Length of output: 9147

Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs (1)

93-93: LGTM! Nullable property changes align with the codebase pattern

The changes to make HitsPer60 and TakeawaysPer60 nullable are consistent with the overall pattern of allowing statistics properties to represent absent data.

Also applies to: 189-189

Nhl.Api.Domain/Models/Statistics/PlayerStatisticsFilterResult.cs (1)

62-62: LGTM! Making these properties nullable aligns with the domain model.

The changes to make these statistics properties nullable is a good improvement as:

  • It matches the pattern of other similar properties in the class that are already nullable
  • It better represents the domain where not all statistics may be available
  • The XML documentation already indicates null values are possible for some properties

Also applies to: 69-69, 76-76, 90-90, 97-97, 118-118, 125-125

@Afischbacher Afischbacher merged commit 27294aa into master Nov 25, 2024
4 checks passed
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.

1 participant