Skip to content

feat!: separate CIM data models into standalone splunk-cim-models package [BREAKING]#949

Merged
mkolasinski-splunk merged 16 commits intomainfrom
feat/cim-separation
Mar 27, 2026
Merged

feat!: separate CIM data models into standalone splunk-cim-models package [BREAKING]#949
mkolasinski-splunk merged 16 commits intomainfrom
feat/cim-separation

Conversation

@mkolasinski-splunk
Copy link
Copy Markdown
Contributor

⚠️ Breaking Change

splunk-cim-models is no longer a runtime dependency of PSA. It
is now a dev-only dependency (used only for PSA's own tests).

Add-ons must declare splunk-cim-models in their own dependencies
to control CIM version independently — this is the core purpose of the
separation.

Summary

  • Extract CIM version definitions, 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
  • splunk-cim-models declared as dev dependency — add-ons own
    their CIM version

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

psa-cim-models Package

Add-on Validation

Both add-ons use PSA feat/cim-separation but differ only in CIM
version — proving the decoupling works:

Add-on PSA branch CIM models
splunk-add-on-for-microsoft-office-365 feat/cim-separation psa-cim-models@v1 (CIM v5)
splunk-add-on-for-box feat/cim-separation psa-cim-models@v2 (CIM v6)

Jira

https://splunk.atlassian.net/browse/ADDON-85727

BREAKING CHANGE: splunk-cim-models is no longer a runtime dependency of PSA. Add-ons must declare it in their own dependencies to control CIM version independently.

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
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.
The test-splunk-external job's Test step never exported GH_TOKEN to the
runner environment, so docker-compose couldn't pass it through to the
container (even though docker-compose-ci.yml declared '- GH_TOKEN').
Without the token, entrypoint.sh had no credentials to clone the private
psa-cim-models repo, causing poetry install to fail entirely.
Fixes pre-commit failure in CI run 22754142433.
test_splunk_cim_model asserts a fixed list of field names drawn from the v2
Change data model (e.g. All_Changes::result). That field doesn't exist in
v1, so the assertion always fails for the 1.x matrix cell.

Switch the test-cim-models-versions job to splunk_app_cim_fiction, which
uses --splunk-dm-path with local fiction data models. Expected outcomes are
identical across all splunk-cim-models versions, while all PSA import paths
(COMMON_FIELDS_PATH, DATAMODEL_SCHEMA_PATH, datamodels) are still exercised
-- an incompatible package will surface as a collection or runtime error.

splunk_cim_model stays in test-splunk-matrix where it runs with the default
v2 dev dependency and its version-specific field assertions are valid.
@mkolasinski-splunk mkolasinski-splunk requested a review from a team as a code owner March 27, 2026 08:57
@mkolasinski-splunk mkolasinski-splunk merged commit fbb8f6e into main Mar 27, 2026
24 of 25 checks passed
@mkolasinski-splunk mkolasinski-splunk deleted the feat/cim-separation branch March 27, 2026 09:02
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2026
@srv-rr-github-token
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 7.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants