Skip to content
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

[HOLD for payment 2022-10-24] [$250] Resolve cyclic dependencies lint errors #11102

Closed
MonilBhavsar opened this issue Sep 19, 2022 · 24 comments
Closed
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement.

Comments

@MonilBhavsar
Copy link
Contributor

MonilBhavsar commented Sep 19, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


There are some silenced cyclic dependency lint errors in our codebase. They were silenced in this PR as we didn't want to block our project just because of them.
Cyclic dependency doesn't break anything but it's good to optimize code and get rid of them.

Action Performed:

Break down in numbered steps

  1. Uncomment // eslint-disable-next-line import/no-cycle lines in codebase
  2. Run npm run lint

Expected Result:

No lint errors should show

Actual Result:

Cyclic dependency lint error appears

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Users are not affected

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number:
Reproducible in staging?:
Reproducible in production?:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Upwork job URL: https://www.upwork.com/jobs/~0105a5aec0a694b518
Issue reported by:
Slack conversation:

View all open jobs on GitHub

@MonilBhavsar MonilBhavsar added Daily KSv2 Improvement Item broken or needs improvement. Internal Requires API changes or must be handled by Expensify staff Weekly KSv2 and removed Daily KSv2 labels Sep 19, 2022
@roryabraham
Copy link
Contributor

Should we make this external?

@roryabraham
Copy link
Contributor

If it's internal and doesn't have an assignee I worry it won't get done quickly

@MonilBhavsar
Copy link
Contributor Author

I made it internal as it was introduced by refactoring PR. But agree, we can make it external to get is resolved quickly

@roryabraham roryabraham added External Added to denote the issue can be worked on by a contributor and removed Internal Requires API changes or must be handled by Expensify staff labels Oct 4, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2022

Triggered auto assignment to @michaelhaxhiu (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 4, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2022

Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 4, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2022

Triggered auto assignment to @stitesExpensify (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot changed the title Resolve cyclic dependencies lint errors [$250] Resolve cyclic dependencies lint errors Oct 4, 2022
@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Oct 5, 2022

Proposal

RCA:
Require cycle: src/libs/DateUtils.js -> src/libs/actions/PersonalDetails.js -> src/libs/deprecatedAPI.js -> src/libs/Middleware/index.js -> src/libs/Middleware/Reauthentication.js -> src/libs/Authentication.js -> src/libs/actions/SignInRedirect.js -> src/libs/DateUtils.js

Solution:
DateUtils -> PersonalDetails
So we can remove PersonalDetails import in DateUtils, which is used only in updateTimezone() function.
DateUtils.updateTimezone() function is not used anywhere in the app
But for future use, we can move updateTimezone() from DateUtils to PersonalDetails instead of removal.
Please check detailed code proposal here: aimane-chnaif@f120ae9

@melvin-bot melvin-bot bot added the Overdue label Oct 6, 2022
@thesahindia
Copy link
Member

@aimane-chnaif's proposal looks good to me.

C+ reviewed 🎀👀🎀

cc: @stitesExpensify

@melvin-bot melvin-bot bot removed the Overdue label Oct 8, 2022
@michaelhaxhiu
Copy link
Contributor

Just one question @aimane-chnaif - why are we saying RCA? Are we suggesting this is a regression (i.e. it used to work properly, but now it doesn't)?

@aimane-chnaif
Copy link
Contributor

Just one question @aimane-chnaif - why are we saying RCA? Are we suggesting this is a regression (i.e. it used to work properly, but now it doesn't)?

@michaelhaxhiu I just explained detail about those lint errors. you can ignore that if RCA means only a regression keyword

@parasharrajat
Copy link
Member

parasharrajat commented Oct 9, 2022

Prefer to use Root cause for explaining the cause. And RCA or Regression when you want to refer to regression.

@aimane-chnaif
Copy link
Contributor

ah ok I thought RCA meant Root Cause Analysis, didn't know that R is Regression

@michaelhaxhiu
Copy link
Contributor

Haha sorry if that was confusing @aimane-chnaif you haven't done anything wrong here! 💙

This is totally semantics at this point, but let me break it down for clarity. And let me know if you think any external documentation has made this confusing for you as a contributor - I'll gladly revise it, if so:

  • We perform a Root Cause Analysis (RCA) when there is a regression.
  • We use the term regression to say something used to work, but then broke and stopped working.
  • We do a RCA to identify the root cause of the regression itself and ultimately prevent it from happening again. So we don't get repeated bugs in the same area of the code.
  • If it's a new bug, then we don't call it a regression. So new bugs don't require an RCA.

@michaelhaxhiu
Copy link
Contributor

michaelhaxhiu commented Oct 9, 2022

Though it's a new bug and not a regression, I think it's better to explain why this happens, rather than proposing only a solution.

Totally agree! As you continue to work on jobs, feel free to identify the "root cause" in your Problem statement like @parasharrajat mentioned :) love it.

@melvin-bot melvin-bot bot added the Overdue label Oct 11, 2022
@michaelhaxhiu
Copy link
Contributor

@stitesExpensify can you confirm if this proposal is good to proceed, please?

#11102 (comment)

@roryabraham
Copy link
Contributor

Stepping in to help cover @stitesExpensify while he's OOO

@melvin-bot melvin-bot bot removed Help Wanted Apply this label when an issue is open to proposals by contributors Daily KSv2 labels Oct 12, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2022

📣 @aimane-chnaif You have been assigned to this job by @roryabraham!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@michaelhaxhiu
Copy link
Contributor

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 17, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2022

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.16-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2022-10-24. 🎊

@melvin-bot melvin-bot bot changed the title [$250] Resolve cyclic dependencies lint errors [HOLD for payment 2022-10-24] [$250] Resolve cyclic dependencies lint errors Oct 17, 2022
@puneetlath puneetlath added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 19, 2022
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Oct 24, 2022
@michaelhaxhiu
Copy link
Contributor

Invited @thesahindia to the job, so we can pay both of you at the same time. @thesahindia can you confirm when you accepted it?

@michaelhaxhiu
Copy link
Contributor

Will get this paid today

@thesahindia
Copy link
Member

Applied 🚀

@michaelhaxhiu
Copy link
Contributor

All paid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement.
Projects
None yet
Development

No branches or pull requests

8 participants