[Bug]: bash array syntax error, inconsistent error handling, and incorrect JSON examples
- Dominant language
- Shell
- Stars
- 25.7k
- Forks
- 2.6k
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 16
Description
### What happened?
Found three bugs during a code audit:
**1. `scripts/deploy_root_files.sh` line 16 — Bash array syntax error (HIGH)**
The `FILES_TO_DEPLOY` array has a stray comma: `("404.html" "robots.txt" "llms.txt", "llms-full.txt")`. Bash arrays are space-delimited, so the comma causes the element to be interpreted as `llms.txt,` (with trailing comma). The real `llms.txt` is never found and silently skipped during gh-pages deployment.
**2. `.mkdocs/macros.py` line 67 — Inconsistent exception handling (MEDIUM)**
`proto_to_table` only catches `FileNotFoundError`, while the sibling macros `proto_enum_to_table` (line 143) and `proto_service_to_table` (line 186) both catch `Exception`. A proto parse error would propagate uncaught and crash the entire MkDocs build.
**3. `docs/specification.md` — Invalid JSON and field mismatches in examples (MEDIUM)**
- §4.6.1 (line 1016): Trailing comma before `}` — invalid JSON
- §6.6 (line 1616): Field name `pushNotificationConfig` should be `taskPushNotificationConfig` per proto field `SendMessageConfiguration.task_push_notification_config`
- §6.6 (line 1620): `"schemes": ["Bearer"]` should be `"scheme": "Bearer"` per proto `AuthenticationInfo.scheme` (singular string, not array)
- §6.6 (line 1638): `"state": "submitted"` should be `"TASK_STATE_SUBMITTED"` per §5.5 SCREAMING_SNAKE_CASE requirement
- §6.7 (line 1686): Missing comma after `"raw"` value, and trailing comma after `"mediaType"` — invalid JSON
### Relevant log output
```shell
# Bug 1: deploy_root_files.sh - bash array element becomes "llms.txt," instead of "llms.txt"
$ bash -c 'FILES=("a" "b", "c"); for f in "${FILES[@]}"; do echo "$f"; done'
a
b,
c
# Bug 2: macros.py - proto_to_table only catches FileNotFoundError (line 67)
# proto_enum_to_table catches Exception (line 143)
# proto_service_to_table catches Exception (line 186)
$ grep -n "except.*as e:" .mkdocs/macros.py
67: except FileNotFoundError as e: # <-- inconsistent
143: except Exception as e:
186: except Exception as e:
# Bug 3: specification.md - invalid JSON examples
$ python3 -c "import json; json.loads('{ \"protocolVersion\": \"0.3\", }')" 2>&1
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 27
$ python3 -c "import json; json.loads('{ \"raw\": \"abc\" \"filename\": \"x.png\" }')" 2>&1
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 15
```
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Assessment
This issue has not been assessed yet.