feat(config): add mergify config simulate command#1019
Conversation
|
This pull request is part of a stack:
|
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new mergify config simulate CLI subcommand that allows users to simulate Mergify actions on a given pull request using a local configuration file. It sends the raw configuration YAML to the Mergify simulator API endpoint and displays the result. This builds on the config validate subcommand introduced in #1016.
Changes:
- Added
SimulatorResultdataclass andsimulate_pr()async function to the config/validate module for calling the Mergify simulator API - Added
simulateClick command with PR URL parsing, token/API-URL options, and Rich output formatting - Added tests covering happy path, invalid URL, API failure, and missing config file scenarios
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
mergify_cli/config/validate.py |
Adds SimulatorResult dataclass and simulate_pr() async function to POST to the simulator API |
mergify_cli/config/cli.py |
Adds PR URL regex parser and simulate Click command with token/api-url options |
mergify_cli/tests/config/test_validate.py |
Adds four tests for the simulate command: success, invalid URL, API failure, and config not found |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
65a045d to
e046ae0
Compare
🧪 CI InsightsHere's what we observed from your CI run for 82be43f. 🟢 All jobs passed!But CI Insights is watching 👀 |
|
@jd this pull request is now in conflict 😩 |
Change-Id: Ied875a3ed104bea77a4bc7ab6d226a4e782bcb42 Claude-Session-Id: 35f710ae-3790-4349-b55b-82247979f4a8
e046ae0 to
82be43f
Compare
Merge Queue Status
This pull request spent 2 minutes 23 seconds in the queue, including 2 minutes 9 seconds running CI. Required conditions to merge
|
Add
mergify config simulatecommand that queries the API simulator endpoint.