- Install dependencies:
poetry install - Build local Python package:
poetry build - Build add-on from a package source:
poetry run ucc-gen build --source <path-to-package> - Build add-on with verbose file state output:
poetry run ucc-gen build --source <path-to-package> --verbose - Build add-on and custom UI together:
poetry run ucc-gen build --source <path-to-package> --build-custom-ui - Initialize a new add-on skeleton:
poetry run ucc-gen init --addon-name "<addon_name>" --addon-display-name "<display_name>" --addon-input-name <input_name> - Package a built add-on:
poetry run ucc-gen package --path output/<addon_name> - Validate a built add-on with AppInspect integration:
poetry run ucc-gen validate --addon-path output/<addon_name> - Run docs site locally:
poetry run mkdocs serve -a localhost:8001 - One-command backend/frontend/dev setup:
./scripts/quick_start_ui.sh - Build UI assets and copy into UCC static assets:
./scripts/build_ui.sh - UI workspace setup (run from
ui/):yarn run setup - UI dev server (run from
ui/):yarn start - UI production build (run from
ui/):yarn build
- Run Python unit tests:
poetry run pytest tests/unit - Run smoke tests:
poetry run pytest tests/smoke - Run UI end-to-end tests:
poetry run pytest tests/ui - Run UI library tests (run from
ui/):yarn run test - Run tests with coverage report:
poetry run pytest tests/unit --cov splunk_add_on_ucc_framework --cov-report html - Run smoke tests with coverage report:
poetry run pytest tests/smoke --cov splunk_add_on_ucc_framework --cov-report html - Coverage HTML output path:
htmlcov/index.html - Make sure unit tests coverage does not decrease after changes made
- Before running UI tests locally, build a sample add-on and start Splunk via
./scripts/run_splunk.shas documented indocs/contributing.md.
splunk_add_on_ucc_framework/: core Python framework anducc-gencommand implementation.tests/: unit, smoke, and UI pytest suites.ui/: TypeScript UI library, Storybook, ESLint/Prettier workflows.docs/: MkDocs source for user/developer documentation.scripts/: helper scripts for local UI build/start and Splunk test environment.assets/: project assets used by docs/workflows.output/: generated add-on build outputs.dist/: built distribution artifacts.demo_addon_for_splunk/,demo_addon_for_splunk_already_exists/,init_addon_for_ucc_package/: sample/add-on fixture projects used for validation and demos.
- Run all Python lint/type hooks with:
pre-commit run --all-files - Pre-commit is authoritative for Python checks and includes:
black,mypy,flake8,pyupgrade,autoflake, andmarkdownlint. - Python formatting/lint baseline: Flake8 max line length is
120(see.flake8). - Use Python 3.9+ compatible syntax for Python changes (
pyupgrade --py39-plusis enforced). - For UI changes in
ui/, run fromui/:yarn run eslintandyarn run format:verify(oryarn run eslint:fix/yarn run formatwhen intentionally rewriting formatting). yarn run setupinui/is a prerequisite before other UI yarn tasks.
- Default development branch is
develop; open regular feature/fix/docs PRs againstdevelop. - Use small PRs and include tests with bug fixes/features.
- PR titles must follow Conventional Commits, e.g.
feat(ui): add ...,fix(generator): ...,docs(...): .... - Regular PRs to
developshould be merged via squash on GitHub. - Release PR flow is
develop -> mainwith merge commit (not squash), then backportmain -> developwith merge commit. - Use documented GitHub CLI commands in
docs/contributing.mdfor release/backport PR creation and merge automation.
- Do not hand-edit generated add-on artifacts under
output/<addon_name>/...; regenerate withucc-gen build. - Do not hand-edit
docs/generated_files.md; it is generated bysplunk_add_on_ucc_framework/generators/doc_generator.py. After changing generated-file descriptions, regenerate it viapoetry run ucc-gen-docs. - Treat files documented in
docs/generated_files.mdas generated outputs (for exampledefault/app.conf,default/inputs.conf,default/restmap.conf,default/web.conf, generated XML views/nav, alert files, and OpenAPI output). - Input scripts are regenerated on each build. Put custom modular input logic in helper modules (
inputHelperModule) inbin/; those helper modules are preserved. - If you need custom
.confbehavior, prefer providing source.conffiles in the add-ondefaultsource location instead of patching generated output. - Avoid committing local runtime/cache artifacts such as
.venv/,.pytest_cache/,.mypy_cache/,htmlcov/, and transient local output unless intentionally updating reproducible fixtures. - When changing commands, release flow, or test workflows, update
docs/commands.mdand/ordocs/contributing.mdin the same PR.
If git commit fails with gpg failed to sign the data, do not bypass with --no-gpg-sign or --no-verify. Instead:
- Stage files with
git addas normal. - Provide the user with the exact
git commitcommand to run in their own terminal. - Wait for confirmation before proceeding (push, MR creation, etc.).