Skip to content
Open
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
17 changes: 13 additions & 4 deletions .github/scripts/tag-syncer.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
# SPDX-FileCopyrightText: 2026 - Canonical Ltd
# SPDX-License-Identifier: Apache-2.0

# /// script
# requires-python = ">=3.12"
# dependencies = [
# "launchpadlib>=2.1.0",
# ]
# ///
"""Helper script to sync git tags with snap builds in Launchpad.

Usage:
python3 tag-syncer.py <snap-recipes...>
"""

import logging
import sys
import subprocess
import sys

from launchpadlib.launchpad import Launchpad


logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(message)s",
Expand Down Expand Up @@ -133,7 +140,7 @@ def process_build(build) -> bool:
"""Process a single build and create a tag if appropriate.

Returns:
bool: True if build was processed successfully (tagged or skipped), False on error.
bool: True if build was processed successfully (tagged or skipped).
"""
if not is_build_ready_for_tagging(build):
return True
Expand Down Expand Up @@ -261,7 +268,9 @@ def main(*snap_recipes: str) -> None:
if len(sys.argv) < 2:
logger.error("Usage: tag-syncer.py <snap-recipes...>")
logger.error(
"Example: tag-syncer.py ~openstack-snappers/snap-openstack/+snap/openstack-caracal-candidate ~openstack-snappers/+snap/openstack-main-edge"
"Example: tag-syncer.py"
" ~openstack-snappers/snap-openstack/+snap/openstack-caracal-candidate"
" ~openstack-snappers/+snap/openstack-main-edge"
)
sys.exit(1)

Expand Down
Loading
Loading