Skip to content

Conversation

@ericstj
Copy link
Member

@ericstj ericstj commented Oct 21, 2025

We were faced with paths coming from project.assets.json with multiple trailing directory separators:

##[warning]Project output path /__w/1/s/artifacts/obj// specified by /mnt/vss/_work/1/s/artifacts/obj/project.assets.json does not exist.

When normalizing the path we'd remove one of the trailing slashes, but not both. Later on:

##[debug]Attempting to rebase /__w/1/s/artifacts/obj/ to /mnt/vss/_work/1/s/artifacts/obj using relative artifacts/obj
##[warning]Project path /__w/1/s/eng/icu.proj specified by /mnt/vss/_work/1/s/artifacts/obj/project.assets.json does not exist

We couldn't rebase the path because of the extra trailing slash, so we don't find the real path to the project relative to the scan directory.

As a result we'd report the component as coming from some path outside the scan directory --

--- Component: ---
9.0.305 net45 unknown - DotNet
--- Found at: ---
/../../../../../__w/1/s/eng/icu.proj

Since its outside the scan directory, we couldn't locate the project to probe for the .NET SDK, honoring global.json. As a result we report the machine-wide SDK version that's preinstalled on the machine running component detection.

After the fix this extra project will correctly be mapped and the correct SDK will be reported.

--- Component: ---
10.0.100-rc.1.25420.111 net45 unknown - DotNet
--- Found at: ---
/eng/icu.proj

@ericstj ericstj requested a review from a team as a code owner October 21, 2025 21:45
@ericstj
Copy link
Member Author

ericstj commented Oct 21, 2025

Now I remember why I used that method :-D It's to avoid trimming the root. I'll adjust the fix.

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.9%. Comparing base (cf8fa35) to head (777711f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ection.Detectors/dotnet/DotNetComponentDetector.cs 88.8% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1475     +/-   ##
=======================================
+ Coverage   89.8%   90.9%   +1.0%     
=======================================
  Files        413     423     +10     
  Lines      33117   37178   +4061     
  Branches    2047    2229    +182     
=======================================
+ Hits       29767   33812   +4045     
+ Misses      2935    2922     -13     
- Partials     415     444     +29     

☔ 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.

@grvillic grvillic merged commit 2fd5d4f into microsoft:main Oct 24, 2025
22 checks passed
@github-actions
Copy link

github-actions bot commented Oct 24, 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.

3 participants