Update CHANGES.md for release 0.9.3 #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Validate source files exist | |
| run: | | |
| echo "Validating source files..." | |
| ERRORS=0 | |
| # Check agent plugin | |
| if [ ! -f "local/share/check_mk/agents/plugins/oposs_smart_error" ]; then | |
| echo "Error: Agent plugin not found" | |
| ERRORS=$((ERRORS + 1)) | |
| else | |
| echo "✓ Agent plugin found" | |
| fi | |
| # Check check plugins | |
| FILES=( | |
| "local/lib/python3/cmk_addons/plugins/oposs_smart_error/agent_based/oposs_smart_error.py" | |
| "local/lib/python3/cmk_addons/plugins/oposs_smart_error/checkman/oposs_smart_error" | |
| "local/lib/python3/cmk_addons/plugins/oposs_smart_error/graphing/oposs_smart_error.py" | |
| "local/lib/python3/cmk_addons/plugins/oposs_smart_error/rulesets/oposs_smart_error.py" | |
| "local/lib/python3/cmk_addons/plugins/oposs_smart_error/rulesets/ruleset_oposs_smart_error_bakery.py" | |
| ) | |
| for file in "${FILES[@]}"; do | |
| if [ ! -f "$file" ]; then | |
| echo "Error: Check plugin file not found: $file" | |
| ERRORS=$((ERRORS + 1)) | |
| fi | |
| done | |
| if [ $ERRORS -eq 0 ]; then | |
| echo "✓ All check plugin files found" | |
| fi | |
| # Check bakery plugin | |
| if [ ! -f "local/lib/python3/cmk/base/cee/plugins/bakery/oposs_smart_error.py" ]; then | |
| echo "Error: Bakery plugin not found" | |
| ERRORS=$((ERRORS + 1)) | |
| else | |
| echo "✓ Bakery plugin found" | |
| fi | |
| if [ $ERRORS -gt 0 ]; then | |
| echo "Validation failed with $ERRORS errors" | |
| exit 1 | |
| fi | |
| echo "All source files validated successfully" | |
| - name: Python syntax check | |
| run: | | |
| echo "Checking Python syntax..." | |
| python3 -m py_compile local/lib/python3/cmk_addons/plugins/oposs_smart_error/agent_based/oposs_smart_error.py | |
| python3 -m py_compile local/lib/python3/cmk_addons/plugins/oposs_smart_error/graphing/oposs_smart_error.py | |
| python3 -m py_compile local/lib/python3/cmk_addons/plugins/oposs_smart_error/rulesets/oposs_smart_error.py | |
| python3 -m py_compile local/lib/python3/cmk_addons/plugins/oposs_smart_error/rulesets/ruleset_oposs_smart_error_bakery.py | |
| python3 -m py_compile local/lib/python3/cmk/base/cee/plugins/bakery/oposs_smart_error.py | |
| python3 -m py_compile local/share/check_mk/agents/plugins/oposs_smart_error | |
| echo "✓ All Python files have valid syntax" | |
| - name: Test build script | |
| run: | | |
| chmod +x scripts/build-mkp.sh | |
| ./scripts/build-mkp.sh 0.0.1-test | |
| # Verify package was created | |
| if [ ! -f "oposs_smart_errors-0.0.1-test.mkp" ]; then | |
| echo "Error: Package not created" | |
| exit 1 | |
| fi | |
| # Verify package contents | |
| echo "Verifying package contents..." | |
| tar -tf oposs_smart_errors-0.0.1-test.mkp | sort | |
| # Clean up | |
| rm -f oposs_smart_errors-0.0.1-test.mkp | |
| echo "✓ Build script test passed" | |
| - name: Validate package metadata | |
| run: | | |
| # Create a test package | |
| chmod +x scripts/build-mkp.sh | |
| ./scripts/build-mkp.sh 0.0.1-test | |
| # Extract and validate info.json | |
| tar -xf oposs_smart_errors-0.0.1-test.mkp info.json | |
| # Check JSON is valid | |
| python3 -c "import json; json.load(open('info.json'))" | |
| echo "✓ info.json is valid JSON" | |
| # Check required fields | |
| python3 -c 'import json; info = json.load(open("info.json")); required_fields = ["title", "name", "description", "version", "author", "files"]; missing = [f for f in required_fields if f not in info]; print("Missing required fields: " + str(missing)) if missing else print("✓ All required fields present"); exit(1) if missing else None' | |
| # Clean up | |
| rm -f oposs_smart_errors-0.0.1-test.mkp info.json | |
| echo "✓ Package metadata validation passed" |