Skip to content

Compile the release without the key and build the image on pull requests - #501

Merged
shostakovich merged 3 commits into
mainfrom
fix-release-compile
Oct 24, 2026
Merged

shostakovich merged 3 commits into
mainfrom
fix-release-compile

Conversation

@shostakovich

Copy link
Copy Markdown
Contributor

Why

After #500 the image job on main gets past deps.compile and fails at mix compile: Ecto dumps a field's default at compile time, and for the encrypted attachments of TimelinePost and Mention (from #499) that encrypts, which needs CONFIG_ENCRYPTION_KEY. A release reads the key only at runtime. Both fields now skip the default validation, as DeploymentTarget already does.

Both breakages passed every PR check because only main built the image. Pull requests now build it too, without logging in, pushing or writing the layer cache; main pushes it and is the only one to write the cache, so pull requests do not evict it.

The image job also gets a concurrency group per ref: merges in quick succession built in parallel, so an older build could push :latest over a newer one.

How tested

  • env -u CONFIG_ENCRYPTION_KEY MIX_ENV=prod mix compile failed with the error from main before the fix and passes after it; mix assets.deploy and mix release pass without the key too
  • mix compile --warnings-as-errors, mix format --check-formatted, mix credo --strict, mix deps.unlock --check-unused, mix test: all pass
  • actionlint reports nothing for ci.yml
  • The image check of this PR builds the image with both changes

Risk

Low. Struct defaults stay []. Pull requests take a few minutes longer for the image build; main's job is unchanged apart from the gating.

🤖 Generated with Claude Code

shostakovich and others added 3 commits October 24, 2026 16:36
Ecto dumps a field's default at compile time to validate it. For the
encrypted attachments of timeline posts and mentions that encrypts, which
needs CONFIG_ENCRYPTION_KEY, and a release reads the key only at runtime,
so `mix compile` in the Docker build failed. Skip the default validation,
as DeploymentTarget already does for its encrypted config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The image job ran only on main, so a broken Docker build surfaced only
after the merge. Pull requests now build the image too, without logging
in, pushing or writing the layer cache; main still pushes it and is the
only one to write the cache, so pull requests do not evict it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merges in quick succession started image builds in parallel, so an older
build could finish last and push :latest over a newer image, which
Watchtower would then deploy. A concurrency group per ref queues them;
a newer build replaces a waiting older one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shostakovich
shostakovich merged commit 2ef6e30 into main Oct 24, 2026
6 checks passed
@shostakovich
shostakovich deleted the fix-release-compile branch October 24, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant