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 2024-04-30] [$500] Deprecate POLICY_MEMBERS #39376

Closed
luacmartins opened this issue Apr 1, 2024 · 14 comments
Closed

[HOLD for payment 2024-04-30] [$500] Deprecate POLICY_MEMBERS #39376

luacmartins opened this issue Apr 1, 2024 · 14 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@luacmartins
Copy link
Contributor

luacmartins commented Apr 1, 2024

We're updating how we store Onyx data for certain policy related keys and we decided to deprecate POLICY_MEMBERS in favor of policy.employeeList. That means that we have to:

  1. Update all usages of the policyMembers_ key to use policy_ key and retrieve the data from employeeList
  2. Update all places that retrieve the accountID to use email instead, since employeeList is keyed by emails, not accountID

I got started in this PR, but I'll have to prioritize other tasks and won't be able to finish it any time soon.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0113641b8717113c5d
  • Upwork Job ID: 1774889638571356160
  • Last Price Increase: 2024-04-01
  • Automatic offers:
    • ZhenjaHorbach | Contributor | 0
    • hungvu193 | Contributor | 0
Issue OwnerCurrent Issue Owner: @MitchExpensify
@luacmartins luacmartins added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 1, 2024
@luacmartins luacmartins self-assigned this Apr 1, 2024
Copy link

melvin-bot bot commented Apr 1, 2024

Triggered auto assignment to @MitchExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@luacmartins luacmartins added the External Added to denote the issue can be worked on by a contributor label Apr 1, 2024
@melvin-bot melvin-bot bot changed the title Deprecate POLICY_MEMBERS [$500] Deprecate POLICY_MEMBERS Apr 1, 2024
Copy link

melvin-bot bot commented Apr 1, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0113641b8717113c5d

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 1, 2024
Copy link

melvin-bot bot commented Apr 1, 2024

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Apr 1, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Deprecate POLICY_MEMBERS

What is the root cause of that problem?

New feature

What changes do you think we should make in order to solve the problem?

1. Delete old values
To make this part we need to delete all mentions policyMembers and policyMembersDraft

2. Refactor code

In this part we need to check for the presence of policies or policiesDraft in the components(utils) and then use employeeList field to get the values instead of deleted values

Also we need update all places that retrieve the accountID to use email instead, since employeeList is keyed by emails, not accountID

3. Update tests and PolicyMembersUtils

I noticed that we have some tests where we use policyMembers
So we need to fix this also

What alternative solutions did you explore? (Optional)

NA

@aneequeahmad
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Need to deprecate POLICY_MEMBERS in favor of policy.employeeList

What is the root cause of that problem?

Currently we have

  • POLICY_MEMBERS key to retrieve data from employeeList
  • employeeList is keyed by accountID

What changes do you think we should make in order to solve the problem?

We need to update

  • Use policy_ key instead of POLICY_MEMBERS key to retrieve the data from employeeList.
  • email key should be used instead of accountID key to get employeeList since it is keyed by emails.

Some examples are

policy?.employeeList instead of policyMembers
emailList.forEach loop instead of accountIDs.forEach loop
key: policyKey instead of key: membersListKey
[sessionEmail]: {...} instead of [sessionAccountID]: {...}

What alternative solutions did you explore? (Optional)

N/A

@nkdengineer
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Deprecate POLICY_MEMBERS

What is the root cause of that problem?

No RCA

What changes do you think we should make in order to solve the problem?

Update all usages of the policyMembers_ key to use policy_ key and retrieve the data from employeeList

  1. Remove POLICY_MEMBERS and POLICY_MEMBERS_DRAFTS. Replace all uses of policyMembers in the components with policy?.employeeList. For the case update POLICY_MEMBERS into Onyx, update the employeeList of policy. For POLICY_MEMBERS_DRAFTS, we can add an optimistic field in policy like employeeListDraft

POLICY_MEMBERS_DRAFTS: 'policyMembersDrafts_',

POLICY_MEMBERS: 'policyMembers_',

Update all places that retrieve the accountID to use email instead, since employeeList is keyed by emails, not accountID

  1. Use email key base for employeeList when we update employeeList into Onyx or use it in other functions.

  2. Actually, I see that when we add or remove members to the workspace, employeeList isn't updated so we need to update employeeList in the backend with the correct format.

What alternative solutions did you explore? (Optional)

NA

@luacmartins
Copy link
Contributor Author

Thanks everyone for the proposals. Since this a pretty straight forward task, I'll go with the first propposal that we got. Assigning @ZhenjaHorbach to this issue!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

📣 @ZhenjaHorbach 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@ZhenjaHorbach
Copy link
Contributor

📣 @ZhenjaHorbach 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer 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 📖

PR will be ready today or tomorrow

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Apr 3, 2024
@luacmartins luacmartins assigned hungvu193 and unassigned eVoloshchak Apr 9, 2024
Copy link

melvin-bot bot commented Apr 9, 2024

📣 @hungvu193 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

Copy link

melvin-bot bot commented Apr 18, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@ZhenjaHorbach
Copy link
Contributor

PR was deployed into production on April 22
It's time to pay )

@luacmartins luacmartins changed the title [$500] Deprecate POLICY_MEMBERS [HOLD for payment 2024-04-30] [$500] Deprecate POLICY_MEMBERS May 1, 2024
@luacmartins luacmartins added the Awaiting Payment Auto-added when associated PR is deployed to production label May 1, 2024
@luacmartins luacmartins removed the Reviewing Has a PR in review label May 1, 2024
@MitchExpensify
Copy link
Contributor

Payment summary

C $500 @ZhenjaHorbach Upwork
C+ $500 @hungvu193 Upwork

@MitchExpensify
Copy link
Contributor

Paid and contracts ended

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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants