Skip to content

Replace existing Go detector with Go117 detector#1426

Merged
AMaini503 merged 6 commits into
mainfrom
user/aamaini/2287934
Jun 10, 2025
Merged

Replace existing Go detector with Go117 detector#1426
AMaini503 merged 6 commits into
mainfrom
user/aamaini/2287934

Conversation

@AMaini503

@AMaini503 AMaini503 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

Changes

  • GoComponentDetector.cs
    • Added a try/catch around go cli execution. This was fixed in response to a failing UT.
    • Changed detector version from 8 to 9
    • Rest of the code is copy/paste from Go117ComponentDetector.cs
  • GoComponentDetectorTests.cs
    • UTs testing go mod graph were mocking go list output. This was changed to mock go.mod parsing.
    • Copied over all Go117 unit tests
  • GoModParser.cs: This parser wasn't handling replace directives like go list would have.
    • Add support to collect all replace directives. Packages that resolve to local paths are ignored. Packages that resolve to other packages are substituted before registration.

@AMaini503 AMaini503 requested a review from a team as a code owner June 9, 2025 10:48
@AMaini503 AMaini503 requested a review from zhenghao104 June 9, 2025 10:48
@github-actions

github-actions Bot commented Jun 9, 2025

Copy link
Copy Markdown

👋 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 🙂

@codecov

codecov Bot commented Jun 9, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 94.05520% with 28 lines in your changes missing coverage. Please review.

Project coverage is 89.5%. Comparing base (2a41d42) to head (d129d22).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...onentDetection.Detectors/go/GoComponentDetector.cs 81.0% 14 Missing and 4 partials ⚠️
...onentDetection.Detectors/go/Parsers/GoModParser.cs 91.9% 2 Missing and 3 partials ⚠️
...ection.Detectors.Tests/GoComponentDetectorTests.cs 98.4% 0 Missing and 5 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1426     +/-   ##
=======================================
- Coverage   89.7%   89.5%   -0.3%     
=======================================
  Files        407     404      -3     
  Lines      32379   31978    -401     
  Branches    2000    1994      -6     
=======================================
- Hits       29072   28629    -443     
- Misses      2881    2935     +54     
+ Partials     426     414     -12     

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

Comment thread src/Microsoft.ComponentDetection.Detectors/go/GoComponentDetector.cs Outdated
Comment thread src/Microsoft.ComponentDetection.Detectors/go/GoComponentDetector.cs Outdated
@AMaini503 AMaini503 merged commit 08a12e3 into main Jun 10, 2025
23 of 26 checks passed
@AMaini503 AMaini503 deleted the user/aamaini/2287934 branch June 10, 2025 02:13
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