Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/7-segment-clock
Submodule 7-segment-clock updated 1 files
+35 −34 manager.py
4 changes: 2 additions & 2 deletions src/plugin_system/store_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,15 +974,15 @@ def install_from_url(self, repo_url: str, plugin_id: str = None, plugin_path: st
}

# Validate manifest has required fields
required_fields = ['id', 'name', 'class_name', 'compatible_versions']
required_fields = ['id', 'name', 'class_name']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify usage of version and display_modes fields from manifest

echo "=== Checking for manifest 'version' field usage ==="
rg -nP --type=py -C2 'manifest.*version' -g '!src/plugin_system/store_manager.py' | head -40

echo -e "\n=== Checking for manifest 'display_modes' field usage ==="
rg -nP --type=py -C2 'manifest.*display_modes' -g '!src/plugin_system/store_manager.py' | head -40

echo -e "\n=== Checking for 'version' in manifest validation or access ==="
rg -nP --type=py '\bversion' src/plugin_system/ | grep -i manifest | head -20

echo -e "\n=== Checking plugin manifest files themselves ==="
find . -name "manifest.json" -type f | head -10 | xargs cat 2>/dev/null | head -80

Repository: ChuckBuilds/LEDMatrix

Length of output: 4724


Remove version and display_modes from required_fields only if all dependent code is updated.

The required_fields have been reduced to ['id', 'name', 'class_name'], removing version and display_modes. However, these fields are actively used elsewhere:

  • src/plugin_system/state_reconciliation.py:195 accesses manifest.get('version') for plugin state tracking
  • Multiple test files assert 'display_modes' in manifest and access it directly at manifest['display_modes'][0]

Plugins installed without these fields will break test assertions and leave incomplete state records. Either restore these as required fields or update all dependent code to handle their absence gracefully.

🤖 Prompt for AI Agents
In @src/plugin_system/store_manager.py around line 977, The change removed
'version' and 'display_modes' from required_fields in the manifest validation,
but other code (e.g., state_reconciliation.py's manifest usage and multiple
tests that assert manifest['display_modes'][0]) still expects them; restore
'version' and 'display_modes' to required_fields in the declaration (the
variable named required_fields) so new plugin manifests always include them, or
if you prefer to allow omission, update all call sites to use safe accessors
(e.g., manifest.get('version') with a sensible default and
manifest.get('display_modes', []) before indexing) and adjust tests to assert
the safe defaults instead — pick one approach and apply it consistently across
the manifest validation, the state reconciliation logic (the code that reads
manifest.get('version')/manifest['display_modes']), and the tests.

missing_fields = [field for field in required_fields if field not in manifest]
if missing_fields:
return {
'success': False,
'error': f'Manifest missing required fields: {", ".join(missing_fields)}'
}

# Validate version fields consistency
# Validate version fields consistency (warnings only, not required)
validation_errors = self._validate_manifest_version_fields(manifest)
if validation_errors:
self.logger.warning(f"Manifest version field validation warnings for {plugin_id}: {', '.join(validation_errors)}")
Expand Down
3 changes: 3 additions & 0 deletions web_interface/blueprints/api_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,9 @@ def separate_secrets(config, secrets_set, prefix=''):
'auto_load_enabled', 'development_mode',
'plugins_directory']:
continue
# Skip display settings that are already handled above (they're in nested structure)
if key in display_fields:
continue
# For any remaining keys (including plugin keys), use deep merge to preserve existing settings
if key in current_config and isinstance(current_config[key], dict) and isinstance(data[key], dict):
# Deep merge to preserve existing settings
Expand Down
Loading