Skip to content

Repository files navigation

mergify-ci-integrations

CI provider / job-context detection for Mergify's test-client integrations — a shared Rust core and the language bindings that wrap it, in one repo.

Layout

crates/
  mergify-ci-core/     Rust detection core (standalone, crates.io-publishable)
clients/
  pytest-mergify/      pytest plugin: a PyO3 (abi3) binding over the core,
                       built as a maturin mixed project
  ts/                  TypeScript workspace (pnpm): the @mergifyio/vitest and
                       @mergifyio/playwright reporters over a shared
                       @mergifyio/ci-core; CI detection via @mergifyio/ci-native,
                       a napi binding over the core (prebuilt per platform)
  rspec-mergify/       RSpec plugin (Ruby gem): still pure Ruby, awaiting its
                       magnus binding over the core

Core

mergify-ci-core exposes detect(env, cwd) -> CiContext, taking the environment and working directory as explicit arguments (no std::env globals). It detects the CI provider — GitHub Actions, CircleCI, Jenkins, and the pytest-mergify test suite — with the same rules as pytest-mergify's get_ci_provider.

Clients

A client bundles the core into its own published package via a Cargo path dependency; there is no separate binding artifact. pytest-mergify compiles the PyO3 binding into its wheel as pytest_mergify._mergify_ci, so users pip install pytest-mergify with no Rust toolchain.

The TypeScript workspace under clients/ts/ (imported from mergify-ci-plugins-ts with its git history) is the exception to the bundled model: npm natives ship as per-platform packages, so @mergifyio/ci-native wraps the core behind napi and @mergifyio/ci-core consumes it for CI detection, fail-open — platforms without a prebuilt binary detect nothing rather than breaking the run. The API client goes through that same binding: @mergifyio/ci-core fetches quarantine and flaky-detection context from the Rust client. The packages release from this repo via ts-v<SemVer> tags (fixed version across the workspace, two-step draft-then-publish like pytest-mergify).

The RSpec gem under clients/rspec-mergify/ (imported from rspec-mergify with its git history) wraps the core behind magnus, and follows the bundled model the same way the wheel does rather than the way npm natives do: Ruby has no stable ABI, so a precompiled gem is fat, carrying one extension per supported Ruby. It still carries its own API calls and OpenTelemetry SDK export. It releases from this repo via rspec-mergify-v<SemVer> tags, two-step draft-then-publish like the others, to RubyGems over Trusted Publishing: seven platform gems plus a plain ruby gem that installs anywhere and reports CI as unknown, so an unsupported platform degrades rather than failing to install.

Develop

cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
maturin build --manifest-path clients/pytest-mergify/Cargo.toml
pnpm -C clients/ts install && pnpm -C clients/ts run build && pnpm -C clients/ts test
(cd clients/rspec-mergify && bundle install && bundle exec rspec && bundle exec rubocop)

CI runs the workspace tests, builds + imports the pytest-mergify wheel on Linux, macOS, and Windows, runs the TS workspace's lint + test matrix (node 22/24), and runs the gem's suite over Ruby 3.1–3.4 and 4.0 plus the packaging check that builds it the way a release does.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages