Skip to content

Don't run routing tests if PR only touches LP/MIP files#935

Open
chris-maes wants to merge 2 commits intoNVIDIA:mainfrom
chris-maes:ci_changes
Open

Don't run routing tests if PR only touches LP/MIP files#935
chris-maes wants to merge 2 commits intoNVIDIA:mainfrom
chris-maes:ci_changes

Conversation

@chris-maes
Copy link
Contributor

Description

Issue

Checklist

  • I am familiar with the Contributing Guidelines.
  • Testing
    • New or existing tests cover these changes
    • Added tests
    • Created an issue to follow-up
    • NA
  • Documentation
    • The documentation is up to date with these changes
    • Added new documentation
    • NA

@chris-maes chris-maes requested a review from a team as a code owner March 5, 2026 00:17
@chris-maes chris-maes requested a review from jakirkham March 5, 2026 00:17
@copy-pr-bot
Copy link

copy-pr-bot bot commented Mar 5, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

Adds a workflow grouping has_non_lp_mip_changes and uses it to set SKIP_ROUTING_TESTS; several CI scripts now conditionally skip routing-related tests and dataset downloads when that flag indicates non-LP/MIP changes.

Changes

Cohort / File(s) Summary
Workflow Configuration
.github/workflows/pr.yaml
Adds has_non_lp_mip_changes changed-files grouping, exposes it as needs.changed-files.outputs.changed_file_groups.has_non_lp_mip_changes, and maps it to SKIP_ROUTING_TESTS across jobs.
CTest wrapper
ci/run_ctests.sh
Introduces ROUTING_TESTS handling and skips matching routing tests when SKIP_ROUTING_TESTS is true.
Python pytest wrappers
ci/run_cuopt_pytests.sh, ci/run_cuopt_server_pytests.sh
Switches to PYTEST_ARGS arrays and appends --ignore entries when SKIP_ROUTING_TESTS is true, then invokes pytest with assembled args.
Test data setup scripts
ci/test_cpp.sh, ci/test_python.sh, ci/test_wheel_cuopt.sh
Guards dataset retrieval and test-data download blocks with a check that skips these steps when SKIP_ROUTING_TESTS is true.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is a template with empty sections and an unchecked checklist, lacking substantive details about the changes, but it is not completely off-topic since the context references the CI behavior change. Provide a meaningful description explaining the motivation, implementation approach, and testing performed for the CI optimization.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: conditionally skipping routing tests when PRs only modify LP/MIP files, which aligns with the workflow and test script modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pr.yaml:
- Around line 282-283: The YAML contains tab characters in the lines with the
patterns '!cpp/src/math_optimization/**' and '!cpp/src/pdlp/**' which breaks
parsing; open the workflow file and replace any tab characters surrounding those
entries with spaces so indentation uses only spaces, ensure list items remain
properly aligned (consistent 2 or 4 spaces as used elsewhere), and re-run a YAML
linter (yamllint) to confirm no tabs remain.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dbff7485-1478-4bd9-a371-30f94a012aa2

📥 Commits

Reviewing files that changed from the base of the PR and between d61b196 and 4fe91c5.

📒 Files selected for processing (7)
  • .github/workflows/pr.yaml
  • ci/run_ctests.sh
  • ci/run_cuopt_pytests.sh
  • ci/run_cuopt_server_pytests.sh
  • ci/test_cpp.sh
  • ci/test_python.sh
  • ci/test_wheel_cuopt.sh

@chris-maes chris-maes added the non-breaking Introduces a non-breaking change label Mar 5, 2026
@chris-maes chris-maes added this to the 26.04 milestone Mar 5, 2026
@chris-maes chris-maes added the improvement Improves an existing functionality label Mar 5, 2026
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pr.yaml:
- Around line 280-291: The has_non_lp_mip_changes exclusion list is incomplete
and misses multiple LP/MIP-owned paths, causing irrelevant CI routing; update
the has_non_lp_mip_changes pattern set to also exclude the public headers and
other LP/MIP directories (examples: cpp/include/cuopt/linear_programming/**,
python/cuopt/cuopt/linear_programming/**, benchmarks/linear_programming/**,
datasets/linear_programming/** and datasets/mip/**,
python/cuopt_server/**/linear_programming/**, regression/lp_*.sh and
regression/mip_*.sh, plus docs/ and skills/examples paths that contain LP/MIP
examples) so that only truly non-LP/MIP changes flip has_non_lp_mip_changes;
locate the has_non_lp_mip_changes block in the workflow and add the
corresponding glob patterns (using the same negation style like '!cpp/src/...'
already present) to the list.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 30715bd2-7654-413c-a6c6-4ebfbc44ce55

📥 Commits

Reviewing files that changed from the base of the PR and between 4fe91c5 and 3dd26ea.

📒 Files selected for processing (1)
  • .github/workflows/pr.yaml

Comment on lines +280 to +291
has_non_lp_mip_changes:
- '**'
- '!cpp/src/math_optimization/**'
- '!cpp/src/pdlp/**'
- '!cpp/src/dual_simplex/**'
- '!cpp/src/cuts/**'
- '!cpp/src/barrier/**'
- '!cpp/src/mip_heuristics/**'
- '!cpp/src/branch_and_bound/**'
- '!cpp/tests/dual_simplex/**'
- '!cpp/tests/linear_programming/**'
- '!cpp/tests/mip/**'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python - <<'PY'
import pathlib
import re

workflow = pathlib.Path(".github/workflows/pr.yaml").read_text()

# Extract has_non_lp_mip_changes block
m = re.search(r'^\s*has_non_lp_mip_changes:\n((?:\s+- .+\n)+)', workflow, re.M)
if not m:
    raise SystemExit("Could not find has_non_lp_mip_changes block in .github/workflows/pr.yaml")

block = m.group(1).splitlines()
excluded_prefixes = []
for line in block:
    s = line.strip()
    if s.startswith("- '!") and s.endswith("/**'"):
        excluded_prefixes.append(s[len("- '!"):-len("/**'")])

# Candidate LP/MIP-related files in repo (heuristic by path tokens)
tokens = (
    "mip", "lp", "pdlp", "dual_simplex", "linear_programming",
    "math_optimization", "branch_and_bound", "barrier", "cuts"
)

candidates = []
for p in pathlib.Path(".").rglob("*"):
    if not p.is_file():
        continue
    ps = p.as_posix()
    if ".git/" in ps:
        continue
    low = ps.lower()
    if any(t in low for t in tokens):
        covered = any(ps.startswith(prefix + "/") for prefix in excluded_prefixes)
        if not covered:
            candidates.append(ps)

print("Excluded prefixes from has_non_lp_mip_changes:")
for ep in excluded_prefixes:
    print("  -", ep)

print("\nPotential LP/MIP-related files NOT covered by exclusions:")
for c in sorted(candidates):
    print("  -", c)

print(f"\nTotal uncovered candidates: {len(candidates)}")
PY

Repository: NVIDIA/cuopt

Length of output: 16454


Verify has_non_lp_mip_changes covers all LP/MIP-owned paths.

The exclusion list is incomplete. Currently excluded are only cpp/src/ and cpp/tests/ directories, but significant LP/MIP-related files exist elsewhere:

  • cpp/include/cuopt/linear_programming/** (38 files) — public API headers for LP/MIP solvers
  • python/cuopt/cuopt/linear_programming/** (20+ files) — Python LP module
  • benchmarks/linear_programming/** — benchmark infrastructure
  • datasets/linear_programming/** and datasets/mip/** — test data
  • python/cuopt_server/...linear_programming/** — server-side LP utilities and tests
  • regression/lp_*.sh and regression/mip_*.sh — regression test suites
  • Documentation and skill examples containing LP/MIP examples (50+ files)

PRs touching only these files will incorrectly be treated as has_non_lp_mip_changes=true, causing routing tests to run unnecessarily. Add these paths to the exclusion list or document the intended scope.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr.yaml around lines 280 - 291, The has_non_lp_mip_changes
exclusion list is incomplete and misses multiple LP/MIP-owned paths, causing
irrelevant CI routing; update the has_non_lp_mip_changes pattern set to also
exclude the public headers and other LP/MIP directories (examples:
cpp/include/cuopt/linear_programming/**,
python/cuopt/cuopt/linear_programming/**, benchmarks/linear_programming/**,
datasets/linear_programming/** and datasets/mip/**,
python/cuopt_server/**/linear_programming/**, regression/lp_*.sh and
regression/mip_*.sh, plus docs/ and skills/examples paths that contain LP/MIP
examples) so that only truly non-LP/MIP changes flip has_non_lp_mip_changes;
locate the has_non_lp_mip_changes block in the workflow and add the
corresponding glob patterns (using the same negation style like '!cpp/src/...'
already present) to the list.

@github-actions
Copy link

🔔 Hi @anandhkb, this pull request has had no activity for 7 days. Please update or let us know if it can be closed. Thank you!

If this is an "epic" issue, then please add the "epic" label to this issue.
If it is a PR and not ready for review, then please convert this to draft.
If you just want to switch off this notification, then use the "skip inactivity reminder" label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant