analytics/test/support
Adrian Gruntkowski 17b12ddaeb
Implement basics of Teams (#4658)
* Extend schemas with new fields and relationships for teams

* Implement listing sites and sites with invitations with teams

* Implement creating invitations with teams

* Implement accepting invites with teams

* Add `Teams.SiteTransfer` schema

* Implement creating ownership transfers

* Implement accepting site transfer between teams

* Make results shapes from `Teams.Memberships` role functions more consistent

* Remove :team relation from ApiKey schema

* Pass and provision team on subscription creation

* Pass and provision team on enterprise plan creation

* Implement creating site for a team

* Keep team in sync during legacy ownership transfer and invitations

* Resolve conflict in `Teams.get_or_create` without transaction

* Abstract `GracePeriod` manipulation behind `Plausible.Users`

* Put `User.start_trial` behind `Plausible.Users` API

* Sync team fields on user update, if team exists

* Sync cleaning invitations, updating and removing members

* Transfer invitations too

* Implement backfill script

* Allow separate pg repo for backfill script

* Rollback purposefully at the end

* Update backfill script with parallel processing

* Use `IS DISTINCT FROM` when comparing nullable fields

* Handle no teams to backfill case gracefully when reporting

* Parallelize guest memberships backfill

* Remove transaction wrapping and query timeouts

* Make team sync check more granular and fix formatting

* Wrap single team backfill in a transatction for consistent restarts

* Make invitation and site transfer backfills preserve invitation ID

* Update migration repo config for easier dev access

* Backfill teams for users with subscriptions without sites

* Log timestamps

* Put teams sync behind a compile-time flag

* Keep timestamps in sync and fix subscriptions backfill

* Fix formatting

* Make credo happy

* Don't `use Plausible.Migration` to avoid dialyzer complaining

None of the tooling from there is used anywhere and `@repo` can
be defined directly in the migration script.

* Drop SSL workarounds in the backfill script

---------

Co-authored-by: Adam Rutkowski <hq@mtod.org>
2024-10-21 07:35:23 +00:00
..
conn_case.ex Implement UI for 2FA setup and verification (#3541) 2023-12-06 12:01:19 +01:00
data_case.ex Google APIs integration improvements (#2358) 2022-10-24 09:34:02 +02:00
exchange_rate_mock.ex Revenue tracking: Add currency field to goal creation (#2948) 2023-05-23 12:08:09 +02:00
factory.ex Implement basics of Teams (#4658) 2024-10-21 07:35:23 +00:00
google_api_mock.ex Implement search and pagination in Google Keywords modal (#4378) 2024-07-23 11:53:52 +03:00
html.ex Snippet integration verification (#4106) 2024-05-23 15:00:50 +02:00
http_mocker.ex Upgrade Erlang/Elixir stack (#3454) 2023-10-24 10:33:48 +02:00
live_view_test_fix.ex update runtime to elixir-1.17.1 and erlang-27.0 (#4255) 2024-06-24 13:22:33 +02:00
paddle_api_mock.ex Unify default pricing currency selection (#4221) 2024-06-14 14:49:22 +02:00
plugins_api_case.ex Merge Plugins.API.Router into main one (#3767) 2024-02-12 10:44:32 +01:00
test_controller.ex Allow configuring AuthorizeSiteAccess plug site param (#4597) 2024-09-26 09:52:45 +00:00
test_utils.ex Drop event explicitly on session lock timeout (#4582) 2024-09-16 10:36:53 +00:00