-
Notifications
You must be signed in to change notification settings - Fork 903
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
(ENGTASKS-3693) Prototype updating user agent with process information #3460
Conversation
Raised issue #3526 for this. |
src/chocolatey/infrastructure/information/ProcessInformation.cs
Outdated
Show resolved
Hide resolved
0f118c8
to
b62b5e0
Compare
@corbob I think this is ready for review at this point. |
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.
Just a few comments and I seem to recall a few changes...
src/chocolatey.tests/infrastructure.app/nuget/NugetCommonSpecs.cs
Outdated
Show resolved
Hide resolved
src/chocolatey/infrastructure.app/services/ProcessCollectorService.cs
Outdated
Show resolved
Hide resolved
src/chocolatey/infrastructure/information/ProcessInformation.cs
Outdated
Show resolved
Hide resolved
35d3a34
to
8f90d16
Compare
d7c879f
to
5a218a4
Compare
I've run the tests in TestKitchen and am seeing failures that I wasn't seeing when running locally. I'm going to mark this as draft for now so we don't inadvertently merge it. |
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.
From a change to the CODEOWNERS files, this LGTM, however, I have left a couple comments elsewhere that I think need to be addressed.
src/chocolatey.tests/infrastructure.app/nuget/NugetCommonSpecs.cs
Outdated
Show resolved
Hide resolved
f166b16
to
1fd6951
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.
LGTM!
This branch is out of date with the develop branch, so not in a position to merge this just now, but I am happy to activate the |
Work the ProcessTree into a service that can be pulled in to the NugetCommon library in order to provide a more informative user agent when querying repositories.
The primary method is quickest, but as it is an unstable API, we have a need to provide a fallback that will be able to be used if the DLL is missing/removed, or if the entry point is later removed. Of the stable options, this p/invoke method seems to be the next best option to work with. Crucially, these p/invokes need to be provided by different types, so that if there is a TypeLoadException from a failed p/invoke, we can still attempt the fallback. Also, added a couple more exclusions for the choco.exe shim and for winlogon, which are not useful to include.
We need to define values for ReleaseOfficial for the benchmark project or the Cake build complains. Also added Chocolatey.PowerShell to the slnf in the repo, since that was missing.
RuntimeInformation is shadowed by Mono which means that build breaks and because all of the namespaces are the same under Mono's version, that name is not usable in our build currently. We can reuse our existing Platform.GetPlatform() helper here instead, rather than trying to disentangle exactly why this build configuration is not particularly functional.
These processes are not particularly useful to note as they are common terminal emulators, so we can exclude them when looking at the process tree.
Simplify some naming, also add a constant (and comment) to clarify what some of the p/invoke nonsense is doing.
Description Of Changes
choco.exe
as well as the root process of the tree (filtering out common shells, terminal emulators, and explorer.exe).This PR also includes a prototype changes of an investigation where we include additional information about the current process tree that
choco.exe
is part of, including additional information about what the current process is when needed.Additionally, benchmarks have also been added as part of this investigation.
Below is the results from these benchmarks that was ran on a dedicated computer (This had been ran multiple times, but only one result is included).
Motivation and Context
To investigate possibilies that we have.
Testing
choco search chocolatey --debug
and verify that the process tree and user agent including the root and calling process are shown in the debug logs.Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #3526