Skip to content

Consolidate Dependabot, fix #595 (mimalloc + indexmap), add feature-matrix CI#627

Merged
anakrish merged 4 commits intomicrosoft:mainfrom
anakrish:small-issues
Mar 24, 2026
Merged

Consolidate Dependabot, fix #595 (mimalloc + indexmap), add feature-matrix CI#627
anakrish merged 4 commits intomicrosoft:mainfrom
anakrish:small-issues

Conversation

@anakrish
Copy link
Copy Markdown
Collaborator

@anakrish anakrish commented Mar 24, 2026

Summary

This PR addresses several small but impactful issues around dependency management, feature gating, and CI coverage.

1. Consolidate Dependabot cargo entries

Problem: Dependabot had 9 separate cargo ecosystem entries (one per directory), creating independent PRs that bumped a dependency in one Cargo.lock but not others. This version skew caused most Dependabot PRs to fail CI.

Fix: Consolidate all cargo directories into a single entry using the directories key. Dependabot now creates one PR per dependency update that covers the root workspace and all bindings simultaneously. Also added bundler and github-actions entries, and semantic commit-message prefixes (build(deps) / ci(deps)) to all ecosystem entries.

2. Remove mimalloc from default features (fixes #595)

Problem: The full-opa feature (part of default) pulled in mimalloc and allocator-memory-limits, forcing a vendored global allocator on all library consumers. This conflicted with users who set their own #[global_allocator] and caused build issues with outdated libmimalloc-sys versions.

Fix: Remove allocator-memory-limits and mimalloc from the full-opa feature. Bindings that ship as standalone artifacts (ffi, java, python, ruby) now explicitly opt in to regorus/allocator-memory-limits in their own Cargo.toml, so they retain the performant allocator.

Additionally, propagate indexmap/std via the std feature using weak-dependency syntax (indexmap?/std). This fixes the IndexMap<String, usize> compile error when users enable std + rvm without default features.

3. Feature-combination CI checks

Problem: CI only tested --all-features and --no-default-features — it never tested intermediate combinations like std,arc,rvm (the exact #595 scenario).

Fix:

  • PR CI: Added 5 fast cargo check --no-default-features runs to run_ci_suite() covering the most important non-default combinations.
  • Weekly workflow: New feature-matrix.yml runs cargo build + cargo test across 9 feature combinations every Saturday, using a GitHub Actions matrix with fail-fast: false. Also manually triggerable via workflow_dispatch.

Closes #595

Consolidate all 9 separate cargo ecosystem entries into a single entry
using the 'directories' key. This ensures Dependabot creates one PR per
dependency update across the root workspace and all bindings, preventing
version skew that caused build failures.

Also add semantic commit-message prefixes to all ecosystem entries:
- build(deps) for cargo, gomod, maven, nuget, pip, bundler
- ci(deps) for github-actions

Rename the cargo group to 'rust-dependencies' and the github-actions
group to 'github-actions' for clarity.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
Address microsoft#595: the vendored mimalloc allocator should not be imposed on
library consumers. Remove allocator-memory-limits and mimalloc from the
full-opa feature so that users of regorus as a library can choose their
own global allocator.

Bindings (ffi, java, python, ruby) that ship as standalone artifacts
continue to opt in to regorus/allocator-memory-limits explicitly so they
retain the performant allocator.

Also propagate indexmap/std via the std feature (using the indexmap?/std
weak-dependency syntax) so that users enabling std + rvm without default
features no longer hit 'IndexMap takes 3 generic arguments' errors.

Closes microsoft#595

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
PR CI (xtask): add cargo check for 5 non-default feature combos in
run_ci_suite(). These run on every PR and catch compile failures from
feature-gating issues (e.g. microsoft#595) with near-zero overhead.

Weekly workflow: new feature-matrix.yml runs cargo build + cargo test
across 9 feature combinations every Monday. Uses a GitHub Actions matrix
with fail-fast: false so all combos are tested even if one fails.

Combinations tested weekly:
- std,arc (minimal library)
- std,arc,rvm (common library usage)
- std,arc,full-opa (full-opa without mimalloc)
- std,arc,full-opa,allocator-memory-limits (binding-style)
- std,arc,rvm,regex,time,semver,cache (cherry-picked builtins)
- std,arc,rvm,coverage,cache (observability)
- std,arc,full-opa,azure_policy (Azure Policy)
- std,arc,full-opa,azure-rbac (Azure RBAC)
- arc,opa-no-std (no_std codepath)

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
@anakrish anakrish changed the title Small issues Consolidate Dependabot, fix #595 (mimalloc + indexmap), add feature-matrix CI Mar 24, 2026
@anakrish anakrish requested a review from Copilot March 24, 2026 14:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves dependency/feature management and CI coverage for the Rust workspace and bindings, addressing feature-gating regressions (notably #595) and reducing Dependabot PR skew across multiple Cargo.lock files.

Changes:

  • Consolidates Dependabot configuration so Rust dependency bumps are coordinated across the workspace and bindings, and adds consistent commit-message prefixes.
  • Adjusts crate feature wiring: removes mimalloc from the full-opa default path, propagates indexmap/std via std, and makes bindings explicitly opt into allocator-memory-limits.
  • Adds intermediate feature-subset compilation checks in PR CI and introduces a weekly feature-matrix workflow to build/test multiple feature combinations.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
xtask/src/tasks/ci/mod.rs Adds fast cargo check runs for key non-default feature combinations in PR CI.
Cargo.toml Removes mimalloc from full-opa and propagates indexmap/std through the std feature.
bindings/java/Cargo.toml Explicitly opts Java binding default features into regorus/allocator-memory-limits.
bindings/python/Cargo.toml Explicitly opts Python binding default features into regorus/allocator-memory-limits.
bindings/ruby/ext/regorusrb/Cargo.toml Explicitly opts Ruby native extension default features into regorus/allocator-memory-limits.
.github/workflows/feature-matrix.yml Adds a weekly scheduled (and dispatchable) matrix build/test across feature combinations.
.github/dependabot.yml Consolidates Cargo update entries and adds bundler/github-actions updates with commit prefixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/feature-matrix.yml
… feature

The set_global_memory_limit function is only available when the
allocator-memory-limits feature is enabled. After removing mimalloc
from the default feature set, the rvm_benchmark failed to compile.

Add #[cfg(feature = "allocator-memory-limits")] guards around the
call sites and the MEMORY_LIMIT_BYTES constant.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@anakrish anakrish marked this pull request as ready for review March 24, 2026 15:28
@anakrish anakrish merged commit 86088d2 into microsoft:main Mar 24, 2026
62 checks passed
@anakrish anakrish deleted the small-issues branch March 24, 2026 16:54
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.

Vendored mimalloc cause issues

3 participants