Expose plugin eligibility metadata in app-server summaries (#35837)

## What changed

- Add nullable `disabledReason` and `eligiblePlanTypes` fields to v2
  `PluginSummary` responses and generated schemas.
- Preserve the remote catalog values across discovered, installed, and cached
  plugin summary paths while returning `null` for local plugins and older
  remote responses.
- Treat unrecognized disabled reasons as `unknown` for forward compatibility.

## Testing

- Cover protocol round trips, remote summary propagation, unknown disabled
  reasons, and app-server responses for admin-disabled and plan-ineligible
  plugins.

GitOrigin-RevId: 657a7ea6f838a6ff8bd1769ebcca0f3432684437
This commit is contained in:
Eric Ning authored and copyberry committed 2026-07-28 22:28:08 +00:00
1 parent c550cb3e01
commit 12b961d4c5
21 files changed
+472 -63

No files matched your search

@@ -619,6 +619,17 @@ pub enum PluginAvailability {
DisabledByAdmin,
}
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
#[ts(export_to = "v2/", rename_all = "snake_case")]
pub enum PluginDisabledReason {
DisabledByAdmin,
PlanNotEligible,
RequiredAppUnavailable,
#[serde(other)]
Unknown,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
@@ -646,6 +657,12 @@ pub struct PluginSummary {
/// Availability state for installing and using the plugin.
#[serde(default)]
pub availability: PluginAvailability,
/// Why the remote plugin is unavailable, when provided by plugin-service.
#[serde(default)]
pub disabled_reason: Option<PluginDisabledReason>,
/// Raw plugin-service plan identifiers eligible to install the plugin.
#[serde(default)]
pub eligible_plan_types: Option<Vec<String>>,
pub interface: Option<PluginInterface>,
#[serde(default)]
pub keywords: Vec<String>,