Sort app scripts topologically by its dependencies#30385
Sort app scripts topologically by its dependencies#30385ChristophWurst merged 1 commit intomasterfrom
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
skjnldsv
left a comment
There was a problem hiding this comment.
This took a crazy turn! Code looks good, tests too! 🚀
Awesome work!
|
Psalm failure unrelated |
4a94d01 to
29df162
Compare
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.
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.
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