Skip to content

info: clarify APICapability and OptionalCapabilities docs - #153

Open
eriknordmark wants to merge 2 commits into
lf-edge:mainfrom
eriknordmark:document-api-capabilities
Open

info: clarify APICapability and OptionalCapabilities docs#153
eriknordmark wants to merge 2 commits into
lf-edge:mainfrom
eriknordmark:document-api-capabilities

Conversation

@eriknordmark

Copy link
Copy Markdown
Contributor

A controller has no way to discover the APICapability gates from the API
itself. The enum's comment describes it as covering "features in the
EdgeDevConfig", but it has grown to also cover messages EVE-OS sends — a
controller expecting S.M.A.R.T. information in ZHardwareHealth from a device
below API_CAPABILITY_SMART_REPORT would wait for it indefinitely. The comment
now says both.

It also states explicitly that the enum is a monotonic level, to be compared
with >= rather than tested for equality or set membership. EVE-OS reports a
single top value (pkg/pillar/cmd/zedagent/reportinfo.go assigns
API_CAPABILITY_REPORT_TPM_EVENTLOG), so a controller treating it as a flag set
would silently mishandle it. And it contrasts OptionalCapabilities, which is
the opposite: independent booleans varying by build flavor rather than version.

Smaller fixes in the same area:

  • OptionalCapabilities.hw_inventory_support was the only field in its message
    without a comment, and it is what tells a controller whether an empty
    HardwareInventory means "found no hardware" or "cannot report".
  • The hardware-oriented Capabilities message is now distinguished from the
    other two, since its comment previously read like a description of
    APICapability.
  • API_CAPABILITY_DISABLE_VTPM was truncated at "Support for disabling", and
    API_CAPABILITY_VOLUME_SNAPSHOTS_IMMEDIATE duplicated value 5's comment.

Wire-compatible: comments only. No field numbers, names or types change.
make proto produces no rawDesc churn and no Python change — only Go doc
comments, in the second commit.

@eriknordmark
eriknordmark requested review from milan-zededa, rene and uncleDecart and removed request for uncleDecart August 7, 2026 20:51
@eriknordmark
eriknordmark force-pushed the document-api-capabilities branch from 4f54631 to 2411b71 Compare August 7, 2026 21:42
@eriknordmark
eriknordmark marked this pull request as draft August 7, 2026 21:42
eriknordmark and others added 2 commits August 7, 2026 23:47
APICapability covers two kinds of support: EdgeDevConfig fields EVE-OS
parses, and messages EVE-OS sends. The latter is not evident from the
existing comment, yet it matters just as much - without
API_CAPABILITY_SMART_REPORT a controller would wait indefinitely for
S.M.A.R.T. information in ZHardwareHealth. Record that, and state
explicitly that the enum is a monotonic level to be compared with >=
rather than a set of flags. OptionalCapabilities is the opposite:
independent booleans varying by build flavor.

Add CAPABILITIES.md with a table of what each value covers and a
checklist for controller implementers; five rows are marked as inferred
rather than authoritative and want review. Also give hw_inventory_support
its first comment, distinguish the hardware-oriented Capabilities message
from the other two, and fix a truncated, a duplicated and an
ungrammatical comment.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
No functional changes; generated code and assets only.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@eriknordmark
eriknordmark force-pushed the document-api-capabilities branch from 2411b71 to 5eab836 Compare August 7, 2026 21:51
@eriknordmark
eriknordmark marked this pull request as ready for review August 11, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant