Docs build succeeds when a proto table macro cannot resolve, so the error ships to the site
- Lingua principale
- Shell
- Stelle
- 25.7k
- Fork
- 2.6k
- Merge medio
- 3g 6h
- PR unite (30g)
- 16
Descrizione
The three proto table macros return their failures as page content rather than raising, so an unresolved type reference renders into the published spec and the build still exits 0. Two are on the site right now:
- §4.3.1 — `Error: Message PushNotificationConfig not found.`
- §10.4.7 — `Error: Message CreateTaskPushNotificationConfigRequest not found.`
https://a2a-protocol.org/latest/specification/
The proto defines `TaskPushNotificationConfig`; there is no `PushNotificationConfig` message. `CreateTaskPushNotificationConfigRequest` is only an RPC method name, never a defined type.
#1676 reported the first in March and #1981 fixes both, but neither surfaced on its own, because a broken reference is not a build failure.
To find them from a clean checkout:
```python
import re
spec = open('docs/specification.md').read()
proto = open('specification/a2a.proto').read()
refs = set(re.findall(r'proto_(?:enum_)?to_table\(\s*"([^"]+)"', spec))
types = set(re.findall(r'^\s*(?:message|enum)\s+(\w+)\s*\{', proto, re.M))
print(sorted(refs - types))
```
Two of the three macros also wrap the whole body in `except Exception`, so any error, not only a missing type, becomes page text.
I have a branch that raises instead, and sets `on_error_fail` on the macros plugin. Without that flag mkdocs-macros catches the exception, renders it into the page and still exits 0, so raising alone does not close this. With it, the build fails naming the file and the type.
Verified locally against `16ba526`:
| | build | §4.3.1 |
|---|---|---|
| main today | exits 0 | error string rendered |
| raise only | exits 0 | exception rendered into the page |
| raise + `on_error_fail` | exits 100, names file and type | build refuses to ship |
| guard + #1981's two lines | exits 0 | real `TaskPushNotificationConfig` table |
Happy to open it once #1981 lands, or now if you would rather review them together. Kept it off `docs/specification.md` so it stays a `ci:` change rather than a `docs(spec):` one.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
The issue is in the mkdocs-macros plugin used for building the docs. Look at the macros in docs/specification.md that call proto_to_table and proto_enum_to_table. The fix involves modifying these macros to raise errors and setting the on_error_fail flag in mkdocs.yml. Start by running the provided Python script to find unresolved references, then examine the macro definitions and the mkdocs configuration. Test the build locally to ensure it fails when references are broken.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, shell
- Ambito
- build-system, documentation
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Attiva
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 65/100