mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-05-28 15:03:31 +00:00
fix(plugins): skip update for local-only plugins instead of failing (#354)
Adds a local_only flag to the starlark-apps manifest so the update endpoint returns a skipped status rather than recording a false failure when the plugin has no git repo and no registry entry. Co-authored-by: Chuck <chuck@example.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,5 +22,6 @@
|
|||||||
"Pillow>=10.0.0",
|
"Pillow>=10.0.0",
|
||||||
"PyYAML>=6.0",
|
"PyYAML>=6.0",
|
||||||
"requests>=2.31.0"
|
"requests>=2.31.0"
|
||||||
]
|
],
|
||||||
|
"local_only": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2687,6 +2687,16 @@ def update_plugin():
|
|||||||
with open(manifest_path, 'r', encoding='utf-8') as f:
|
with open(manifest_path, 'r', encoding='utf-8') as f:
|
||||||
manifest = json.load(f)
|
manifest = json.load(f)
|
||||||
current_last_updated = manifest.get('last_updated')
|
current_last_updated = manifest.get('last_updated')
|
||||||
|
if manifest.get('local_only'):
|
||||||
|
logger.debug("Skipping update for local-only plugin: %s", plugin_id)
|
||||||
|
if api_v3.operation_history:
|
||||||
|
api_v3.operation_history.record_operation(
|
||||||
|
"update",
|
||||||
|
plugin_id=plugin_id,
|
||||||
|
status="skipped",
|
||||||
|
details={"reason": "local_only"}
|
||||||
|
)
|
||||||
|
return success_response(message=f'Plugin {plugin_id} is managed locally and does not receive registry updates')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug("Could not read local manifest for plugin: %s", e)
|
logger.debug("Could not read local manifest for plugin: %s", e)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user