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

Add support for .NET workload sets #14083

Merged
merged 9 commits into from
Oct 20, 2023
Merged

Add support for .NET workload sets #14083

merged 9 commits into from
Oct 20, 2023

Conversation

joeloff
Copy link
Member

@joeloff joeloff commented Oct 5, 2023

Description

Add support for generating workload set MSIs from a workload set NuGet package as described here.

Changes include

  • Refactoring common properties for workload creation tasks into a base class since we now have two tasks
  • Cleaning up the directory template to use fragments and share directory table authoring across multiple MSIs
  • Additional tests to verify generated workload set installers
  • Explicit test package versions in the unit test project. These are very specific versions and should rarely change. Placing them in versions.props doesn't provide much benefit.
  • Additional package group type metadata to distinguish between workload manifest and workload set package groups for inserting to Visual Studio

@joeloff joeloff requested a review from a team October 5, 2023 18:00
Co-authored-by: Noah Gilson <OTAKUPENGUINOP@GMAIL.COM>
MiYanni
MiYanni previously approved these changes Oct 6, 2023
Copy link
Member

@MiYanni MiYanni left a comment

Choose a reason for hiding this comment

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

I might not know the full context of how these changes operate, but the code looked really clean to me. Big thumbs up from me. 👍

string platform = kvp.Key;

// The key is the paths to the packages included in the pack group, sorted in alphabetical order
string uniquePackGroupKey = string.Join("\r\n", kvp.Value.Select(p => p.PackagePath).OrderBy(p => p));
Copy link
Member

Choose a reason for hiding this comment

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

nit: You can use Environment.NewLine instead of hard-coded "\r\n".

swixProjectItem.SetMetadata(Metadata.PackageType, DefaultValues.PackageTypeMsiPack);
swixProjectItem.SetMetadata(Metadata.IsPreview, "false");
ITaskItem swixProjectItem = new TaskItem(swixProj);
swixProjectItem.SetMetadata(Metadata.SdkFeatureBand, $"{sdkFeatureBand}");
Copy link
Member

Choose a reason for hiding this comment

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

Is $"{sdkFeatureBand}" basically being used as sdkFeatureBand.ToString()?

Copy link
Member Author

Choose a reason for hiding this comment

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

yup, I'm embracing interpolation

Copy link
Member

Choose a reason for hiding this comment

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

The bold AND the brave only embrace interpolation so... fearlessly. 😜 I wonder if the IL ends up any different. I just hadn't seen someone use string interpolation for single-values before.

joeloff and others added 2 commits October 6, 2023 16:22
Co-authored-by: Michael Yanni <MiYanni@microsoft.com>
@mmitche
Copy link
Member

mmitche commented Oct 10, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

nagilson
nagilson previously approved these changes Oct 12, 2023
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 have more questions than really anything else... I don't understand this all too well, but it seems reasonable given the knowledge I do have. If there is someone out there with this domain knowledge, it'd be best to have their review too.

dsplaisted
dsplaisted previously approved these changes Oct 16, 2023
/// <summary>
/// Set of NuGet packages containing workload sets.
/// </summary>
public ITaskItem[] WorkloadSetPackageFiles
Copy link
Member

Choose a reason for hiding this comment

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

Do we ever expect there to be more than one of these packages passed to the task?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably not, but if we ever needed it, we won't need an Arcade update.

}

Msis = msiItems.ToArray();
SwixProjects = swixProjectItems.ToArray();
Copy link
Member

Choose a reason for hiding this comment

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

I think for the baseline workload sets, which will be created in the installer repo, we will want to create the MSIs, but we won't insert the authoring into Visual Studio. Will we be able to filter out the VS authoring appropriately?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Right now the tasks generate the projects for those, but it's up to the repo to decided whether or not it wants to build those projects. Here's an example where the runtime builds the swix projects: https://github.com/dotnet/runtime/blob/ccc475ed5646abe71ef596702d06e78e34981736/src/workloads/workloads.csproj#L179

Alternatively we could add a parameter that controls generating the swixprojects.

@joeloff
Copy link
Member Author

joeloff commented Oct 18, 2023

Any other feedback or are we good to merge?

@dsplaisted
Copy link
Member

Good to merge as far as I'm concerned

@joeloff joeloff merged commit eed07a0 into dotnet:main Oct 20, 2023
11 checks passed
@joeloff joeloff mentioned this pull request Oct 20, 2023
@joeloff
Copy link
Member Author

joeloff commented Oct 20, 2023

/backport to release/8.0

@github-actions
Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/arcade/actions/runs/6592101683

@github-actions
Copy link
Contributor

@joeloff backporting to release/8.0 failed, the patch most likely resulted in conflicts:

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

Applying: Add support for .NET workload sets
Applying: Cleanup formatting
Applying: Format cleanup
Applying: PR Feedback
Applying: PR feedback
Applying: Fix iOS package version
error: sha1 information is lacking or useless (eng/Versions.props).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0006 Fix iOS package version
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions
Copy link
Contributor

@joeloff an error occurred while backporting to release/8.0, please check the run log for details!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants