Skip to content

Change default workload set use to 'true' #45936

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 11 commits into from
Feb 6, 2025

Conversation

Forgind
Copy link
Contributor

@Forgind Forgind commented Jan 13, 2025

Starting this as a draft because I can almost guarantee that some test will fail.

@ghost ghost added Area-Workloads untriaged Request triage from a team member labels Jan 13, 2025
@@ -40,6 +40,8 @@ public override string ToString()
{
return JsonSerializer.Serialize<InstallStateContents>(this, s_options);
}

public bool ShouldUseWorkloadSets() => UseWorkloadSets ?? true;
Copy link
Member

Choose a reason for hiding this comment

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

excellent idea - nitpick though - should use workload sets be hidden in some way so that we don't use it accidentally in the codebase, instead always going through your new helper?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, JsonSerializer doesn't serialize private properties without a good bit of extra work:
https://stackoverflow.com/questions/61869393/get-net-core-jsonserializer-to-serialize-private-members

Good idea, though 🙂

Copy link
Member

@baronfel baronfel Jan 16, 2025

Choose a reason for hiding this comment

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

crazier idea - maybe add the [EditorBrowsable(EditorBrowsableState.Never)] attribute to UseWorkloadSets to hide it from completion? I love this little hack: https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.editorbrowsableattribute?view=net-9.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Never heard of that, but that should be doable!

Copy link
Member

Choose a reason for hiding this comment

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

Did you get a chance to try this out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, forgot to. Now I'm split because I think it's a positive change, but I'm pretty reluctant to retrigger tests when they're passing for a once...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently this doesn't work anyway, unfortunately. It isn't available on some of the frameworks where it's needed:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wait, I'm probably stupid? That seems like an editor bug; it should be available on net10.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After a bit more poking around, I suspect this just doesn't work properly in my IDE, so I'll push the change. If it fails, I can revert it.

@Forgind Forgind marked this pull request as ready for review February 3, 2025 20:22
@@ -37,7 +37,8 @@ public void GivenNoWorkloadsAreInstalledListIsEmpty()
command.Execute();

// Expected number of lines for table headers
_reporter.Lines.Count.Should().Be(6);
// Expecting a workload set adds two lines
Copy link
Member

Choose a reason for hiding this comment

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

This comment was helpful, thanks :)

Copy link
Member

@nagilson nagilson left a comment

Choose a reason for hiding this comment

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

I like this approach for turning it on; this was well designed! It looks good to me, though I think we should announce when we make workload sets on by default. I dont think we've been very public about workload sets or probably most people dont know what they are.

Is there an announcement page for this or a breaking change doc we're going to have?

@Forgind Forgind merged commit 9801e2d into dotnet:main Feb 6, 2025
37 checks passed
@Forgind Forgind deleted the make-sets-default branch February 6, 2025 23:47
@Forgind Forgind added breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug and removed untriaged Request triage from a team member labels Feb 6, 2025
Copy link
Contributor

dotnet-policy-service bot commented Feb 6, 2025

Added needs-breaking-change-doc-created label because this PR has the breaking-change label.

When you commit this breaking change:

  1. Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
  2. Ask a committer to mail the .NET Breaking Change Notification DL.

Tagging @dotnet/compat for awareness of the breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Workloads breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug needs-breaking-change-doc-created
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants