-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
move nuget update analysis to native code #10025
Conversation
9152693
to
5d19672
Compare
6895a94
to
a3226ea
Compare
a3226ea
to
919e1d1
Compare
919e1d1
to
c839998
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly skimmed it, and trusting your team to own this section of code. What parts I did poke at deeper looked good to me.
I have tried to keep the changes that check the experiments flag, move the new update checker, and apply the prefix
Native
... to a single commit so that when the experiment is over, that single commit can essentially be reverted (modulo some minor cleanup) to enable the new behavior.
😍
@@ -16,6 +16,7 @@ concurrency: | |||
|
|||
env: | |||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |||
SMOKE_TEST_BRANCH: main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! Making life simple down the road.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had to re-figure this out too many times.
Merging via a merge commit to preserve history... I find the "fix lint" commits ugly, but I don't want to squash down and lose the niceness where you'd put most of the feature-flag changes behind a single commit. |
The accompanying smoke test PR is:
This PR adds a new native command
analyze
that takes the place of theupdate_checker
in Ruby. The purpose of this code is to query the available NuGet package sources to see what updates are available. With this change we now no longer manually poke any NuGet APIs; we're using "real" NuGet bits for all of it which means we shouldn't have any more issues around not-quite-compliant NuGet feeds.There is also a test change in Ruby to stub the calls into the native C# tool to instead simply dump a pre-baked JSON response. This takes several minutes off of the CI time.
Experiments
There is a lot of churn in this PR, so to mitigate some of that, a large bulk of work was placed behind the
nuget_native_analysis
flag, but not all.Changes that this PR incorporates whether or not the experiment is enabled:
file_parser.rb
) has been updated to always report the full path of dependency files (e.g.,/src/Directory.Build.props
instead of justDirectory.Build.props
. This is required to avoid confusion during a multi-directory update, because it's possible for two directories to be given,src/
andtest/
, and if both have aDirectory.Build.props
file, later update stages don't know which file is being referenced. This change is reflected in the smoke tests..nuspec
file and then extract the repo. This change is reflected in the smoke tests.Changes placed behind the experiments flag:
update_checker.rb
has been modified to check for the experiment flag and dispatch to the new update checker innative_update_checker/native_update_checker.rb
when appropriate. If the experiment flag is not set, the old behavior remains. To disambiguate files and types with similar names, I've prependednative_
orNative
to the new ones.I have tried to keep the changes that check the experiments flag, move the new update checker, and apply the prefix
Native...
to a single commit so that when the experiment is over, that single commit can essentially be reverted (modulo some minor cleanup) to enable the new behavior.I have verified the old and new behavior is invoked as appropriate by running an update job both with and without the experiments flag in the
job.yml
file.I timed some update operations and the new behavior appears to be within a few seconds of the old/existing behavior with quite an overlap, so the end result is probably a wash.
Existing updater, 2 runs: 5:23 and 6:16
New updater, 2 runs: 5:51, 6:29