Skip to content

feat: inherit table templates from pinned GitHub YAML files - #299

Open
ArdaTkn wants to merge 1 commit into
SkyeAv:mainfrom
ArdaTkn:feat/github-template-inheritance
Open

ArdaTkn wants to merge 1 commit into
SkyeAv:mainfrom
ArdaTkn:feat/github-template-inheritance

Conversation

@ArdaTkn

@ArdaTkn ArdaTkn commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Closes #277.

Summary

  • Add parse_github_ref and fetch_github_template in src/tablassert/ingests.py supporting pinned github:<owner>/<repo>/<path>@<ref> template inheritance with local caching under .tablassert/templates/ and CSafeLoader parsing.
  • Update ingests.to_sections to resolve template.from (and optional select) and deep-merge it under the local template via fastmerge.
  • Add template-bad-github-ref to TablassertErrorCodes, unit tests in tests/test_github_templates.py, and an Unreleased changelog entry.

Local gate

  • scripts/check_changelog.py --base upstream/main: PASS
  • ruff check . / ruff format --check .: clean
  • pyright: 0 errors
  • vulture / deptry .: clean
  • pytest tests/test_github_templates.py tests/test_ingests.py: 15 passed

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d7e4ffff-d759-4a7a-9565-f92fd832d167
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ArdaTkn

ArdaTkn commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Hardened feat/github-template-inheritance in 3b78d30:

  • Path traversal / URL injection validation: parse_github_ref now validates owner/repo slugs (^[A-Za-z0-9_.-]+$, rejecting ./..), path segments (rejecting empty/./.. segments, ?, #, \\, whitespace), and git refs.
  • Error handling & cache integrity: fetch_github_template wraps URLError/OSError, UnicodeDecodeError, and yaml.YAMLError in coded TablassertError(..., code="template-bad-github-ref") and only writes to .tablassert/templates/ after CSafeLoader parses a valid YAML mapping (preventing cache poisoning).
  • Cleanup & tests: Removed unused _remote_template intermediate key and added tests for traversal/injection refs, HTTP failures, and invalid-YAML non-caching.

Local gates passing: check_changelog.py, ruff, pyright, vulture, deptry, and pytest (17 passed).

@ArdaTkn
ArdaTkn force-pushed the feat/github-template-inheritance branch from 4fa2c94 to 3b78d30 Compare November 19, 2026 23:15

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inherit templates from GitHub files and maintain a repository of common source shapes

1 participant