towerops/lib/towerops
Graham McIntire 9cb4c59638 dialyzer: replace suppressions with real fixes where possible
Changes to eliminate @dialyzer suppressions by fixing underlying causes:

NIF stubs (towerops_native.ex, mib_translator.ex):
- Change stubs to :erlang.nif_error(:nif_not_loaded) (no_return type).
  Real NIF replaces stubs at load time; calls to unloaded stubs now fail
  loudly instead of returning fake data. Lets dialyzer trust @spec.
- Remove @dialyzer :nowarn_function on three NIFs and on translate/1.

Discovery sync_* functions (snmp/discovery.ex, channels/agent_channel.ex):
- agent_channel passes %{device_id: _, interfaces: _} and %{id: _} maps
  into Discovery.sync_ip_addresses/sync_processors/sync_storage, which
  @spec'd only %Device{}. Add narrow map-type unions (ip_sync_device,
  snmp_device_ref) reflecting what the functions actually access.
- Remove @dialyzer :nowarn_function on three agent_channel helpers.

remote_ip.ex — real bug caught and fixed:
- `:ranch.get_addr(socket.transport_pid)` was always raising since
  Bandit uses ThousandIsland, not Ranch; the rescue _ -> nil silently
  returned nil every time. Switched to Phoenix's documented
  :peer_data connect_info (already enabled in endpoint.ex) via
  socket.assigns; remote IP now actually works.
- Remove remote_ip.ex entry from .dialyzer_ignore.exs.

Accounts / Organizations (Ecto.Multi opacity):
- Add @specs to Multi-building helpers, refactor into pipe chains.
- 6 @dialyzer :nowarn_function → 0, but 7 :no_opaque remain. Root
  cause is upstream: Ecto.Multi.new/0 returns a struct with a literal
  %MapSet{} whose @opaque internal representation trips dialyzer on
  every subsequent Multi.* call. Unfixable without an Ecto patch or
  bypassing Multi entirely. Comments document the specific upstream
  issue rather than a vague "Ecto.Multi opacity" claim.

Devices.ex:
- Adding @specs made it worse (call_without_opaque → contract_with_
  opaque); inlining the Multi didn't help either — same MapSet root
  cause. Suppression kept with a sharper comment.
2026-04-21 11:01:30 -05:00
..
accounts dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
admin fix: comprehensive security audit fixes (#108) 2026-03-22 10:10:27 -05:00
agents dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
alerts dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
api_tokens dialyzer: fix unknown_type warnings (60 → 0) 2026-04-21 09:43:37 -05:00
billing dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
capacity refactor: convert 6 Gleam modules to idiomatic Elixir with TDD (#196) 2026-03-28 09:52:07 -05:00
cn_maestro fix: make sidebar sticky with header and resolve all credo issues (#32) 2026-03-15 18:19:09 -05:00
config_changes refactor: convert 6 Gleam modules to idiomatic Elixir with TDD (#196) 2026-03-28 09:52:07 -05:00
contexts help update 2026-02-04 17:56:48 -06:00
devices dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
ecto_types dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
gaiia dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
geoip remove Mix.env and support ip database import 2026-01-28 13:08:06 -06:00
integrations paperclip/TOW-21-uisp-integration-phase1 (#31) 2026-03-15 17:57:36 -05:00
job_monitoring more tests and fixes 2026-02-07 11:50:18 -06:00
maintenance Add maintenance windows and weather overlay (backend) 2026-02-16 10:01:19 -06:00
mobile_sessions refactor/dry-improvements (#202) 2026-03-28 10:56:34 -05:00
monitoring dialyzer: fix all unmatched_return warnings (154 → 0) 2026-04-21 10:03:55 -05:00
netbox dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
on_call dialyzer: fix all unmatched_return warnings (154 → 0) 2026-04-21 10:03:55 -05:00
organizations refactor: convert 6 Gleam modules to idiomatic Elixir with TDD (#196) 2026-03-28 09:52:07 -05:00
pagerduty optimize-slow-tests (#193) 2026-03-27 17:05:29 -05:00
preseem dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
profiles optimize-slow-tests (#193) 2026-03-27 17:05:29 -05:00
proto dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
reports fix: make sidebar sticky with header and resolve all credo issues (#32) 2026-03-15 18:19:09 -05:00
security dialyzer: fix all unmatched_return warnings (154 → 0) 2026-04-21 10:03:55 -05:00
settings fix/findings-medium-priority (#188) 2026-03-27 12:31:53 -05:00
sites feat: add geographic location to sites with geocoding, address fields, and Leaflet.js network map 2026-02-14 13:07:14 -06:00
snmp dialyzer: replace suppressions with real fixes where possible 2026-04-21 11:01:30 -05:00
sonar dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
splynx fix: humanize raw error strings in integration sync modules 2026-03-12 13:53:28 -05:00
status_pages fix: make sidebar sticky with header and resolve all credo issues (#32) 2026-03-15 18:19:09 -05:00
topology dialyzer: fix unknown_type warnings (60 → 0) 2026-04-21 09:43:37 -05:00
uisp dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
visp fix: humanize raw error strings in integration sync modules 2026-03-12 13:53:28 -05:00
weather Add GeoIP import HTTP tests 2026-03-10 16:02:49 -05:00
workers dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
accounts.ex dialyzer: replace suppressions with real fixes where possible 2026-04-21 11:01:30 -05:00
activity_feed.ex reliability-audit-fixes (#181) 2026-03-26 14:10:36 -05:00
admin.ex fix: replace Repo.rollback with proper error handling for Oban compatibility (#201) 2026-03-28 09:11:21 -05:00
agents.ex dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
alerts.ex dialyzer: fix all unmatched_return warnings (154 → 0) 2026-04-21 10:03:55 -05:00
api_tokens.ex dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
application.ex dialyzer: fix all unmatched_return warnings (154 → 0) 2026-04-21 10:03:55 -05:00
billing.ex fix: infer device role during discovery and handle string price values 2026-03-10 13:25:51 -05:00
capacity.ex done i think (#177) 2026-03-26 10:23:26 -05:00
config_changes.ex refactor: fix all credo strict issues, format all code, fix broken routes 2026-02-13 19:34:40 -06:00
dashboard.ex fix/findings-medium-priority (#188) 2026-03-27 12:31:53 -05:00
devices.ex dialyzer: replace suppressions with real fixes where possible 2026-04-21 11:01:30 -05:00
error_tracker_ignorer.ex Ignore pod shutdown errors in ErrorTracker 2026-02-17 10:59:51 -06:00
gaiia.ex refactor/dry-improvements (#202) 2026-03-28 10:56:34 -05:00
geocoding.ex Add GeoIP import HTTP tests 2026-03-10 16:02:49 -05:00
geoip.ex db-performance-migrations (#234) 2026-04-04 14:22:25 -05:00
honeybadger_filter.ex fix: suppress benign shutdown errors during K8s pod rollouts 2026-02-12 12:16:40 -06:00
http.ex optimize-slow-tests (#193) 2026-03-27 17:05:29 -05:00
integrations.ex refactor/dry-improvements (#202) 2026-03-28 10:56:34 -05:00
job_monitoring.ex more tests and fixes 2026-02-07 11:50:18 -06:00
log_filter.ex Add comprehensive Dialyzer type specifications 2026-01-17 10:52:02 -06:00
logger_filters.ex fix: suppress benign shutdown errors during K8s pod rollouts 2026-02-12 12:16:40 -06:00
mailer.ex moduledocs 2026-01-17 15:08:49 -06:00
maintenance.ex dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
mobile_sessions.ex fix: replace Repo.rollback with proper error handling for Oban compatibility (#201) 2026-03-28 09:11:21 -05:00
monitoring.ex dialyzer: fix all unmatched_return warnings (154 → 0) 2026-04-21 10:03:55 -05:00
numeric.ex refactor: convert 6 Gleam modules to idiomatic Elixir with TDD (#196) 2026-03-28 09:52:07 -05:00
on_call.ex fix: input validation, SSRF, API hardening, and cookie security 2026-03-14 14:48:59 -05:00
organizations.ex dialyzer: replace suppressions with real fixes where possible 2026-04-21 11:01:30 -05:00
preseem.ex fix/findings-medium-priority (#188) 2026-03-27 12:31:53 -05:00
profiles.ex fix/findings-medium-priority (#188) 2026-03-27 12:31:53 -05:00
query_helpers.ex refactor: convert 6 Gleam modules to idiomatic Elixir with TDD (#196) 2026-03-28 09:52:07 -05:00
rate_limit.ex update hammer 2026-02-08 10:08:31 -06:00
redis_health_check.ex fix: remove to_charlist conversion for Redix host option 2026-01-24 17:49:57 -06:00
release.ex fix dialyzer things 2026-01-03 12:56:40 -06:00
repo.ex moduledocs 2026-01-17 15:08:49 -06:00
reports.ex refactor/dry-improvements (#202) 2026-03-28 10:56:34 -05:00
result.ex refactor: convert 6 Gleam modules to idiomatic Elixir with TDD (#196) 2026-03-28 09:52:07 -05:00
rf_links.ex fix: make sidebar sticky with header and resolve all credo issues (#32) 2026-03-15 18:19:09 -05:00
search.ex refactor: fix all credo strict issues, format all code, fix broken routes 2026-02-13 19:34:40 -06:00
settings.ex fix/test-failures (#112) 2026-03-22 13:02:06 -05:00
sites.ex refactor/dry-improvements (#202) 2026-03-28 10:56:34 -05:00
snmp.ex dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
status_pages.ex refactor/dry-improvements (#202) 2026-03-28 10:56:34 -05:00
time.ex refactor/dry-improvements (#202) 2026-03-28 10:56:34 -05:00
topology.ex dialyzer: fix remaining 88 warnings — clean dialyzer run 2026-04-21 10:32:42 -05:00
trace.ex refactor/dry-improvements (#202) 2026-03-28 10:56:34 -05:00
url_validator.ex refactor: convert 6 Gleam modules to idiomatic Elixir with TDD (#196) 2026-03-28 09:52:07 -05:00
vault.ex add mikrotik device handling 2026-02-01 16:42:39 -06:00
weather.ex Prevent Oban polling/monitoring job stacking per device 2026-02-16 16:37:48 -06:00