Background
Currently, network README.md files are generated from individual .gtpl template files (e.g., chains/dendrite-2/README.md.gtpl). During code review, we identified that these templates have potential robustness issues when accessing nested fields without proper guards, which can cause template rendering errors.
Proposed Changes
1. Refactor to Single Template
- Consolidate the generation of network README.md files to rely on a single, reusable template
- Reduce code duplication across multiple chain-specific template files
- Improve maintainability by having a central template to update
2. Improve Template Robustness
- Add proper guards when accessing nested fields like
userInfo.keybase.picture_url and userInfo.keybase.username
- Implement safe fallbacks when fields are missing (e.g., omit images/links or render placeholders)
- Ensure templates don't error when datasource fields are absent or have unexpected structure
3. Specific Areas to Address
- Genesis validators table generation with keybase identity handling
- Website URL processing and validation
- Safe extraction of gentx messages from genesis data
Context
This issue originated from PR #875 during the review of chains/dendrite-2/README.md.gtpl where template robustness concerns were identified.
References:
Acceptance Criteria
Background
Currently, network README.md files are generated from individual .gtpl template files (e.g., chains/dendrite-2/README.md.gtpl). During code review, we identified that these templates have potential robustness issues when accessing nested fields without proper guards, which can cause template rendering errors.
Proposed Changes
1. Refactor to Single Template
2. Improve Template Robustness
userInfo.keybase.picture_urlanduserInfo.keybase.username3. Specific Areas to Address
Context
This issue originated from PR #875 during the review of chains/dendrite-2/README.md.gtpl where template robustness concerns were identified.
References:
Acceptance Criteria