Skip to content

Enable nullability for ToolStripTemplateNode #13401

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Apr 30, 2025

Enable nullability for ToolStripTemplateNode

Microsoft Reviewers: Open in CodeFlow

@LeafShi1 LeafShi1 requested a review from a team as a code owner April 30, 2025 07:26
@LeafShi1 LeafShi1 requested review from Copilot and removed request for a team April 30, 2025 07:26
@LeafShi1 LeafShi1 requested a review from ricardobossan April 30, 2025 07:26
@LeafShi1 LeafShi1 requested a review from Epica3055 April 30, 2025 07:27
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 pull request enables nullable annotations on ToolStripTemplateNode and updates its related code to support nullability. Key changes include:

  • Removal of "#nullable disable" and updating field types with nullable annotations
  • Adjustments to method signatures and null-check logic using null-conditional operations
  • Updates to castings and service retrieval patterns to accommodate potential null values

@Tanya-Solyanik
Copy link
Contributor

Tanya-Solyanik commented Apr 30, 2025

@LeafShi1 - this PR got labeled as 'area: NRT' by 2 tools, by https://github.com/dotnet/winforms/blob/main/.github/policies/resourceManagement.yml and by https://github.com/dotnet/winforms/blob/main/.github/workflows/labeler-predict-pulls.yml, could you please remove the rule that adds this label from the resourceManagement bot?
Also, going forward we should use area- prefix because labeler works with it.

Copy link

codecov bot commented May 6, 2025

Codecov Report

Attention: Patch coverage is 4.22535% with 136 lines in your changes missing coverage. Please review.

Project coverage is 62.72004%. Comparing base (a345d2c) to head (cb9f820).
Report is 14 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13401         +/-   ##
===================================================
- Coverage   62.72868%   62.72004%   -0.00864%     
===================================================
  Files           1561        1562          +1     
  Lines         159997      160027         +30     
  Branches       14918       14960         +42     
===================================================
+ Hits          100364      100369          +5     
- Misses         58856       58883         +27     
+ Partials         777         775          -2     
Flag Coverage Δ
Debug 62.72004% <4.22535%> (-0.00864%) ⬇️
integration 11.33488% <0.00000%> (+0.00168%) ⬆️
production 40.91164% <4.22535%> (-0.00756%) ⬇️
test 95.70296% <ø> (ø)
unit 38.31541% <4.22535%> (-0.00778%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Tanya-Solyanik
Copy link
Contributor

@LeafShi1 - could you please factor out the bot fix to merge it ASAP? I have concerns about the nullability changes, I feel that site or DesignHost being null is an indication of a bigger problem - template node is a design time element and it should not be instantiated outside the designer. I need to investigate this scenario, i.e. I guess that inproc designer would throw a null reference exception in this case.

@LeafShi1
Copy link
Member Author

LeafShi1 commented May 7, 2025

@LeafShi1 - could you please factor out the bot fix to merge it ASAP? I have concerns about the nullability changes, I feel that site or DesignHost being null is an indication of a bigger problem - template node is a design time element and it should not be instantiated outside the designer. I need to investigate this scenario, i.e. I guess that inproc designer would throw a null reference exception in this case.

Revert the changes in resourceManagement.yml and put it in a separate PR #13417

@LeafShi1 LeafShi1 force-pushed the Enable-nullability-for-ToolStripTemplateNode branch from 864eb5e to cb9f820 Compare May 7, 2025 02:06
@LeafShi1 LeafShi1 removed the area: NRT label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants