Skip to content

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

Open
LouisParkin wants to merge 14 commits into
stackstate-7.78.2from
STAC-25137
Open

STAC-25137 Tolerate dict/list/str customHostMetadata in Dynatrace Hos…#360
LouisParkin wants to merge 14 commits 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! 🚢

LouisParkin and others added 14 commits June 25, 2026 10:25
…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>
… 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>
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>
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>
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>
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>
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>
Fixes flake8 F401 after Python 3.13 JSON error message update.

Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid double https:// when CI already supplies a full repository URL.

Co-authored-by: Cursor <cursoragent@cursor.com>
Windows is no longer built or supported.

Co-authored-by: Cursor <cursoragent@cursor.com>
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