STAC-25137 Tolerate dict/list/str customHostMetadata in Dynatrace Hos…#360
Open
LouisParkin wants to merge 14 commits into
Open
STAC-25137 Tolerate dict/list/str customHostMetadata in Dynatrace Hos…#360LouisParkin wants to merge 14 commits into
LouisParkin wants to merge 14 commits into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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?
Step 4: I'm confident that everything is properly tested:
I got a PO / QA Approval by:
Step 5: Can we ship this feature to production?