Skip to content

STAC-25137 Tolerate dict/list/str customHostMetadata in Dynatrace Hos…#360

Merged
LouisParkin merged 1 commit into
stackstate-7.78.2from
STAC-25137
Jun 30, 2026
Merged

STAC-25137 Tolerate dict/list/str customHostMetadata in Dynatrace Hos…#360
LouisParkin merged 1 commit into
stackstate-7.78.2from
STAC-25137

Conversation

@LouisParkin

Copy link
Copy Markdown
Contributor

…tEntity

Dynatrace returns properties.customHostMetadata inconsistently across environments: as a {key: value} dict in some and as a list of {'key':.., 'value':..} objects in others. HostProperties.customHostMetadata was typed as Dict[str, Any], so the list shape failed Pydantic validation and the whole host entity was silently dropped from topology (observed at Rabobank, ~16 hosts skipped at dynatrace_topology.py:398).

Parse the field tolerantly: accept a dict, else a list, else a string, falling back to str() for any other non-null type, so a single type mismatch no longer drops the entity. Mirrors the existing convert_custom_pg_metadata approach for the sibling customPgMetadata field. Adds regression tests for the list (production), dict, string and non-scalar -> str cases.

Step 1: Link to Jira issue

Step 2: Description of changes

Step 3: Did you add / update tests for your changes in the right area?

  • Unit/Component test
  • Integration test

Step 4: I'm confident that everything is properly tested:

I got a PO / QA Approval by:

  • Name

Step 5: Can we ship this feature to production?

  • Yes, I'm proud of my work. Ship it! 🚢

…tEntity

Dynatrace returns properties.customHostMetadata inconsistently across
environments: as a {key: value} dict in some and as a list of
{'key':.., 'value':..} objects in others. HostProperties.customHostMetadata was
typed as Dict[str, Any], so the list shape failed Pydantic validation and the
whole host entity was silently dropped from topology (observed at Rabobank,
~16 hosts skipped at dynatrace_topology.py:398).

Parse the field tolerantly: accept a dict, else a list, else a string, falling
back to str() for any other non-null type, so a single type mismatch no longer
drops the entity. Mirrors the existing convert_custom_pg_metadata approach for
the sibling customPgMetadata field. Adds regression tests for the list
(production), dict, string and non-scalar -> str cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

STAC-25137: document that CI image Python tracks the agent's embedded Python

The CI runner image's Python must match the CPython the StackState Agent embeds
(omnibus/config/software/python3.rb default_version, mirrored in .python-version).
Bumping it is part of the agent upstream-merge process, not ad-hoc work; expanded
the 'CI image' README section to point at UPSTREAM_MERGE.md and list the files to
change. Keeps integrations CI on the interpreter the agent ships so version-specific
bugs (e.g. pydantic validation differences, cf. STAC-25137) are caught before release.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

STAC-25137 Build new docker image.

Bump integrations CI runner to Python 3.13.14 (bookworm base): Dockerfile,
Makefile, setup_env.sh, conda_env.ps1, .python-version, and .gitlab-ci.yml
(RUNNER_IMAGE_TAG variable, docker job, stackstate-7.78.2 branch rules).
Auto-run the docker job when the commit message contains "Build new docker image".

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Point CI at py3.13.14 runner image 20260625-py313

Switch RUNNER_IMAGE_TAG after the docker job published
registry.tooling.stackstate.io/.../stackstate-agent-integrations-runner:20260625-py313.

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Fix linux_deps venv creation on Python 3.13

Debian bookworm's apt virtualenv cannot seed py3.13 with the legacy
--pip=23.3.1 --setuptools=44.1.1 pins (job 15030656775). Use stdlib
python3.13 -m venv instead. Drop unused apt virtualenv from the runner
Dockerfile for the next image rebuild.

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Pin Python 3.13-compatible pip and setuptools

Centralize pip 24.3.1 and setuptools 75.8.2 in python_tool_versions.env
for CI venv setup, tox, Windows conda, and the runner Dockerfile. Replaces
legacy pins that cannot bootstrap Python 3.13.

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Fix servicenow JSON error test on Python 3.13

Python 3.13's json decoder reports a different first error for the
malformed fixture; accept known messages across Python versions.

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Remove unused PY3 import in servicenow tests

Fixes flake8 F401 after Python 3.13 JSON error message update.

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Build new docker image.

Rebuild runner with pinned pip/setuptools/virtualenv; fix PyPI publish
.pypirc URL; add manual windows_smoke job; enable publish on STAC branches.

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Fix windows_smoke check name for PowerShell CI

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Fix checks-dev publish for setuptools 75 / pip 24

Use twine upload instead of deprecated setup.py upload; run publish in
the linux_deps venv with explicit linux_deps artifact dependency.

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Fix publish twine step working directory

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Normalize GitLab PyPI publish URL in .pypirc

Avoid double https:// when CI already supplies a full repository URL.

Co-authored-by: Cursor <cursoragent@cursor.com>

STAC-25137 Remove windows_smoke CI job

Windows is no longer built or supported.

Co-authored-by: Cursor <cursoragent@cursor.com>
@LouisParkin LouisParkin merged commit 9cb3adf into stackstate-7.78.2 Jun 30, 2026
1 check passed
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.

2 participants