Skip to content

Enable nullable annotations for ProjectModel lock file types - #7718

Merged
nkolev92 merged 7 commits into
devfrom
dev-nkolev92-projectModelNullable
Oct 6, 2026
Merged

nkolev92 merged 7 commits into
devfrom
dev-nkolev92-projectModelNullable

Conversation

@nkolev92

@nkolev92 nkolev92 commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Bug

Progress: NuGet/Home#14779

Description

Enables nullable reference type annotations for an initial set of NuGet.ProjectModel lock-file contracts.

The packages lock-file models now enforce required dependency IDs and target frameworks during initialization, while version ranges, resolved versions, content hashes, runtime identifiers, and aliases remain nullable where the file formats legitimately omit them. The unused PackagesLockFile.Path API is retained for compatibility and marked obsolete.

Asset log messages and build actions now expose honest nullable contracts for optional project, file, library, target-graph, and default-struct data. Required message inputs fail fast, while absent target graphs remain null so assets-file serialization continues to omit the property rather than emitting an empty array.

Lock-file items now require non-null paths, expose optional content-file and runtime-target metadata as nullable, and remove optional backing properties when assigned null. The UTF-8 item converter validates required JSON names and preserves absent property values. Public API annotations and downstream adapters were updated, with focused tests covering the new runtime guarantees.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 013e85dd-74c4-4fc3-8d86-3630d49e8e6d
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 013e85dd-74c4-4fc3-8d86-3630d49e8e6d
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 013e85dd-74c4-4fc3-8d86-3630d49e8e6d
@nkolev92 nkolev92 changed the title Enable nullable annotations for packages lock file models Enable nullable annotations for ProjectModel lock file types Sep 17, 2026
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 013e85dd-74c4-4fc3-8d86-3630d49e8e6d
This reverts commit f89108b.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 013e85dd-74c4-4fc3-8d86-3630d49e8e6d
@nkolev92
nkolev92 marked this pull request as ready for review September 18, 2026 20:06
@nkolev92
nkolev92 requested a review from a team as a code owner September 18, 2026 20:06
@zivkan zivkan added the Merge next release PRs that should not be merged until the dev branch targets the next release label Sep 25, 2026
@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Oct 4, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 15 days of this comment, unless it has a "Status:Do not auto close" label. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch.

@nkolev92
nkolev92 merged commit 8f5178b into dev Oct 6, 2026
18 checks passed
@nkolev92
nkolev92 deleted the dev-nkolev92-projectModelNullable branch October 6, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merge next release PRs that should not be merged until the dev branch targets the next release Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants