Skip to content
2 changes: 1 addition & 1 deletion .github/workflows/release-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ permissions:
env:
# Default ddev version when callers don't pass `ddev-version`. Tracked by Renovate.
# renovate: datasource=pypi depName=ddev
DEFAULT_DDEV_VERSION: "14.3.2"
DEFAULT_DDEV_VERSION: "16.0.0"

jobs:
prepare:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-release-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ on:
- ".github/workflows/scripts/**"
- ".github/workflows/release-dispatch.yml"
- ".github/workflows/release-trigger.yml"
- ".github/workflows/test-release-scripts.yml"
pull_request:
paths:
- ".github/workflows/scripts/**"
- ".github/workflows/release-dispatch.yml"
- ".github/workflows/release-trigger.yml"
- ".github/workflows/test-release-scripts.yml"

jobs:
test:
Expand All @@ -27,7 +29,7 @@ jobs:
python-version: "3.13"

- name: Install pytest
run: pip install pytest==8.3.5
run: pip install pytest==9.0.3

- name: Run tests
working-directory: .github/workflows/scripts
Expand Down
1 change: 1 addition & 0 deletions datadog_checks_dev/changelog.d/23543.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make `generate-profile-from-mibs` emit `symbol` instead of the deprecated `column` field on table metric tags, and accept `symbol` in `validate-profile`.
Original file line number Diff line number Diff line change
Expand Up @@ -639,17 +639,17 @@ def _add_profile_row_node(
oid_name = alias['name']

index = {'MIB': mib, 'tag': oid_name}
column = {'name': oid_name}
symbol = {'name': oid_name}
index_oid = _find_oid_by_name(mib, oid_name, mibs_directories, json_mib_directory, source, compiled_mibs_path)
if index_oid is not None:
column['OID'] = index_oid
symbol['OID'] = index_oid
index_table_oid = '.'.join(index_oid.split('.')[:-2])
index_table_name = _find_name_by_oid(
mib, index_table_oid, mibs_directories, json_mib_directory, source, compiled_mibs_path
)
if index_table_name is not None:
index['table'] = index_table_name
index['column'] = column
index['symbol'] = symbol
metric_tags.append(index)

profile_oid_collection[table_oid]['metric_tags'] = metric_tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def validate(self, profile, path):
if not all_metric_tags_are_valid:
self.fail(
"metric_tables defined in lines {} are not valid. \
\nmetric_tags must have 'column' or 'index' value".format(lines)
\nmetric_tags must have 'symbol', 'column' or 'index' value".format(lines)
)

if not self.result.failed:
Expand All @@ -281,7 +281,7 @@ def check_metric_tags_are_valid(self, metric_tags):
all_tags_are_valid = True
lines = []
for metric_tag in metric_tags:
if not (metric_tag.get('column') or metric_tag.get('index')):
if not (metric_tag.get('symbol') or metric_tag.get('column') or metric_tag.get('index')):
all_tags_are_valid = False
lines.append(metric_tag.get('__line__'))

Expand Down
1 change: 1 addition & 0 deletions ddev/changelog.d/23573.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include .yaml workflow files in update-python-config so all workflow Python pins are updated.
1 change: 1 addition & 0 deletions ddev/changelog.d/23575.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix type annotation of on_error in the EventBusOrchestrator by narrowing it down to OrchestratorHookError. This better represents the actual error passed to the method.
6 changes: 4 additions & 2 deletions ddev/src/ddev/cli/meta/scripts/update_py_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ def integrations(app):


def update_ci_files(app: Application, new_version: str, old_version: str, tracker: ValidationTracker):
workflows_dir = app.repo.path / ".github" / "workflows"
files_to_update = [
*(app.repo.path / ".github" / "workflows").glob("*.yml"),
*(app.repo.path / ".github" / "workflows" / "scripts").glob("*.sh"),
*workflows_dir.glob("*.yml"),
*workflows_dir.glob("*.yaml"),
*(workflows_dir / "scripts").glob("*.sh"),
]

# Patterns to match:
Expand Down
12 changes: 6 additions & 6 deletions ddev/src/ddev/event_bus/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from collections.abc import Awaitable, Callable
from concurrent.futures import Executor, ThreadPoolExecutor
from dataclasses import dataclass
from typing import assert_never
from typing import assert_never, cast

from .exceptions import (
FatalProcessingError,
Expand All @@ -22,7 +22,7 @@
SkipMessageError,
)

ErrorHandler = Callable[[Exception], Awaitable[None]]
type ErrorHandler[E: Exception] = Callable[[E], Awaitable[None]]


@dataclass
Expand All @@ -44,7 +44,7 @@ def __init__(self, name: str):
async def on_success(self, message: T) -> None:
pass

async def on_error(self, error: Exception) -> None:
async def on_error(self, error: MessageProcessingError | ProcessorHookError) -> None:
"""
Handle a processor-scoped failure.

Expand Down Expand Up @@ -232,7 +232,7 @@ async def on_message_received(self, message: BaseMessage): # pragma: no cover
"""
pass

async def on_error(self, error: Exception) -> None:
async def on_error(self, error: OrchestratorHookError) -> None:
"""
Handle an orchestrator-scoped failure.

Expand All @@ -251,7 +251,7 @@ async def on_error(self, error: Exception) -> None:
"""
raise error

async def _apply_error_policy(self, wrapped_error: Exception, handler: ErrorHandler) -> None:
async def _apply_error_policy[E: Exception](self, wrapped_error: E, handler: ErrorHandler[E]) -> None:
"""
Routes ``wrapped_error`` through ``handler`` and applies the orchestrator's policy.

Expand Down Expand Up @@ -460,7 +460,7 @@ async def _task_wrapper(self, processor: Processor, message: BaseMessage):
try:
match processor:
case AsyncProcessor():
await processor.process_message(message)
await cast(AsyncProcessor, processor).process_message(message)
case SyncProcessor():
await asyncio.get_running_loop().run_in_executor(self._executor, processor.process_message, message)
case _:
Expand Down
13 changes: 13 additions & 0 deletions ddev/tests/cli/meta/scripts/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ def fake_repo(tmp_path_factory, config_file, local_repo, ddev, mocker):
""",
)

write_file(
repo_path / '.github' / 'workflows',
'claim-pypi-name.yaml',
f"""name: claim pypi name
jobs:
claim:
steps:
- uses: actions/setup-python@v6
with:
python-version: "{OLD_PYTHON_VERSION}"
""",
)

write_file(
repo_path / 'ddev',
'pyproject.toml',
Expand Down
7 changes: 6 additions & 1 deletion ddev/tests/cli/meta/scripts/test_update_py_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_update_py_config(fake_repo, ddev):
result = ddev('meta', 'scripts', 'update-python-config', NEW_PYTHON_VERSION)

assert result.exit_code == 0, result.output
assert result.output.endswith('Python upgrades\n\nPassed: 9\n')
assert result.output.endswith('Python upgrades\n\nPassed: 10\n')

contents = constant_file.read_text()
assert f'PYTHON_VERSION = {OLD_PYTHON_VERSION!r}' not in contents
Expand All @@ -25,6 +25,11 @@ def test_update_py_config(fake_repo, ddev):
assert f'PYTHON_VERSION: "{OLD_PYTHON_VERSION}"' not in contents
assert f'PYTHON_VERSION: "{NEW_PYTHON_VERSION}"' in contents

yaml_workflow = fake_repo.path / '.github' / 'workflows' / 'claim-pypi-name.yaml'
contents = yaml_workflow.read_text()
assert f'python-version: "{OLD_PYTHON_VERSION}"' not in contents
assert f'python-version: "{NEW_PYTHON_VERSION}"' in contents

hatch_file = fake_repo.path / 'dummy' / 'hatch.toml'
contents = hatch_file.read_text()
assert f'python = ["{OLD_PYTHON_VERSION}"]' not in contents
Expand Down
Loading
Loading