Commit Graph

214 Commits

Author SHA1 Message Date
dependabot[bot] 69d8d22ac2
Bump actions/cache from 4 to 5 (#5949)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 12:58:01 +00:00
dependabot[bot] 9978f9be0f
Bump actions/download-artifact from 6 to 7 (#5951)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 12:45:26 +00:00
dependabot[bot] 6446e15871
Bump actions/upload-artifact from 5 to 6 (#5948)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 12:37:54 +00:00
dependabot[bot] 810b956269
Bump tj-actions/changed-files from 47.0.0 to 47.0.1 (#5950)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 47.0.0 to 47.0.1.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](24d32ffd49...e002140703)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-version: 47.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 12:37:41 +00:00
Adam Rutkowski aed90f7ffc
Make CI vigilant about uncaptured logs during test runs (#5676)
* Let's see

* test error

* Revert test changes

* Bump

* schedulers

* tmp

* Bump timex

* ignore libcluster warning

* fixup

* fix typo

* Set shell: bash
2025-12-15 13:28:04 +00:00
dependabot[bot] 85d9e59bf3
Bump actions/checkout from 5 to 6 (#5903)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 12:19:59 +00:00
Adam Rutkowski b64a2355a0
Platform upgrade: elixir 1.19.4 and otp 27.3.4.6 (#5920)
* Platform upgrade: elixir 1.19.4 and otp 27.3.4.6

* !fixup

* credo

* credo

* Bump cache

* fix docker image tag

* hum

* hum

* Match docker images

* Define ALPINE_VERSION once

* fixup
2025-12-01 12:50:49 +00:00
Uku Taht 3c9ba41cb6
Use prima modal in ip_rules settings (#5910)
* Use prima modal in ip_rules settings

* Remove unused alias

* Do not render portal in test environment - fixes tests

* Simplify invitation modal tests

* Bump CI cache version to rebuild with prima 0.2.1

The CI was using cached dependencies with prima 0.1.9, which doesn't
support the portal parameter needed for tests. Bumping the cache
version forces a rebuild with the correct prima 0.2.1 from mix.lock.

* CI debugging

* Use correct mix env

* Resolve mix.env() at compile-time
2025-11-27 13:22:05 +00:00
dependabot[bot] 2a5850aff0
Bump actions/setup-node from 5 to 6 (#5813)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cenk Kücük <cenk@plausible.io>
2025-10-28 10:58:15 +00:00
dependabot[bot] 5754f2be6b
Bump actions/download-artifact from 5 to 6 (#5829)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 09:29:07 +00:00
dependabot[bot] 1eda271438
Bump actions/upload-artifact from 4 to 5 (#5830)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 09:28:33 +00:00
RobertJoonas a83b4f3583
Clean up legacy verification code and script v2 flag (#5824)
* add module name to service_error when check times out

Otherwise, it can sometimes remain unclear in the diagnostics, whether
it was InstallationV2 or InstallationV2CacheBust that timed out.

* Remove duplicate timeout logic

The current production logs show two types of verification timeouts:

* service_error: "Unhandled Browserless response status: 408" (vast
  majority of cases)
* service_error: :timeout (only a few cases)

The latter happens when we hit the Req receive_timeout
(endpoint_timeout + 2s). I've seen Browserless not respect the timeout
param from time to time, so it's better to keep the timeout logic
"in-house" only.

* make service_error into a map with code and extra

* interpret temporary service errors

...but still consider them "unhandled" for telemetry, also notifying Sentry
and logging the warning.

* separate sentry messages (verification)

* make Verification.ChecksTest more DRY

* organize tests into describe blocks

* test verification telemetry and logging

* fix codespell

* get rid of legacy verification

* rename Checks.InstallationV2 -> Checks.VerifyInstallation

* delete Live.Installation and rename Live.InstallationV2 -> Live.Installation

* rename installationv2 (live) files as well

* delete old change-domain routes

Also rename current liveview modules and routes, removing the v2 suffix

* rename domain_change_v2 files, removing v2 suffix

* remove legacy JS verifier code

Also fix dockerignore and elixir.yml referencing a wrong priv path

* rename verification_v2_test -> verification_test

* remove v2 prefix from logs and sentry messages

* clean up duplicate external_sites_controller_test.exs tests

* remove flag

* fix typespec

* pass timeout as query param to Browserless too

* Fixup external sites controller test module (#5826)

* fix test description

---------

Co-authored-by: Artur Pata <artur.pata@gmail.com>
2025-10-27 09:39:41 +00:00
dependabot[bot] bcd723e3a6
Bump actions/github-script from 7 to 8 (#5704)
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 09:33:24 +00:00
dependabot[bot] da1733ace3
Bump actions/setup-node from 4 to 5 (#5703)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 09:33:15 +00:00
dependabot[bot] 4635b4fe11
Bump tj-actions/changed-files from 46.0.5 to 47.0.0 (#5722)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 46.0.5 to 47.0.0.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](ed68ef82c0...24d32ffd49)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-version: 47.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-19 09:32:57 +00:00
Artur Pata cc5ca4b752
Script v2: Apply prettier (#5718)
* Apply prettier

* Fix issue with quotes in test setup

* Fix other issues with customSubmitHandlerStub

* Fix format with cookies fixtures
2025-09-15 11:21:27 +00:00
Artur Pata 757cf95070
Script v2: Adds linter and prettier, satisfies linter (#5691)
* Install deps and create config

* Satisfy linter in tests

* Silence redeclare warnings

* Remove shadowed/redeclared variables

* Update changelog
2025-09-04 04:56:42 +00:00
dependabot[bot] 7313137a57
Bump actions/checkout from 4 to 5 (#5647)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-18 09:07:45 +00:00
Karl-Aksel Puulmann e52e9882c9
Bump eslint-plugin-playwright, add tracker-release: none label (#5645)
* Add support for `tracker release: none` label

* Update eslint-plugin-playwright

* Fix conditional

* chore: Bump tracker_script_version to 28
2025-08-18 09:02:01 +00:00
Karl-Aksel Puulmann 516b977b91
ScriptV2: On NPM release, link to NPM in basecamp (#5631) 2025-08-12 07:44:59 +00:00
dependabot[bot] ddba753710
Bump actions/download-artifact from 4 to 5 (#5626)
* Bump actions/download-artifact from 4 to 5

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update arch to get tracker CI to run

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Pata <artur.pata@gmail.com>
2025-08-11 09:44:19 +00:00
Artur Pata 51647b323d
Shard playwright tests, cache tracker npm deps and browsers (#5603) 2025-08-04 09:49:10 +00:00
RobertJoonas b76996b3a4
Verification v2 (#5549)
* new verifier script with tests + telemetry

* dataDomainMismatch tests

* more tests for callbackStatus and plausibleInstalled

* create priv/verifier subfolder + fix Elixir CI

* bump CI cache version

* organize verifier tests

* Remove accidentally committed verifier

* Rework compilation: Make it a variant, always return new verifier code in tests

* Make priv/tracker/verifier/ exist

* Handle static checks with grace

* Fix paths

* Fix paths

* Add some tests

* Add one more test

* split up the JS

* proxyLikely + code structure refactor + unit tests

* fix telemetry fields

* move most telemetry to logs

* run verifier tests only on chromium

* detect wordpressPlugin and wordpressLikely

* detect GTM

* rename JS checks

* detect cookiebot

* include new fields in logs

* different logs for browserless request vs js failures

* detect manual extension

* detect unknown attrs + fix logging

* stick to Elixir checks for snippet detection

* fix codespell

* fix IO.inspect

* remove unnecessary fields from test mock

* cookiebot doc

* move test into verifier subfolder

* do not duplicate ts types

* comma -> semicolon in log

* test dynamically loaded snippet

* improve logging on Browserless error

---------

Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
2025-07-14 14:32:21 +00:00
Cenk Kücük c982caab9b
Add configuration for partitioned testing (#5567)
* Add configuration for partitioned testing

* Partition ce_test related tests as well
2025-07-14 07:17:07 +00:00
dependabot[bot] a8a3f67eff
Bump actions/checkout from 3 to 4 (#5498)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 09:45:49 +00:00
Karl-Aksel Puulmann c3dd21431c
ScriptV2: `transformRequest` (#5488)
* Commit as Plausible Bot

This way commits by it can be excluded from protections

* ScriptV2: Add support for `config.transformRequest`

transformRequest allows users to either manipulate or ignore requests to plausible
with a minimal footprint.

Some use-cases we're aware of and are planning for:
1. Ignoring requests similar to previous exclusion rules in WordPress
2. Normalizing urls for requests

* Allow passing `options.url` for overriding url when calling track

Previous naming `u` was unintuitive, but is kept around (untyped) for backwards
compatibility reasons

* chore: Bump tracker_script_version to 17

* Changelog

* Update types

* Docs

* Add test showing interaction with engagement events

* README.md
2025-06-12 11:50:27 +00:00
Adam Rutkowski 26bb3ffe91
Include co-authors in basecamp notifications (#5490)
* Include co-authors in basecamp notifications

* Update .github/workflows/build-private-images-ghcr.yml

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2025-06-11 07:16:38 +00:00
Karl-Aksel Puulmann 17f116d827
ScriptV2: Tracker release process, documentation (#5477)
* Release process start

* Move CHANGELOG.md to tracker directory, symlink

* Update LICENSE

* Restructure symlinks to make sure files are included in `npm pack`

* Start with new flows

* New workflow for tracker script releasing

* Changelog

* typo

* Fix bump steps naming

* Scope commit to tracker/ folder

* Step naming
2025-06-10 08:34:42 +00:00
hq1 05e87c258d
Fix Basecamp notification message (#5486)
* Fix BC notification message

* Update .github/workflows/build-private-images-ghcr.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-10 07:44:51 +00:00
hq1 97679872e5
Make BC notifications more compact and meaningful? (#5485)
* Make basecamp notifications more compact and meaningful?

* Maybe like this

* Maybe like this even

* Maybe even like this lmao
2025-06-10 07:23:53 +00:00
Karl-Aksel Puulmann 98cdeb23dd
ScriptV2: Configuration renames, iteration (#5427)
* plausible-main -> plausible-web

* Change elixir workflow

* Update tracker option names in tracker.ex

* config.hash -> config.hashBasedRouting

* Enable revenue by default for plausible-web

* Enable taggedEvents by default

* config.local -> config.captureOnLocalhost

* manual -> autoCapturePageviews

* Update playwright tests

* Support adding/editing file types for download in plausible-web

Original docs: https://plausible.io/docs/file-downloads-tracking#what-if-i-want-to-track-a-different-file-type

* rebase: initialize-page-dynamically update

* chore: Bump tracker_script_version to 12

* Ignore pageviews in file-downloads.spec

* Phrasing in tests

* Remove unneeded conditional
2025-05-27 11:28:17 +00:00
Karl-Aksel Puulmann 07fbfb0c05
Bump CACHE_VERSION to ensure latest plausible-main (#5404)
In a recent branch https://github.com/plausible/analytics/pull/5389 a cached
value got renamed, causing issues like in the following build:

https://github.com/plausible/analytics/actions/runs/15137498435/job/42552696051?pr=5402
2025-05-20 12:58:30 +00:00
Karl-Aksel Puulmann f8658320d5
ScriptV2: plausible-main application code (#5389)
* PlausibleWeb.Tracker -> PlausibleWeb.TrackerPlug

* Support getting plausible-main.js via app from `/js/s-${tag}`

tag currently is site.installation_meta["id"] but im planning (separately) to
introduce a different, shorter id version (using something like NanoId/HashId).

This will be introduced in a separate PR though

* Mark some variables as legacy

* Remove compile-time dependency on plausible-main.js

* Fix build

* moduledoc

* Bump CACHE_VERSION to ensure plausible-main is compiled

* 404 consistently

* Revert "Remove compile-time dependency on plausible-main.js"

This reverts commit 4b533ef0f6.

* Ensure file exists at compile-time

* flat_map over reject

* assert -> refute

* JSON.encode!
2025-05-19 06:02:26 +00:00
Karl-Aksel Puulmann 96abac2d4e
ScriptV2: plausible-main, script size measurements (#5375)
* analyze-sizes.js script

* Start work on plausible-main

Size changes:
```
Main variants:
|                                 | Brotli | Gzip  | Uncompressed |
| ------------------------------- | ------ | ----- | ------------ |
| plausible-main.js (new variant) | 2344B  | 2675B | 6062B        |

Important legacy variants:
|                                                                                                   | Brotli               | Gzip                 | Uncompressed          |
| ------------------------------------------------------------------------------------------------- | -------------------- | -------------------- | --------------------- |
| plausible.js                                                                                      | 1086B (-6B / -0.5%)  | 1283B (+5B / +0.4%)  | 2684B (+4B / +0.1%)   |
| plausible.hash.js                                                                                 | 1078B (+24B / +2.3%) | 1268B (+29B / +2.3%) | 2642B (+76B / +3%)    |
| plausible.pageview-props.tagged-events.js                                                         | 1846B (+57B / +3.2%) | 2158B (+63B / +3%)   | 4739B (+185B / +4.1%) |
| plausible.file-downloads.hash.pageview-props.revenue.js                                           | 1669B (+62B / +3.9%) | 1958B (+54B / +2.8%) | 4097B (+175B / +4.5%) |
| plausible.compat.exclusions.file-downloads.outbound-links.pageview-props.revenue.tagged-events.js | 2286B (+81B / +3.7%) | 2692B (+84B / +3.2%) | 5978B (+280B / +4.9%) |

Summary:
|                                                                                                                     | Brotli               | Gzip                 | Uncompressed            |
| ------------------------------------------------------------------------------------------------------------------- | -------------------- | -------------------- | ----------------------- |
| Largest variant (plausible.compat.exclusions.file-downloads.outbound-links.pageview-props.revenue.tagged-events.js) | 2286B (+81B / +3.7%) | 2692B (+84B / +3.2%) | 5978B (+280B / +4.9%)   |
| Max change (plausible.exclusions.hash.local.manual.outbound-links.pageview-props.js)                                | 1460B (+80B / +5.8%) | 1755B (+83B / +5%)   | 3557B (+241B / +7.3%)   |
| Min change (plausible.js)                                                                                           | 1086B (-6B / -0.5%)  | 1283B (+5B / +0.4%)  | 2684B (+4B / +0.1%)     |
| Median change                                                                                                       | 1723B (+65B / +3.9%) | 2037B (+70B / +3.6%) | 4335B (+220.5B / +5.3%) |
```

* Janky conditionals for COMPILE_CONFIG

Results in no size increase for historical scripts:

Main variants:
|                                 | Brotli | Gzip  | Uncompressed |
| ------------------------------- | ------ | ----- | ------------ |
| plausible-main.js (new variant) | 2339B  | 2672B | 6058B        |

Important legacy variants:
|                                                                                                   | Brotli          | Gzip                | Uncompressed    |
| ------------------------------------------------------------------------------------------------- | --------------- | ------------------- | --------------- |
| plausible.js                                                                                      | 1092B (0B / 0%) | 1280B (+2B / +0.2%) | 2680B (0B / 0%) |
| plausible.hash.js                                                                                 | 1054B (0B / 0%) | 1241B (+2B / +0.2%) | 2566B (0B / 0%) |
| plausible.pageview-props.tagged-events.js                                                         | 1789B (0B / 0%) | 2097B (+2B / +0.1%) | 4554B (0B / 0%) |
| plausible.file-downloads.hash.pageview-props.revenue.js                                           | 1607B (0B / 0%) | 1906B (+2B / +0.1%) | 3922B (0B / 0%) |
| plausible.compat.exclusions.file-downloads.outbound-links.pageview-props.revenue.tagged-events.js | 2205B (0B / 0%) | 2610B (+2B / +0.1%) | 5698B (0B / 0%) |

Summary:
|                                                                                                                     | Brotli                   | Gzip                     | Uncompressed             |
| ------------------------------------------------------------------------------------------------------------------- | ------------------------ | ------------------------ | ------------------------ |
| Largest variant (plausible.compat.exclusions.file-downloads.outbound-links.pageview-props.revenue.tagged-events.js) | 2205B (0B / 0%)          | 2610B (+2B / +0.1%)      | 5698B (0B / 0%)          |
| Max change (plausible.js)                                                                                           | 1092B (0B / 0%)          | 1280B (+2B / +0.2%)      | 2680B (0B / 0%)          |
| Median change                                                                                                       | 1655B (0B / 0%)          | 1969B (+2B / +0.1%)      | 4116B (0B / 0%)          |

* plausible-main: no COMPILE_EXCLUSIONS

Size change from this:
|                   | Brotli              | Gzip                  | Uncompressed          |
| ----------------- | ------------------- | --------------------- | --------------------- |
| plausible-main.js | 2223B (-116B / -5%) | 2533B (-139B / -5.2%) | 5710B (-348B / -5.7%) |

* Rework server.js to be less compiler-aware

* Add first test for plausible-main.js

* Tests for plausible-main variant

* Remove report-sizes.js

* Tracker - report size changes in a comment

* Update summary notes

* Handle outbound links not being captured by network tab in webkit

See: https://3.basecamp.com/5308029/buckets/39034214/card_tables/cards/8429433464

* Solve a TODO

* Sign in comment

* Update pin

* Mock file downloads

* Update base branch

* Pin add-and-commit as per cenk request

* Use bot for checkout

* Attempt to reduce permissions

* Smaller fetch depth

* Fix rebase
2025-05-12 06:55:54 +00:00
Karl-Aksel Puulmann 7265d04a8c
ScriptV2: Improved tracker compile.js (#5363)
* Add CLI arguments to compile.js and logging

* Rename folder

* Extract compile code, es modules

* Add a progress bar

* Remove handlebars

* Update report-sizes

* Remove debug code

* inline

* More generous split

* Allow positional arguments for compiling

* Add watch option to compile

* Add compileFile logic

* Most tests run under playwright

* All tests runnable

* Update playwright, remove hack

Note that upgrading to latest failed due to a new test failure. This
might be due to a chrome update.

* Compile script on the fly for tests

* Minor refactor for compileAll

* es module for generate-variants.js

* Allow passing suffix to compilation script - this can be used to generate separate files for comparison

* Fix positionals

* Switch from 2 passes to 1 pass

Did some data analysis on this data:
- Compared to master, 1 pass increased brotli size by 0.7%, 2 passes 0.4%.

Given the change is insignificant enough, we can ignore it for now

The increase is likely due to order of operations in compilation and
some inlined functions getting lost.

* Move customEvents.js to plausible.js

* Clean up API

* Suffix default

* Rework variants.json, globals stored there

* Add more variants under test

* Distribute work across multiple worker threads

Compile time went on my machine from 60s -> 30s

* Fixup server

* Update canSkipCompile

* chore: Bump tracker_script_version to 7

* Update scripts

* Update node-version

* Experiment with adding a small delay to page

* Casing

* rename variable

* Update help text

* features -> compileIds, backport functionality from other branch
2025-05-08 07:05:09 +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
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
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
Karl-Aksel Puulmann 539f4a3f98
Tracker script version reported to /api/event (#5198)
* WIP

* tracker_script_version over reportedVersion

Will make it easier to grep for this thing

* CHANGELOG.md

* Only add tracker/package.json in workflow commit

* chore: Bump tracker_script_version to 1

* Show tracker_script_version is reported in tracker tests

* Track `engagement_time` while accounting for time page is blurred (#5206)

Consider this scenario:
1. User opens page /blog
2. 3 seconds later, alt-tabs to another window
3. minute later, alt-tabs to the page and closes it

Previously, this would be reported as 1m03s engagement_time. Now this
would be reported as 3s engagement_time.

* remove redundant engagement cooldown (#5199)

---------

Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
2025-03-18 07:30:17 +00:00
Karl-Aksel Puulmann 351e7c9100
Bump elixir.yml cache version to fix a test (#5143)
A test in test/plausible_web/plugs/tracker_test.exs was failing due to
cached version of tracker script being used in other PRs.

The reason it didn't fail in the original PR adding the test was that
changes in tracker script bypassed the cache **for that pr**.
2025-03-06 10:30:21 +00:00
hq1 552528d62d
Bump elixir to 1.17.3 and OTP to 27.2.1 (#5040)
* Bump elixir to 1.17.3 and OTP to 27.2.1

To address https://github.com/erlang/otp/issues/8588

* Bump cache

* Bump secondary alpine

* Try unzip due to `{:error, :bad_eocd}` on OTP 27.2.1

* jfc

* Revert "jfc"

This reverts commit 018d33fadc.

* Revert "Try unzip due to `{:error, :bad_eocd}` on OTP 27.2.1"

This reverts commit e04750ff82.

* huh

* Use Plausible.File.mv!

* Another one

* fixup

* Format

* Another one

* Format

* Update test/plausible/exports_test.exs

Co-authored-by: ruslandoga <ruslandoga+gh@icloud.com>

* Bump CI cache again

---------

Co-authored-by: ruslandoga <ruslandoga+gh@icloud.com>
2025-02-10 08:17:10 +00:00
ruslandoga ea7b50d3fe
Use ARM runners to build public images for ARM (#4988)
* use arm runners

* drop qemu

* rename jobs

* Update .github/workflows/build-public-images-ghcr.yml

* add missing runs-on

* fix build step id

* don't need ERL_FLAGS=+JMsingle true
2025-01-20 12:48:52 +00:00
Cenk Kücük 7d371fe999
upgrade clickhouse-server image (#4956) 2025-01-14 10:45:05 +00:00
Karl-Aksel Puulmann a3241c2f24
[WIP] Pin nodejs version to be the same as .tool-versions (#4945)
* Only notify of failure on master

* Pin nodejs version to be the same as .tool-versions
2025-01-08 08:20:53 +00:00
Cenk Kücük 0db7176726
Delete .github/workflows/build-public-images.yml (#4917) 2024-12-18 05:39:52 +00:00
Adrian Gruntkowski 3afec60d98
Remove team adapters (#4877)
* wip

* wip

* 🍌

* WIP

* Draw the rest of the owl (well, almost)

* Remove obsolete unlimited trial logic

* Remove `allow_next_upgrade_override?` adapter

* Remove `Teams` adapter

* Remove /sites adapters

* Remove `Sites` adapter

* Remove `change_plan` adapter

* Fix up CE test

* Remove adapter for Billing.latest_enterprise_plan_with_price(s)

* Remove adapter for `Billing.has_active_subscription?`

* Remove adapter for `Billing.active_subscription_for`

* Remove remaining billing adapter

* Remove all_pending_transfers

* Remove `get_owner` adapter

* Remove `has_sites?` and `owns_sites?` adapters

* Remove `Ownership` adapter

* Remove `check_invitation_permissions` adapter

* Remove `check_team_member_limit` adapter

* Remove `ensure_transfer_valid` adapter

* Remove Invitations adapter

* Remove sole teams adapter

* Make dialyzer happy

* Consolidate `Billing.features_usage` definition

* Remove unused `Quota.Usage`

* Remove remains of `read_team_schema` FF and reduce number of CI passes

* Bang up the condition

* Include pending invitations when querying `has_sites?`

* Fix and improve conditional expression in `plan_box` component

* Update comments

---------

Co-authored-by: Adam Rutkowski <hq@mtod.org>
2024-12-05 09:02:09 +00:00
Karl-Aksel Puulmann 133423f7e6
Limit workflows being executed for elixir (#4856)
We're not expecting a lot of incompatibilities with pg 15 so it makes sense to combine these with reading team schemas
2024-12-03 11:23:34 +00:00
Karl-Aksel Puulmann 4aa7dec301
Channels: Migration to add materialized column, backfill code (#4798)
* Channels: Migration to add column, backfill code

This change adds `acqusition_channel` columns to events_v2 and
sessions_v2 tables. These columns are materialized - we don't ingest
into them directly. Instead they're calculated based on other columns.

The data migration changes now allow to also backfill the column.

Tested the ability to change definitions by changing the function
definitions and re-running the migration with backfill. Confirmed that
the underlying data changed as expected.

* quiet option

* Exclude data migrations from validation

* Migration consistency
2024-11-12 06:41:34 +00:00
dependabot[bot] 58ad39b5cc
Bump poseidon/wait-for-status-checks from 0.5.0 to 0.6.0 (#4741)
Bumps [poseidon/wait-for-status-checks](https://github.com/poseidon/wait-for-status-checks) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/poseidon/wait-for-status-checks/releases)
- [Commits](https://github.com/poseidon/wait-for-status-checks/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: poseidon/wait-for-status-checks
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-06 18:48:51 +00:00
dependabot[bot] c763709588
Bump thollander/actions-comment-pull-request from 2.5.0 to 3.0.1 (#4770)
Bumps [thollander/actions-comment-pull-request](https://github.com/thollander/actions-comment-pull-request) from 2.5.0 to 3.0.1.
- [Release notes](https://github.com/thollander/actions-comment-pull-request/releases)
- [Commits](https://github.com/thollander/actions-comment-pull-request/compare/v2.5.0...v3.0.1)

---
updated-dependencies:
- dependency-name: thollander/actions-comment-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-06 18:39:44 +00:00