Skip to content

feat: separate CIM data models into standalone splunk-cim-models package#946

Open
mkolasinski-splunk wants to merge 4 commits intomainfrom
feat/cim-separation
Open

feat: separate CIM data models into standalone splunk-cim-models package#946
mkolasinski-splunk wants to merge 4 commits intomainfrom
feat/cim-separation

Conversation

@mkolasinski-splunk
Copy link
Contributor

Summary

  • Extract CIM version definitions (datamodel_definition.py), 23 data model JSON schemas, CommonFields.json, and DatamodelSchema.json into a new standalone splunk-cim-models package
  • Update PSA to import CIM data from splunk_cim_models instead of internal modules
  • Keep backward-compat stub in CIM_Models/datamodel_definition.py with deprecation warning
  • All 500 unit tests passing

Motivation

Every CIM version bump (4.18 → 5.x → 6.x) currently forces a full PSA release even though only data changes. Separating CIM data into its own package enables:

  • Independent CIM version releases without touching PSA
  • Add-ons can pin/control CIM version in their own dependencies
  • Cleaner separation of test framework logic vs. CIM data

Changes

File Change
splunk-cim-models/ New package with all CIM data files
pytest_splunk_addon/splunk.py Import datamodels from splunk_cim_models
pytest_splunk_addon/app_test_generator.py Use DATA_MODELS_PATH from splunk_cim_models
pytest_splunk_addon/cim_tests/test_generator.py Use COMMON_FIELDS_PATH from splunk_cim_models
pytest_splunk_addon/cim_tests/json_schema.py Use DATAMODEL_SCHEMA_PATH from splunk_cim_models
pyproject.toml Add splunk-cim-models path dependency
CIM_Models/datamodel_definition.py Backward-compat re-export with deprecation warning
Unit tests Updated path assertions to expect splunk_cim_models paths

Test plan

  • PSA unit tests (500/500 passing locally)
  • CI unit tests (test-splunk-unit)
  • CI e2e matrix tests (all 12 markers, especially splunk_app_cim_fiction, splunk_app_cim_broken, splunk_cim_model)
  • CI external tests (test-splunk-external)
  • Validate with splunk-add-on-for-box knowledge tests

Made with Cursor

Extract CIM version definitions (datamodel_definition.py), data model JSON
schemas (23 files), CommonFields.json, and DatamodelSchema.json into a new
splunk-cim-models package. This enables independent CIM version releases
without requiring a full PSA release.

Changes:
- Create splunk-cim-models/ package with setuptools build backend
- Update splunk.py to import datamodels from splunk_cim_models
- Update app_test_generator.py to use DATA_MODELS_PATH from splunk_cim_models
- Update cim_tests/test_generator.py to use COMMON_FIELDS_PATH from splunk_cim_models
- Update cim_tests/json_schema.py to use DATAMODEL_SCHEMA_PATH from splunk_cim_models
- Add splunk-cim-models as path dependency in pyproject.toml
- Keep backward-compat stub in CIM_Models/datamodel_definition.py with deprecation warning
- Update unit tests to expect new package paths
@mkolasinski-splunk mkolasinski-splunk requested a review from a team as a code owner February 13, 2026 07:12
Change splunk-cim-models dependency from path reference to standard
version constraint so pip consumers (e.g. TAs) can specify their own
source for splunk-cim-models without conflicting with PSA's internal
path reference in the built wheel metadata.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments