Skip to content

Fix NuGet lock files and enforce them not changing accidentally #14611

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 3 commits into from
Apr 29, 2025

Conversation

jonthysell
Copy link
Contributor

@jonthysell jonthysell commented Apr 23, 2025

Description

This PR fixes NuGet lock files so they're more correct/compliant, and makes it easier to keep them that way.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Why

We recently updated to WinAppSDK 1.7 and have made other changes to the flavors we build (with different dependencies) so our lock files were out of date / constantly overriding one another.

What

This PR fixes NuGet lock files so they're more correct/compliant. This includes:

  1. Updating the NuGetRestoreForceEvaluateAllSolutions.ps1 script to completely fix the lock files
  2. Ensuring every project has a proper packages.lock.json file for its default configuration
  3. Ensuring projects that are built old AND new arch also have a separate newarch lock file
  4. Ensuring projects that are build with/without experimental WinUI3 also have a separate experimentalwinui3 lock file
  5. Causing an (optional) CI build error if the lock files change during the build (they shouldn't) with message to re-run the script
  6. Removed all unnecessary packages.config files which confuse NuGet restoration

Screenshots

N/A

Testing

Verified no complaints about changed lock files after builds in the pipeline.

Changelog

Should this change be included in the release notes: no

Microsoft Reviewers: Open in CodeFlow

@jonthysell jonthysell changed the title [WIP] Fix NuGet lock files Fix NuGet lock files Apr 23, 2025
@jonthysell jonthysell changed the title Fix NuGet lock files Fix NuGet lock files and enforce them not changing Apr 23, 2025
@jonthysell jonthysell changed the title Fix NuGet lock files and enforce them not changing Fix NuGet lock files and enforce them not changing accidentally Apr 23, 2025
@jonthysell jonthysell added Area: Compliance Workstream: ES Compliance SFI Provide regular ES infrastructure and ensure RNW meets internal security and compliance requirements labels Apr 24, 2025
@jonthysell jonthysell force-pushed the packagelockfiles branch 2 times, most recently from 3abbc69 to 2b40240 Compare April 24, 2025 22:32
## Description

This PR fixes NuGet lock files so they're more correct/compliant.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
We recently updated to WinAppSDK 1.7 and have made other changes to the flavors we build (with different dependencies) so our lock files were out of date / constantly overriding one another.

### What

This PR fixes NuGet lock files so they're more correct/compliant. This includes:

1. Updating the `NuGetRestoreForceEvaluateAllSolutions.ps1` script to completely fix the lock files
2. Ensuring every project has a proper `packages.lock.json` file for its default configuration
3. Ensuring projects that are built old AND new arch also have a separate `newarch` lock file
4. Ensuring projects that are build with/without experimental WinUI3 also have a separate `experimentalwinui3` lock file
5. Causing an (optional) CI build error if the lock files change during the build (they shouldn't) with message to re-run the script
6. Removed all unnecessary `packages.config` files which confuse NuGet restoration

## Screenshots
N/A

## Testing
Verified no complaints about changed lock files after builds in the pipeline.

## Changelog
Should this change be included in the release notes: _no_

# This is the commit message #2:

Fix integration-test

# This is the commit message #3:

fix integration test
@jonthysell jonthysell marked this pull request as ready for review April 24, 2025 23:47
@jonthysell jonthysell requested review from a team as code owners April 24, 2025 23:47
@jonthysell jonthysell enabled auto-merge (squash) April 24, 2025 23:47
@jonthysell jonthysell merged commit 99b2a74 into microsoft:main Apr 29, 2025
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Compliance Workstream: ES Compliance SFI Provide regular ES infrastructure and ensure RNW meets internal security and compliance requirements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants