mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 11:46:35 +00:00
The README generator read its author URL out of the ## Credits sections it
writes itself. .mailmap now folds every address a person commits under into
their @infinito.nexus one, whose local part names their social profile, and
that profile becomes the single point of truth for an author.
utils/meta/identity.py parses .mailmap rather than shelling out to
git check-mailmap, which refuses the worktree the test container mounts.
Cross-checked against git over all 14 identities in the history: no
disagreement.
A new env handler carries the committing identity into the container, which
mounts the checkout but not the contributor's git configuration. Without it
both new tests would skip exactly where they are meant to fire:
* tests/integration/meta/test_commit_identity.py fails when the configured
address does not fold, and prints the .mailmap line to add.
* tests/external/repository/test_author_profile.py probes that profile
live, behind a canary so an unreachable instance is not reported as a
missing profile.
Both look at the current address only. Probing every declared author would be
red for people who have not created a profile yet, and a suite that is red for
someone else's omission stops being read.
Marko Pjevac is declared as a role author but has no address here, so his
Credits line stays unlinked.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
47 lines
1.5 KiB
Python
47 lines
1.5 KiB
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from utils.cache.files import PROJECT_ROOT
|
|
from utils.meta.authors import author_names, role_authors
|
|
from utils.software import SOFTWARE_AUTHOR
|
|
|
|
|
|
class TestAuthorNames(unittest.TestCase):
|
|
def test_the_credited_people_are_listed(self) -> None:
|
|
self.assertIn(SOFTWARE_AUTHOR, author_names())
|
|
|
|
def test_the_names_are_sorted_and_unique(self) -> None:
|
|
names = author_names()
|
|
|
|
self.assertEqual(list(names), sorted(names))
|
|
self.assertEqual(len(names), len(set(names)))
|
|
|
|
def test_every_name_is_declared_by_at_least_one_role(self) -> None:
|
|
declared = set()
|
|
for role_dir in sorted((PROJECT_ROOT / "roles").iterdir()):
|
|
if role_dir.is_dir():
|
|
declared.update(role_authors(role_dir))
|
|
|
|
self.assertEqual(
|
|
set(author_names()),
|
|
declared,
|
|
"the names come from galaxy_info.author, not from prose that could "
|
|
"drift from the role metadata",
|
|
)
|
|
|
|
def test_a_role_crediting_several_people_yields_each_of_them(self) -> None:
|
|
multi = [
|
|
names
|
|
for role_dir in sorted((PROJECT_ROOT / "roles").iterdir())
|
|
if role_dir.is_dir() and len(names := role_authors(role_dir)) > 1
|
|
]
|
|
|
|
self.assertTrue(multi, "no role credits more than one author any more")
|
|
for names in multi:
|
|
self.assertTrue(all(name and not name.startswith(" ") for name in names))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|