-
Notifications
You must be signed in to change notification settings - Fork 8
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
[DMS-26] Generate dependencies #193
Conversation
if (resourceName == "EducationOrganization") | ||
{ | ||
resourceName = "School"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open to suggestions here. Definitely a code smell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an idea. Read the abtractResources
section to get EducationOrganization
and GeneralStudentProgramAssociation
. Then scan the resources for the first one that has isSubclass: true
and matches each. Use that instead.
It might work, or it might be too simplistic in that it picks e.g. EducationOrganizationNetwork
which isn't as "connected" (from a dependency graph perspective) as School
. In which case you'd need to do some sort of "connectedness" analysis of subclasses to select the one to substitute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another idea, ignore the abstract superclasses to start and get an ordering. Then find all the subclasses in the ordering and insert the superclass right after the last subclass. That's probably the easiest way.
src/frontend/EdFi.DataManagementService.Frontend.AspNetCore/Modules/MetadataEndpointModule.cs
Outdated
Show resolved
Hide resolved
e32144e
to
7602b58
Compare
3cf5c75
to
f673452
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see some unit testing of GetDependencies()
. Provided suggestions on making testability easier.
867d22b
to
3f5ddbb
Compare
902c366
to
0ec5ea5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Very minor naming recommendation.
} | ||
"""; | ||
|
||
private readonly string _expectedDescriptor = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_expectedDependencies
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha! Oops.
} | ||
|
||
[TestFixture] | ||
public class Given_A_Dependency_Calculator() : DependencyCalculatorTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍
} | ||
"""; | ||
|
||
private readonly string _expectedDescriptor = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_expectedDependencies
?
No description provided.