Skip to content

Remove _FALLBACK_ADAPTER_TYPES curated fallback#307

Merged
maximelb merged 2 commits into
masterfrom
remove-fallback-adapter-types
Jun 20, 2026
Merged

Remove _FALLBACK_ADAPTER_TYPES curated fallback#307
maximelb merged 2 commits into
masterfrom
remove-fallback-adapter-types

Conversation

@maximelb

@maximelb maximelb commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

adapter list-types (cloud-adapter & external-adapter) used to fall back to a hard-coded _FALLBACK_ADAPTER_TYPES dict whenever the live hive JSON-Schema couldn't be fetched. This removes that fallback entirely.

Why

The fallback only kicked in when the backend was unavailable — and during downtime every other command fails anyway, so a stale, manually-maintained list just misleads. The type list now comes solely from the live cloud_sensor/external_adapter hive schema. If the schema can't be fetched, the error surfaces instead of being swallowed.

The hard-coded list was in fact already stale: tested live against an org, the schema advertises types the dict never had (bitwarden, box, cylance, defender, falconcloud, sentinel_one, trend_micro, zendesk, …).

Changes

  • Drop the _FALLBACK_ADAPTER_TYPES constant and the _describe() helper.
  • adapter_types() derives from the schema only and raises (ClickException) if it can't.
  • Drop the description column: descriptions only ever came from the curated dict — the live schema carries none, so the column was permanently empty. list-types now returns just the type name.
  • Tests updated: cover the schema-derived path and assert the command errors out (rather than printing a stale list) when the schema is unavailable.

Tested

Live against an org via the dev CLI: both cloud-adapter list-types and external-adapter list-types return the full live type set (34 / 45 types), table + json render correctly, and the schema --type <unknown> error still enumerates valid types.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EfrssJQLhNEFhvaUr1EPzv

adapter list-types now derives the supported type list (and per-type
description) solely from the live cloud_sensor/external_adapter hive
JSON-Schema. The hard-coded fallback only ever masked backend downtime,
during which every other command fails anyway, so a stale list would
only mislead. If the schema can't be fetched the error now surfaces.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EfrssJQLhNEFhvaUr1EPzv
lcbill
lcbill previously approved these changes Jun 19, 2026
The live hive schema does not carry per-type descriptions; descriptions
only ever came from the curated fallback dict that this PR removes.
Rather than emit a permanently-empty "description" column, list-types
now returns just the type name. Reverts _types_from_schema to its plain
list return as well.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EfrssJQLhNEFhvaUr1EPzv
@maximelb maximelb merged commit 8d4d94f into master Jun 20, 2026
7 checks passed
@maximelb maximelb deleted the remove-fallback-adapter-types branch June 20, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants