- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.8k
[None][doc] Replace the main in the examples' link with commit id. #7837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[None][doc] Replace the main in the examples' link with commit id. #7837
Conversation
| 📝 WalkthroughWalkthroughAdds pygit2 usage to docs tooling to read the repository HEAD commit and pin example script URLs to that commit for llm-api and serve references. No public interfaces changed; also removes an extraneous blank line. Changes
 Sequence Diagram(s)sequenceDiagram
    autonumber
    participant Helper as docs/source/helper.py
    participant pygit2 as pygit2
    participant LocalRepo as Local Git repo
    participant GitHub as GitHub URL builder
    Helper->>pygit2: open repository
    pygit2->>LocalRepo: read HEAD
    LocalRepo-->>pygit2: return commit hash
    pygit2-->>Helper: provide commit hash
    Helper->>GitHub: build blob/{commit_hash}/examples/llm-api URL
    Helper->>GitHub: build blob/{commit_hash}/examples/serve URL
    Note over Helper,GitHub: Documentation links pinned to exact commit
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
 ✅ Passed checks (1 passed)
 ✨ Finishing touches
 🧪 Generate unit tests
 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
 🚧 Files skipped from review as they are similar to previous changes (1)
 ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
 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. Comment  | 
| /bot run | 
| PR_Github #19182 [ run ] triggered by Bot | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️  Outside diff range comments (2)
docs/source/helper.py (2)
72-74: Type annotations use PEP 585 generics; this breaks on Python 3.8.Target is Python 3.8+. Either enable postponed annotations or use typing.List/typing.Dict, etc.
Minimal fix (add near top of file, after the license header):
+from __future__ import annotationsOr replace occurrences like:
def collect_script_paths(...) -> list[Path]:→-> List[Path]
def write_scripts(...) -> list[DocMeta]:→-> List[DocMeta]
def get_pydantic_methods() -> list[str]:→-> List[str]And:
-from typing import Optional +from typing import Optional, List
157-159: Bug: mixing str with Path using the / operator.This raises TypeError. Wrap the string in Path.
Apply this diff:
- include_path = '../../..' / script_path.relative_to(root_dir) + include_path = Path('../../..') / script_path.relative_to(root_dir)
🧹 Nitpick comments (1)
docs/source/helper.py (1)
1-1: Missing NVIDIA Apache‑2.0 header (2025).Please prepend the standard NVIDIA Apache‑2.0 header per repo policy.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
- docs/source/helper.py(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Use only spaces, no tabs; indent with 4 spaces.
Files:
- docs/source/helper.py
**/*.py
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.py: Python code must target Python 3.8+.
Indent Python code with 4 spaces; do not use tabs.
Maintain module namespace when importing; prefer 'from package.subpackage import foo' then 'foo.SomeClass()' instead of importing the class directly.
Python filenames should be snake_case (e.g., some_file.py).
Python classes use PascalCase names.
Functions and methods use snake_case names.
Local variables use snake_case; prefix 'k' for variables that start with a number (e.g., k_99th_percentile).
Global variables use upper SNAKE_CASE prefixed with 'G' (e.g., G_MY_GLOBAL).
Constants use upper SNAKE_CASE (e.g., MY_CONSTANT).
Avoid shadowing variables from an outer scope.
Initialize all externally visible members of a class in the constructor.
Prefer docstrings for interfaces that may be used outside a file; comments for in-function or file-local interfaces.
Use Google-style docstrings for classes and functions (Sphinx-parsable).
Document attributes and variables inline so they render under the class/function docstring.
Avoid reflection when a simpler, explicit approach suffices (e.g., avoid dict(**locals()) patterns).
In try/except, catch the most specific exceptions possible.
For duck-typing try/except, keep the try body minimal and use else for the main logic.
Files:
- docs/source/helper.py
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).
Files:
- docs/source/helper.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Pre-commit Check
Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com>
91ac31a    to
    eb162fb      
    Compare
  
    | PR_Github #19182 [ run ] completed with state  | 
| /bot skip --comment "doc build already pass" | 
| PR_Github #19207 [ skip ] triggered by Bot | 
| PR_Github #19207 [ skip ] completed with state  | 
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com>
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
…7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com>
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
…VIDIA#7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
…7837) Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com> Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Replace
https://github.com/NVIDIA/TensorRT-LLM/blob/main/examples/llm-api/llm_inference_distributed.pywith
https://github.com/NVIDIA/TensorRT-LLM/blob/2f3e3ae465fe03203f4e87c7cfa153d22cb54e43/examples/llm-api/llm_inference_distributed.pySummary by CodeRabbit
Documentation
Chores