Skip to content

v0.9.0

Latest

Choose a tag to compare

@jessepeterson jessepeterson released this 03 Dec 06:31

Thanks to our contributors for this release: @csandrew-dev, @drkr-sl, @mactesting12, and @WardsParadox!

Note

This release has MySQL storage backend schema changes. Please apply the changes in the schema.00005.sql file if you have an existing MySQL backend installation.

New

  • Native Go struct parsing of status reports: #180
    • Status reports are now parsed against the generated Apple DDM status structures in ddm/status instead of being walked loosely with jsonpath/fastjson; the 62 documented status items come for free.
    • Status reports now travel through a ddm.StatusHandler / ddm.StatusHandlerFunc you can wrap (e.g. around storage.NewStatusStoreHandler); see the package godoc for examples.
    • korylprince/go-adm is our code generator
  • PostgreSQL storage backend: #179
  • SQL storage backends: connection pool tuning options: #168, #184
    • conn_max_lifetime, conn_max_idle_time, and max_open_conns storage options for both mysql and pgsql backends.
    • See the Ops Guide on storage options for more info.

Changed

  • (API) Status report parsing now validates against the generated Apple DDM schemas: #180
    • Status values are still walked leniently from the raw bytes; only declaration status and report errors go through the generated structures. This also fixes phantom errors from loose coercion (e.g. "active": "true" becoming false).
    • Notably: reports whose JSON types do not match the generated structures are now rejected (HTTP 500, nothing stored); but unknown/missing keys and null still pass.
  • (API) Package relocations for the status report write/read type models: #180
    • ddm.* write/read types moved to storage.* (e.g. ddm.DeclarationStatus → storage.DeclarationStatus, ddm.StatusValue → storage.StatusValue/StoredStatusValue); ddm.ParseStatus() → storage.ParseStatusReport(); ddm.ParseStatusUsingMux/RegisterStatusHandlers removed.
    • http/ddm.StatusReportHandler → http/ddm.NewStatusReportHandler (takes a ddm.StatusHandler); StatusStorer.StoreDeclarationStatus now takes *storage.StatusReport.
  • MySQL storage backend
    • status reports and errors are now append-only: #178
      • Both tables gain an auto-increment id; row_count is dropped. schema.00005.sql migrates existing rows.
      • delete_errors=N now keeps the newest N errors (rather than the last N reports' worth); a single report can contain many errors.
      • A missing report now returns HTTP 404 instead of 500.
    • (API) storage.WithoutStatusReports() option to disable saving status reports altogether: 0d8bc5c
    • WithErrorDeletion docs clarified to count errors, not reports: #178
    • retry transactions on transient lock errors: #185
      • Replaces the internal tx helper with NanoMDM's Txn, which retries deadlocks and lock-wait timeouts with jittered backoff; WithTxnOptions tunes it. The status-values upsert now runs in a transaction too.

Fixed

  • storage: shadowed errors from Multi declaration items: 85f7965
  • MySQL storage backend
    • duplicate declaration status rows per set: 475d0ff
    • query bug deleting rows from the wrong table for status reports: 0d8bc5c
    • failed insert could be committed; invalid SQL for index + status ID lookup: #178
    • concurrency wait bug in test: ea83366
  • kv storage backend: unstable declarations token from map iteration: #170
  • notifier:
    • only the first enqueue chunk carried the command body: #181
    • enqueue/push URLs now append enrollment IDs as a path (fixes user-channel IDs): 5c55cc0

Other