Skip to content

chore(backend): raise rust-version to the pinned 1.97 toolchain - #54

Open
selmant wants to merge 3 commits into
developfrom
chore/rust-version-1.97
Open

selmant wants to merge 3 commits into
developfrom
chore/rust-version-1.97

Conversation

@selmant

@selmant selmant commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Description

Raise the backend crate's minimum supported Rust version from 1.85 to 1.97 to match the Rust 1.97.1 toolchain already pinned in backend-rs/rust-toolchain.toml. Apply the resulting Clippy fixes: use minute/hour duration constructors, make eligible functions const fn, and replace divisibility checks with is_multiple_of. These mechanical rewrites preserve the existing values and behavior.

The Rust CI job also failed before reaching the tests because AniBridge's release download URL repeatedly returned HTTP 504. Fetch the same release asset through GitHub's API and serve it as an extra local mirror using MAPPING_MIRROR_TEMPLATES. The smoke test continues to exercise the backend's download, validation, and import paths for both datasets and requires populated dataset generations. Document the CI mirror in the backend README.

How Has This Been Tested?

Validated locally on Linux with the pinned Rust 1.97.1 toolchain:

  • cargo fmt --check, cargo clippy --all-targets --locked -- -D warnings, and cargo build --locked.
  • Ran the exact updated CI smoke step while the release download URL was returning HTTP 504. It applied all 88 SQLite migrations, verified 17 authenticated reads before and after restart, and imported 263,751 AniBridge edges and 142,474 Fribb edges into the scratch mapping database. The downloaded release matched GitHub's published SHA-256.
  • CI=true FORESEERR_MAPPING_TEST_DB=<scratch database> cargo test --locked: 725 passed, including the populated mapping database test.
  • actionlint, ShellCheck, and Prettier checks for the workflow and documentation.
  • Independently compared all 41 changed duration expressions and confirmed that each retains its original value in seconds.

Checklist:

  • I have read and followed the contribution guidelines.
  • I tested this change manually (see our AI policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build bun run build
  • Translation keys bun run i18n:extract
  • Database migration (if required)

rust-toolchain.toml already pins 1.97.1, so 1.85 was only holding clippy
back from newer std APIs. Applies what that unlocks: Duration::from_mins
and from_hours, is_multiple_of, and const fns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2977b85 and 531e6f8.

Files selected for processing: 2

  • .github/workflows/backend-rs.yml
  • backend-rs/README.md

No actionable comments were generated in the recent review.

Walkthrough

The Rust package now requires Rust 1.97. Across the backend, equivalent duration expressions use minute- and hour-based constructors, selected arithmetic checks use updated methods, and selected functions are declared const. The summaries report no changes to the described durations or function behavior.

Changes: Rust backend updates

Layer / File(s) Summary
Version, duration, and arithmetic updates
backend-rs/Cargo.toml, backend-rs/src/*.rs, backend-rs/src/mappinglayer/*, backend-rs/src/routes/*
The Rust version requirement changes from 1.85 to 1.97. Duration expressions use minute- and hour-based constructors without changing their stated values. Two arithmetic checks are rewritten with is_multiple_of.
Const function declarations
backend-rs/src/jobs/cron.rs, backend-rs/src/mappinglayer/*, backend-rs/src/mdblist.rs, backend-rs/src/routes/*, backend-rs/src/runtime/plugin.rs, backend-rs/src/typeorm.rs
Selected functions and methods become const fn; their described checks and results remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • selmant/foreseerr#10: Adds the Rust version requirement and toolchain pin referenced by this PR’s version update.
Merge Risk: Minimal · previous review 2977b

The updates preserve the described timing and runtime behavior. No actionable merge-blocking issue is identified; merge readiness remains subject to normal build and test checks.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "chore(backend): raise rust-version to the pinned 1.97 toolchain" matches the main change. The PR raises rust-version in backend-rs/Cargo.toml from 1.85 to 1.97, which matches the pinned Rus…
Docstring Coverage Passed Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
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.
Full details: Title check

Explanation

The title "chore(backend): raise rust-version to the pinned 1.97 toolchain" matches the main change. The PR raises rust-version in backend-rs/Cargo.toml from 1.85 to 1.97, which matches the pinned Rust 1.97.1 toolchain in rust-toolchain.toml. The title is concise, specific, and follows a conventional-commit style. The rest of the changeset (Duration::from_mins/from_hours replacements, const fn conversions, and is_multiple_of replacements) is Clippy-driven follow-up enabled by the MSRV bump. The title does not mention these, which is expected because the title only needs the primary change.

Full details: Docstring Coverage

Explanation

Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 33 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4923c01 and 2977b85.

Files selected for processing: 1

  • backend-rs/src/mappinglayer/probe.rs
Files skipped from review as they are similar to previous changes: 1

  • backend-rs/src/mappinglayer/probe.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant