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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Each section from every release note are combined when the
# CHANGELOG.rst is rendered. So the text needs to be worded so that
# it does not depend on any information only available in another
# section. This may mean repeating some details, but each section
# must be readable independently of the other.
#
# Each section note must be formatted as reStructuredText.
---
fixes:
- |
Add logic to include integrations that do not have a manifest.json file in the Agent.
46 changes: 34 additions & 12 deletions tasks/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,24 @@ def check_supports_python_version(check_dir, python):
return False


def _load_manifest_platform_overrides(integrations_dir):
"""
Read [overrides.manifest.platforms] from <integrations_dir>/.ddev/config.toml.

Returns a mapping of integration folder -> list of supported platform strings
(e.g. "linux", "windows", "mac_os"). Used as a fallback for integrations that
no longer ship a manifest.json.
"""
import toml

config_path = os.path.join(integrations_dir, '.ddev', 'config.toml')
if not os.path.isfile(config_path):
return {}
with open(config_path) as f:
config = toml.load(f)
return config.get('overrides', {}).get('manifest', {}).get('platforms', {}) or {}


@task
def collect_integrations(_, integrations_dir, python_version, target_os, excluded):
"""
Expand All @@ -715,6 +733,7 @@ def collect_integrations(_, integrations_dir, python_version, target_os, exclude
"""
import json

manifest_overrides = _load_manifest_platform_overrides(integrations_dir)
integrations = []

for entry in os.listdir(integrations_dir):
Expand All @@ -724,21 +743,24 @@ def collect_integrations(_, integrations_dir, python_version, target_os, exclude

manifest_file_path = os.path.join(int_path, "manifest.json")

# If there is no manifest file, then we should assume the folder does not
# contain a working check and move onto the next
if not os.path.exists(manifest_file_path):
continue
if os.path.exists(manifest_file_path):
with open(manifest_file_path) as f:
manifest = json.load(f)

with open(manifest_file_path) as f:
manifest = json.load(f)
# Figure out whether the integration is supported on the target OS
if target_os == 'mac_os':
tag = 'Supported OS::macOS'
else:
tag = f'Supported OS::{target_os.capitalize()}'

# Figure out whether the integration is supported on the target OS
if target_os == 'mac_os':
tag = 'Supported OS::macOS'
if tag not in manifest['tile']['classifier_tags']:
continue
elif entry in manifest_overrides:
# No manifest.json; fall back to .ddev/config.toml [overrides.manifest.platforms]
if target_os not in manifest_overrides[entry]:
continue
else:
tag = f'Supported OS::{target_os.capitalize()}'

if tag not in manifest['tile']['classifier_tags']:
# No manifest file and no override -> assume the folder is not a working check
continue

if not check_supports_python_version(int_path, python_version):
Expand Down
Loading