majestic: cli applies a change now, so stop calling it deprecated - #511
Merged
Conversation
OpenIPC/firmware#2366 made `cli -s` write /etc/majestic.yaml and then ask Majestic to reload, so the pages telling people to prefer the HTTP API because `cli` does not apply anything are describing firmware that no longer exists. `cli` and the API now do the same job, and each is better at something: `cli` is the one that works before Majestic is running, which is the whole of first boot, and it can write a key this build does not declare; the API validates, and can be called from another machine. Three claims were wrong rather than merely stale: The SIGHUP row said a reload tears the pipeline down and builds it again. It has not meant that for a while -- Majestic prices the difference and takes the cheapest option that carries it, which is why setting a bitrate no longer costs the stream. Rewritten to describe the ladder. The plugin table attributed reloading to who sent the signal, "what the WebUI and cli use to apply a change". Both produce either outcome depending on the key, so the row now splits on what actually decides it: a rebuild reloads the plugin, an in-place change does not. And majestic-config.md now says why a saved file stays short. widgetii/majestic PR 608 stopped Majestic writing its own defaults into majestic.yaml, so a value you never set is absent rather than frozen at whatever the default was when you last pressed Save -- which is what lets a corrected default reach a camera that has already been configured.
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more' |
PR Summary by QodoCorrect Majestic CLI and reload behavior documentation
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
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.
Problem
Wiki commit
b126e5e(#477) migrated 71 recipes fromclito the HTTP API and markedclideprecated, on the grounds that the API applies a change live and
clidoes not. That wastrue when it was written. OpenIPC/firmware#2366 has since made
cli -swrite/etc/majestic.yamland then ask Majestic to reload, so the pages describe firmware that nolonger exists.
Three of the claims are wrong rather than merely stale.
What changed
cliis not deprecated —majestic-streamer.md,menu-index.md,howto-tinycam-onvif.md. The two tools now do the same job, and the pages say which isbetter at what instead of preferring one:
cliis the one that works before Majestic isrunning, which is the whole of first boot (a
customizer.shhas no API to call), and it canwrite a key this build does not declare. The API validates —
404for a key the binary doesnot have,
400for a value out of range — and can be called from another machine.The
SIGHUProw was wrong —majestic-streamer.md. It said a reload tears the pipelinedown and builds it again. Majestic has priced the difference for a while now and takes the
cheapest option that will carry the change, which is exactly why setting a bitrate no longer
costs the stream. The row now describes that ladder.
The plugin table attributed reloading to the wrong thing —
majestic-plugins.md. It readkillall -HUP majestic(what the WebUI andcliuse to apply a change) against aparameter set live through the HTTP API, which splits on who sent the write. Both the WebUI
and
cliproduce either outcome depending on the key. The rows now split on what actuallydecides it: a reload that rebuilds the pipeline reloads the plugin; a change applied in place
does not.
And
majestic-config.mdnow says why a saved file stays short. widgetii/majestic#608stopped Majestic writing its own defaults into
majestic.yaml, so a value you never set isabsent rather than frozen at whatever the default happened to be when you last pressed Save.
That is what lets a corrected default reach a camera that has already been configured, and it
is worth stating on the page that shows people the full key list.
Checked
No CI in this repo, so by hand:
Tables keep their column counts, every relative link in the five changed files resolves, and
#changing-parameters-via-the-http-apistill exists — it is linked from two places and bothare in this diff. The heading is deliberately left alone so external deep links keep working.
en/archive/is untouched.