Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

Addresses feedback from #1617 (comment)

Changes

The circular dependency test called IsDependencyOfExplicitlyReferencedComponents twice without asserting the boolean return values, allowing the test to pass even when dependency relationships were incorrectly recorded.

Added .Should().BeTrue() assertions to both calls. Corrected the second assertion to check component C against explicitly-referenced component A (not transitive component B):

// Before: no assertions, checked C against B
componentRecorder.IsDependencyOfExplicitlyReferencedComponents<NpmComponent>(
    componentCId,
    parentComponent => parentComponent.Name == componentA.Name || parentComponent.Name == componentB.Name);

// After: asserts result, checks C against explicitly-referenced A
componentRecorder.IsDependencyOfExplicitlyReferencedComponents<NpmComponent>(
    componentCId,
    parentComponent => parentComponent.Name == componentA.Name).Should().BeTrue();

The method validates that a component is a dependency of an explicitly referenced component. Only A is explicitly referenced in package.json, so both B and C must be validated against A.

New Detector Checklist

  • I have gone through the docs for creating a new detector here
  • My new detector implements IDefaultOffComponentDetector
  • I have created a PR to the verification repo with components that my new detector can find
  • (If necessary) I have updated the Feature Overview table in the README

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…in circular dependency test

Co-authored-by: RushabhBhansali <24465841+RushabhBhansali@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to address feedback on transitive dependency calculation Add assertions to IsDependencyOfExplicitlyReferencedComponents test calls Jan 28, 2026
Copilot AI requested a review from RushabhBhansali January 28, 2026 22:36
@github-actions
Copy link

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

@RushabhBhansali RushabhBhansali marked this pull request as ready for review January 28, 2026 23:26
@RushabhBhansali RushabhBhansali requested a review from a team as a code owner January 28, 2026 23:26
@RushabhBhansali RushabhBhansali requested review from brettfo and removed request for a team January 28, 2026 23:26
@RushabhBhansali RushabhBhansali merged commit cb55fcf into users/rbhansali/fix-npm-transitive-dependency Jan 28, 2026
19 of 22 checks passed
@RushabhBhansali RushabhBhansali deleted the copilot/sub-pr-1617 branch January 28, 2026 23:26
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.1%. Comparing base (9f83cdc) to head (d306a9a).
⚠️ Report is 1 commits behind head on users/rbhansali/fix-npm-transitive-dependency.

Additional details and impacted files
@@                              Coverage Diff                              @@
##           users/rbhansali/fix-npm-transitive-dependency   #1618   +/-   ##
=============================================================================
  Coverage                                           90.1%   90.1%           
=============================================================================
  Files                                                435     435           
  Lines                                              37556   37556           
  Branches                                            2312    2311    -1     
=============================================================================
+ Hits                                               33861   33863    +2     
  Misses                                              3219    3219           
+ Partials                                             476     474    -2     

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

RushabhBhansali added a commit that referenced this pull request Jan 29, 2026
* Fix depedency duplication logic. Avoid duplicate parent-dependency pairs only.

* added test

* circular dependency test

* removed redundant file

* updated detector version

* Add assertions to IsDependencyOfExplicitlyReferencedComponents test calls (#1618)

* Initial plan

* Add assertions to IsDependencyOfExplicitlyReferencedComponents calls in circular dependency test

Co-authored-by: RushabhBhansali <24465841+RushabhBhansali@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: RushabhBhansali <24465841+RushabhBhansali@users.noreply.github.com>
Co-authored-by: Rushabh <rbhansali@microsoft.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: RushabhBhansali <24465841+RushabhBhansali@users.noreply.github.com>
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