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

Permit loose manifest priority #41996

Merged
merged 3 commits into from
Jul 17, 2024
Merged

Conversation

Forgind
Copy link
Member

@Forgind Forgind commented Jul 5, 2024

Description

If the user opts into using workload sets, installs a workload set, then tries to switch back to using loose manifests, we correctly permit installing or updating to loose manifests, but we do not garbage collect the workload sets, both because garbage collection isn't yet implemented for workload sets and because we would keep the latest workload set regardless. That workload set is still findable, therefore, and when the user tries dotnet workload --version, dotnet workload update --print-rollback, or anything else that uses the resolver to find workloads, it uses the workload set instead of correctly switching back to loose manifests.

Customer Impact

Customers who ever use workload sets can never use loose manifests again unless they follow manual steps to delete their workload set(s).

Regression

No; the resolver always worked this way, but workload sets didn't exist, so it wasn't an issue.

Risk

Low. Relatively few people are using workload sets, and this is changing behavior to align with what the user explicitly requested (or got by using a rollback file), so it changes behavior to align with user expectations. If they'd switched to loose manifests by accident (somehow?), they can always switch back very easily.

Testing

Changed automated tests to account for the change and walked through one in a debugger to make sure it did what I'd expect.

Copy link
Member

@dsplaisted dsplaisted left a comment

Choose a reason for hiding this comment

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

Initially I didn't fully understand your change, so I made a version of the change myself: dsplaisted@3c54769

On looking at your change a second time, I think it generally works (I had missed the early return statement). However it looks like your change may not respect global.json or a workload set version passed in via the constructor, both of which it should do.

Since this is a change to the resolver which goes into full VS, I think we should consider taking this change for 8.0.4xx if we can. @marcpopMSFT

@marcpopMSFT
Copy link
Member

So the primary change is adding installState.UseWorkloadSets == true to the check, correct? That seems pretty safe and isolated to add. Any concerns with taking this for 8.0.4xx?

@Forgind
Copy link
Member Author

Forgind commented Jul 9, 2024

So the primary change is adding installState.UseWorkloadSets == true to the check, correct? That seems pretty safe and isolated to add. Any concerns with taking this for 8.0.4xx?

Not from me. @dsplaisted?

If it's agreed to, I'll rebase on 8.0.4xx.

@Forgind Forgind force-pushed the set-not-priority branch from e37b7cf to 0bed9c1 Compare July 9, 2024 13:29
@Forgind Forgind changed the base branch from main to release/8.0.4xx July 9, 2024 13:29
@Forgind Forgind force-pushed the set-not-priority branch from 0bed9c1 to 769b812 Compare July 9, 2024 18:03
Copy link
Member

@dsplaisted dsplaisted left a comment

Choose a reason for hiding this comment

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

It would be good to have some tests for this, be they functional and/or VM-based MSI tests.

@Forgind
Copy link
Member Author

Forgind commented Jul 23, 2024

/backport to main

Copy link
Contributor

Started backporting to main: https://github.com/dotnet/sdk/actions/runs/10063639987

Copy link
Contributor

@Forgind backporting to main failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Permit loose manifest priority
Using index info to reconstruct a base tree...
M	src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs
A	src/Tests/Microsoft.NET.Sdk.WorkloadManifestReader.Tests/SdkDirectoryWorkloadManifestProviderTests.cs
Falling back to patching base and 3-way merge...
Auto-merging test/Microsoft.NET.Sdk.WorkloadManifestReader.Tests/SdkDirectoryWorkloadManifestProviderTests.cs
Auto-merging src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs
CONFLICT (content): Merge conflict in src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Permit loose manifest priority
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

@Forgind an error occurred while backporting to main, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@Forgind Forgind modified the milestones: 8.0.4xx, 8.0.8 Jul 23, 2024
@Forgind Forgind mentioned this pull request Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Workloads Servicing-approved untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants