mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
The version-source updater only read meta/services.yml. An addon pinned in meta/addons/<id>.yml stayed where it was: the ONLYOFFICE connector for Nextcloud sat on v10.1.2, which does not install on Nextcloud 35, until someone bumped it by hand. The updater now reads addon files too. An addon declares its source in the `update:` block it already has, beside monitored, catalog and upstream_id. A monitored addon of the github-releases catalog needs nothing more: its upstream_id names the repository whose tags are its versions. The update-version-sources job opens the PRs, one per role. Every pinned addon is wired: - nextcloud onlyoffice carries its own version pin now. Its archive URL stays a literal that carries the pin, because test_pinned_addon_archives_available reads it as written - wordpress mcp-adapter, moodle auth_oidc and jellyfin sso-authentication follow the tags of their repository, moodle within its v4.5 series - the three xwiki extensions read their Maven metadata - pretix-oidc reads the PyPI simple index. The JSON API answers 404 behind the package cache the test stack routes pypi.org through - joomla's plugin is built here and jellyfin's ldap-authentication is bound to the md5 of its archive; both are opted out with that reason A bump rewrites the pin and the config.archive line together, and an archive that does not carry the pin fails test_version_keys, so the two cannot drift apart again. test_version_pins_are_watched covers addon pins as well: a new one without a source or a reasoned opt-out fails the lint. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
63 lines
1.6 KiB
Python
Executable File
63 lines
1.6 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
from pathlib import Path
|
|
|
|
from utils.update.source import apply_updates, find_outdated_updates
|
|
|
|
from . import PROJECT_ROOT
|
|
|
|
|
|
def main() -> int:
|
|
parser = argparse.ArgumentParser(
|
|
description=(
|
|
"Update version pins that declare their upstream in an `update:` "
|
|
"block of roles/*/meta/services.yml or roles/*/meta/addons/*.yml."
|
|
)
|
|
)
|
|
parser.add_argument(
|
|
"--repo-root",
|
|
type=Path,
|
|
default=PROJECT_ROOT,
|
|
help="Repository root to scan and update",
|
|
)
|
|
parser.add_argument(
|
|
"--dry-run",
|
|
action="store_true",
|
|
help="Print planned updates without modifying files",
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
repo_root = args.repo_root.resolve()
|
|
updates = find_outdated_updates(repo_root)
|
|
|
|
if not updates:
|
|
print("Declared version sources are already up to date.")
|
|
return 0
|
|
|
|
print("Planned version source updates:")
|
|
for update in updates:
|
|
entry = update.entry
|
|
rel_path = entry.config_path.relative_to(repo_root)
|
|
print(
|
|
f"- {rel_path}:{entry.line} {entry.role}/{entry.entity}.{entry.key} "
|
|
f"{entry.current} -> {update.latest}"
|
|
)
|
|
|
|
if args.dry_run:
|
|
return 0
|
|
|
|
changed_paths = apply_updates(updates)
|
|
if changed_paths:
|
|
print("\nUpdated files:")
|
|
for path in changed_paths:
|
|
print(f"- {path.relative_to(repo_root)}")
|
|
else:
|
|
print("\nNo files changed.")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|