This guide helps you set up the validation and CI/CD tooling for the CACA Splunk app.
Run the PowerShell validation script:
# Full validation
.\scripts\validate.ps1
# Quick validation (skip AppInspect)
.\scripts\validate.ps1 -QuickInstall pre-commit to automatically validate before each commit:
# Install pre-commit
pip install pre-commit
# Install the hooks in your repo
pre-commit install
# Test it
pre-commit run --all-filesGitHub Actions automatically run on:
- ✅ Push to
mainordevelopbranches - ✅ Pull requests
- ✅ Manual workflow dispatch
No setup needed - it just works!
.conffile syntax validation- Version consistency (app.manifest ↔ app.conf)
- App ID consistency
- Required files present
- XML syntax (dashboards, navigation)
- JSON syntax (app.manifest)
- Lookup table definitions match CSV files
- No hardcoded passwords/tokens/API keys
- No private keys committed
- Proper file permissions
- No unwanted files (
.git,local/,*.pyc) - Proper
.gitignorecoverage - No large files
- Splunkbase compliance
- Cloud compatibility
- Best practices
- Security vulnerabilities
Required:
- Git
- Python 3.7+
- PowerShell (Windows) or Bash (Linux/macOS)
Optional but recommended:
- Splunk AppInspect:
pip install splunk-appinspect - Pre-commit:
pip install pre-commit
AppInspect is Splunk's official validation tool:
# Install via pip
pip install splunk-appinspect
# Verify installation
splunk-appinspect --versionBenefits:
- Official Splunkbase validation
- Cloud compatibility checks
- Security scanning
- Best practices enforcement
Pre-commit hooks run validation before each git commit:
# 1. Install pre-commit
pip install pre-commit
# 2. Install hooks in your repo (one-time setup)
cd c:\Users\Devin\Repos\splunk-content-monitoring-console
pre-commit install
# 3. Test the setup
pre-commit run --all-filesNow validation runs automatically before every commit!
Skip hooks temporarily:
git commit --no-verify -m "Emergency fix"# Run local validation
.\scripts\validate.ps1 -Quick
# If no errors, commit
git add .
git commit -m "My changes"
# Pre-commit hooks run automatically here# Run full validation including AppInspect
.\scripts\validate.ps1
# Check the results
# Fix any errors or warnings
# Review appinspect_report.json if generatedGitHub Actions run automatically:
- Push your changes to GitHub
- Go to Actions tab in your repo
- Watch the validation workflow run
- Review any failures in the workflow logs
Solution: Install AppInspect or use -Quick flag:
pip install splunk-appinspect
# OR
.\scripts\validate.ps1 -QuickSolution: Update both files to match:
app.manifest→info.id.versiondefault/app.conf→version =
Solution: Check dashboard XML syntax:
# Open the failing XML file
# Look for unclosed tags, invalid characters, etc.
# Use an XML validator or IDE with XML supportSolution: Skip certain hooks or run selectively:
# Skip all hooks temporarily
git commit --no-verify
# Run specific hook
pre-commit run check-yaml --all-filesSolution:
- Go to Actions tab in GitHub
- Click on the failed workflow
- Expand the failed step
- Read the error message
- Fix locally and push again
Edit .pre-commit-config.yaml:
- Add/remove hooks
- Change hook arguments
- Skip specific checks
Edit .github/workflows/validate.yml:
- Change trigger branches
- Add/remove validation steps
- Adjust failure conditions
Edit scripts/validate.ps1:
- Add custom checks
- Change validation logic
- Adjust output formatting
-
Run validation before pushing
.\scripts\validate.ps1 -Quick git push -
Use pre-commit hooks
- Catches issues early
- Prevents bad commits
- Saves time in CI/CD
-
Fix warnings, not just errors
- Warnings can become errors
- Better code quality
- Easier maintenance
-
Run full validation before releases
.\scripts\validate.ps1 # Full check with AppInspect -
Review AppInspect reports
- Check
appinspect_report.json - Address all failures
- Consider fixing warnings
- Check
For issues with:
- Validation scripts: Check
scripts/README.md - Pre-commit: Visit https://pre-commit.com/
- AppInspect: Visit https://dev.splunk.com/enterprise/docs/developapps/testvalidate/appinspect/
- GitHub Actions: Check
.github/workflows/validate.ymlcomments
Happy coding! 🚀