Commit Graph

3477 Commits

Author SHA1 Message Date
Adam Rutkowski c524748002 Merge branch 'master' into release-3.0.0 2025-04-10 09:53:09 +02:00
hq1 023c7ac2c0
Fix community editon migrations (#5307)
* Fix migration that was not working

cc @macobo

* Fixup old migrations to use `community_edition?` predicate

* Move hourly api request limit migration to the bottom

The odds are low that self-hosters use that one, but let's
make sure it runs after teams have been migrated.

* Tag dump plans as ee only
2025-04-10 06:25:09 +00:00
RobertJoonas 087b6e77bc
last 90 days -> last 91 days (#5301) 2025-04-09 16:40:06 +00:00
hq1 59fa96863f
Plugins API: allow prop enable for internal keys (always) (#5302) 2025-04-09 14:01:33 +00:00
Adam Rutkowski 743e0c1243 Bump backfill migration timestamp 2025-04-09 13:08:48 +02:00
Adam Rutkowski e655fc79ca Fix backfill 2025-04-09 13:08:20 +02:00
RobertJoonas 27290b9899
Change default period to today for brand new sites (#5298)
* default period to today for brand new sites

* use uppercase
2025-04-09 10:48:42 +00:00
Karl-Aksel Puulmann 3d1d0c5139
APIv2: More tolerant shorthands for date ranges (#5282)
* APIv2: More tolerant shorthands for date ranges

I was using APIv2 today and got pissed off that I couldn't do
`"date_range": "3d"`. So I went ahead and fixed this issue...

* Changelog

* typegen

* fix

* More invalid tests
2025-04-09 10:38:54 +00:00
RobertJoonas 4eb4b68b99
Sort by exit rate (#5289)
* WIP

* Works, maybe

* More tests

* format + slight refactor special_metrics

* implement exit_rate equivalent to current dashboard metric

* add validations to query_parser

* implement comparisons for exit_rate

* merge imported exit rate

* plug in the new metric

* make exit_rate sortable

* changelog

* generate types

* rename tests

* changelog

* maintain order of special metrics

* move exit_rate to the bottom as the less significant special metric

* capitalize null + query assign tweaks

* add comment

* Update lib/plausible/stats/sql/special_metrics.ex

Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>

---------

Co-authored-by: Artur Pata <artur.pata@gmail.com>
Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com>
2025-04-09 09:47:12 +00:00
Karl-Aksel Puulmann c18961b2d2
Remove sampling flag code and reduce sampling threshold (#5299)
* Remove old flagged code

* Reduce sampling threshold

We're seeing slow queries for users near the current threshold, so
reducing it.
2025-04-09 09:41:27 +00:00
Karl-Aksel Puulmann 92e41ff3ad
Tracker: `fetch.catch` (#5291)
* Tracker: `fetch.catch`

Without this, errors from the API result in uncaught exceptions in
clients pages.

* chore: Bump tracker_script_version to 2
2025-04-08 15:19:33 +00:00
Karl-Aksel Puulmann f8ddecf080
APIv2: Fix autocomplete in Stats API playground (#5286)
Filters autocomplete only showed `"is", "segment"` under autocomplete
instead of all options. This is due to limitations in the vscode
autocomplete package which I don't fully understand but have to do with
partially overlapping `oneOf` definitions. As such the fix was to make
each `oneOf` element as independent of each other as possible.

Basecamp ref: http://localhost:8001/docs/stats-api-playground
2025-04-08 15:17:59 +00:00
Adam Rutkowski 80cbcc41bc Start cloak vault for self-hosted release migrations.
Since this one is using schemas, existing encrypted columns
do require cloak to be up.
2025-04-08 16:43:01 +02:00
Adrian Gruntkowski 1e17d54b5b
Set site and member limits to unlimited for CE (#5288)
* Set site and member limits to unlimited for CE

* Don't even compile billing tests that trigger warnings in `ce_test`

* Split layout test into 2 distinct tests for CE and EE due to limits

* Update CHANGELOG.md

* Remove redundant test tag
2025-04-08 14:22:20 +00:00
Adam Rutkowski d00298f4af Update User schema with a field required by teams migration 2025-04-08 11:30:51 +02:00
Adam Rutkowski 54c1737901 Fix migration that was not working
cc @macobo
2025-04-08 11:11:41 +02:00
Adam Rutkowski eb0fdffcaf Release 3.0.0 2025-04-08 10:39:52 +02:00
Adam Rutkowski 5a66e9dba4 Update changelog (old release) 2025-04-08 10:39:17 +02:00
hq1 de1bde4529
Backfill teams - CE (#4925)
* OG script

* Adapt to CE

* Remove commented line

* Backfill teams CE in a single transaction (#4985)

* single tx

* add migration

* Reorder migrations

So that identifier is already present and
can be fetched using schema-based queries.

* Reorder again on top of master + use data migration utils

---------

Co-authored-by: ruslandoga <ruslandoga+gh@icloud.com>
2025-04-08 08:23:43 +00:00
Adrian Gruntkowski 659cae50aa
Set current_team when user has team membership in viewed site (#5284)
* Make `site_role/2` return whether real is team or site scoped

* Rename `has_admin_access?` => `has_editor_access?`

* Switch current team if user is a team member in site's team
2025-04-08 08:09:47 +00:00
Karl-Aksel Puulmann 6127ebccc1
time-on-page: Remove flag, CHANGELOG.md, time_on_page in APIv2, update old tests (#5277)
* Remove new_time_on_page feature flag

* Update tests to use new time on page

* Mark time-on-page as a public metric in APIv2

* CHANGELOG.md

* Validate time_on_page in APIv2

* Update typing

* Remove redudant arguments

* Update GA4 test

* Update stats_controller_test

* Remove assertion from csv_importer

* Add nil case to new time on page tests
2025-04-08 07:28:03 +00:00
Karl-Aksel Puulmann bf482efe84
APIv2: Release `has_done`/`has_not_done` (#5285)
* APIv2: Release `has_done`/`has_not_done`

* Update tests to mark new features publicly available
2025-04-08 07:13:18 +00:00
Karl-Aksel Puulmann 0fcbcc3a8c
time-on-page: csv import/export support, preparation for release (#5274)
* CSV import/export support for time-on-page

Note only the new time-on-page metric is exported this way

* visibility check for graphing of time_on_page

* FE no longer receives/sends legacy_time_on_page_cutoff

* Remove current_user from exports

* Remove legacy_time_on_page_cutoff from query.include, make behavior work off of site.legacy_time_on_page_cutoff explicitly

* Remove dead function

* More current_user_id removals
2025-04-08 06:25:11 +00:00
Adrian Gruntkowski 847353d17e
Fix determining CE/EE in migrations (#5283)
* Exclude MigrationUtils in validation check

* Expose runtime versions of CE/EE checks for migrations

* Fix migrations relying on CE/EE checks
2025-04-07 09:03:01 +00:00
Adrian Gruntkowski d31a175c40
Remove `teams` feature flag and fix seeds (#5276)
* Fix seeds

* Remove teams flag
2025-04-07 07:59:41 +00:00
Adrian Gruntkowski 7f52730b71
Add teams hourluy api request limit backfill to CE-only migration (#5275) 2025-04-07 07:56:39 +00:00
Karl-Aksel Puulmann f330182a68
Show year (if multi-year graph) in graph tooltips (#5279)
The graph ticks already had this feature, but this was missing from
tooltips. Hope this sparks some joy.

Basecamp ref: https://3.basecamp.com/5308029/buckets/36789884/card_tables/cards/7630914606
2025-04-07 06:30:49 +00:00
Karl-Aksel Puulmann a9a18fbd35
Make combo box tests less flaky (#5278)
Currently, every now and then the async combo box tests fail, probably
due to timing races. This is a rudementary attempt at fixing this by
making the test less sensitive to timing.
2025-04-07 06:30:43 +00:00
Adrian Gruntkowski 250e7399a9
Only show team CTA banner to owner when site team is not set up (#5273) 2025-04-03 12:50:50 +00:00
ruslandoga 301a041736
use one lock partition per cache in sessions (#5123) 2025-04-03 12:45:31 +00:00
Adrian Gruntkowski 6ed7d1f8cc
Add styling to CTA link (#5271) 2025-04-03 11:28:53 +00:00
Adrian Gruntkowski a715ed2f32
Remove Editor->Admin site role conversion and limit permissions (#5210)
* Remove editor->admin mapping from Site Settings > People

* Restrict editor role and allow admin to update site role

* Disable actions in Site Settings > People for roles other than admin and owner

* Fix test

* Update labeling of guest members in CRM for clarity

* Update phrasing in other spots of UI

* Update CHANGELONG.md

* Revise team related banners displayed under Site Settings > People

* Fix permissions check for role update
2025-04-03 11:04:19 +00:00
Adrian Gruntkowski 6ee4f57cf7
Revert "Remove trial notice on 1st site creation (#5269)" (#5270)
This reverts commit 8a1ee87acc.
2025-04-03 10:02:14 +00:00
hq1 8a1ee87acc
Remove trial notice on 1st site creation (#5269)
Per @metmarkosaric's request
2025-04-03 08:57:56 +00:00
Adrian Gruntkowski 0f4a90815a
Send e-mail to new owners when site team is changed (#5267)
* Send e-mail to new owners when site team is changed

* Improve subject copy

Co-authored-by: hq1 <hq@mtod.org>

* Update copy in test

---------

Co-authored-by: hq1 <hq@mtod.org>
2025-04-03 08:50:54 +00:00
Adrian Gruntkowski ba08ea9d9d
Show number of setup teams in CRM dashboard (#5268) 2025-04-03 08:33:16 +00:00
Adrian Gruntkowski 299e59afc2
Append `__team` parameter to URLs in notification e-mails (#5266)
* Append `__team` parameter to URLs in notification e-mails

* Improve copy in guest to team member promotion email

* Make "return_to" set in redirect in `RequireAccountPlug` actually work

* Improve accepted site transfer e-mail phrasing and link
2025-04-02 14:38:52 +00:00
hq1 98ffeca6a6
Stack bump: Elixir 1.18, OTP 27.3.1, Node 23.2.0, (#5264)
* Update tool versions

* Update deps

* Address runtime/compilation warnings

* Format

* Update Dockerfile

* wip

* Simpler

* oof

* hum

* format

* Bump cache vsn

* oops

* Fixup

* Fix dockerfile

* Try bumping node too 🤷

* Revert "Try bumping node too 🤷"

This reverts commit cdbe8d4a78.

* Reapply "Try bumping node too 🤷"

This reverts commit 12cafae22b.

* Welp
2025-04-02 12:39:22 +00:00
Marko Saric a1c1f09a73
change the copy on the top of a new dashboard (#5262) 2025-04-02 07:49:17 +00:00
Adrian Gruntkowski cb65f12448
Fix links to users under "Other Members" in Site CRM (#5263) 2025-04-01 13:05:08 +00:00
Artur Pata 5db306126a
Update eslint and use eslint flat config (#5260)
* Update eslint and use eslint flat config

* Ignore unresolved for CI with comment
2025-04-01 11:14:36 +00:00
hq1 ab350e0b2b
Ensure guest promotion e-mail is sent w/ updated team name (#5261) 2025-04-01 10:37:05 +00:00
Adrian Gruntkowski 4f0207ce6f
Prefix site roles with "Guest " in UI (#5259)
* Prefix site roles with "Guest " in UI

* Update tests
2025-04-01 09:02:08 +00:00
Adrian Gruntkowski 75f1cd74e0
Update CHANGELOG.md with teams support (#5256) 2025-04-01 09:02:01 +00:00
Adrian Gruntkowski ffa82176a2
Only show nag screen when the current team has any sites (#5257) 2025-04-01 08:32:37 +00:00
RobertJoonas 7e248d07ca
Fix favicons for domains including a subfolder (#5258)
* fix favicons for subfolder domains

* changelog

* rename source -> domain
2025-04-01 08:08:01 +00:00
RobertJoonas 487e3d81b4
Ingestion: Reject blank engagements with 400 (#5253)
* reject blank engagements with 400

* address review comments

* add request tests
2025-03-31 14:34:21 +00:00
Adrian Gruntkowski 94e9a20038
Populate `team_id` when provisioning API key (#5234)
* Set team when creating API key

* Create API key with team ID and adjust API key CRM

* Make CRM work with team-less API keys still

* Scope owner's API keys by team on setup

* Rate limit team scoped API keys by their team

* Enforce team scoping for API key with a team

* Prevent using legacy API keys against setup teams

* Enforce team scoping in Sites API too

* Scope API keys list in settings by team

* Do not prevent legacy API keys from accessing setup teams

* List legacy API keys across all teams

* Display "API Keys" under "Team Settings" when team is setup

* Scope teams index in Sites API as well

* Test Sites API actions

* Revert "Scope owner's API keys by team on setup"

This reverts commit 08fd5b4e801417a28ebb9937457cf3e59f7386a0.

* Test and slightly simplify API key CRM logic

* Test API key provisioning from Account Settings

* Test `AuthorizePublicApi` plug adjustments

* Simplify conditionals (h/t @aerosol)

* Change back to using `schema` in CRM logic

* Don't run tests triggering Kaffy warning locally

* Run quirky Kaffy tests only on CI in EE env
2025-03-31 11:35:09 +00:00
RobertJoonas 8d98a75cd5
Upgrade page fixes (#5248)
* recommend business plan if user on business plan already

* fix billing notices on choose-plan page
2025-03-31 10:19:34 +00:00
Artur Pata 55982d6173
Fix oban option, split operations in CSV import export test (#5139) 2025-03-31 09:36:14 +00:00