Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent_requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pycryptodomex==3.23.0
pydantic==2.11.7
pyjwt==2.10.1
pymongo[srv]==4.8.0; python_version >= '3.9'
pymqi==1.12.11; sys_platform != 'darwin' or platform_machine != 'arm64'
pymqi==1.12.11
pymysql==1.1.1
pyodbc==5.2.0; sys_platform != 'darwin' or platform_machine != 'arm64'
pyopenssl==25.1.0
Expand Down
1 change: 1 addition & 0 deletions datadog_checks_dev/changelog.d/20832.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fail config validation if templates are missing.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under a 3-clause BSD style license (see LICENSE)
import difflib
import os
import re

import click
import yaml
Expand Down Expand Up @@ -35,8 +36,6 @@

IGNORE_DEFAULT_INSTANCE = {'ceph', 'dotnetclr', 'gunicorn', 'marathon', 'pgbouncer', 'process', 'supervisord'}

TEMPLATES = ['default', 'openmetrics_legacy', 'openmetrics', 'jmx']


@click.command(context_settings=CONTEXT_SETTINGS, short_help='Validate default configuration files')
@click.argument('check', shell_complete=complete_valid_checks, required=False)
Expand Down Expand Up @@ -113,6 +112,7 @@ def config(ctx, check, sync, verbose):

if not validate_default_template(spec_file_content):
message = "Missing default template in init_config or instances section"
files_failed[spec_file_path] = True
check_display_queue.append(lambda message=message, **kwargs: echo_failure(message, **kwargs))
annotate_error(spec_file_path, message)

Expand Down Expand Up @@ -186,13 +186,13 @@ def validate_default_template(spec_file):
if 'template: init_config' not in spec_file or 'template: instances' not in spec_file:
# This config spec does not have init_config or instances
return True
for line in spec_file.split('\n'):
has_default_templates = any("init_config/{}".format(template) in line for template in TEMPLATES) and any(
"instances/{}".format(template) in line for template in TEMPLATES
)
if has_default_templates:
return True
return False

templates = {
'intances': [f'template: init_config/{t}' for t in ['default', 'openmetrics_legacy', 'openmetrics', 'jmx']],
'init_config': [f'template: init_config/{t}' for t in ['default', 'openmetrics_legacy', 'openmetrics', 'jmx']],
}
# We want both instances and init_config to have at least one template present.
return all(any(re.search(t, spec_file) for t in tpls) for tpls in templates)


def validate_config_legacy(check, check_display_queue, files_failed, files_warned, file_counter):
Expand Down
1 change: 1 addition & 0 deletions ibm_ace/changelog.d/20815.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Lift `pymqi` dependency exclusion for macOS on AArch64/ARM64
2 changes: 1 addition & 1 deletion ibm_ace/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ license = "BSD-3-Clause"

[project.optional-dependencies]
deps = [
"pymqi==1.12.11; sys_platform != 'darwin' or platform_machine != 'arm64'",
"pymqi==1.12.11",
]

[project.urls]
Expand Down
1 change: 1 addition & 0 deletions ibm_mq/changelog.d/20815.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Lift `pymqi` dependency exclusion for macOS on AArch64/ARM64
2 changes: 1 addition & 1 deletion ibm_mq/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ requires-python = ">=3.9"
[project.optional-dependencies]
deps = [
"psutil==6.0.0",
"pymqi==1.12.11; sys_platform != 'darwin' or platform_machine != 'arm64'",
"pymqi==1.12.11",
]

[project.urls]
Expand Down
1 change: 1 addition & 0 deletions mysql/changelog.d/20833.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Moved logger instantiation in MySQL version compatibility check to the except block to only perform the costly call to `get_check_logger()` when outputting the warning log.
5 changes: 2 additions & 3 deletions mysql/datadog_checks/mysql/version_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ class MySQLVersion(namedtuple('MySQLVersion', ['version', 'flavor', 'build'])):
def version_compatible(self, compat_version):
# some patch version numbers contain letters (e.g. 5.0.51a)
# so let's be careful when we compute the version number
log = get_check_logger()
try:
mysql_version = self.version.split('.')
except Exception as e:
log.warning("Cannot compute mysql version, assuming it's older.: %s", e)
log = get_check_logger()
log.warning("Cannot compute MySQL version, assuming it's older: %s", e)
return False
log.debug("MySQL version %s", mysql_version)

patchlevel = int(re.match(r"([0-9]+)", mysql_version[2]).group(1))
version = (int(mysql_version[0]), int(mysql_version[1]), patchlevel)
Expand Down
2 changes: 2 additions & 0 deletions mysql/tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def cursor(self):
assert v.version == '5.5.12'
assert v.flavor == 'MySQL'
assert v.build == 'log'
assert v.version_compatible(compat_version=(5, 4, 3))
assert not v.version_compatible(compat_version=(8, 0, 43))


@pytest.mark.parametrize(
Expand Down
Loading