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 transitive dependency resolution algorithm #371

Merged

Conversation

lbialy
Copy link
Collaborator

@lbialy lbialy commented Feb 6, 2024

as in the title, we have had our impl from Java impl which was ported from C# impl which is broken and includes custom resource children of any other resources, including local, remote components and other custom resources, this works and is covered with an extensive test

@pawelprazak pawelprazak added the area/core The SDK's core code label Feb 6, 2024
@lbialy lbialy added the kind/bug Some behavior is incorrect or out of spec label Feb 6, 2024
@pawelprazak pawelprazak added P0 Bugs severe enough to interrupt existing work kind/bug Some behavior is incorrect or out of spec and removed kind/bug Some behavior is incorrect or out of spec labels Feb 6, 2024
@pawelprazak pawelprazak added this to the 0.2.0 milestone Feb 6, 2024
Copy link
Collaborator

@pawelprazak pawelprazak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks great :D

val childrenResult = current match
case cr: ComponentResource => ctx.resources.getStateFor(cr).map(_.children)
case _ => Result.pure(Set.empty)
case cb: ComponentBase => resources.getStateFor(cb).map(_.children.filterNot(_ == current))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

findAllReachableResources((left - current) ++ children, acc + current)
val updatedAcc =
current match
case dr: DependencyResource => // Dependency resources are added directly to the set, they don't have a state.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

@lbialy lbialy merged commit c35c17b into develop Feb 6, 2024
2 checks passed
@lbialy lbialy deleted the lbialy/fix-transitive-dependency-resolution-algorithm branch February 6, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core The SDK's core code kind/bug Some behavior is incorrect or out of spec P0 Bugs severe enough to interrupt existing work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants