-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Add circular dependency detection to CI #7316
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
Add circular dependency detection to CI #7316
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7316 +/- ##
==========================================
+ Coverage 93.88% 93.89% +0.01%
==========================================
Files 181 181
Lines 13194 13194
==========================================
+ Hits 12387 12389 +2
+ Misses 807 805 -2
Continue to review full report at Codecov.
|
That looks good to me, but I believe we should fix the current circular dependencies in this PR, right? |
Well, ideally yes, but I'm not sure how complex that is. Alternatively we can merge this as a non-required check, knowing that build will fail until another PR solves this. |
I don't this CI check is entirely accurate. Example https://github.com/parse-community/parse-server/blob/master/src/Auth.js#L326 |
You mean because Auth requires Rest only in method Lines 325 to 326 in 0becb0c
I am thinking whether this can be an issue regardless.
I think whether a certain construction of circular dependency is an issue depends on the inner workings of the node module cache, which can change at any point. Maybe the safe way is to generally avoid them. For my taste, circular dependency is generally a suspicious pattern that often hints to a code quality issue. |
cec3100
to
a086924
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.
Nice! We should do the JS SDK next. It has a lot more.
I removed the circular dependencies. I think we should add this CI check and prohibit them for a more robust code base. |
* add circular dependency detection to CI * fixed Auth-RestWrite circular dependency * updated package lock * fixed Logger circular dependency * fix lint
🎉 This change has been released in version 5.0.0-beta.1 |
🎉 This change has been released in version 5.0.0 |
New Pull Request Checklist
Issue Description
Circular dependency patterns can cause hard to pin down bugs and should be avoided. Parse Sever currently has no CI check to prevent these.
In fact, Parse Server currently does have 4 circular dependencies that should be addressed:
Related issue: (n/a, meta)
Approach
Adds circular dependency detection to CI via madge, which seems to be a well maintained and popular repo.
Alternative
We could add a custom rule to ESLINT to detect that, but I have no experience with the reliability of that rule; madge seems to be better maintained and is designed specifically for that purpose.
TODOs before merging