Files
roadmap/tools/roadmap_validator/constants.py
fbarbu15 845d6b8dcd Chore/roadmap validator (#318)
## Summary

- Introduce a standalone Python roadmap validator with a CLI entry
point, modular validation pipeline, and GitHub Actions wiring so roadmap
content can be linted locally and in CI.
- Provide reusable validation primitives for path resolution,
front-matter parsing, identity checks, task parsing, catalog
enforcement, and template adherence.
- Document usage, configuration, and workflow behaviour to make the
validator approachable for contributors.

## Validator Details

- **Core tooling**
- Added the `tools/roadmap_validator/` package with `validate.py` (CLI),
`validator.py` (orchestration), and helper modules (`tasks.py`,
`identity.py`, `paths.py`, `constants.py`, `issues.py`).
- CLI supports directory/file targets, skips default filenames, emits
GitHub annotations, and integrates optional substring filtering
- README explains features, environment variables, and development
guidance.
- **Catalog and template enforcement**
- `catalog.py` verifies each allowed content unit has `index.md` and
`preview.md`, confirms roadmap entries appear under the proper
quarter/area, and flags stale or missing links.
- `templates.py` enforces template basics: front matter completeness,
`## Description` ordering/content, template placeholder cleanup, and
task section detection.
- **Task validation**
- `tasks.py` checks required metadata (`owner`, `status`, `start-date`,
`end-date`), date formats, populated descriptions/deliverables, TODO
markers, tangible deliverable heuristics, and `fully-qualified-name`
prefixes.
- **Workflow integration**
- `.github/workflows/roadmap-validator.yml` runs the validator on pushes
and manual dispatch, installs dependencies, scopes validation to changed
Markdown, and surfaces findings via GitHub annotations.

## Existing Roadmap Updates

- Normalised 2025q4 commitments across Web, DST, QA, SC, and other units
by filling in missing descriptions, deliverables, schedule notes,
recurring task statuses, and maintenance tasks.
- Added tasks where absent, removed remaining template placeholders,
aligned fully qualified names, and ensured roadmap files conform to the
new validator checks.

## Testing

```bash
python tools/roadmap_validator/validate.py *2025q4*
```

CI: `Roadmap Validator` workflow runs automatically on pushes/dispatch.

---------

Co-authored-by: kaiserd <1684595+kaiserd@users.noreply.github.com>
2025-10-28 15:41:11 +02:00

71 lines
1.5 KiB
Python

"""Shared constants and regular expressions for roadmap validation."""
import re
REQUIRED_FRONT_MATTER_KEYS = ("title", "tags", "description")
REQUIRED_TASK_FIELDS = ("owner", "status", "start-date", "end-date")
METADATA_ALIAS_MAP = {
"fully-qualified-name": "fully-qualified-name",
"fully qualified name": "fully-qualified-name",
"owner": "owner",
"status": "status",
"start-date": "start-date",
"start date": "start-date",
"end-date": "end-date",
"end date": "end-date",
}
DATE_PATTERN = r"^\d{4}/\d{1,2}/\d{1,2}$"
DATE_RE = re.compile(DATE_PATTERN)
TODO_PATTERN = r"\bTODO\b"
TODO_RE = re.compile(TODO_PATTERN, re.IGNORECASE)
TASK_HEADING_PATTERN = r"^###\s+(.*)"
TASK_HEADING_RE = re.compile(TASK_HEADING_PATTERN)
META_LINE_PATTERN = r"^[\-\*]\s*([^:]+):\s*(.*)$"
META_LINE_RE = re.compile(META_LINE_PATTERN)
VAGUE_KEYWORDS = (
"investigate",
"research",
"explore",
"analysis",
"assess",
"assessment",
"evaluate",
"evaluation",
"review",
"understand",
"ideate",
"brainstorm",
)
TANGIBLE_KEYWORDS = (
"pr",
"issue",
"issues",
"pull request",
"merge request",
"test",
"tests",
"notion",
"doc",
"docs",
"documentation",
"report",
"reports",
"dashboard",
"script",
"plan",
"plans",
"page",
"pages",
"spec",
"specs",
"analysis doc",
"deliverable",
"deliverables",
)
SKIP_FILENAMES = {"index.md", "preview.md"}