Add per-field metadata to apl-feed apply and feed.meta.json sidecar#77
Merged
Conversation
apl-feed apply --json gains an additive object-form value: {value, edited_at, edited_by}. When provided, the tuple is atomically written to /etc/airplanes/feed.meta.json under the same lock as feed.env, for the six remote-config fields (LATITUDE, LONGITUDE, ALTITUDE, MLAT_USER, MLAT_ENABLED, MLAT_PRIVATE). Bare-string writes to those fields default-stamp edited_by=feeder. A bootstrap migration seeds the sidecar with edited_by=legacy on existing installs.
…subset Reject .updates keys containing non-[A-Za-z0-9_] characters before splitting to KEY=value pairs (a crafted key with an embedded newline or '=' could have injected a second pair). Reject sidecar writes when feed.meta.json already exists as a directory (mv -f would otherwise silently move the temp file into it). Refuse INCOMING_META entries whose key is not in the payload, so a stale global cannot rewrite metadata for an unrelated field. Tailor the sidecar-write failure warning to whether feed.env was updated.
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.
apl-feed apply --json now accepts an object-form value {value, edited_at, edited_by} alongside the existing bare-string form. When provided, the tuple is atomically written to /etc/airplanes/feed.meta.json under the same lock as feed.env, for LATITUDE, LONGITUDE, ALTITUDE, MLAT_USER, MLAT_ENABLED, and MLAT_PRIVATE. Bare-string writes to those fields default-stamp edited_by=feeder; a bootstrap migration seeds the sidecar with edited_by=legacy on existing installs.
The wire contract is additive — every existing caller continues to work without sending the new shape; metadata stamping is opt-in per request.