Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: query with workspace descendents #6782

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

bdehamer
Copy link
Contributor

@bdehamer bdehamer commented Sep 9, 2023

Fixes npm/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.

@bdehamer bdehamer changed the title [WIP] Fix query with workspaces fix: query with workspaces Sep 9, 2023
@bdehamer bdehamer force-pushed the bdehamer/bugfix-query-with-workspace branch 5 times, most recently from 87e5b86 to 4b7f558 Compare September 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 owner September 11, 2023 20:40
@bdehamer bdehamer changed the title fix: query with workspaces fix: query with workspace descendents Sep 11, 2023
@bdehamer bdehamer force-pushed the bdehamer/bugfix-query-with-workspace branch 7 times, most recently from 163af67 to 45889e1 Compare September 14, 2023 22:49
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 bdehamer force-pushed the bdehamer/bugfix-query-with-workspace branch from 45889e1 to 24fa595 Compare September 15, 2023 14:39
@wraithgar wraithgar merged commit bef7481 into latest Sep 15, 2023
16 of 17 checks passed
@wraithgar wraithgar deleted the bdehamer/bugfix-query-with-workspace branch September 15, 2023 14:44
@github-actions github-actions bot 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 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.

[BUG] query command returns incomplete dependency list for workspaces
2 participants