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

[PAY-481][PAY-483][PAY-484] Add premium content write changes to DN #3752

Merged
merged 12 commits into from
Aug 29, 2022

Conversation

sddioulde
Copy link
Contributor

Description

  • Add db migration and update track model to include is_premium and premium_conditions
  • Update track schema
  • Add premium content access checker class
  • Prevent premium track repost/unrepost save/unsave if user has no access
  • Stub out the nft collection ownership check
  • Add integration test

Added code should not change current behavior for tracks.

Tests

Added test passes. So do all the previously existing ones.

Monitoring - How will this change be monitored? Are there sufficient logs / alerts?

Added some logs in the track access checker.

================ REMINDER: ================
If this PR touches a critical flow (such as Indexing, Uploads, Gateway or the Filesystem), make sure to add the requires-special-attention label.

** Add relevant labels as necessary. **
-->

@sddioulde sddioulde added discovery-node Discovery Node (previously known as Discovery Provider) requires-special-attention This change is risky and/or critical and requires special attention in review labels Aug 24, 2022
@sddioulde sddioulde changed the title Add premium content write changes to DN [PAY-481][PAY-483][PAY-484] Add premium content write changes to DN Aug 24, 2022
@sddioulde sddioulde force-pushed the sd-pc-dn-write branch 2 times, most recently from 2e7a256 to 085edc2 Compare August 25, 2022 04:48
@sddioulde
Copy link
Contributor Author

going to handle restricting reposts and saves in entity_manager too once ongoing work is merged soon by from platform team

Copy link
Contributor

@piazzatron piazzatron left a comment

Choose a reason for hiding this comment

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

Sweet!!!! Mostly have nits here - the only significant thing is whether we want to have the access_checker have bulk ops so we don't bottleneck indexing.

Wondering also how the premium_conditions JSON column/parsing will work once we add compound conditions - I think what we have here is fine, but want to make sure we're not going to paint ourselves into a corner when we support AND/OR and then have to migrate the existing JSON or anything like that.

@sddioulde sddioulde force-pushed the sd-pc-dn-write branch 2 times, most recently from f1c36b6 to 96c149f Compare August 26, 2022 00:57
@sddioulde sddioulde force-pushed the sd-pc-dn-write branch 6 times, most recently from 4221cac to b7114ec Compare August 27, 2022 00:13
@sddioulde
Copy link
Contributor Author

Once we have the AND/OR compositions, all that should change is the _evaluate_conditions function which should have all it needs to perform the checks and return True/False.

@sddioulde sddioulde merged commit ac33e4d into master Aug 29, 2022
@sddioulde sddioulde deleted the sd-pc-dn-write branch August 29, 2022 23:44
audius-infra pushed a commit that referenced this pull request Aug 31, 2022
## Changelog

- 2022-08-30 [b2033d5] [C-927] Fix 0x prefix in native (#3788) [Raymond Jacobson]
- 2022-08-30 [287f5e2] Temporarily remove track repost and save prevention for premium tracks in indexing (#3792) [Saliou Diallo]
- 2022-08-30 [843c8c9] Enable reconfigs for one secondary by default (#3794) [Theo Ilie]
- 2022-08-30 [3060080] Fix incomplete replica set for deregistered node (#3791) [Theo Ilie]
- 2022-08-30 [d8cb6a1] fix n+1 query bug in model_to_dictionary (#3793) [Steve Perkins]
- 2022-08-30 [e386114] Regenerate package lock in eth contracts (#3790) [Cheran]
- 2022-08-30 [0e27048] Final fixes for E2E local compose (#3789) [Cheran]
- 2022-08-30 [ed12c45] [CON-284] Add tracing decorator and decorate non-queue functions (#3750) [Johannes Naylor]
- 2022-08-29 [4c46521] PrimarySyncFromSecondary log nit (#3787) [Sid Sethi]
- 2022-08-29 [ac33e4d] [PAY-481][PAY-483][PAY-484] Add premium content write changes to DN (#3752) [Saliou Diallo]
- 2022-08-29 [e4d1af9] CON-371 PrimarySyncFromSecondary Rewrite for Perf Improvements (#3759) [Sid Sethi]
- 2022-08-29 [6f10439] CON-370 Fix export bug for large users (#3779) [Sid Sethi]
- 2022-08-29 [9a20f2f] Fix orphaned data gte and log stack for reconfig 500s (#3786) [Theo Ilie]
- 2022-08-29 [d905e1d] Fix last_added_to field for uploaded collections (#3784) [Isaac Solo]
- 2022-08-29 [e240525] [INF-181] Add audius-cmd (#3612) [Cheran]
- 2022-08-29 [5327ff5] Add syncForceWipeEnabled env var (#3778) [Theo Ilie]
- 2022-08-26 [a81235a] Gracefully stop recover-orphaned-data jobs (#3776) [Theo Ilie]
- 2022-08-26 [de178d2] EntityManager Upgradeability Unit Test (#3740) [Hareesh Nagaraj]
- 2022-08-26 [3b98f10] v1.0.0 (#3777) [Reed]
- 2022-08-26 [5129552] Fix failing test-solana-programs-anchor CI (#3775) [Isaac Solo]
- 2022-08-26 [179e41d] Add logs to orphaned data recovery job (#3774) [Theo Ilie]
- 2022-08-26 [aad5c9f] INF-227 Finalize additional Grafana Alerting entities (#3732) [Joaquin Casares]
- 2022-08-26 [5eaec3e] Remove rsyslogd from identity (#3769) [Dheeraj Manjunath]
- 2022-08-26 [0a5ecbb] Fix bug in fetching sync export + consolidate logic (#3771) [Theo Ilie]
- 2022-08-26 [cba01d4] Make orphaned data fixes + improvements (#3766) [Theo Ilie]
- 2022-08-25 [28cccc7] [PAY-586] Rename getAssociatedTokenAccountInfo and getUserBank (#3762) [Reed]
- 2022-08-25 [432caa7] Add storage path size prometheus metric in content node (#3768) [Dheeraj Manjunath]
- 2022-08-25 [c5dde7d] New "soft unhealthy" env var + actually set healthy status from content node (#3730) [Dheeraj Manjunath]
- 2022-08-25 [2ae731d] Fix issueSyncRequest libs not having ethContracts (#3764) [Theo Ilie]
- 2022-08-25 [0b4d837] CON-368 Fix sync duration logging bug #3763 [Sid Sethi]
- 2022-08-25 [fe85228] Fix wormhole with upgraded libs (#3757) [Raymond Jacobson]
- 2022-08-25 [33c9973] Fix invalidate playlist's original record (#3761) [Isaac Solo]
- 2022-08-25 [732a1d4] Skip replica set updates for users w/o URSM data (#3754) [Theo Ilie]
- 2022-08-25 [75ab7b5] Make Content Node tsconfig include all src files (#3760) [Theo Ilie]
- 2022-08-25 [18d1af4] [CON-324] Implement orphaned data recovery (#3696) [Theo Ilie]
- 2022-08-25 [e74f72b] CON-366 CN - Log on secondarySyncFromPrimary() success + logging cleanup (#3749) [Sid Sethi]
- 2022-08-25 [2389d8f] Bump sdk to v0.0.40 [audius-infra]
- 2022-08-24 [9133cab] Fix entity manager playlist invalidation (#3756) [Isaac Solo]
- 2022-08-24 [a680ad2] Fix last added and invalid tx (#3755) [Isaac Solo]
audius-infra pushed a commit that referenced this pull request Aug 31, 2022
## Changelog

- 2022-08-30 [b2033d5] [C-927] Fix 0x prefix in native (#3788) [Raymond Jacobson]
- 2022-08-30 [287f5e2] Temporarily remove track repost and save prevention for premium tracks in indexing (#3792) [Saliou Diallo]
- 2022-08-30 [843c8c9] Enable reconfigs for one secondary by default (#3794) [Theo Ilie]
- 2022-08-30 [3060080] Fix incomplete replica set for deregistered node (#3791) [Theo Ilie]
- 2022-08-30 [d8cb6a1] fix n+1 query bug in model_to_dictionary (#3793) [Steve Perkins]
- 2022-08-30 [e386114] Regenerate package lock in eth contracts (#3790) [Cheran]
- 2022-08-30 [0e27048] Final fixes for E2E local compose (#3789) [Cheran]
- 2022-08-30 [ed12c45] [CON-284] Add tracing decorator and decorate non-queue functions (#3750) [Johannes Naylor]
- 2022-08-29 [4c46521] PrimarySyncFromSecondary log nit (#3787) [Sid Sethi]
- 2022-08-29 [ac33e4d] [PAY-481][PAY-483][PAY-484] Add premium content write changes to DN (#3752) [Saliou Diallo]
- 2022-08-29 [e4d1af9] CON-371 PrimarySyncFromSecondary Rewrite for Perf Improvements (#3759) [Sid Sethi]
- 2022-08-29 [6f10439] CON-370 Fix export bug for large users (#3779) [Sid Sethi]
- 2022-08-29 [9a20f2f] Fix orphaned data gte and log stack for reconfig 500s (#3786) [Theo Ilie]
- 2022-08-29 [d905e1d] Fix last_added_to field for uploaded collections (#3784) [Isaac Solo]
- 2022-08-29 [e240525] [INF-181] Add audius-cmd (#3612) [Cheran]
- 2022-08-29 [5327ff5] Add syncForceWipeEnabled env var (#3778) [Theo Ilie]
- 2022-08-26 [a81235a] Gracefully stop recover-orphaned-data jobs (#3776) [Theo Ilie]
- 2022-08-26 [de178d2] EntityManager Upgradeability Unit Test (#3740) [Hareesh Nagaraj]
- 2022-08-26 [3b98f10] v1.0.0 (#3777) [Reed]
- 2022-08-26 [5129552] Fix failing test-solana-programs-anchor CI (#3775) [Isaac Solo]
- 2022-08-26 [179e41d] Add logs to orphaned data recovery job (#3774) [Theo Ilie]
- 2022-08-26 [aad5c9f] INF-227 Finalize additional Grafana Alerting entities (#3732) [Joaquin Casares]
- 2022-08-26 [5eaec3e] Remove rsyslogd from identity (#3769) [Dheeraj Manjunath]
- 2022-08-26 [0a5ecbb] Fix bug in fetching sync export + consolidate logic (#3771) [Theo Ilie]
- 2022-08-26 [cba01d4] Make orphaned data fixes + improvements (#3766) [Theo Ilie]
- 2022-08-25 [28cccc7] [PAY-586] Rename getAssociatedTokenAccountInfo and getUserBank (#3762) [Reed]
- 2022-08-25 [432caa7] Add storage path size prometheus metric in content node (#3768) [Dheeraj Manjunath]
- 2022-08-25 [c5dde7d] New "soft unhealthy" env var + actually set healthy status from content node (#3730) [Dheeraj Manjunath]
- 2022-08-25 [2ae731d] Fix issueSyncRequest libs not having ethContracts (#3764) [Theo Ilie]
- 2022-08-25 [0b4d837] CON-368 Fix sync duration logging bug #3763 [Sid Sethi]
- 2022-08-25 [fe85228] Fix wormhole with upgraded libs (#3757) [Raymond Jacobson]
- 2022-08-25 [33c9973] Fix invalidate playlist's original record (#3761) [Isaac Solo]
- 2022-08-25 [732a1d4] Skip replica set updates for users w/o URSM data (#3754) [Theo Ilie]
- 2022-08-25 [75ab7b5] Make Content Node tsconfig include all src files (#3760) [Theo Ilie]
- 2022-08-25 [18d1af4] [CON-324] Implement orphaned data recovery (#3696) [Theo Ilie]
- 2022-08-25 [e74f72b] CON-366 CN - Log on secondarySyncFromPrimary() success + logging cleanup (#3749) [Sid Sethi]
- 2022-08-25 [2389d8f] Bump sdk to v0.0.40 [audius-infra]
- 2022-08-24 [9133cab] Fix entity manager playlist invalidation (#3756) [Isaac Solo]
- 2022-08-24 [a680ad2] Fix last added and invalid tx (#3755) [Isaac Solo]
@AudiusProject AudiusProject deleted a comment from linear bot Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discovery-node Discovery Node (previously known as Discovery Provider) requires-special-attention This change is risky and/or critical and requires special attention in review size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants