Skip to content

fix: query with workspace descendents - #6782

Merged
wraithgar merged 1 commit into
latestfrom
bdehamer/bugfix-query-with-workspace
Sep 15, 2023
Merged

fix: query with workspace descendents#6782
wraithgar merged 1 commit into
latestfrom
bdehamer/bugfix-query-with-workspace

Conversation

@bdehamer

@bdehamerbdehamer commented Sep 9, 2023

Copy link
Copy Markdown
Contributor

Fixesnpm/statusboard#703

In scenarios where one workspace has a dependency on another workspace, querySelectorAll may omit some child dependencies. This stems from the fact that the algorithm to find dependencies, starts at the leaf and tries to find a path (following edgesIn) which leads back to the selected node. When workspaces are involved you can't reliably walk back up the dependency tree in this direction (ArboristNodes representing a workspace have no edgesIn).

The proposed fix updates the hasAscendant function to also follow the linksIn collection when trying to find a path to the selected node.

Comment threadworkspaces/arborist/test/query-selector-all.js
Comment threadworkspaces/arborist/test/query-selector-all.js
@bdehamerbdehamer changed the title [WIP] Fix query with workspacesfix: query with workspacesSep 9, 2023
@bdehamer
bdehamerforce-pushed the bdehamer/bugfix-query-with-workspace branch 5 times, most recently from 87e5b86 to 4b7f558CompareSeptember 11, 2023 20:32
@bdehamer
bdehamer marked this pull request as ready for review September 11, 2023 20:40
@bdehamer
bdehamer requested a review from a team as a code ownerSeptember 11, 2023 20:40
@bdehamerbdehamer changed the title fix: query with workspacesfix: query with workspace descendentsSep 11, 2023
@bdehamerbdehamer mentioned this pull request Sep 13, 2023
@bdehamer
bdehamerforce-pushed the bdehamer/bugfix-query-with-workspace branch 7 times, most recently from 163af67 to 45889e1CompareSeptember 14, 2023 22:49
Comment threadworkspaces/arborist/lib/query-selector-all.js
Fixes a query bug which omits some dependencies in scenarios where a
workspace has a dependency on another workspace in the project.
Signed-off-by: Brian DeHamer <bdehamer@github.com>
@bdehamer
bdehamerforce-pushed the bdehamer/bugfix-query-with-workspace branch from 45889e1 to 24fa595CompareSeptember 15, 2023 14:39
@wraithgar
wraithgar merged commit bef7481 into latestSep 15, 2023
@wraithgar
wraithgar deleted the bdehamer/bugfix-query-with-workspace branch September 15, 2023 14:44
@github-actionsgithub-actionsBot mentioned this pull request Sep 15, 2023
bdehamer added a commit that referenced this pull request Sep 15, 2023
Fixes a query bug which omits some dependencies in scenarios where a
workspace has a dependency on another workspace in the project.
Sign up for freeto 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.

[BUG] query command returns incomplete dependency list for workspaces

2 participants

@bdehamer@wraithgar