Improve custom-build fleet deployment management - #174
Draft
ODevStudio wants to merge 4 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #172.
Summary
API and data model
New authenticated routes:
POST /api/v1/device/check-inGET /api/v1/fleet/overviewGET|POST /api/v1/fleet/buildsPATCH|DELETE /api/v1/fleet/builds/<combination-hash>POST /api/v1/fleet/assignmentsFleet records now retain build references with label, firmware/options summary, and added timestamp. Device records lazily gain
desired_updated_at,installed_combination,firmware_version, andlast_seen_at. Existing records remain readable with missing fields treated as null. Bulk writes are chunked at the Durable Object 128-entry storage limit while remaining inside one transaction.Browser
The fleet view now provides saved builds, full-hash copy, installed and desired columns, deployment state, last-seen time, responsive scale selection, select-all, selected/all-scale assignment, deliberate clearing, and confirmations for multi-scale changes. Hashes remain full-length identities; the browser displays a 12-character uppercase prefix.
Firmware
The Custom Build menu performs one compact authenticated check-in. Custom firmware reports normalized
HDS_CUSTOM_BUILD_COMBINATION_HASH; official firmware reports null.After validating the returned full desired hash, firmware compares it with that local compile-time identity. An exact match shows
Already installedand the 8-character uppercase prefix, then returns before manifest, signature, firmware, LittleFS, OTA-state, or reboot paths. A differing hash continues through the existing signed-manifest flow. Install confirmation shows target version plus hash prefix.Scale resources
Controlled
esp32s3size comparison against45edef5:Fleet size and saved-build count therefore do not change scale-side storage or steady-state memory.
Verification
node --test cloudflare/custom-build-worker/test/fleet.test.mjs- 10 passednode --test cloudflare/custom-build-worker/test/configurator.test.mjs- 6 passednode --test cloudflare/custom-build-worker/test/worker.test.mjs- 2 passedpython tools/test_plugin_catalog.pypython tools/test_plugin_ci_contract.pypython tools/test_custom_build_ota_contract.pypython tools/test_custom_build_execution.pypython tools/test_custom_ota_public_key_header.pypython tools/test_custom_cache_transport.pypython tools/test_pull_ota_contract.pypython tools/test_ota_runtime_isolation_contract.pypython tools/test_ota_rollback_contract.pypython tools/test_ota_reboot_routing_contract.pypython tools/test_ota_input_isolation_contract.pypython tools/test_ota_public_key_header.py- 9 passedpython tools/test_ai_docs_contract.pypio run -e esp32s3pio run -e esp32s3-customgit diff --checkThe OTA contract regression asserts that equal full hashes return before manifest retrieval or installation and that the current identity originates from the compile-time macro.
Intentionally omitted