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
4 changes: 3 additions & 1 deletion changelog.d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ Write one entry without a heading or leading bullet. Describe the observable cha
including migration instructions for a break, and say whether a recommended value moved.
Cite register entries as `TC-n` and OEPs by number; `poe register-sync` renumbers a
fragment's citations with the rest of the branch, and `tests/test_register.py` checks
them. Markdown links are relative to the root `CHANGELOG.md`, where the text will appear.
them. Markdown links are relative to the root `CHANGELOG.md`, where the text will appear,
and must point to a page under `docs/`, since the manual includes the changelog; use a full
URL for anything else. `tests/test_release_metadata.py` checks them.
Use a unique slug to avoid conflicts. A later correction can edit the original fragment
while it is still pending.

Expand Down
1 change: 1 addition & 0 deletions changelog.d/changelog-links.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A release note can link a page of the manual: the manual's changelog page now resolves links from the repository root, as `changelog.d/README.md` says. No value, model or public name changed.
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
```{include} ../CHANGELOG.md
:relative-docs: docs/
```
15 changes: 15 additions & 0 deletions tests/test_release_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,18 @@ def test_the_citation_names_the_latest_release():
_scalar(citation, "version"),
_scalar(citation, "date-released"),
) == released[0]


def test_changelog_links_resolve_in_the_manual():
# A fragment's link first reaches the manual when the release pull request collects
# it, and a broken one then fails the documentation build, so check it here.
include = (ROOT / "docs/changelog.md").read_text(encoding="utf-8")
assert ":relative-docs: docs/" in include
notes = [ROOT / "CHANGELOG.md", *(ROOT / "changelog.d").glob("*.*.md")]
for path in notes:
text = path.read_text(encoding="utf-8")
for target in re.findall(r"\]\(([^)#\s]+)[^)]*\)", text):
if re.match(r"[a-z]+:", target):
continue
assert target.startswith("docs/"), f"{path.name}: {target}"
assert (ROOT / target).is_file(), f"{path.name}: {target}"
Loading