Skip to content

feat(json): add github backend to parse PR/Issues from json into DoclingDocument/DocLang - #5328

Open
PeterStaar-IBM wants to merge 8 commits into
mainfrom
feat/gh-backend
Open

PeterStaar-IBM wants to merge 8 commits into
mainfrom
feat/gh-backend

Conversation

@PeterStaar-IBM

@PeterStaar-IBM PeterStaar-IBM commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Add native conversion of GitHub issues, pull requests, and discussions into a DoclingDocument. The backend accepts saved GitHub JSON, and the CLI can retrieve a conversation directly through the authenticated GitHub CLI (gh).

  • Paginate comments, reviews, inline review threads, and nested replies. Preserve their parent relationships, permalinks, and available review context. Mark accepted discussion answers.
  • Convert Markdown into structured content with code blocks, links, labels, and pictures. DCLX exports preserve named conversation groups and package loaded images.

Try it with the CLI

Use a Docling build from this branch. For URL input, install gh and run gh auth login first.

docling convert https://github.com/docling-project/docling/pull/5328 \
  --from json_github --to dclx --output ./output

The same command accepts GitHub issue and discussion URLs. To convert a saved export, pass its path. Local JSON works without gh, and --keep-source embeds the original JSON in the archive.

docling convert ./pr.json \
  --from json_github --to dclx --keep-source --output ./output

Image fetching is opt-in. Use --github-image-fetch remote for online images and --github-image-fetch local for files referenced by a local export. Add --github-strict-assets to fail on missing images. For large conversations, --github-timeout 180 raises the default 60-second retrieval limit.

See the GitHub conversion guide for JSON export commands and SDK usage.

Checklist

  • Documentation updated.
  • Runnable example added.
  • Backend, CLI, and DCLX tests added.

Review evidence

  • 39 targeted GitHub and DCLX tests passed, covering retrieval, document structure, CLI conversion, and export round trips.
  • A CLI smoke test confirmed that one DCLX archive retained both the named reply groups and the original GitHub JSON.
  • make validate passed on the staged merge. uv lock --locked --offline confirmed the lockfile is current.

Signed-off-by: Peter Staar <taa@zurich.ibm.com>
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @PeterStaar-IBM, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@github-actions github-actions Bot added ai:ci-needs-care AI triage: check CI-safety findings before you approve CI CLI issues related to the command line interface (CLI) enhancement New feature or request html issue related to html backend markdown issue related to markdown backend labels Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

AI triage (advisory)

Checked commit eead5f96b4. The analysis read the diff only. It did not run code from this pull request.

The PR adds a json_github input format. It converts GitHub issue, pull request, and discussion JSON into a DoclingDocument. It also adds gh retrieval from a URL, GitHub CLI options, an opt-in preserve_code_whitespace option for the Markdown and HTML backends, docs, and tests.

CI safety: needs maintainer care before you approve CI.

  • .github/workflows/checks.yml: changes CI workflows, actions, or CI scripts
  • tach.toml: changes CI test selection
  • docling/utils/github.py: fetch_github_conversation runs gh api graphql with subprocess.run. This uses the ambient gh authentication and the network, so a test that does not mock subprocess.run could use CI credentials.
  • .plans/active/github-json-backend.md: The file contains workflow text for an AI agent, such as "Each stage requires a proposed patch and approval before file changes." It is not documentation for users.
2 related pull request(s) in the same code
PR State Signal Assessment
#5536 open changes the same code related: Both PRs add a new InputFormat and register it in the same files. The formats are different (MediaWiki and GitHub JSON), so both can be merged. Expect merge conflicts.
#5529 open changes the same code related: Both PRs add a new JSON-based InputFormat and change the JSON format detection in document.py. The formats are different (OXR and GitHub JSON). The detection changes can conflict.

The ai:* labels are advisory. They do not approve CI and they do not add tests:full. A new push runs this check again.

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

@github-actions github-actions Bot added ai:ci-needs-care AI triage: check CI-safety findings before you approve CI and removed ai:ci-needs-care AI triage: check CI-safety findings before you approve CI labels Nov 16, 2026
@github-actions github-actions Bot mentioned this pull request Nov 17, 2026
3 tasks done
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
@github-actions github-actions Bot added ai:ci-needs-care AI triage: check CI-safety findings before you approve CI and removed ai:ci-needs-care AI triage: check CI-safety findings before you approve CI labels Nov 23, 2026
@PeterStaar-IBM PeterStaar-IBM changed the title Feat/gh backend feat(json): add github backend to parse PR/Issues from json into DoclingDocument/DocLang Nov 23, 2026
@github-actions github-actions Bot added ai:ci-needs-care AI triage: check CI-safety findings before you approve CI and removed ai:ci-needs-care AI triage: check CI-safety findings before you approve CI labels Nov 23, 2026
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
@github-actions github-actions Bot added ai:ci-needs-care AI triage: check CI-safety findings before you approve CI and removed ai:ci-needs-care AI triage: check CI-safety findings before you approve CI labels Nov 24, 2026

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

ai:ci-needs-care AI triage: check CI-safety findings before you approve CI CLI issues related to the command line interface (CLI) enhancement New feature or request html issue related to html backend markdown issue related to markdown backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant