Commit Graph

82 Commits

Author SHA1 Message Date
hq1
d2f2c69387
Conditionally support switching between v1 and v2 clickhouse schemas (#2780)
* Remove ClickhouseSetup module

This has been an implicit point of contact to many
tests. From now on the goal is for each test to maintain
its own, isolated setup so that no accidental clashes
and implicit assumptions are relied upon.

* Implement v2 schema check

An environment variable V2_MIGRATION_DONE acts like
a feature flag, switching plausible from using old events/sessions
schemas to v2 schemas introduced by NumericIDs migration.

* Run both test suites sequentially

While the code for v1 and v2 schemas must be kept still,
we will from now on run tests against both code paths.
Secondary test run will set V2_MIGRATION_DONE=1 variable,
thus making all `Plausible.v2?()` checks return `true'.

* Remove unused function

This is a remnant from the short period when
we would check for existing events before allowing
creating a new site.

* Update test setups/factories with v2 migration check

* Make GateKeeper return site id along with :allow

* Make Billing module check for v2 schema

* Make ingestion aware of v2 schema

* Disable site transfers for when v2 is live

In a separate changeset we will implement simplified
site transfer for when v2 migration is complete.
The new transfer will only rename the site domain in postgres
and keep track of the original site prior to the transfer
so we keep an ingestion grace period until the customers
redeploy their scripting.

* Make Stats base queries aware of v2 schema switch

* Update breakdown with v2 conditionals

* Update pageview local start with v2 check

* Update current visitoris with v2 check

* Update stats controller with v2 checks

* Update external controller with v2 checks

* Update remaining tests with proper fixtures

* Rewrite redundant assignment

* Remove unused alias

* Mute credo, this is not the right time

* Add test_helper prompt

* Fetch priv dir so it works with a release

* Fetch distinct partitions only

* Don't limit inspect output for partitions

* Ensure SQL is printed to IO

* Remove redundant domain fixture
2023-03-27 13:52:42 +02:00
Adam
4654a50365
Revert "Fail CI when tests are logging (#2748)" (#2758)
This reverts commit 05d14774be.
2023-03-15 13:13:46 +01:00
Adam
05d14774be
Fail CI when tests are logging (#2748)
A re-iteration of a miserable attempt from #2694

Hi @dgvncsz0f, how you've been ;D
2023-03-14 07:45:41 -03:00
Adam
59a76dedf1
Revert "Fail the CI if tests emit log errors/warnings (#2694)" (#2745)
* Revert "Fail the CI if tests emit log errors/warnings (#2694)"

This reverts commit ef894b0546.

* Mute a test
2023-03-13 16:13:17 +01:00
Uku Taht
43bf7dd09f
Use user-agent instead of screen_width to get device type (#2711)
* Use user-agent instead of screen_width to get device type

Co-authored-by: eriknakata <erik.nakata5@gmail.com>

* Fix credo

* Log on unhandled UAInspector device type

* Make 'browser' the default tab in devices report

* Remove device tooltip

* Remove screen_width from ingestion completely

* Remove browserstack harness, run playwright directly

* Select meta key based on OS platform

* Run CI tests in parallel

* Improve device match readability

* Add changelog

---------

Co-authored-by: eriknakata <erik.nakata5@gmail.com>
2023-03-02 11:04:01 +01:00
Adam Rutkowski
ecb552479f
Upgrade erlang/elixir/alpine stack (#2695)
* Dockerfile: pin elixir-1.14.3, erlang-25.2.3, alpine-3.17.0

* asdf: pin erlang 25.2.3, elixir 1.14.3-otp-25

* Remove nonsense

* Remove erlang dupe

* Remove erlang, it's in the base image already

* Remove empty file

* Truncate seconds in NaiveDateTime instances

* Bump cache key

* Mitigate Error:error:0308010C:digital envelope routines::unsupported

See: https://www.newline.co/@kchan/how-to-fix-the-error-errorerror0308010cdigital-envelope-routinesunsupported--0f8d3f17

* Upgrade to latest alpine image and pin to an exact digest

* Revert "Upgrade to latest alpine image and pin to an exact digest"

This reverts commit cdf6624efa.

* Pin alpine image to an exact digest

---------

Co-authored-by: Cenk Kücük <c@cenk.me>
2023-02-22 09:49:43 +01:00
Adam Rutkowski
ef894b0546
Fail the CI if tests emit log errors/warnings (#2694)
* Make CI fail if tests emit warning/error logs

* Swallow log output in GA test case
2023-02-21 10:38:22 +01:00
Adam Rutkowski
ac1f44f89a
Bump clickhouse images to 22.8.13.20-alpine (prod/CI) (#2660)
* Bump clickhouse images to 22.8.13.20-alpine (prod/CI)

* !fixup

* Remove clickhouse-ci target
2023-02-09 08:11:03 +01:00
Uku Taht
1772ddff17
Add Checkly (#2520)
* Add Checkly Terraform config

* add deployment workflow

* use pagerduty instead of email for notifications

* use terraform cloud backend

* update variable declaration

* rename checkly check group

* update syntax

* test trigger

* Revert "test trigger"

This reverts commit 333e82beac.

* run a single job at a time

Co-authored-by: Cenk Kücük <c@cenk.me>
2023-01-05 20:25:54 +01:00
Adam Rutkowski
5de43b758d
Run tests in async mode where applicable (#2542)
* Set pg pool size for MIX_ENV=test

* Include slow tests in CI run

* Exclude slow tests by default

* Mark tests slow/async where applicable

* Restructure captcha mocks

* Revert async where env is relied upon

* Add --max-failures=1 to CI run

* Set warnings as errors

* Disable async where various mocks are used

* Revert "Disable async where various mocks are used"

This reverts commit 2446b72a29.

* Disable async for test using vcr
2022-12-26 10:20:29 -03:00
Uku Taht
8bdbabbdad
Enable Dialyzer and Credo in CI (#2315) 2022-11-04 23:42:03 -03:00
ruslandoga
ad10721d46
add v prefix to version tags in public images (#2340) 2022-10-19 09:09:09 -03:00
Adam Rutkowski
aa97e9cf89
Notify team on image build failures (#2331) 2022-10-13 11:41:05 -03:00
Uku Taht
2c2f710d24 Push public image 2022-10-11 13:35:34 +02:00
RobertJoonas
c0da024b23
Remove static tracker files (#2116)
* remove tracker files from git index

* generate tracker files on npm test

* generate tracker files for elixir tests/dev/CI

* update tracker/package-lock.json

* exclude npm run deploy from mix test + some docs
2022-10-11 12:19:28 +02:00
Uku Taht
eca71b9b60 Run CI against all supported PostgreSQL versions 2022-10-05 11:01:41 +03:00
FarisZR
620e29ab33
ARM64 support for docker images (#2103)
* Add ARM64 build

* Update CHANGELOG.md

* Update Docker arm PR number
2022-09-26 16:11:30 +03:00
Uku Taht
df9f96970c Clear github actions cache for Elixir compilation 2022-09-21 13:41:03 +03:00
Adam Rutkowski
86b45fd52e
Add dependabot deps upgrade integration (#2187)
* Add dependabot deps upgrade integration

* Include npm/docker in dependabot config
2022-09-19 14:55:03 +03:00
Vinicius Brasil
54260c294f
Publish Elixir documentation to GitHub Pages (#2231)
* Install and setup ex_doc

* Create GitHub Action to publish docs
2022-09-16 10:56:35 +03:00
Adam Rutkowski
2692bf4e38
Build docker images with new tags (#2212)
* Build docker images with new tags

* Use single workflow to build all private images
2022-09-13 15:43:58 -03:00
Vinicius Brasil
7c24120ee1
Build Docker images for each PR (#2152)
* Create Action for building PR images

* Make master and stable private images

* Rename docker.yml to build-public-images.yml
2022-09-06 09:29:12 -07:00
Uku Taht
99fd101135
Add basic test harness for browserstack/playwright (#1961)
* Add basic test harness for browserstack/playwright

* Refactor the tests

* added the first test for outbound links

* tests for outbound-links and file-downloads

* added more browser versions to test on

* Lint tracker test files

* Update harness.js with BrowserStack example

* Fix Playwright request mocks

* Add test harness to CI

* Remove Safari on Windows from browsers list

Co-authored-by: Robert <robertjoonas16@gmail.com>
Co-authored-by: Vinicius Brasil <vini@hey.com>
2022-08-04 11:50:09 +03:00
Uku Taht
2b8e3ea62a
Use finch in sentry client (#1996)
* Introduce Finch for Sentry integration

* Make sure the DummyAgent can be started

* No need to sanitize the dsn, finch takes care of that

* Simplify the dummy child spec

* Annotate redirects clause

* Make use of new `get_int_from_path_or_env`

* Actually use finch in Sentry config

* Configure `excluded_domains` correctly for Sentry

The way sentry is configured currently, when we get an HTTP error it
will be logged twice - once from Sentry.PlugCapture and once from
Sentry.LoggerBackend. The logger backend module does the right thing
by default but for some reason we've been overriding the config
parameter that by default stops double-counting errors. This commit
returns to the default configuration which is better.

* Default to 15s timeout

* Attempt to send twice at most

* Warn in sentry client

* Use warn level in sentry client

Co-authored-by: Adam Rutkowski <hq@mtod.org>
2022-07-08 11:14:52 +03:00
Kian-Meng Ang
ae61aecfd0
Use erlef/setup-beam for GitHub Actions (#1880) 2022-06-06 10:42:24 +03:00
Uku Taht
b667d65d52 Move ARG to running container instead of build container 2022-05-27 15:24:11 +03:00
Uku Taht
f0e0062dc1 FIx typo 2022-05-27 14:49:04 +03:00
Uku Taht
5b5c70b82d Add build metadata to build arg 2022-05-27 14:30:21 +03:00
Uku Taht
afe2f6d8e1 Tag docker images during build 2022-05-27 14:09:57 +03:00
Uku Taht
da93f2aa6e Remove dead code 2022-05-27 10:52:58 +03:00
Marko Saric
6a5364fa0b
Create config.yml 2022-05-24 09:35:00 +02:00
Uku Taht
db27aa48bb CI BS 2022-05-03 15:42:50 +03:00
Uku Taht
af4054ef84 CI BS 2022-05-03 15:41:36 +03:00
Uku Taht
28e19e9278 Print GITHUB_WORKSPACE 2022-05-03 15:21:02 +03:00
Uku Taht
7e143fc8ee Fix docker build 2022-05-03 15:06:20 +03:00
Uku Taht
d100f1400d Show version number 2022-05-03 12:14:38 +03:00
Marko Saric
77b5e722e5
Update bug_report.yaml 2022-04-19 12:38:49 +02:00
Uku Taht
17eb87f827 Update issue template options 2022-03-25 10:16:32 +02:00
Uku Taht
a783cb3ee9 Update issue template 2022-03-25 10:15:16 +02:00
Uku Taht
438d605429 Update issue template 2022-03-25 10:14:35 +02:00
Uku Taht
0e28101344 Issue template 2022-03-25 10:11:09 +02:00
Marko Saric
834470281d
Update bug_report.yaml 2022-03-24 20:30:34 +01:00
Uku Taht
d9b4f81ef5 Add dark mode to PR template 2021-12-20 11:27:24 +02:00
Adam from Buildjet
1146ec0960
BuildJet 4vCPU (#1523) 2021-12-08 15:57:15 +02:00
Uku Taht
bd64372e6b Install deps for tracker 2021-11-24 12:17:05 +02:00
Uku Taht
b83e7b9dc5 Build JS before measuring it 2021-11-24 12:06:28 +02:00
Uku Taht
fdac5e2be6 Add bundlemon 2021-11-24 11:55:14 +02:00
Uku Taht
05bf43c1be
City level location data (#1449)
* Merge branch 'plausible_master'

* Add City level details

* Add City level details

* Use ISO codes instead of geoname_id for subdivisions

* Add easier way to configure geolocation database

* Add workflow for dev branch

* Correct clickhouse migration

* Translate subdivision names

* Translate city names

* WIP

* Region and country filters

* Fix region filter

* Remove region_name when removing region filter

* Add modals for regions and cities

* Remove dead code

* WIP

* Revert "WIP"

This reverts commit 3202bf2fe9.

* Feature flag to hide cities when deployed

* Add changelog entry

* Remove unused code

* Remove unused variables

* Fix test

Co-authored-by: AymanTerra <aymanterra@yahoo.com>
2021-11-23 11:39:09 +02:00
Uku Taht
b01b569cd5 Update clickhouse version in tests 2021-11-16 10:45:21 +02:00
Uku Taht
497824d578 Add prefix to node action 2021-10-12 11:15:50 +02:00