Repository navigation
Populate site_imports from sites.imported_data in CE - #4155
Conversation
54558a7 to
3eb0a39
Compare
|
Unfortunately, this might not work as I have used https://hexdocs.pm/ecto_sql/Ecto.Migrator.html#with_repo/3 wrapper function to ensure |
|
Can the script switch to using Plausible.IngestRepo? |
|
@ruslandoga Wouldn't |
|
Why would it be missing? |
|
@ruslandoga That's why it's failing here in the first place, to my understanding. Looking at https://github.com/elixir-ecto/ecto_sql/blob/v3.11.2/lib/mix/tasks/ecto.migrate.ex#L151-L158 - the migration task only starts a particular repo for the duration of executing the migrations, not the whole app (or other repos, in parallel). I think the same holds for migrator in releases. |
|
This fails with migrator run via release because I think it's better to add an explicit migration step to upgrade instructions instead, like: |
|
I think it's easier to work around this than to push it down to self-hosters to perform another manual step.
PR: #4158 |
We are not using
|
3eb0a39 to
14fbfc0
Compare
Anyone trying to setup the application locally (for instance, with P.S. The updated |
MIX_ENV=ce|ce_test mix ecto.setup fails already since seeds use funnels :) And it doesn't seem like ClickhouseRepo is called if there are no sites in the DB (the setup use-case). Something feels off to me about this migrator wrapper. |
|
I was wrong, only the selected repos and apps are started right now. analytics/lib/plausible_release.ex Lines 178 to 182 in ebabf75 [
{:ecto_sql, ~c"SQL-based adapters for Ecto and database migrations", ~c"3.11.1"},
{:ch, ~c"HTTP ClickHouse driver for Elixir", ~c"0.2.5"},
{:mint, ~c"Small and composable HTTP client.", ~c"1.6.0"},
{:hpax, ~c"Implementation of the HPACK protocol (RFC 7541) for Elixir", ~c"0.2.0"},
{:castore, ~c"Up-to-date CA certificate store.", ~c"1.0.7"},
{:ecto, ~c"A toolkit for data mapping and language integrated query for Elixir", ~c"3.11.2"},
{:eex, ~c"eex", ~c"1.16.0"},
{:postgrex, ~c"PostgreSQL driver for Elixir", ~c"0.17.5"},
{:jason, ~c"A blazing fast JSON parser and generator in pure Elixir.\n", ~c"1.4.1"},
{:decimal, ~c"Arbitrary precision decimal arithmetic.", ~c"2.1.1"},
{:db_connection, ~c"Database connection behaviour for database transactions and connection pooling\n", ~c"2.6.0"},
{:telemetry, ~c"Dynamic dispatching library for metrics and instrumentations", ~c"1.2.1"},
{:ssl, ~c"Erlang/OTP SSL application", ~c"11.1"},
{:public_key, ~c"Public key infrastructure", ~c"1.15"},
{:asn1, ~c"The Erlang ASN1 compiler version 5.2.1", ~c"5.2.1"},
{:crypto, ~c"CRYPTO", ~c"5.4"},
{:logger, ~c"logger", ~c"1.16.0"},
{:elixir, ~c"elixir", ~c"1.16.0"},
{:compiler, ~c"ERTS CXC 138 10", ~c"8.4.1"},
{:stdlib, ~c"ERTS CXC 138 10", ~c"5.2"},
{:kernel, ~c"ERTS CXC 138 10", ~c"9.2"}
]So this migration still needs a workaround to either:
defp prepare do
# ...
Enum.each([Plausible.ClickhouseRepo | repos()], & &1.start_link(pool_size: 2))
endI've opened a PR with the latter: #4155 |
Changes
This PR makes site_imports be automatically populated from sites.imported_data on startup for CE builds. Right now the self-hosters need to do it manually. See #4125 (reply in thread)
Tests
Changelog
Documentation
Dark mode