-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Sort app scripts topologically by its dependencies #30385
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
Conversation
3ddb89f to
9e22367
Compare
|
Not sure whether we want the CircularDependencyException to be thrown. We also could skip that if we don't consider circular dependencies a problem (in certain cases they can result in broken dependency chains). |
9e22367 to
ed247d9
Compare
Thinking about it again, it's not a good idea to fail hard here by throwing an exception and we should just log an error instead. Agreed? |
I removed the CircularDependencyException. Instead, the circular dependency is now merely logged as an error if detected. |
571a872 to
0690078
Compare
3e7f920 to
71f5da2
Compare
0b5adc8 to
5c2e069
Compare
221d607 to
bcc4c71
Compare
bcc4c71 to
e438f97
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.
This took a crazy turn! Code looks good, tests too! 🚀
Awesome work!
|
Psalm failure unrelated |
4a94d01 to
29df162
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.
👍 ![]()
Soooo true 🙈 🤪 I wouldn't have expected this to become such a ride. Thanks a lot to @ChristophWurst and @skjnldsv for guiding me! |
Implement a proper topological sorting algorithm. Based on the implementation by https://github.com/marcj/topsort.php Logs an error in case a circular dependency is detected. Fixes: #30278 Signed-off-by: Jonas Meurer <jonas@freesources.org>
29df162 to
491bd62
Compare
|
Seems like I'm not allowed to merge - maybe due to the (unrelated) psalm test failures? 🤔 Could someone with super powers merge? 😬 |
|
|
||
| namespace OCP; | ||
|
|
||
| use OC\AppScriptDependency; |
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.
Unfortunately, this causes an psalm warning, since now OCP depends on OC. This wasn't found earlier since psalm was broken but it appear on #30508
I'm not sure if we can ignore this issue and just add it to the baseline or if we should fix it
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.
Fine to add to the baseline from my perspective as it is only used in the method implementation and not exposed in any kinds.
Implement a proper topological sorting algorithm. Based on the
implementation by https://github.com/marcj/topsort.php
Throws a CircularDependencyException if a circular dependency is
detected.
Fixes: #30278