Skip to content

Git Markdown source — type: git + GitSourceStrategy#32

Merged
hendrikebbers merged 3 commits into
mainfrom
feat/016-git-markdown-source
Jul 13, 2026
Merged

Git Markdown source — type: git + GitSourceStrategy#32
hendrikebbers merged 3 commits into
mainfrom
feat/016-git-markdown-source

Conversation

@herbie-bot

Copy link
Copy Markdown
Collaborator

Summary

Adds a type: git source with GitSourceStrategy that indexes Markdown directly from GitHub repos (public/private via token), plugging into the ContentSourceStrategy seam (spec 007) — the first new SourceType, with everything downstream unchanged. Higher fidelity than HTML scraping for repos we own.

Spec

  • docs/specs/016-git-markdown-source/{design,behaviors,steps}.md

Changes

  • GitConfig record + optional ContentSource.git field (the extension spec 002 deferred)
  • GitSourceStrategy (SourceType.GIT): Trees-API discovery filtered by paths globs (SHA = change marker; hard failure throws → source isolated, not mass-deleted), raw-content fetch with a server-side bearer token (never logged), YAML frontmatter + Markdown extraction with Hugo-shortcode cleaning, path → canonical-URL mapping, locale from filename suffix
  • application.yaml: example oe-website-markdown git source (disabled; token via GITHUB_TOKEN_OE_WEBSITE, empty default)

Test coverage

  • GitSourceStrategyTest via MockRestServiceServer (discovery/filter/SHA, bearer token, discovery-failure isolation, frontmatter/shortcode/URL/locale extraction, fetch-failure skip) + pure mapToUrl/localeFromPath/parseMarkdown; ConfiguredSourcesTest git binding. 155 tests total; both reviews clean.

Closes #31
🤖 Generated with Claude Code

- GitConfig record + optional ContentSource.git field (the extension spec 002
  deferred; existing call sites pass null).
- GitSourceStrategy (@component, SourceType.GIT, auto-routed by the registry):
  GitHub Trees API discovery filtered by paths globs (blob SHA = change marker;
  hard failure throws so the source is isolated, not mass-deleted); raw-content
  fetch with a server-side bearer token (never logged); YAML frontmatter +
  Markdown body extraction with Hugo-shortcode cleaning; path -> canonical URL
  mapping; locale from filename suffix. Produces the same ContentDocument.
- application.yaml: example oe-website-markdown git source (disabled; token via
  GITHUB_TOKEN_OE_WEBSITE, empty default).
- Tests: GitSourceStrategyTest (MockRestServiceServer + pure helpers) +
  ConfiguredSourcesTest git binding. 155 tests green.
- steps.md; refresh CLAUDE.md.

Refs #31
@hendrikebbers hendrikebbers merged commit 38dbf15 into main Jul 13, 2026
1 check passed
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.

Git Markdown source — type: git + GitSourceStrategy

2 participants