Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 26 additions & 75 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,95 +7,36 @@

version: 2
updates:
# All Rust/Cargo directories are grouped into a single entry so that
# when a dependency is updated, Dependabot creates ONE PR that bumps it
# across the root workspace AND every binding, preventing version skew.
- package-ecosystem: "cargo"
directory: "/" # Location of package manifests
directories:
- "/"
- "/bindings/ffi"
- "/bindings/java"
- "/bindings/python"
- "/bindings/ruby"
- "/bindings/wasm"
schedule:
interval: "weekly"
commit-message:
prefix: "build(deps)"
groups:
per-dependency:
rust-dependencies:
patterns:
- "*"
# Ignore vendored mimalloc crates; updates are managed manually.
ignore:
- dependency-name: "regorus-mimalloc"
- dependency-name: "regorus-mimalloc-sys"

- package-ecosystem: "cargo"
directory: "/bindings/ffi"
schedule:
interval: "weekly"
groups:
per-dependency:
patterns:
- "*"

- package-ecosystem: "cargo"
directory: "/bindings/java"
schedule:
interval: "weekly"
groups:
per-dependency:
patterns:
- "*"

- package-ecosystem: "cargo"
directory: "/bindings/python"
schedule:
interval: "weekly"
groups:
per-dependency:
patterns:
- "*"

- package-ecosystem: "cargo"
directory: "/bindings/ruby"
schedule:
interval: "weekly"
groups:
per-dependency:
patterns:
- "*"

- package-ecosystem: "cargo"
directory: "/bindings/ruby/ext/regorusrb"
schedule:
interval: "weekly"
groups:
per-dependency:
patterns:
- "*"

- package-ecosystem: "cargo"
directory: "/bindings/wasm"
schedule:
interval: "weekly"
groups:
per-dependency:
patterns:
- "*"

- package-ecosystem: "cargo"
directory: "/tests/ensure_no_std"
schedule:
interval: "weekly"
groups:
per-dependency:
patterns:
- "*"

- package-ecosystem: "cargo"
directory: "/xtask"
schedule:
interval: "weekly"
groups:
per-dependency:
patterns:
- "*"

- package-ecosystem: "gomod"
directory: "/bindings/go"
schedule:
interval: "weekly"
commit-message:
prefix: "build(deps)"
groups:
per-dependency:
patterns:
Expand All @@ -105,6 +46,8 @@ updates:
directory: "/bindings/java"
schedule:
interval: "weekly"
commit-message:
prefix: "build(deps)"
groups:
per-dependency:
patterns:
Expand All @@ -114,6 +57,8 @@ updates:
directory: "/bindings/csharp"
schedule:
interval: "weekly"
commit-message:
prefix: "build(deps)"
groups:
per-dependency:
patterns:
Expand All @@ -123,6 +68,8 @@ updates:
directory: "/bindings/python"
schedule:
interval: "weekly"
commit-message:
prefix: "build(deps)"
groups:
per-dependency:
patterns:
Expand All @@ -132,6 +79,8 @@ updates:
directory: "/bindings/ruby"
schedule:
interval: "weekly"
commit-message:
prefix: "build(deps)"
groups:
per-dependency:
patterns:
Expand All @@ -141,7 +90,9 @@ updates:
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "ci(deps)"
groups:
per-dependency:
github-actions:
patterns:
- "*"
107 changes: 107 additions & 0 deletions .github/workflows/dependabot-refresh-cargo-lockfiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
#
name: dependabot/refresh-cargo-lockfiles

on:
pull_request_target:
types: [opened, synchronize, reopened]
branches: ["main"]

permissions:
contents: write

env:
CARGO_TERM_COLOR: always

jobs:
refresh-cargo-lockfiles:
if: >-
github.actor == 'dependabot[bot]' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Setup Rust toolchain
run: |
rustup override set 1.92.0
cargo --version
rustc --version

- name: Refresh affected Cargo lockfiles
shell: bash
run: |
set -euo pipefail

base_sha="${{ github.event.pull_request.base.sha }}"
head_sha="${{ github.event.pull_request.head.sha }}"

mapfile -t changed_files < <(git diff --name-only "$base_sha" "$head_sha" -- '**/Cargo.toml' '**/Cargo.lock')

if [ "${#changed_files[@]}" -eq 0 ]; then
echo "No Cargo manifest or lockfile changes detected."
exit 0
fi

declare -A manifests=()
for path in "${changed_files[@]}"; do
case "$path" in
bindings/ffi/*)
manifests["bindings/ffi/Cargo.toml"]=1
;;
bindings/java/*)
manifests["bindings/java/Cargo.toml"]=1
;;
bindings/python/*)
manifests["bindings/python/Cargo.toml"]=1
;;
bindings/ruby/*)
manifests["bindings/ruby/Cargo.toml"]=1
;;
bindings/wasm/*)
manifests["bindings/wasm/Cargo.toml"]=1
;;
*)
manifests["Cargo.toml"]=1
;;
esac
done

for manifest in "${!manifests[@]}"; do
echo "Refreshing lockfile for $manifest"
cargo metadata --format-version 1 --all-features --manifest-path "$manifest" > /dev/null
done

if [[ -n "${manifests[Cargo.toml]+x}" ]]; then
echo "Refreshing lockfile for tests/ensure_no_std/Cargo.toml (thumbv7m-none-eabi)"
cargo metadata --format-version 1 \
--manifest-path tests/ensure_no_std/Cargo.toml \
--filter-platform thumbv7m-none-eabi > /dev/null
fi

- name: Commit lockfile refresh
shell: bash
run: |
set -euo pipefail

git add Cargo.lock \
bindings/ffi/Cargo.lock \
bindings/java/Cargo.lock \
bindings/python/Cargo.lock \
bindings/ruby/Cargo.lock \
bindings/wasm/Cargo.lock

if git diff --cached --quiet; then
echo "No Cargo lockfile changes required."
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "build(deps): refresh Cargo lockfiles"
git push
82 changes: 82 additions & 0 deletions .github/workflows/feature-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Thorough weekly test of non-default feature combinations.
# Catches regressions from dependency updates and feature-gating issues
# that the fast PR CI checks (cargo check only) would miss at runtime.
name: tests/feature-matrix

on:
workflow_dispatch:
schedule:
# Run at 3:42 AM UTC every Saturday.
- cron: "42 3 * * 6"

env:
CARGO_TERM_COLOR: always

jobs:
feature-matrix:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Bare minimum: validates that the core interpreter works
# without any builtins or optional subsystems.
- name: minimal (std + arc)
features: std,arc

# Common library usage pattern (issue #595): consumer enables
# std + arc + rvm and relies on indexmap/std propagation.
- name: library (std + arc + rvm)
features: std,arc,rvm

# New default after removing mimalloc from full-opa.
# Ensures all builtins compile without the allocator.
- name: full-opa (no mimalloc)
features: std,arc,full-opa

# Binding-style usage: full-opa with the vendored allocator.
# Mirrors how ffi/java/python/ruby bindings are built.
- name: full-opa + allocator
features: std,arc,full-opa,allocator-memory-limits

# Selective builtins without full-opa: validates that popular
# features can be cherry-picked independently.
- name: cherry-picked builtins
features: std,arc,rvm,regex,time,semver,cache

# Observability features only: coverage + cache without the
# heavier builtins (regex, time, etc.).
- name: observability
features: std,arc,rvm,coverage,cache

# Azure Policy adds jsonschema + dashmap; test it compiles
# and runs on top of full-opa.
- name: azure-policy
features: std,arc,full-opa,azure_policy

# Azure RBAC adds regex + time + net on top of full-opa.
- name: azure-rbac
features: std,arc,full-opa,azure-rbac

# no_std with the OPA-compatible feature set: exercises the
# spin_no_std codepath and absence of std-only dependencies.
- name: no_std
features: arc,opa-no-std

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Rust toolchain
uses: ./.github/actions/toolchains/rust
- name: Cache cargo
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
shared-key: ${{ runner.os }}-regorus-features
- name: Fetch dependencies
run: cargo fetch --locked
- name: Build
run: cargo build --no-default-features --features "${{ matrix.features }}" --frozen
- name: Test
run: cargo test --no-default-features --features "${{ matrix.features }}" --frozen
Loading