Commit Graph
72 Commits
Author SHA1 Message Date
Thomas SharedInboxandClaude Sonnet 4.6 b10696a41e fix(ci): remove tmp timing file — receiver writes directly to stdout
TIMINGFILE=$(mktemp) was an unnecessary /tmp path. The receiver already
prints its report to stdout on shutdown; wait $RECV_PID captures it in
place. Only PORTFILE remains in /tmp (unique via mktemp, deleted in cleanup).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 10:38:26 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 3471e1fd2c feat(ci): OTEL timing receiver for check-dagger
Adds ci/otelrecv/main.go — a minimal OTLP HTTP/JSON trace receiver that
listens on a random port (port 0) so parallel runs never collide.

The check-dagger Taskfile task now starts the receiver in the background,
passes the port via a mktemp file, runs dagger with OTEL env vars set,
then prints a per-span timing report on shutdown. Falls back to plain
dagger call when Go is not available (e.g. CI containers without Go).

First run will show raw attribute keys so we can learn Dagger's exact
telemetry format and refine the cached/live detection logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 10:27:57 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 2d559d4947 feat: cache Android AAB build; stamp versionCode + resign after cache hit
BuildAndroidRelease() drops all params and builds with --build-number 1
(no keystore injected, Gradle uses debug signing). The command is now
stable across all commits — full Dagger cache hit whenever source is
unchanged.

Three new Dagger functions handle the post-cache steps:
- StampAndroidVersionCode(aab, versionCode): pure-stdlib Python patches
  the AAB's compiled manifest proto (android:versionCode resource ID
  0x0101021b) and strips META-INF/ to clear the old signature.
- SignAndroidBundle(aab, keystoreBase64, keystorePassword): decodes the
  base64 keystore secret and re-signs with jarsigner.
- PublishAndroid(ctx, playStoreConfig, keystoreBase64, keystorePassword):
  chains all three + UploadToPlayStore, computing time.Now().Unix() as
  the versionCode internally.

Taskfile: build-android-bundle simplified (no keystore params); publish-
android now calls publish-android in a single Dagger call instead of the
two-step build-then-upload.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 13:35:20 +02:00
Thomas GüttlerandClaude Sonnet 4.6 9466f03936 perf: use commit timestamp as build number to enable Dagger cache hits
$(date +%s) changed every run, making the flutter build WithExec args
unique each time and busting the Dagger layer cache (500s build every run).

$(git log -1 --format=%ct HEAD) is stable for the same commit, so a
retry of a failed upload gets a full cache hit on the build step.
Still monotonically increasing across commits, satisfying Play Store.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 09:20:05 +02:00
Thomas GüttlerandClaude Sonnet 4.6 ef8268a41e fix: rename duplicate build-android-bundle task to build-android-bundle-local
The old fvm-based task had the same name as the new Dagger-based one,
causing go-task to error immediately (1-second CI failure).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 08:37:18 +02:00
Thomas GüttlerandClaude Sonnet 4.6 8783bcf5f0 fix: unique build number and split build/upload steps
- Pass --build-number $(date +%s) to flutter build for both APK and AAB
  so each CI run gets a unique version code (fixes "already been used" error)
- Extract UploadToPlayStore(aab, playStoreConfig) as its own Dagger function
  so the build and upload are independently callable
- Add build-android-bundle task (exports AAB via dagger export) and
  upload-android-bundle task (calls UploadToPlayStore with the local file)
- CI deploy-playstore job now has two steps: Build Android Bundle and
  Upload to Play Store, so a failed upload can be retried without rebuilding
- deploy-apk also gets --build-number to avoid version code collisions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 08:18:33 +02:00
Thomas GüttlerandClaude Sonnet 4.6 484a183a19 fix: pass release keystore into Dagger Android builds
Both BuildAndroidApk and BuildAndroidRelease were using the debug
signing config because the keystore and password were never forwarded
into the Dagger container. Add setupKeystore() helper that decodes
ANDROID_KEYSTORE_BASE64 into android/app/upload-keystore.jks and
sets ANDROID_KEYSTORE_PASSWORD, then wire both secrets through
DeployApk, PublishAndroid, and the Taskfile/CI env blocks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 07:49:45 +02:00
Thomas SharedInbox c712199d0b feat: decrease dagger output size with -q and DAGGER_NO_NAG=1 (#124)
Add -q (quiet) flag to all dagger call invocations to suppress INFO-level
engine messages while keeping warnings and errors visible. Set DAGGER_NO_NAG=1
globally to suppress the Dagger Cloud tracing nag line. --progress=plain
is retained on all calls as required.
2026-05-17 22:15:25 +02:00
Gemini CLI b8acf37c24 fix: CI Dagger syntax, missing deps, and Stalwart startup 2026-05-17 17:14:35 +02:00
Gemini CLI 52473d216d ci: centralize Dagger calls in Taskfile and enforce standards via pre-commit 2026-05-17 16:43:52 +02:00
Gemini CLI 8cbe8c01bb ci: use idiomatic Dagger service bindings for Stalwart
Refactor the CI pipeline to use WithServiceBinding for the Stalwart mail
server, replacing legacy shell scripts and manual port management.
Introduces pre-seeded data for the Stalwart service to avoid network
hits and improves headless UI testing with Xvfb.
2026-05-17 16:01:42 +02:00
GuettliBot2 af3f1e706a ci: migrate coverage to Dagger and fix coverage gate exclusions 2026-05-17 09:15:53 +02:00
GuettliBot2 90ab0a6905 ci: rename integration tests to test-backend and migrate to Dagger 2026-05-17 08:47:15 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 aeb4c5ab41 feat: improve About screen with labeled versions, dark mode, account counts, and bottom buttons (#111)
- Rename "Version" to "App Version"; rename "OS Version" to platform-prefixed label (e.g. "Android Version")
- Link app version to its Codeberg git commit (via GIT_HASH dart-define)
- Add "Dark Mode" yes/no row
- Add IMAP Accounts and JMAP Accounts rows
- Move copy/create-issue actions from AppBar icons to labeled buttons below the table
- Pass GIT_HASH dart-define in Taskfile APK/AAB build commands

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 08:03:13 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 cf277064cc feat(builds): populate builds page with Linux and Android history (#94)
The builds page at /builds/ was empty because generate-build-history
only ran inside deploy-playstore; if that job failed early (e.g. Play
Store secrets not configured) the website was never updated, and the
build-linux job never triggered a website update at all.

Changes:
- generate_build_history.py: extend to cover Linux tarballs in addition
  to Android APKs, capped at MAX_BUILDS_PER_PLATFORM (30) each
- Taskfile: add website-publish task (generate-build-history +
  website-deploy), exclude *.tar.gz from rsync, update descriptions
- .forgejo/workflows/ci.yml: add publish-website job that waits for
  both build-linux and deploy-playstore (using always() so it runs
  even when deploy-playstore fails), then removes the duplicate
  generate/deploy steps from deploy-playstore
- .github/workflows/ci.yml: add deploy job that deploys Linux build,
  generates build history, builds Hugo site, and rsyncs to server
- .gitignore: ignore website/content/builds/_index.md (generated),
  Python __pycache__, and widget test failure screenshots
- stalwart-dev/integration_ui_test.sh: use ${USER:-$(id -un)} for
  robustness in environments where USER is unset
- scripts/test_generate_build_history.py: unit tests for parse_builds
  and render_entries covering both platforms

Generated content (builds/_index.md and per-day pages) is not tracked
in git; it is produced at CI time and rsynced to the server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 19:08:55 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 1af4fa8cf9 feat(ci): fail early when mock files are out of date (#87)
Add check-mocks task that re-runs build_runner and fails if any
*.mocks.dart file differs from what is committed. Wired into
check-fast (pre-commit) and added as an early CI step so stale
mocks are caught before the full test suite runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 10:19:28 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 00c4de8447 feat(windows): add Windows release build, deploy, and in-app update banner
Adds build-windows-release and deploy-windows-to-server Taskfile tasks,
a build-windows CI job (requires a windows-runner self-hosted runner),
and extends updateInfoProvider to also cover Platform.isWindows.
latest.json is now extended with a 'windows' key; both deploy tasks
preserve the other platform's URL when updating the file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 23:56:01 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 724df4ea37 feat(linux): package Linux release, deploy to server, add in-app update banner
Build task embeds GIT_HASH via --dart-define; new deploy-linux-to-server task
packages a tar.gz and updates latest.json on the server. The account list screen
shows a MaterialBanner when a newer Linux build is available.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 23:46:29 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 4b83d3e456 feat(cd): continuous delivery — scp APK to server and build Hugo history
- scripts/generate_build_history.py: SSH into server, list APKs under
  public_html/builds/YYYY/MM/DD/, fetch commit titles from Codeberg API,
  and write Hugo content pages to website/content/builds/
- Taskfile: add deploy-apk-to-server and generate-build-history tasks;
  add --exclude='*.apk' to website-deploy rsync so APKs survive redeploy
- CI: after Play Store deploy, set up SSH key, scp APK, generate history,
  then deploy website
- .gitignore: exclude website/content/builds/ (generated at deploy time)
- website/hugo.toml: add Builds nav item

Closes #73

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 21:46:56 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 53757595c4 revert(android): restore epoch seconds for build-number
The (YY-20)mmddHHMM formula generates ~605M for 2026, which is lower
than existing epoch-second deployments (~1.747B). Google Play rejects
version code regressions at commit time (403 Forbidden).

Blocked — see issue #63 for context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 19:00:02 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 28b86ec1be fix(android): use human-readable build number (YY-20)mmddHHMM
Replaces epoch seconds with a compact date-based integer so the Play
Store version code is interpretable by humans while staying below the
2 100 000 000 upper bound until ~2040.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 18:26:43 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 c46de2abb8 fix(android): use epoch seconds for versionCode, not yymmddhhmm
date +%y%m%d%H%M for 2026-05-14 17:17 = 2605141717 which exceeds
Android's 2100000000 versionCode cap, aborting the build.
Epoch seconds (~1.75B today) stay under the cap and remain unique.
Human-readable build-name (yymmddhhmm) is unchanged for issue #63.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 17:19:50 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 f6f10700f8 feat: select all, human-readable build version, release gated on CI
- Add Select All button to AppBar during selection mode (#15)
- Replace Unix timestamp build number with yymmdd-hhmm format (#63)
- Gate release.yml on CI workflow success via workflow_run event
- Update golden for email_list_selection to reflect new Select All button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 14:23:54 +02:00
Bot of Thomas Güttler 2f1bff8922 ci: enforce ui/→data/ layer boundary (A5) (#53) 2026-05-14 11:41:34 +02:00
Bot of Thomas Güttler 1117cadf2a feat(D2): add task check-coverage and enforce coverage gate in check-fast (#34) 2026-05-14 05:29:41 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 3a63f9adb4 fix: use Unix timestamp as Android versionCode
git rev-list --count returns 1 in shallow CI clones. A Unix timestamp
(~1.747B, well under Android's 2.1B max) is always increasing and works
in both CI shallow checkouts and local full clones.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 19:31:25 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 2f376ef33c fix: use git commit count as Android versionCode
Play Store rejects versionCode 1 since it was already used. Deriving
the build number from `git rev-list --count HEAD` gives a monotonically
increasing versionCode on every push with no manual bumping required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 19:23:24 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 a968b9ff8c fix: add _codegen dep to build-android-bundle
Missing generated .g.dart files caused flutter build appbundle to fail.
_codegen already implies _pub-get via its dep chain.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 18:57:19 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 65aba81952 feat: enable Play Store CI deploy via Google Play API
- Add ndk debugSymbolLevel=FULL to release build type (opt-B for debug symbols)
- Add google-api-python-client to Nix devshell
- Add scripts/deploy_playstore.py to upload AAB to internal track
- Add deploy-android-bundle task to Taskfile
- Enable release.yml (remove if:false, wire up task deploy-android-bundle)
- Fix forbidden-files pre-commit hook to run task via nix develop (like dart-check)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 17:13:38 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 1d3557d67b fix: drop nested nix develop in website-build to preserve env vars
HUGO_PARAMS_GITVERSION was stripped when website-build called
'nix develop --command hugo' from within an already-active nix shell
(nested nix develop resets the environment). Hugo is already on PATH
from the outer 'nix develop --command task website-deploy' in CI, and
locally tasks run from within 'nix develop' per AGENTS.md convention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 09:42:06 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 8f7d33d885 feat: embed git hash in website and verify after CI deploy
- website/layouts/_partials/extend_head.html: injects <meta name="x-version">
  using HUGO_PARAMS_GITVERSION (set by Taskfile at build time)
- Taskfile: website-build sets HUGO_PARAMS_GITVERSION=<short HEAD>;
  new website-verify task runs scripts/website-verify.sh
- scripts/website-verify.sh: fetches homepage, retries 6x/10s, checks
  that the deployed version hash matches HEAD
- website.yml: Verify step after Deploy; scripts/website-verify.sh added
  to path trigger

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 09:32:46 +02:00
Thomas SharedInboxandClaude Sonnet 4.6 76278d6f69 fix: CI _preflight, swap tea→fgj, add ci-logs helper
- flake.nix: replace tea with fgj (fetchurl of v0.4.0 linux_amd64 binary)
- flake.nix shellHook: export IN_NIX_SHELL=1 so that nix develop --command
  sets the variable that _preflight checks (nix develop does not set it
  automatically, unlike the old nix-shell)
- Taskfile.yml _preflight: use IN_NIX_SHELL check instead of DIRENV_DIR,
  which never worked in CI
- scripts/ci_logs.sh + task ci-logs: fetch raw Codeberg Actions job logs
  from the web-UI endpoint (API endpoint not available on Codeberg 15.0.0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 06:05:55 +02:00
Thomas SharedInbox efdcab74d7 setup nix in CI, and reformat. 2026-05-12 21:55:06 +02:00
Thomas SharedInbox 0c14f98a14 Configure Play Store roadmap and Hugo website with automated deployment 2026-05-12 09:10:21 +02:00
Thomas SharedInbox d4902d1395 Deploy via CI. 2026-05-12 08:15:47 +02:00
Thomas SharedInbox 3ca71cd4e5 feat: add hyperlinks to Codeberg commits in ChangeLog (Issue #9) 2026-05-10 13:18:35 +02:00
Thomas SharedInbox 4f55aaa0f7 chore: clean up Taskfile and ensure ChangeLog automation 2026-05-10 11:25:07 +02:00
Thomas SharedInbox 382408985d chore: fix Taskfile automation and cleanup duplication 2026-05-10 11:24:31 +02:00
Thomas SharedInbox 2ecb29d6ee feat: implement in-app ChangeLog from git history 2026-05-10 11:23:39 +02:00
Thomas SharedInbox 26acf7589a chore: strengthen git safeguards and remove tracked .metadata 2026-05-10 10:48:18 +02:00
Thomas SharedInbox e9e731c551 fix: resolve pre-commit and coverage gate issues 2026-05-09 18:59:12 +02:00
guettlibotandThomas SharedInbox 6d58ee1e00 Fix Issues 1, 2, and 3: Headers, Undo, and Crash Reporting (#6)
## Overview
This PR implements several fixes and enhancements requested in the latest session:

### Fixes
1. **Issue 1: Raw Email Headers**
   - Added database support for raw headers.
   - Added a new Headers tab in the email detail screen with a zebra-colored table display.
2. **Issue 2: Exception on Undo of Delete**
   - Added `toJson` and `fromJson` to `EmailAddress` model to fix serialization during undo.
3. **Issue 3: Crash Reporting**
   - Added a button to the Crash Screen to report issues directly on Codeberg.

### Infrastructure
- Added Nix experimental features check to `Taskfile.yml` to ensure a consistent dev environment.

## Verification
- Manually verified the Headers display on Linux.
- Verified Undo for IMAP and JMAP accounts.
- Verified the Crash Screen button.

Co-authored-by: Thomas SharedInbox <sharedinbox@thomas-guettler.de>
Reviewed-on: https://codeberg.org/guettli/sharedinbox/pulls/6
2026-05-09 18:49:34 +02:00
Thomas SharedInbox 674b21298d feat: implement exponential backoff and permanent error handling for sync engine 2026-05-09 13:25:59 +02:00
Thomas Güttler b314a0c1b6 feat: migrate CI to Codeberg Actions and add self-hosted runner config
- Added .forgejo/workflows/ci.yml for thin CI orchestration.
- Configured Dockerized Codeberg runner with Nix support in codeberg-runner/.
- Added systemd service for persistent runner execution.
- Added GEMINI.md for project CI/Nix conventions.
- Added Taskfile task for Linux release builds.
2026-05-08 12:04:42 +02:00
Thomas Güttler 656d4b46d7 Optimize deployment, fix E2E flakiness, and implement database-backed threading
- Optimize task deploy-android with marker files and source/generate tracking.
- Fix flaky Android E2E test with pumpAndSettle and safety delays.
- Implement global CrashScreen and error handlers in main.dart.
- Refactor threading to use a persistent Threads table for performance.
- Add database indexes and migration for schema v18.
- Enhance coverage gate with ghost path checks and increased coverage (82%).
2026-05-07 22:07:54 +02:00
Thomas Güttler ae5a48016c Fix Android deployment pipeline and integration tests
- Run integration tests sequentially in Taskfile.yml to avoid port 4190 (ManageSieve) conflict.
- Add ManageSieve listener to Stalwart config for better test coverage.
- Increase Android emulator boot timeout and add software-mode flags (-accel off, -no-boot-anim, -gpu swiftshader_indirect) to accommodate environments without KVM.
- Update LATER.md with notes on software emulation performance.
2026-05-06 21:54:41 +02:00
Thomas Güttler 9ba6677308 chore: remove MobSF (overkill for current needs) 2026-05-06 20:47:27 +02:00
Thomas Güttler 2f58fb7a08 fix: IMAP attachments (size/download) and immediate sync for deletions
- Fix IMAP attachment sizes showing as '0 B' by falling back to decoded content length.
- Fix IMAP attachment downloads failing for single-part fetches by falling back to root message.
- Implement immediate server-side sync for deletions/flags using a new onChangesQueued stream.
- Automate FVM SDK setup and add 'task setup'.
- Make MobSF optional in build-android to handle environment restrictions.
- Update test fakes to match EmailRepository interface changes.
2026-05-06 09:58:42 +02:00
Thomas GüttlerandClaude Opus 4.7 2e2b7c3d9f fix: Android E2E aliceTile race + bundle deploy-android infra
The Android UI integration test failed at tap(aliceTile) with "0 widgets"
even though pumpUntil had just found the tile. On the slow software-rendered
emulator the route-pop animation finalises during pumpUntil's trailing 300 ms
settle, briefly leaving the tile out of the tree. Re-confirm with a second
pumpUntil before the tap.

Bundles the previously uncommitted infra changes that make task deploy-android
run end-to-end inside nix develop: Linux desktop runtime libs + GL software
rendering env in flake.nix, path_provider_android pin to <2.3 to avoid the
libdartjni SIGSEGV, deferred DB-path resolution after WidgetsFlutterBinding,
+iglx for xvfb-run, platform-tools on PATH, and a single pre-commit script
replacing the dart-format / task-check-fast pair.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 12:36:30 +02:00
Thomas GüttlerandClaude Sonnet 4.6 9c74dec866 perf: speed up deploy-android via MobSF pre-warm and parallel integration tests
Start MobSF as a dep of build-android (_mobsf-start) so it warms up during
the APK build instead of blocking afterwards (saves up to 90 s). Add
_integrations task to run integration and integration-ui in parallel since
they use random Stalwart ports and different Flutter build targets.

Also add `docker rm ... || true` before `docker run` in both _mobsf-start and
mobsf_scan.sh to handle stopped-but-not-removed containers gracefully.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 07:13:13 +02:00