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

Remove the custom SDK download on the CI, use a later version of dotnet.exe in our testing #3924

Merged
merged 11 commits into from
Mar 2, 2021

Conversation

nkolev92
Copy link
Member

@nkolev92 nkolev92 commented Feb 25, 2021

Bug

Fixes: https://github.com/NuGet/Client.Engineering/issues/739

Regression? Last working version:

Description

The good practice is to always be testing against the active release of the SDK.
When signing was added, we were targeting net5.0, while net5.0 was in development, so we needed to do some fancy work in order to make everything work.

This change tries to bring us back to a simpler world.

  • Removes the SDK download for building. It'd be a good practice to choose our own SDK, but that raises too many questions given that the build machines are not owned by us.
    The SDK is built with the ability to build older versions of the runtime, so we shouldn't run into issues.

  • Moves the SDK to test against to 5.0.2xx. You might ask why not 5.0.3xx? Well it's not exactly available/stable enough yet.

  • There are some script behavior changes as we migrated to the new script, so I had to add a workaround for that. Note that I did file 2 respective issues.

dotnet/install-scripts#152 and dotnet/install-scripts#153.

Finally I had to match a test to have the correct expectations now that we're using a dotnet.exe with the same functionality.

The particular test is dotnet list package and here's the SDK side implementation: https://github.com/dotnet/sdk/pull/14352/files#diff-0c2d181894818092e8d9bd3388ffd12bf2c22bcd0e4e48bc282e1b1c51b7d82fR159

At a later point we can move to a newer SDK.

  • This PR also contains a cleanup of past insertion clean-up.

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@nkolev92 nkolev92 requested a review from a team as a code owner February 25, 2021 01:48
Copy link
Contributor

@heng-liu heng-liu left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this issue!

After this fix, we're not able to install and use .NET SDK in early preview stage(not the same version installed by VS), but only use the .NET SDK installed on the CI machine.
But this should only be concerned if we need to build with very early preview version, which happens only if NuGet needs to use the new APIs from early preview version. So this situation should be very rare from my understanding.

eng/pipelines/templates/Apex_Tests_On_Windows.yml Outdated Show resolved Hide resolved
build/config.props Show resolved Hide resolved
@nkolev92 nkolev92 requested a review from heng-liu February 25, 2021 22:26
build/common.ps1 Outdated Show resolved Hide resolved
@nkolev92 nkolev92 requested a review from zivkan March 1, 2021 19:02
@nkolev92
Copy link
Member Author

nkolev92 commented Mar 1, 2021

Ready again @heng-liu

}

throw new ArgumentException(string.Format(Strings.ListPkg_InvalidOptions, firstOption, incompatibleOption));
throw new ArgumentException(string.Format(Strings.ListPkg_InvalidOptions));
Copy link
Member

Choose a reason for hiding this comment

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

Product changes and CI changes in the same PR can increase the effort required to cherry-pick onto old release branches. Consider splitting the PR. This change, for example, will cause product issues if cherry-picked onto a branch before --deprecated and --vulnerable were added.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a test fix.
Honestly, this product change is a dead codepath.

The parsing is happening on the SDK side, ours is there for our internal testing. In production scenarios, only the dotnet.exe code gets hit.

Alternatively, I can just change the string that the test asserts from the resource to a hardcoded string.

lmk wyt.

Copy link
Contributor

@heng-liu heng-liu left a comment

Choose a reason for hiding this comment

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

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.

4 participants