Inject the file_parser and use its attributes, Add a prepare! hook#13208
Merged
Inject the file_parser and use its attributes, Add a prepare! hook#13208
Conversation
50d1d25 to
d39414b
Compare
Ahmed3lmallah
previously approved these changes
Oct 1, 2025
Contributor
Ahmed3lmallah
left a comment
There was a problem hiding this comment.
LGTM, with a minor comment.
d39414b to
8020584
Compare
Ahmed3lmallah
approved these changes
Oct 1, 2025
Contributor
Ahmed3lmallah
left a comment
There was a problem hiding this comment.
Thank you for addressing the comment!
255f5ed to
723b6df
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
This PR makes a slight adjustment to the
DependencyGraphercomponent to have it accept the file parser directly and execute it via a hook that ecosystems can redefine in the event they need to add before/after logic or an alternative parsing strategy in rare cases.Since the FileParser's attributes contains the dependency files, credentials, etc, they can provide the grapher everything it needs to use native helpers to make additional calls without having to change the interface in future.
Anything you want to highlight for special attention from reviewers?
Rather than get into metaprogramming to instantiate the parser within the grapher, I elected for a simple DI approach to give us the
prepare!method as a call site ecosystems can override in whatever way they need to.This fulfils the goal of the grapher being the component which holds unto any logic that is redundant to parsing in update job cases without adding a lot of complexity - in the worst case scenario where an ecosystem needs a totally different parsing strategy for graphing, we can easily use the attributes of the base parser to create a new special-case one on the fly.
How will you know you've accomplished your goal?
Nothing breaks, this is a small structural refactor with no behaviour changes.
Checklist