Repository navigation
Mirror Mender's fleet for registration and the admin Fleet page - #683
Open
Volyarosh94 wants to merge 1 commit into
Open
Volyarosh94 wants to merge 1 commit into
Volyarosh94 wants to merge 1 commit into
Conversation
mender-auto-accept pushes the whole fleet to /api/internal/mender/snapshot. MENDER_SOURCE (api, shadow, mirror) picks what registration reads. The admin Fleet page shows registry, claim and Mender state side by side.
|
Claude finished @Volyarosh94's task in 3m 6s —— View job Review: Mirror Mender's fleet for registration and the admin Fleet page
SummaryThis is a careful, well-documented piece of work, and I did not find any correctness bugs. A few notes on what I specifically checked:
Cross-checks
Nothing here blocks merge from my read. Nice work on the concurrency reasoning in particular — it's the part most PRs in this area get wrong. |
Contributor
Author
|
The sender is offworldlabs/node-infra#12. It follows docs/mender-snapshot.md here, and pushes nothing until RETINA_SYNC_TARGETS is set, so either can merge first. |
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.
Based on #682 (stub pages and ops), which sits on the rest of the open chain, so merge those first.
What
mender_devicesandmender_sync_state(migration 0027). mender-auto-accept fills them withPOST /api/internal/mender/snapshot: a bearer token (MENDER_SYNC_TOKEN, compared in constant time, 404 while unset), a 2 MiB cap, 409 for agenerated_atthat is not newer, and a whole-fleet upsert that marks devices missing from the body as not present.MENDER_SOURCEpicks where registration asks:api(live, the default),shadow(live answer decides, the mirror is compared in the log) ormirror. Inmirrora stale snapshot refuses withmender_unreachableandmirror stale (...); the age limit isMENDER_MIRROR_MAX_AGE_S.mender_snapshot_source_changed, andmender_snapshot_count_dropwhen a push lists more than 20% fewer devices than the last.GET /api/admin/fleetand an admin Fleet page: one row per node with registry state, claim and contact email state, Mender state, presence (both, registry only, Mender only) and a banner when the mirror is stale.docs/mender-snapshot.mdis the contract for node-infra. The runbook gets a cutover section and alert entries,docs/alerting.mdthe three Mender alerts, and.env.examplethe new keys, with theMENDER_PATblock marked legacy./v1/nodes, andcontracts/nodes-v1.openapi.yamlis untouched. Theapipath stays until cutover step 7 in the runbook.Calls I made
snapshot_issue, and registration refuses thatnode_idonly. 422 is for the envelope. Agreed with the node-infra side.node_idis unique only among present rows without an issue, so a decommissioned device or a duplicate cannot block a push.MENDER_SOURCErefuses registration with the alert.node_id.Tested
just checkgreen, new tests fail without their code, 0027 up/down/up on a copy of a dev database, and the Fleet page checked in a browser at desktop and phone width with a snapshot pushed by curl.