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

Remove general purpose dedupe toggle #33963

Merged
merged 10 commits into from
Feb 15, 2024

Conversation

mjriley
Copy link
Contributor

@mjriley mjriley commented Jan 11, 2024

Product Description

This should show dedupe functionality to users without the dedupe toggle enabled. Users with the existing dedupe toggle will still maintain access to using dedupe updates.

Technical Summary

Associated ticket: https://dimagi-dev.atlassian.net/browse/SAAS-14958

Feature Flag

This removes most of the functionality for the CASE_DEDUPE feature flag

Safety Assurance

Safety story

Currently I've only done local testing and re-run the tests. I'd like to verify this on staging. As the functionality to remove update functionality is intended to be reversed in phase 2, I'm not holding myself to writing test suites for this functionality

Automated test coverage

Mentioned above, the new functionality here, where rules do not allow updates unless they have the feature flag, is not backed up by tests because this functionality is not meant to stick around long-term.

QA Plan

TBD

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@mjriley mjriley requested a review from esoergel as a code owner January 11, 2024 02:46
@@ -1464,7 +1464,7 @@ def _commtrackify(domain_name, toggle_is_enabled):

CASE_DEDUPE = StaticToggle(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want this to be a FrozenPrivilegeToggle so that new users can't be added to it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want this to be a FrozenPrivilegeToggle so that new users can't be added to it?

Thanks for pointing this class out to me. The immediate problem is that I don't believe there is an associated privilege for dedupe, which I'm making sure isn't an oversight on my part. Beyond that, I'm not sure this is a great fit. It sounds like FrozenPrivilegeToggle is meant to duplicate privilege functionality for domains that don't have the privilege. In this case, this toggle is meant to be for domains that are grandfathered into still allowing case updates, which the GA feature will not allow

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this toggle is meant to be for domains that are grandfathered into...

I think this is exactly what FrozenPrivilegeToggle was intended for.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify further? From that CEP, my understanding is that GA'd features become privileges on software plans. Existing domains that use the GA'd functionality may not belong to those software plans, and so FrozenPrivilegeToggle is intended to bridge that gap. But, whether it is the privilege or the toggle, both are supporting the exact same workflow.

That last part is why I don't believe FrozenPrivilegeToggle is a good fit here. We are discussing different functionality: the GA'd feature will not allow updates, while the existing toggle still will (in fact, the toggle's sole purpose will be to support updates). I think its also reasonable to suspect that this update functionality will be open to domains being added and removed, because while we're GA-ing 75% of the feature, I imagine Solutions still wants to support clients that require 100% of the feature.

@dimagimon dimagimon added Core Compatibility Changes may impact Mobile and Formplayer dependencies Pull requests that update a dependency file reindex/migration Reindex or migration will be required during or before deploy Risk: High Change affects files that have been flagged as high risk. Risk: Medium Change affects files that have been flagged as medium risk. labels Jan 18, 2024
@dimagimon dimagimon removed dependencies Pull requests that update a dependency file Risk: High Change affects files that have been flagged as high risk. labels Jan 19, 2024
@dimagimon dimagimon removed Risk: Medium Change affects files that have been flagged as medium risk. Core Compatibility Changes may impact Mobile and Formplayer labels Jan 19, 2024
Copy link
Contributor

@millerdev millerdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion about merging the migrations. Otherwise looks good.

]

operations = [
migrations.RunPython(add_dedupe_update_toggle, reverse_code=reverse),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this operation be done in corehq/apps/accounting/migrations/0089_dedupe_priv.py to avoid two separate DB migrations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be, but I think I'd be looking to unwind this in the future. It feels awkward that the code to get the data_interfaces app in a workable state lives in the accounting app. Ideally, I think both of these migrations ultimately belong in data_interfaces (or even better, a dedicated dedupe app)

@mjriley mjriley merged commit 7f2eb86 into mjr/dedupe_backfill Feb 15, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reindex/migration Reindex or migration will be required during or before deploy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants