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
39 changes: 39 additions & 0 deletions .ci/scripts/check_changelog_snippets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/env python3
# /// script
# requires-python = ">=3.11"
# dependencies = [
# ]
# ///
import re
import sys
import tomllib
from pathlib import Path

EXCEPTIONS = [
".TEMPLATE.md",
".gitkeep",
".gitignore",
"pulp_deb",
]


def snippet_valid(path: Path, changelog_exts: list[str]) -> bool:
return (path.name in EXCEPTIONS) or (
path.suffix in changelog_exts
and (path.stem.startswith("+") or re.fullmatch(r"\d*", path.stem))
)


if __name__ == "__main__":
with Path("pyproject.toml").open("rb") as fp:
pyproject_toml = tomllib.load(fp)
try:
changelog_exts = [
f".{item['directory']}" for item in pyproject_toml["tool"]["towncrier"]["type"]
]
except KeyError:
changelog_exts = [".feature", ".bugfix", ".doc", ".removal", ".misc"]
matches = Path("CHANGES").rglob("*")
invalid_snippets = ", ".join(f"'{s}'" for s in matches if not snippet_valid(s, changelog_exts))
if invalid_snippets:
sys.exit(f"LINT: Invalid changelog entries: {invalid_snippets}.")
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
run: |
ruff check

- name: "Check Changelog Snippets"
run: |
uv run .ci/scripts/check_changelog_snippets.py

- name: "Run extra lint checks"
run: |
[ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ requires-python = ">=3.11"
dependencies = [
# All things django and asyncio are deliberately left to pulpcore
# Example transitive requirements: asgiref, asyncio, aiohttp
"pulpcore>=3.113.0,<3.130",
"pulpcore>=3.118.0,<3.130",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed failing pipelines by removing the phase out reminder test. Though I'm not sure if we should raise the pulpcore floor for this branch?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is a new pulpcore "support policy", see: #1542 (comment)

If we want to be nice to users we should add a removal changelog both on main branch and this one, so they can see the floor has been raised before updating.

"python-debian>=0.1.44,<0.2.0",
"jsonschema>=4.6,<5.0",
]
Expand Down
Loading