Skip to content

Conversation

kevalmorabia97
Copy link
Collaborator

@kevalmorabia97 kevalmorabia97 commented Sep 5, 2025

What does this PR do?

Type of change: CI fixes

Overview:

  • Add dummy last job to unit and gpu test workflow so we can mark it as required check in github settings
  • Fix gpu test file-changes check: Previously if PR is not updated to include latest main branch commit, this will silently fail and skip gpu test. Correct approach is to use git merge-base between main branch and PR branch to identify common ancenstor commit and then use diff between that commit and last PR commit to find changed files

Testing

Verified CI run

Summary by CodeRabbit

  • Tests

    • Added a PR-scoped required GPU check that fails when GPU tests don't succeed for relevant changes.
    • Added a PR-scoped unit-test completion check that signals when all unit-test jobs finish.
    • Improved change-detection to use a computed merge-base and fail on initial diff errors.
  • Chores

    • Made CI more resilient by fetching full history for comparisons and tightening PR gating while allowing controlled continuation on initial diff errors.

@kevalmorabia97 kevalmorabia97 requested a review from a team as a code owner September 5, 2025 17:11
Copy link

coderabbitai bot commented Sep 5, 2025

Warning

Rate limit exceeded

@kevalmorabia97 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 18 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 13106c1 and 2c052c5.

📒 Files selected for processing (1)
  • .github/workflows/gpu_tests.yml (2 hunks)

Walkthrough

Compute PR merge-base for diff checks, set checkout fetch-depth to 0, make changed-tests tolerate failures and use the computed base, enable fail_on_initial_diff_error for changed-files, add a PR-scoped GPU-required guard that fails when test-relevant changes exist and GPU PR tests didn't succeed, and add a PR-scoped unit aggregator job that echoes completion.

Changes

Cohort / File(s) Summary
GPU workflow: merge-base, checkout, diff inputs, and PR guard
.github/workflows/gpu_tests.yml
- Added step "Calculate merge base" to compute git merge-base from PR head/base SHAs and expose merge-base output.
- Checkout now uses fetch-depth: 0.
- changed-tests: added continue-on-error: true; base_sha input now uses steps.calculate-merge-base.outputs.merge-base instead of base.ref.
- changed-files with block now includes fail_on_initial_diff_error: true.
- Added new job gpu-pr-required-check (if: startsWith(github.ref, 'refs/heads/pull-request/') && always(), needs: [check-file-changes, gpu-tests-pr], runs-on: ubuntu-latest) with a step that exits 1 when needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success'. Includes inline comment "Run even if gpu-tests-pr is skipped".
Unit tests PR aggregator
.github/workflows/unit_tests.yml
- Added unit-pr-required-check job (if: github.event_name == 'pull_request', needs: [linux, windows, multi-py, multi-torch, multi-transformers, partial-install], runs-on: ubuntu-latest) with a single step that runs echo "All PR unit test jobs completed".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant PR as PR Event
  participant CM as calculate-merge-base
  participant CO as checkout (fetch-depth:0)
  participant CF as check-file-changes
  participant CT as changed-tests
  participant CFS as changed-files
  participant GPU as gpu-tests-pr
  participant GUARD as gpu-pr-required-check

  PR->>CO: checkout PR (fetch-depth: 0)
  PR->>CM: compute merge-base (head.sha, base.sha)
  CM-->>CF: provide merge-base
  CF->>CT: run changed-tests (continue-on-error: true, base_sha=merge-base)
  CF->>CFS: run changed-files (fail_on_initial_diff_error: true)
  PR->>GPU: run gpu-tests-pr
  CF-->>GUARD: outputs.any_changed
  GPU-->>GUARD: result status
  alt any_changed == 'true' AND gpu-tests-pr != success
    GUARD->>GUARD: exit 1 (fail workflow)
  else
    GUARD->>PR: allow/continue
  end
Loading
sequenceDiagram
  autonumber
  participant PR as PR Event
  participant L as linux
  participant W as windows
  participant MP as multi-py
  participant MT as multi-torch
  participant MTr as multi-transformers
  participant PI as partial-install
  participant AGG as unit-pr-required-check

  PR->>L: run
  PR->>W: run
  PR->>MP: run
  PR->>MT: run
  PR->>MTr: run
  PR->>PI: run
  par All unit jobs complete
    L-->>AGG: done
    W-->>AGG: done
    MP-->>AGG: done
    MT-->>AGG: done
    MTr-->>AGG: done
    PI-->>AGG: done
  end
  AGG->>PR: echo "All PR unit test jobs completed"
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through YAML, brisk and smart,
I fetch the base and play my part,
I let one test fail without a shout,
I guard the PR when GPUs pout,
I clap and echo — all done, hop! 🥕

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kmorabia/add-ci-requirement-aggregator

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kevalmorabia97 kevalmorabia97 changed the title Add last aggregator job in unit and gpu test to use as required check… Add last aggregator job in unit/gpu CI test to use as required check for PRs Sep 5, 2025
@kevalmorabia97 kevalmorabia97 force-pushed the kmorabia/add-ci-requirement-aggregator branch from a888a83 to fc6b2b2 Compare September 5, 2025 17:16
Copy link

@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: 0

🧹 Nitpick comments (3)
setup.py (1)

16-16: Nit: capitalize brand and clarify docstring.

Suggest aligning with project naming style elsewhere in the file (uses "NVIDIA").

-"""The package setup script for nvidia-modelopt."""
+"""Package setup script for NVIDIA Model Optimizer (nvidia-modelopt)."""
.github/workflows/unit_tests.yml (1)

129-134: Make the PR “required check” job explicit and resilient (run always, fail on unmet deps).

Today, if a needed job fails, this job is skipped (which still blocks merges but looks ambiguous). Mirror the GPU pattern: always run on PRs and explicitly fail when any dependency isn’t success. Also keeps the check green when everything passes.

-  unit-pr-required-check:
-    if: github.event_name == 'pull_request'
+  unit-pr-required-check:
+    if: ${{ github.event_name == 'pull_request' && always() }}
     needs: [linux, windows, multi-py, multi-torch, multi-transformers, partial-install]
     runs-on: ubuntu-latest
     steps:
-      - run: echo "All PR unit test jobs completed"
+      - run: echo "All PR unit test jobs completed"
+      - name: Fail if any required unit-test job did not succeed
+        if: ${{ needs.linux.result != 'success'
+               || needs.windows.result != 'success'
+               || needs['multi-py'].result != 'success'
+               || needs['multi-torch'].result != 'success'
+               || needs['multi-transformers'].result != 'success'
+               || needs['partial-install'].result != 'success' }}
+        run: exit 1
.github/workflows/gpu_tests.yml (1)

73-81: Good pattern for a PR-gating “required check”.

Runs regardless of upstream outcome and fails only when GPU tests were required but not successful. Looks correct.

Optionally add a final informational step so the job shows a positive message when passing:

   steps:
     - name: Required GPU tests did not succeed
       if: ${{ needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success' }}
       run: exit 1
+    - name: GPU required check passed
+      if: ${{ needs.check-file-changes.outputs.any_changed != 'true' || needs.gpu-tests-pr.result == 'success' }}
+      run: echo "GPU required check conditions satisfied"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8a07376 and fc6b2b2.

📒 Files selected for processing (3)
  • .github/workflows/gpu_tests.yml (1 hunks)
  • .github/workflows/unit_tests.yml (1 hunks)
  • setup.py (1 hunks)
⏰ 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). (3)
  • GitHub Check: linux
  • GitHub Check: build-docs
  • GitHub Check: code-quality

@kevalmorabia97 kevalmorabia97 force-pushed the kmorabia/add-ci-requirement-aggregator branch from fc6b2b2 to b94ad1b Compare September 5, 2025 17:24
Copy link

@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: 0

🧹 Nitpick comments (1)
.github/workflows/gpu_tests.yml (1)

74-82: Guard job pattern LGTM; minor hardening suggestions.

The aggregator logic properly fails when relevant changes exist and GPU tests didn’t succeed. Consider:

  • Add least-privilege permissions.
  • Add a small timeout to avoid rare hangs.
  • Optional: add a success echo step for clearer logs.

Example:

   gpu-pr-required-check:
     # Run even if gpu-tests-pr is skipped
     if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
     needs: [check-file-changes, gpu-tests-pr]
     runs-on: ubuntu-latest
+    permissions: {}
+    timeout-minutes: 5
     steps:
+      - name: All good (no relevant changes or GPU tests succeeded)
+        if: ${{ needs.check-file-changes.outputs.any_changed != 'true' || needs.gpu-tests-pr.result == 'success' }}
+        run: echo "GPU checks passed or not applicable"
       - name: Required GPU tests did not succeed
         if: ${{ needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success' }}
         run: exit 1
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fc6b2b2 and b94ad1b.

📒 Files selected for processing (2)
  • .github/workflows/gpu_tests.yml (2 hunks)
  • .github/workflows/unit_tests.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/unit_tests.yml
⏰ 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). (3)
  • GitHub Check: linux
  • GitHub Check: code-quality
  • GitHub Check: build-docs
🔇 Additional comments (1)
.github/workflows/gpu_tests.yml (1)

39-39: Ignore invalid suggestion: base_sha accepts branch names and there is no base_ref input in step-security/changed-files.

Likely an incorrect or invalid review comment.

Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.95%. Comparing base (8a07376) to head (2c052c5).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #292   +/-   ##
=======================================
  Coverage   73.95%   73.95%           
=======================================
  Files         172      172           
  Lines       17405    17405           
=======================================
  Hits        12871    12871           
  Misses       4534     4534           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kevalmorabia97 kevalmorabia97 force-pushed the kmorabia/add-ci-requirement-aggregator branch from b94ad1b to 458c054 Compare September 5, 2025 18:18
Copy link

@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: 0

🧹 Nitpick comments (3)
.github/workflows/gpu_tests.yml (3)

30-30: OK to tolerate action failure; minor hardening.

continue-on-error here works with your fallback. Consider pinning step-security/changed-files to a commit SHA for supply-chain safety.


85-93: Aggregator gate looks good; add least-privilege + timeout.

Reduce blast radius and avoid hangs by tightening permissions and adding a small timeout.

   gpu-pr-required-check:
     # Run even if gpu-tests-pr is skipped
     if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
     needs: [check-file-changes, gpu-tests-pr]
     runs-on: ubuntu-latest
+    permissions: {}
+    timeout-minutes: 5
     steps:
       - name: Required GPU tests did not succeed
         if: ${{ needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success' }}
         run: exit 1

6-6: Branch pattern likely too strict.

GitHub’s glob doesn’t treat + as “one or more”. If you want pull-request/1234, prefer either of:

  • pull-request/** (broad)
  • pull-request/[0-9][0-9]* (digits)
-    branches: ["pull-request/[0-9]+"]
+    branches: ["pull-request/[0-9][0-9]*"]
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b94ad1b and 458c054.

📒 Files selected for processing (2)
  • .github/workflows/gpu_tests.yml (3 hunks)
  • .github/workflows/unit_tests.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/unit_tests.yml
⏰ 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). (4)
  • GitHub Check: linux
  • GitHub Check: wait-checks / wait
  • GitHub Check: code-quality
  • GitHub Check: build-docs
🔇 Additional comments (4)
.github/workflows/gpu_tests.yml (4)

22-22: Output plumbing LGTM.

Switching to steps.compute-any-changed.outputs.any_changed is correct and resilient.


40-41: Conservative fallback confirmation.

Setting fail_on_initial_diff_error: true ensures the step fails on force-push diffs and your fallback triggers. If you intended to avoid running GPU tests on ambiguous diffs, flip this to false.


42-50: Fallback computation is robust.

always() + outcome check + GITHUB_OUTPUT is correct. No changes needed.


39-39: No changes required: base_sha accepts branch refs
The step-security/[email protected] action’s base_sha input accepts either a commit SHA or a branch ref (e.g., “main”), so using fromJSON(...).base.ref is valid. [1][2]

Likely an incorrect or invalid review comment.

@kevalmorabia97 kevalmorabia97 force-pushed the kmorabia/add-ci-requirement-aggregator branch from 458c054 to 29705eb Compare September 5, 2025 18:35
Copy link

@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: 0

🧹 Nitpick comments (4)
.github/workflows/gpu_tests.yml (4)

30-30: Tolerating changed-files errors is fine given the fallback

continue-on-error: true is appropriate here since you compute a safe fallback right after. Consider adding a brief log line when it fails to aid triage, but not required.


40-41: Use PR base SHA, not ref name, to reduce diff flakiness

base_sha should be the base commit SHA, not the branch ref. Using the ref can cause intermittent “initial diff” errors and needlessly force tests to run.

Apply this change (outside the changed-line range) to prefer the exact base commit:

with:
  files: |
    # …unchanged…
  base_sha: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.sha }}
  # Optional: keep the comment and fail_on_initial_diff_error as-is

42-50: Minor hardening of the fallback step

Explicit shell + strict mode improves robustness; otherwise logic is solid.

-      - name: Compute any_changed (fallback to true on failure)
+      - name: Compute any_changed (fallback to true on failure)
         id: compute-any-changed
         if: ${{ always() }}
-        run: |
-          if [ "${{ steps.changed-tests.outcome }}" != "success" ]; then
-            echo "any_changed=true" >> "$GITHUB_OUTPUT"
-          else
-            echo "any_changed=${{ steps.changed-tests.outputs.any_changed }}" >> "$GITHUB_OUTPUT"
-          fi
+        shell: bash
+        run: |
+          set -euo pipefail
+          if [ "${{ steps.changed-tests.outcome }}" != "success" ]; then
+            echo "any_changed=true" >> "$GITHUB_OUTPUT"
+          else
+            val="${{ steps.changed-tests.outputs.any_changed }}"
+            echo "any_changed=${val:-true}" >> "$GITHUB_OUTPUT"
+          fi

85-93: Aggregator job is correct; add least-privilege and align if style

Job correctly fails when tests are required but didn’t succeed. Two small tweaks:

  • Set permissions: {} to avoid granting an unnecessary token.
  • Optional: match earlier jobs’ if: style (no ${{ }} wrapper).
   gpu-pr-required-check:
     # Run even if gpu-tests-pr is skipped
-    if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
+    if: startsWith(github.ref, 'refs/heads/pull-request/') && always()
     needs: [check-file-changes, gpu-tests-pr]
     runs-on: ubuntu-latest
+    permissions: {}
     steps:
       - name: Required GPU tests did not succeed
         if: ${{ needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success' }}
         run: exit 1

Also, please ensure branch protection marks this check as required using the exact name “GPU tests / gpu-pr-required-check”.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 458c054 and 29705eb.

📒 Files selected for processing (2)
  • .github/workflows/gpu_tests.yml (3 hunks)
  • .github/workflows/unit_tests.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/unit_tests.yml
⏰ 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). (4)
  • GitHub Check: linux
  • GitHub Check: wait-checks / wait
  • GitHub Check: code-quality
  • GitHub Check: build-docs
🔇 Additional comments (1)
.github/workflows/gpu_tests.yml (1)

22-22: Output rewiring to computed value looks good

Sourcing outputs.any_changed from the new compute step is correct and prevents silent green when changed-files flakes. No further changes needed.

@kevalmorabia97 kevalmorabia97 force-pushed the kmorabia/add-ci-requirement-aggregator branch from 29705eb to 69523f1 Compare September 5, 2025 19:29
Copy link

@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

🧹 Nitpick comments (1)
.github/workflows/gpu_tests.yml (1)

83-91: Make required-check failure explicit and hook to synthesized output.

Emit a clear message/summary so maintainers know why it failed. If you adopt the synthesized output, reference it here.

Apply:

-  gpu-pr-required-check:
+  gpu-pr-required-check:
     # Run even if gpu-tests-pr is skipped
     if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
     needs: [check-file-changes, gpu-tests-pr]
     runs-on: ubuntu-latest
     steps:
       - name: Required GPU tests did not succeed
-        if: ${{ needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success' }}
-        run: exit 1
+        if: ${{ needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success' }}
+        run: |
+          echo "GPU PR tests must pass when test‑relevant files change."
+          echo "any_changed=${{ needs.check-file-changes.outputs.any_changed }}, gpu-tests-pr=${{ needs.gpu-tests-pr.result }}"
+          echo "GPU PR tests did not succeed for test‑relevant changes." >> "$GITHUB_STEP_SUMMARY"
+          exit 1

If you adopt the synthesized output key name, no change needed here since it remains needs.check-file-changes.outputs.any_changed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 29705eb and 69523f1.

📒 Files selected for processing (2)
  • .github/workflows/gpu_tests.yml (2 hunks)
  • .github/workflows/unit_tests.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/unit_tests.yml
⏰ 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). (4)
  • GitHub Check: linux
  • GitHub Check: wait-checks / wait
  • GitHub Check: code-quality
  • GitHub Check: build-docs
🔇 Additional comments (1)
.github/workflows/gpu_tests.yml (1)

83-86: Confirm branch-naming assumption.

The guard relies on refs/heads/pull-request/*. Please confirm all PR mirror branches follow this pattern; otherwise, the required check may never run.

@kevalmorabia97 kevalmorabia97 force-pushed the kmorabia/add-ci-requirement-aggregator branch from 69523f1 to bb6a568 Compare September 5, 2025 19:44
@kevalmorabia97 kevalmorabia97 force-pushed the kmorabia/add-ci-requirement-aggregator branch from bb6a568 to 13106c1 Compare September 5, 2025 19:46
Copy link

@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

♻️ Duplicate comments (1)
.github/workflows/gpu_tests.yml (1)

25-26: LGTM: full git history enables reliable merge-base.

Setting fetch-depth: 0 fixes shallow-clone issues with git merge-base. Matches prior feedback.

🧹 Nitpick comments (3)
.github/workflows/gpu_tests.yml (3)

29-35: Guard against empty merge-base (nit).

Consider failing fast if merge-base is empty to avoid downstream null outputs.

-        run: |
-          (echo -n "merge-base="; git merge-base "$BASE_SHA" "$PR_SHA") | tee --append "${GITHUB_OUTPUT}"
+        run: |
+          set -euo pipefail
+          mb="$(git merge-base "$BASE_SHA" "$PR_SHA" || true)"
+          if [ -z "${mb:-}" ]; then
+            echo "Failed to compute merge-base" >&2
+            exit 1
+          fi
+          echo "merge-base=$mb" | tee --append "${GITHUB_OUTPUT}"

40-42: Optional: synthesize any_changed on diff errors to avoid silent bypass.

If the changed-files step errors, you can set any_changed=true to force gating rather than relying on job failure propagation.

       - name: Check for changes in test-relevant directories
         id: changed-tests
         uses: step-security/[email protected]
         with:
           base_sha: ${{ steps.calculate-merge-base.outputs.merge-base }}
           sha: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).head.sha }}
           files: |
             .github/workflows/gpu_tests.yml
             modelopt/**
             tests/gpu/**
             tox.ini
             pyproject.toml
             setup.py
           fail_on_initial_diff_error: true
+      - name: Synthesize any_changed (treat failures as changed)
+        id: compute-any-changed
+        run: |
+          if [ "${{ steps.changed-tests.outcome }}" != "success" ]; then
+            echo "any_changed=true" >> "$GITHUB_OUTPUT"
+          else
+            echo "any_changed=${{ steps.changed-tests.outputs.any_changed }}" >> "$GITHUB_OUTPUT"
+          fi

Then expose that as the job output:

-    outputs:
-      any_changed: ${{ steps.changed-tests.outputs.any_changed }}
+    outputs:
+      any_changed: ${{ steps.compute-any-changed.outputs.any_changed }}

Also applies to: 49-49


24-28: Pin third-party actions to commit SHAs (supply-chain hardening).

actions/checkout@v4 is fine, but get-pr-info@main and step-security/[email protected] are mutable tags. Pin to immutable SHAs.

-      - id: get-pr-info
-        uses: nv-gha-runners/get-pr-info@main
+      - id: get-pr-info
+        uses: nv-gha-runners/get-pr-info@<pinned-commit-sha>

-        uses: step-security/[email protected]
+        uses: step-security/changed-files@<pinned-commit-sha>

-      - uses: nv-gha-runners/setup-proxy-cache@main
+      - uses: nv-gha-runners/setup-proxy-cache@<pinned-commit-sha>

Also applies to: 38-38, 73-75

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 69523f1 and 13106c1.

📒 Files selected for processing (2)
  • .github/workflows/gpu_tests.yml (2 hunks)
  • .github/workflows/unit_tests.yml (1 hunks)
⏰ 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). (4)
  • GitHub Check: linux
  • GitHub Check: wait-checks / wait
  • GitHub Check: build-docs
  • GitHub Check: code-quality

Copy link
Collaborator

@ChenhanYu ChenhanYu left a comment

Choose a reason for hiding this comment

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

LGTM;

Signed-off-by: Keval Morabia <[email protected]>
@kevalmorabia97 kevalmorabia97 enabled auto-merge (squash) September 5, 2025 20:20
@kevalmorabia97 kevalmorabia97 merged commit 0d279f1 into main Sep 5, 2025
21 checks passed
@kevalmorabia97 kevalmorabia97 deleted the kmorabia/add-ci-requirement-aggregator branch September 5, 2025 20:42
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