Skip to content

[TRTLLM-12502][infra] Add GitHub Action to sync LFS objects from fork…#13826

Merged
niukuo merged 1 commit into
NVIDIA:mainfrom
niukuo:lfs_sync
May 9, 2026
Merged

[TRTLLM-12502][infra] Add GitHub Action to sync LFS objects from fork…#13826
niukuo merged 1 commit into
NVIDIA:mainfrom
niukuo:lfs_sync

Conversation

@niukuo
Copy link
Copy Markdown
Collaborator

@niukuo niukuo commented May 7, 2026

… after PR merge

Summary by CodeRabbit

  • Chores
    • Added an automated post-merge workflow to synchronize LFS-tracked files when pull requests from forks are merged into the repository.
    • After syncing, the workflow verifies that files are restored (not LFS pointers) and posts a PR comment summarizing up to five successfully synced files.
    • If verification fails, the workflow posts guidance with manual synchronization commands.

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@niukuo niukuo requested review from a team as code owners May 7, 2026 03:10
@niukuo niukuo requested review from EmmaQiaoCh and mlefeb01 May 7, 2026 03:10
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b918287a-20fe-4e58-a94e-2964f6b922e1

📥 Commits

Reviewing files that changed from the base of the PR and between b02bc19 and f5ecf6d.

📒 Files selected for processing (1)
  • .github/workflows/lfs-sync.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/lfs-sync.yml

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow is added that triggers when a pull request from a fork is merged. It detects LFS-tracked files changed in the PR, fetches their objects from the fork, pushes them to the upstream repository's LFS storage, verifies the sync succeeded, and posts a PR comment with the result.

Changes

LFS Sync Workflow

Layer / File(s) Summary
Trigger & Initialization
.github/workflows/lfs-sync.yml
New workflow triggers on pull_request closed events, gated to run only for merged PRs whose head repo is a fork; checks out the merge commit with lfs: false and installs git-lfs.
Detect LFS-tracked changed files
.github/workflows/lfs-sync.yml
Computes changed paths between base and merge SHAs, uses git check-attr filter to identify LFS-tracked files, writes the list to /tmp/lfs_files.txt, and sets a has_lfs output.
Cross-fork LFS fetch & push
.github/workflows/lfs-sync.yml
Temporarily adds the fork as a fork remote, runs git lfs fetch from the fork at the PR head SHA, removes the remote, then pushes all fetched LFS objects to the upstream repository with git lfs push --all origin.
Verification
.github/workflows/lfs-sync.yml
Clones the upstream repo into a temp dir with LFS enabled, runs git lfs pull, and checks each expected file exists and is not an LFS pointer; sets sync_ok.
Notification
.github/workflows/lfs-sync.yml
Posts a PR comment via actions/github-script: success message listing up to 5 synced files, or failure message including manual git remote add/fetch/push commands referencing the fork repo/branch/SHA.

Sequence Diagram

sequenceDiagram
participant GH as GitHub
participant Runner as Actions Runner
participant Fork as Fork Remote
participant Origin as Upstream Repo
participant LFS as Git LFS Storage

GH->>Runner: Trigger workflow (merged fork PR)
Runner->>Runner: Checkout merge commit (lfs:false) & install git-lfs
Runner->>Runner: Detect LFS-tracked changed files
Runner->>Fork: Add temporary remote & git lfs fetch (PR head SHA)
Fork->>Runner: Serve LFS objects
Runner->>Origin: git lfs push --all origin
Runner->>LFS: Upload objects to upstream storage
Runner->>Runner: Clone upstream, git lfs pull, verify files
alt verification success
Runner->>GH: Post success PR comment (files synced)
else verification failure
Runner->>GH: Post failure PR comment (manual commands)
end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete. It contains only the template structure with no actual content in the Description, Test Coverage, or implementation details sections. Fill in the Description section explaining the issue and solution, add Test Coverage details, and provide implementation context for the new workflow.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly relates to the main change: adding a GitHub Action workflow to sync LFS objects from forks after PR merge, which matches the workflow file added.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Microsoft Presidio Analyzer (2.2.362)
.github/workflows/lfs-sync.yml

Microsoft Presidio Analyzer failed to scan this file

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/lfs-sync.yml:
- Around line 173-193: The script currently injects fork-controlled values via
`${{ ... }}` into bash command strings; replace those interpolations by
extracting values from context.payload (e.g., const forkRepo =
context.payload.pull_request.head.repo.full_name and const forkRef/commit =
context.payload.pull_request.head.ref/sha) before calling
github.rest.issues.createComment, and when composing the manual sync commands
ensure these extracted variables are safely shell-escaped (or passed as
environment variables to a separate run step) instead of concatenating raw
values into the command strings (references: the script block building the issue
body, github.rest.issues.createComment call, and the git remote add/fetch
lines).
- Around line 85-170: The fetch/push steps exit the job on failure so the "sync
failed" comment never runs; add id: fetch_fork and id: push_lfs to the "Fetch
LFS objects from contributor fork" and "Push LFS objects to this repository"
steps and set continue-on-error: true on both so the workflow continues on
failure, then change the "Verify with a fresh clone" and the "Comment on PR —
sync failed" steps to run unconditionally using if: always(); in the failure
comment step use a conditional that checks the outcomes and verify output (e.g.
if any of steps.fetch_fork.outcome != 'success' || steps.push_lfs.outcome !=
'success' || steps.verify.outputs.sync_ok == 'false') to decide whether to post
the failure notification. Ensure references use the ids fetch_fork, push_lfs,
and verify to locate the steps.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 069003f5-51ff-40c7-93d4-eb6d975e0329

📥 Commits

Reviewing files that changed from the base of the PR and between 0d32e49 and 797f379.

📒 Files selected for processing (1)
  • .github/workflows/lfs-sync.yml

Comment thread .github/workflows/lfs-sync.yml Outdated
Comment thread .github/workflows/lfs-sync.yml Outdated
@niukuo
Copy link
Copy Markdown
Collaborator Author

niukuo commented May 7, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/lfs-sync.yml:
- Around line 173-174: The failure condition for the "Comment on PR — sync
failed" step doesn't account for the verify step crashing (its outcome
undefined), so update the if expression to also check that steps.verify.outcome
!= 'success' in addition to steps.verify.outputs.sync_ok == 'false' and the
existing fetch-lfs/push-lfs checks; this ensures the failure comment runs when
the verify step fails or crashes (refer to steps.verify,
steps.verify.outputs.sync_ok, steps.verify.outcome, steps.fetch-lfs,
steps.push-lfs, and steps.detect-lfs.outputs.has_lfs).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f48fc621-9ff5-43eb-8100-f96126790c00

📥 Commits

Reviewing files that changed from the base of the PR and between 797f379 and 38aa9d8.

📒 Files selected for processing (1)
  • .github/workflows/lfs-sync.yml

Comment thread .github/workflows/lfs-sync.yml Outdated
@niukuo
Copy link
Copy Markdown
Collaborator Author

niukuo commented May 7, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@niukuo
Copy link
Copy Markdown
Collaborator Author

niukuo commented May 7, 2026

/bot skip --comment "github action"

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #47123 [ skip ] triggered by Bot. Commit: b02bc19 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #47123 [ skip ] completed with state SUCCESS. Commit: b02bc19
Skipping testing for commit b02bc19

Link to invocation

@niukuo
Copy link
Copy Markdown
Collaborator Author

niukuo commented May 7, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@niukuo
Copy link
Copy Markdown
Collaborator Author

niukuo commented May 7, 2026

/bot skip --comment "test on niukuo#18 (comment)"

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #47220 [ skip ] triggered by Bot. Commit: db6ea0e Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #47220 [ skip ] completed with state SUCCESS. Commit: db6ea0e
Skipping testing for commit db6ea0e

Link to invocation

@niukuo
Copy link
Copy Markdown
Collaborator Author

niukuo commented May 8, 2026

/bot skip --comment "github action tested in niukuo#20 (comment)"

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #47272 [ skip ] triggered by Bot. Commit: 313edc9 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #47272 [ skip ] completed with state SUCCESS. Commit: 313edc9
Skipping testing for commit 313edc9

Link to invocation

… after PR merge

Signed-off-by: Yiteng Niu <6831097+niukuo@users.noreply.github.com>
@niukuo niukuo requested a review from ZhanruiSunCh May 8, 2026 07:17
@niukuo niukuo merged commit ded5e98 into NVIDIA:main May 9, 2026
5 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

LFS objects already in storage (2864 files) — no sync needed.

These LFS-tracked files are already present in this repository's LFS storage:

  • cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/cubin/FmhaSm100aKernel_QE4m3KvE2m1OE4m3H128PagedKvCausalP32VarSeqQ128Kv128PersistentContext.cubin.tar.zst
  • cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/cubin/FmhaSm100aKernel_QE4m3KvE2m1OE4m3H128PagedKvCausalP32VarSeqQ128Kv128StaticContext.cubin.tar.zst
  • cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/cubin/FmhaSm100aKernel_QE4m3KvE2m1OE4m3H128PagedKvDenseP32MultiCtasKvCgaVarSeqQ16Kv128StaticSwapsAbForGen.cubin.tar.zst
  • cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/cubin/FmhaSm100aKernel_QE4m3KvE2m1OE4m3H128PagedKvDenseP32MultiCtasKvCgaVarSeqQ8Kv128StaticSwapsAbForGen.cubin.tar.zst
  • cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/cubin/FmhaSm100aKernel_QE4m3KvE2m1OE4m3H128PagedKvDenseP32MultiCtasKvVarSeqQ16Kv128StaticSwapsAbForGen.cubin.tar.zst
  • ...and 2859 more

yufeiwu-nv pushed a commit to yufeiwu-nv/TensorRT-LLM that referenced this pull request May 19, 2026
NVIDIA#13826)

Signed-off-by: Yiteng Niu <6831097+niukuo@users.noreply.github.com>
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.

2 participants