Commit graph

1523 commits

Author SHA1 Message Date
0caf7e4fda
Remove flaky LeaderElection dead-pid cleanup test 2026-05-08 17:27:48 -05:00
e95e2bfe32
Add LogSanitizer tests for sanitize_error_context non-list/non-map branches 2026-05-08 17:22:07 -05:00
2b1a06a6cd
Add MixUnused.Analyzer test for app: nil branch 2026-05-08 17:18:28 -05:00
4560dc0c6f
Add LeaderElection tests for dead-pid cleanup and registered leader pid status 2026-05-08 17:15:26 -05:00
eeec857d01
Add tests for batch_dispatch out-of-bounds removal and load_historical_batch matching generation 2026-05-08 17:13:32 -05:00
e2c0b00238
Add Aprsme.Is tests for send_message live branch, init disable_connection branch, and start_link 2026-05-08 17:09:06 -05:00
02d435557a
Add tests for set_location to_float branches and back-to-back bounds_changed 2026-05-08 17:01:30 -05:00
5685b6931a
Add coverage tests for RF path station packets, process_bounds_update remove_markers, and initialize_replay reschedule 2026-05-08 16:57:09 -05:00
b911bbd626
Add coverage tests for DeviceCache live process branch, PacketConsumer start_link with name, and integer/Decimal coordinate paths 2026-05-08 16:54:26 -05:00
5ba458d505
Add coverage tests for clear_and_reload_markers, cleanup_old_packets, packet_batch low-zoom paths, and historical_loading_timeout 2026-05-08 16:50:44 -05:00
446497d60b
Push coverage past 90% with MapLive postgres_packet/packet_batch and preferred_tracked_packet tests 2026-05-08 14:24:47 -05:00
3f7170cfa2
Add coverage tests for LeaderElection, MapLive integration, ApiDocsLive, BroadcastTaskSupervisor, StatusLive, and Packets 2026-05-08 14:15:35 -05:00
3c1ea54184
Add coverage tests for HistoricalLoader low-zoom non-final and pending-bounds paths 2026-05-08 13:33:13 -05:00
7271cc05cb
Add coverage tests for LeaderElection foreign-pid registration path 2026-05-08 13:29:24 -05:00
d34eab6447
Add coverage tests for HistoricalLoader cursor advance and zoom edge cases 2026-05-08 13:27:01 -05:00
7de1aef648
Add coverage tests for HistoricalLoader real-Packets path and Packets edge cases 2026-05-08 13:21:53 -05:00
5bf66f81b7
Add coverage tests for StreamingPacketsPubSub, Mix.Tasks.Compile.Unused, and HealthCheck 2026-05-08 13:15:59 -05:00
b2a1d8e7e9
Add coverage tests for MixUnused.Analyzer and HistoricalLoader edge cases 2026-05-08 13:09:24 -05:00
aa809976ab
Add coverage tests for DevicesSeeder, StatusLive helpers, DataBuilder, and HistoricalLoader 2026-05-08 13:04:37 -05:00
1e8e97d5f4
Add coverage tests for Telemetry, ApiCSRF, Packets, and PacketsLive.Index 2026-05-08 12:55:20 -05:00
5fb653bf05
Implement mix_unused-style unused public function detector
Adds a self-contained 'unused' Mix compiler task that finds public
functions in this project no caller in the project ever invokes:

- MixUnused.Analyzer: enumerates public functions across the project's
  compiled BEAM files (filtered by app), walks the abstract code in
  each BEAM via :beam_lib to collect every remote {Module, fun, arity}
  call observed at compile time, and subtracts the call set from the
  def set. Exposes :exclude (modules or MFA triples), :compile_path,
  and :app options. Behaviour callbacks (@impl true and any listed
  in behaviour_info(:callbacks)) and well-known entry points
  (start_link, child_spec, mount, render, GenServer callbacks,
  __info__, module_info, etc.) are excluded automatically.

- Mix.Tasks.Compile.Unused: a Mix.Task.Compiler that compiles the
  project then asks the analyzer for unused defs. Severity is
  configurable via the :unused project key; per-file exclusion of
  test/ paths is on by default.

Inspired by https://github.com/hauleth/mix_unused — uses BEAM
introspection rather than a compilation tracer to avoid the
chicken-and-egg problem of recompiling the tracer module itself
during analysis.
2026-05-08 12:30:04 -05:00
039ee83ecb
Add HistoricalLoader real-Packets module path tests and LeaderElection delay branch test 2026-05-08 12:20:53 -05:00
fe25bdda7d
Add Packets tests for round_coordinate types and MicE direction conversion 2026-05-08 12:18:28 -05:00
5066cf7c3b
Add coverage tests for AprsSymbol render helpers and DbOptimizer atom/identifier paths 2026-05-08 12:15:46 -05:00
4bf1a6b3b3
Add coverage tests for CoreComponents (input form/field, safe_row_id) and DataBuilder edge cases 2026-05-08 12:11:14 -05:00
d0296c9f4e
Expand mobile channel, packet consumer, and user settings tests for coverage 2026-05-08 12:08:21 -05:00
57077e2bb1
Add coverage tests for partition manager, map live message handlers, display manager, weather/device id paths
Bumps total coverage to 88.11%.
2026-05-08 12:03:10 -05:00
f9cfbf630e
Improve test coverage to 88.02%
Adds tests covering:
- Aprsme.Packet edge cases (already committed)
- Encoding valid_codepoint? branches via slow grapheme path and encoding_info shapes
- ErrorHandler database/network error categorization (CastError, ConstraintError, QueryError, Postgrex.Error, RuntimeError circuit_open/timeout, custom map :reason)
- HealthCheck plug ask_shutting_down? nil and unresponsive-pid paths
- SpatialPubSub ensure_float branches, dateline broadcast wrap-around, monitored client DOWN handler, no-coordinate broadcast skip
- DataBuilder weather popup, weather-only fallback, tuple value conversion, string weather convert_unit branches
- DeviceIdentification fetch_devices_from_url default-arg head
- PageController format_uptime branches via fake Aprsme.Is GenServer
- WeatherLive.CallsignView compare_timestamps branches via :weather_packet messages
- PacketConsumer field-conversion private helpers via crafted handle_events events
2026-05-08 11:58:09 -05:00
b88e6c373b
Improve test coverage from 87.06% to 87.35%
Adds tests for the PromEx supervision module and custom plugin (both
were 0–25% covered), expands the HealthCheck plug to exercise the
readiness success path through the live ShutdownHandler, adds public-API
roundtrip tests for PacketReplay's via_tuple wrappers, and covers
several private-helper fallback branches in Aprsme.Packet
(ParseError data_extended, MicE map symbol defaults, struct
data_extended, weather binary, has_position via legacy lat/lon, PHG /
altitude error parsing).
2026-05-08 11:08:44 -05:00
51e068f3f1
Add PromEx Prometheus exporter and /metrics endpoint
Wire up prom_ex with built-in Application, Beam, Phoenix, PhoenixLiveView,
and Ecto plugins, plus a custom plugin that exposes the existing
app-specific telemetry (packet pipeline, spatial PubSub, repo pool,
postgres stats, insert optimizer) as Prometheus metrics.

Mount PromEx.Plug at /metrics — internal-only, intended to be scraped
by the cluster's external Prometheus through the kube-apiserver pod
proxy. K8s pod template now carries prometheus.io/{scrape,port,path}
annotations so the existing kubernetes-pods scrape job picks it up
automatically.

PromEx is disabled in the test environment.

Also harden the packet cleanup and partition manager tests with
Repo.delete_all setup hooks so they aren't poisoned by residual rows
committed outside a sandbox transaction in earlier runs (which were
inflating delete counts and triggering ATTACH PARTITION check_violation
errors against packets_default).
2026-05-08 10:41:06 -05:00
72cd6d953b
update vendor 2026-05-08 10:04:25 -05:00
0602efeb90
chore: pin erlang 28.5 and elixir 1.19.5-otp-28 2026-05-05 16:39:08 -05:00
1e32ce7051
Improve test coverage to 87% and point vendor/aprs submodule at codeberg
Coverage:
- Adds focused tests across 13 files covering previously-uncovered
  branches: Packet changeset normalisation (course, wind_direction,
  struct data_extended); Packets store_packet edge cases (nested
  position shapes, ssid handling, string-keyed raw_packet);
  DeviceIdentification HTTP success/404 via Req plug stub; ResendAdapter
  catch-all body, deliver_many, nil/binary formatters; ApiDocsLive
  packets with missing fields; AprsSymbol normalize helpers;
  BadPacketsLive refresh and postgres_notify; MobileChannel handle_info
  catch-all and postgres_packet path; PacketProcessor existing-marker
  movement detection; PacketReplay sanitize_value type clauses;
  InsertOptimizer GenServer lifecycle and negative-duration metric;
  PageController shutdown-handler integration; UrlParams delegated
  helpers.
- mix.exs: configure test_coverage with summary threshold of 87 and
  ignore_modules for test fixtures and macro-only template modules.

Bug fix:
- MapLive.Index handle_info: add a clause for the raw {:new_deployment,
  _} tuple. Phoenix.PubSub.broadcast delivers the raw payload to plain
  subscribers, but the existing handler only matched the %Broadcast{}
  fast-lane wrapper. DeploymentNotifier broadcasts via the raw path,
  which crashed the LiveView under test concurrency.

Submodule:
- Update .gitmodules vendor/aprs URL from
  https://github.com/aprsme/aprs.git to
  ssh://git@codeberg.org/gmcintire/aprs.git.
2026-05-05 15:18:28 -05:00
c711caff4e
Remove AppSignal; fix decrement trigger and stale test assertions
- Delete config/appsignal.exs (was never wired into mix.exs or any
  other config file)
- Migration: fix decrement_packet_sequence trigger to handle the case
  where currval() hasn't been called in the current DB session, matching
  the same exception handling already present in get_packet_count()
- Fix get_historical_packet_count test: invalid non-list bounds are
  silently ignored (no error), so assert is_integer not count == 0
- Add Repo.delete_all(Packet) setup blocks in PacketsOldestTest and
  PacketConsumerTest to clear any committed DB state before tests that
  depend on an empty packets table
2026-05-05 13:20:58 -05:00
327df72859
deps: bump bandit, db_connection, ecto, error_tracker, jason, phoenix, phoenix_live_view, postgrex, swoosh 2026-05-05 12:12:32 -05:00
8c8f7a0ac7
move registry + repo refs to codeberg.org/gmcintire/aprs.me 2026-05-05 12:07:31 -05:00
0cd549652d
k8s: ensure zero-downtime deploys with 1 replica
- maxSurge: 1 (explicit integer, avoid percentage rounding)
- minReadySeconds: 30 (was 10) — new pod must be stable longer before old is killed
- progressDeadlineSeconds: 600 — detect stuck rollouts
- readinessProbe failureThreshold: 3 (was 2) — more tolerance after old pod is gone
- Add PodDisruptionBudget minAvailable: 1 — prevents voluntary disruptions from dropping below 1 pod
2026-04-29 13:55:27 -05:00
a3cb40188b
Dockerfile: align Elixir/OTP/Debian versions with microwaveprop 2026-04-29 12:45:01 -05:00
4b54b88b9f
CI/Dockerfile: mirror microwaveprop pattern (static docker, retry login, amd64 buildx, BUILD_TIMESTAMP arg) 2026-04-29 12:43:39 -05:00
40ad28e97b
CI: build amd64-only via buildx with provenance/sbom off
Forgejo runner with default Docker emits OCI image-index manifests for
multi-arch + attestation builds. argocd-image-updater cannot follow the
index → manifest chain to read the Created timestamp, so it never sees
new tags. Pinning to a single linux/amd64 build with no provenance/sbom
produces a plain Docker v2 manifest that image-updater can read.
2026-04-29 12:37:50 -05:00
09cf9c7d37
remove duplicate github deploy.yml; only forgejo build.yaml runs now
Forgejo Actions executes both .github/workflows/ and .forgejo/workflows/.
deploy.yml was a duplicate of .forgejo/workflows/build.yaml that used
docker/build-push-action@v5, which produces OCI image-index manifests
that argocd-image-updater cannot read. Removing it leaves only the
classic-docker-build workflow.

elixir.yaml, claude.yml, claude-code-review.yml, dependency-updates.yml
are kept (no forgejo equivalents).
2026-04-29 12:35:04 -05:00
50d5309759
README: argocd, not flux 2026-04-29 11:12:50 -05:00
279403bdb9
forgejo CI: drop manifest-bump steps; argocd-image-updater handles it now 2026-04-29 11:05:59 -05:00
FluxCD
d87eeab375 chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1777477809-208401e [skip ci] 2026-04-29 15:53:08 +00:00
208401e8b7
remove obsolete flux GitRepository/Kustomization manifest 2026-04-29 10:49:37 -05:00
FluxCD
15c44c45bc chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1777477694-24d353c [skip ci] 2026-04-29 15:48:21 +00:00
24d353cec4
drop manifest-bump deploy job; argocd-image-updater handles it now 2026-04-29 10:47:54 -05:00
FluxCD
48f7f48abb chore: update aprs.me image to git.mcintire.me/graham/aprs.me:main-1777476137-6a22d2e [skip ci] 2026-04-29 15:22:32 +00:00
6a22d2e457
pin image to last-built tag main-1776451638-5ab2ffc
The previous commit referenced an image tag that was never pushed to the registry,
breaking deploys. Pin to the last working tag until CI produces a new build.
2026-04-29 10:21:54 -05:00
8cea244ea5
Revert "Reapply "ci: deploy via rollout restart instead of git-commit image bumps""
This reverts commit 40ad86b49e.
2026-04-28 15:05:36 -05:00