Skip to content

GAMS sync#39

Open
Godwinss24 wants to merge 10 commits into
oximo-rs:mainfrom
Godwinss24:gams-sync
Open

GAMS sync#39
Godwinss24 wants to merge 10 commits into
oximo-rs:mainfrom
Godwinss24:gams-sync

Conversation

@Godwinss24

@Godwinss24 Godwinss24 commented Jul 12, 2026

Copy link
Copy Markdown

Description
Adds a CI check that verifies the hand-written solver option lists in options.rs (BARON, Gurobi, HiGHS) stay in sync with GAMS' published docs. A manually-triggered workflow scrapes the current GAMS solver option pages using an external tool (gams_scraper) and diffs the result against a checked-in snapshot per solver. This is a verify-only check — it flags drift but does not auto-generate or auto-commit changes; a maintainer still manually updates the relevant *_params! macro
and the snapshot file when it fails.

Checklist

  • I have updated the documentation accordingly
  • I have added tests that cover my changes
  • I have run cargo fmt and cargo clippy to ensure code quality
  • All default tests pass (cargo test)
  • cargo test --features gams passes (requires GAMS)
  • cargo test --features gurobi passes (requires Gurobi)
  • cargo test --features baron passes (requires BARON)

Changes Made

  • Added .github/workflows/gams-sync.yml: manually-triggered
    (workflow_dispatch) workflow that runs gams_scraper for BARON, GUROBI,
    and HIGHS and diffs the output against checked-in snapshots
  • Added snapshots/ folder with current baseline scraper output for each
    supported solver
  • Fixed Cargo.toml to exclude the external gams_scraper checkout from
    the workspace during CI runs
  • Added a README section explaining how the GAMS options sync check works
    and what to do when it fails

Related Issues

Closes #37

@GermanHeim.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@GermanHeim, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 750412b7-b829-4e8e-a90c-bbd4b58b87e0

📥 Commits

Reviewing files that changed from the base of the PR and between b27de14 and 32a8cb9.

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

Walkthrough

Adds BARON, Gurobi, and HiGHS solver option snapshots, a manually triggered GAMS synchronization workflow, workspace exclusion for the scraper, and documentation for updating option definitions.

Changes

GAMS option synchronization

Layer / File(s) Summary
Solver option snapshot baselines
snapshots/baron.txt, snapshots/gurobi.txt, snapshots/highs.txt
Adds typed parameter inventories for BARON, Gurobi, and HiGHS.
Scraper verification process
Cargo.toml, .github/workflows/gams-sync.yml, README.md
Excludes gams_scraper from the workspace, adds a manual workflow that scrapes and diffs solver options, and documents the synchronization procedure.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the change, but it is too generic to clearly summarize the CI-based GAMS sync work. Use a concise title that names the GAMS options sync check or CI workflow instead of the generic "GAMS sync".
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The PR description matches the template with Description, Checklist, Changes Made, and Related Issues sections filled in.
Linked Issues check ✅ Passed The PR implements the requested scraper-based CI verification and updates solver snapshots/docs for BARON, Gurobi, and HiGHS.
Out of Scope Changes check ✅ Passed All changes are directly tied to the GAMS options sync workflow, snapshots, workspace tweak, and documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/gams-sync.yml (1)

40-43: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Distinguish diff differences from diff errors.

diff returns exit code 1 for content differences and 2 for errors (e.g., file not found, permission denied). The current || block reports "options are out of date" for both cases, which could mislead debugging on an I/O error.

♻️ Proposed fix
-            diff "$snapshot" "$new" || {
-              echo "::error::$solver options are out of date. Regenerate and update ${snapshot} and the corresponding options.rs."
-              exit 1
-            }
+            diff "$snapshot" "$new"
+            diff_status=$?
+            if [ $diff_status -eq 1 ]; then
+              echo "::error::$solver options are out of date. Regenerate and update ${snapshot} and the corresponding options.rs."
+              exit 1
+            elif [ $diff_status -eq 2 ]; then
+              echo "::error::Error comparing $solver snapshot ($snapshot vs $new)."
+              exit 1
+            fi
🤖 Prompt for 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.

In @.github/workflows/gams-sync.yml around lines 40 - 43, Update the diff check
in the workflow step around the diff command to distinguish its exit statuses:
report that solver options are out of date only when diff returns 1, and report
or propagate a separate error for other nonzero statuses such as I/O failures.
Preserve the existing failure exit behavior for both cases.
🤖 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/gams-sync.yml:
- Around line 1-44: Add a top-level permissions block to the “Verify GAMS solver
options” workflow granting only contents read access. In both checkout steps,
set persist-credentials to false so the GitHub token is not retained for
subsequent scraper execution.
- Around line 13-17: Update the “Checkout gams_scraper” action to pin the
Godwinss24/GAM-SOLVERS checkout to a specific trusted commit SHA instead of the
default branch tip, and add a brief comment documenting that the SHA must be
deliberately reviewed and updated when upgrading the dependency.

In `@README.md`:
- Line 344: Update the README workflow link so both its display text and target
reference the existing .github/workflows/gams-sync.yml file, replacing the
incorrect gams-options.yml target.

---

Nitpick comments:
In @.github/workflows/gams-sync.yml:
- Around line 40-43: Update the diff check in the workflow step around the diff
command to distinguish its exit statuses: report that solver options are out of
date only when diff returns 1, and report or propagate a separate error for
other nonzero statuses such as I/O failures. Preserve the existing failure exit
behavior for both cases.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d92a40d-625f-454b-875b-16a43bac0d57

📥 Commits

Reviewing files that changed from the base of the PR and between 921e90e and ad890c6.

📒 Files selected for processing (6)
  • .github/workflows/gams-sync.yml
  • Cargo.toml
  • README.md
  • snapshots/baron.txt
  • snapshots/gurobi.txt
  • snapshots/highs.txt

Comment thread .github/workflows/gams-sync.yml
Comment on lines +13 to +17
- name: Checkout gams_scraper
uses: actions/checkout@v4
with:
repository: Godwinss24/GAM-SOLVERS
path: gams_scraper

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Pin the external gams_scraper checkout to a specific commit.

The workflow checks out Godwinss24/GAM-SOLVERS at its default branch tip and then executes that code via cargo run. If the external repo is compromised, arbitrary code runs in CI with the workflow's token. Pin to a specific commit SHA and document the update process.

🔒️ Proposed fix
       - name: Checkout gams_scraper
         uses: actions/checkout@v4
         with:
           repository: Godwinss24/GAM-SOLVERS
+          ref: <pinned-commit-sha>
           path: gams_scraper
           persist-credentials: false
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 13-17: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for 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.

In @.github/workflows/gams-sync.yml around lines 13 - 17, Update the “Checkout
gams_scraper” action to pin the Godwinss24/GAM-SOLVERS checkout to a specific
trusted commit SHA instead of the default branch tip, and add a brief comment
documenting that the SHA must be deliberately reviewed and updated when
upgrading the dependency.

Comment thread README.md Outdated
@GermanHeim

Copy link
Copy Markdown
Collaborator

Hello @Godwinss24, I opened a PR at Godwinss24/GAM-SOLVERS#1 to add support for more solvers.
Once we add that, I would like to make a couple of changes. But this looks really good; thank you!

@Godwinss24

Copy link
Copy Markdown
Author

Hello @GermanHeim, I've reviewed it and merged the PR. The added solver support looks great.

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.

[feature] Improve GAMS options structs

2 participants