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
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,65 @@ jobs:
name: test-logs-${{ matrix.ros_distro }}
path: log/
retention-days: 7

release-metadata:
name: release metadata
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check package.xml and CHANGELOG.rst are bloom-ready
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends python3-catkin-pkg
python3 - <<'PY'
import re

from catkin_pkg.changelog import get_changelog_from_path
from catkin_pkg.package import parse_package
from docutils import nodes
from docutils.core import publish_doctree

PKG = 'rmw_unix_socket_cpp'
pkg = parse_package(PKG)
pkg.validate()
required_urls = {'repository', 'bugtracker', 'website'}
missing = required_urls - {u.type for u in pkg.urls}
assert not missing, f'package.xml is missing <url> types: {sorted(missing)}'
assert pkg.maintainers[0].email, 'maintainer has no email'

# bloom only reads CHANGELOG.rst sitting next to package.xml.
changelog = get_changelog_from_path(PKG)
assert changelog is not None, f'no CHANGELOG.rst in {PKG}/'
versions = [v for v, _, _ in changelog.foreach_version()]
assert pkg.version == versions[-1], \
f'package.xml {pkg.version} is not the newest changelog entry {versions[-1]}'
for version, date, content in changelog.foreach_version():
assert date, f'{version} has no parseable date'
assert content, f'{version} body is empty'

# The parsed view above is not enough: REP-132 allows only paragraphs
# and lists under a version heading, and catkin_pkg drops sub-sections
# silently. A version with an intro paragraph plus sub-sections still
# parses non-empty while every bullet under them is lost, so check the
# raw rst structure too.
tree = publish_doctree(
changelog.rst,
settings_overrides={'report_level': 5, 'warning_stream': False})
for section in tree.findall(nodes.section):
title = section.next_node(nodes.title).astext()
if not re.match(r'^\d+\.\d+\.\d+ \(', title):
continue
nested = [s.next_node(nodes.title).astext()
for s in section.findall(nodes.section) if s is not section]
assert not nested, f'{title} has rst sub-sections {nested}, which are dropped'

# rst has no nested inline markup, so ``code`` inside **bold** emits
# the backticks literally and docutils reports nothing.
for strong in tree.findall(nodes.strong):
text = strong.astext()
assert '``' not in text, f'literal backticks in bold: {text[:60]}'

print(f'{PKG} {pkg.version}: {len(versions)} changelog entries, metadata OK')
PY
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ros_distro: [jazzy, kilted, rolling]
ros_distro: [jazzy, kilted, rolling, lyrical]
container:
image: ros:${{ matrix.ros_distro }}-ros-base
steps:
Expand Down
251 changes: 0 additions & 251 deletions CHANGELOG.md

This file was deleted.

Loading
Loading