Skip to content

Conversation

@ericstj
Copy link
Member

@ericstj ericstj commented Mar 12, 2025

We weren't handling EXEs correctly - simply missed this case.

When a global.json mentions a version that doesn't exist on the path, the dotnet --version command will fail, and the commandLineInvocationService will throw InvalidOperationException since it cannot distinguish this failure from a missing command. Catch this exception and treat it like a failure so we fallback to parsing global.json.

We weren't handling EXEs correctly - simply missed this case.

When a global.json mentions a version that doesn't exist on the path,
the `dotnet --version` command will fail, and the `commandLineInvocationService`
will throw InvalidOperationException since it cannot distinguish this
failure from a missing command.  Catch this exception and treat it like
a failure so we fallback to parsing `global.json`.
@ericstj ericstj marked this pull request as ready for review March 12, 2025 23:23
@ericstj ericstj requested a review from a team as a code owner March 12, 2025 23:23
@ericstj ericstj requested a review from melotic March 12, 2025 23:23
@codecov
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 96.92308% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.5%. Comparing base (255e011) to head (ebfba5d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ection.Detectors/dotnet/DotNetComponentDetector.cs 88.8% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #1367    +/-   ##
======================================
  Coverage   89.5%   89.5%            
======================================
  Files        402     402            
  Lines      31480   31599   +119     
  Branches    1928    1944    +16     
======================================
+ Hits       28186   28302   +116     
- Misses      2879    2881     +2     
- Partials     415     416     +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

We've seen cases where the project.assets.json files refer to paths with
a different root than the current scan.  One example is building inside
a container then running on the filesystem mounted outside the container.

Address this by comparing the relative path to the root, and finding if
the same relative path is present in the assets file's output path.
@grvillic grvillic merged commit 385fd71 into microsoft:main Mar 13, 2025
20 of 23 checks passed
@github-actions
Copy link

github-actions bot commented Mar 13, 2025

👋 Hi! It looks like you modified some files in the Detectors folder.
You may need to bump the detector versions if any of the following scenarios apply:

  • The detector detects more or fewer components than before
  • The detector generates different parent/child graph relationships than before
  • The detector generates different devDependencies values than before

If none of the above scenarios apply, feel free to ignore this comment 🙂

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.

2 participants