PHPackages                             minsarai/magento2-ai-release-guardian - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. minsarai/magento2-ai-release-guardian

ActiveMagento2-module[Testing &amp; Quality](/categories/testing)

minsarai/magento2-ai-release-guardian
=====================================

Automated Magento 2 testing with AI-powered failure analysis using Google Gemini or OpenAI

202[1 issues](https://github.com/minsarai/magento2-ai-release-guardian/issues)PHP

Since Feb 9Pushed 3mo agoCompare

[ Source](https://github.com/minsarai/magento2-ai-release-guardian)[ Packagist](https://packagist.org/packages/minsarai/magento2-ai-release-guardian)[ RSS](/packages/minsarai-magento2-ai-release-guardian/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

🛡️ Minsar AI Release Guardian
=============================

[](#️-minsar-ai-release-guardian)

**Automated Magento 2 Testing with AI-Powered Failure Analysis**

[![Magento 2.4+](https://camo.githubusercontent.com/ca99f26813b31e2cde57b9c98425c63c1454e58d1f729804a13e569e40fadba3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e342b2d6f72616e67652e737667)](https://magento.com/)[![PHP 8.1+](https://camo.githubusercontent.com/45d36955804bf3f4f17097b05a7f41a28e578dc24e0d3ad0d21ae9d9762f44c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312b2d626c75652e737667)](https://php.net/)[![AI Powered](https://camo.githubusercontent.com/b0e235bedc8138a01d4aa7b9538000c234e1359db48be995af5a440626941dc4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f41492d47656d696e692532302537432532304f70656e41492d707572706c652e737667)](https://ai.google.dev/)[![License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

Automated smoke and full testing for Magento 2 with AI-powered failure analysis using Google Gemini or OpenAI.

---

✨ Features
----------

[](#-features)

### 🧪 Automated Testing

[](#-automated-testing)

- **Smoke Tests** - Quick 5-page health checks (Homepage, Search, Product, Cart, Checkout)
- **Full Tests** - Complete 8-step flow including API checkout with customer creation
- **Real-time Progress** - Live updates via AJAX polling
- **Cron Integration** - Automated scheduled testing

### 🤖 AI-Powered Analysis

[](#-ai-powered-analysis)

- **Gemini AI** - Google's latest AI model (gemini-2.0-flash)
- **OpenAI** - GPT-4o-mini support
- **Smart Recommendations** - Root cause analysis, fix steps, prevention tips
- **Beautiful UI** - Gradient design with formatted markdown rendering

### 📊 Comprehensive Reporting

[](#-comprehensive-reporting)

- **Test History** - View all past test runs
- **Detailed Reports** - Step-by-step results with timing and HTTP codes
- **Order Details** - Track created orders, customers, and transactions
- **Quote Tracking** - Monitor cart and quote masked IDs

### ⚙️ Flexible Configuration

[](#️-flexible-configuration)

- **Custom Test Products** - Configure SKU, email, timeouts
- **Multiple Environments** - Test different stores/websites
- **Payment Methods** - Auto-detects enabled payment methods
- **Shipping Methods** - Auto-detects enabled shipping carriers

---

📦 Installation
--------------

[](#-installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

```
composer require minsar/magento2-ai-release-guardian
php bin/magento module:enable Minsar_ReleaseGuardian
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
```

### Manual Installation

[](#manual-installation)

```
cd /path/to/magento
mkdir -p app/code/Minsar/ReleaseGuardian
# Download from: https://github.com/minsarai/magento2-ai-release-guardian
# Extract to app/code/Minsar/ReleaseGuardian
php bin/magento module:enable Minsar_ReleaseGuardian
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
```

```
# Add to crontab
* * * * * php /path/to/magento/bin/magento cron:run
```

---

🚀 Quick Start
-------------

[](#-quick-start)

### 1. Configure Settings

[](#1-configure-settings)

**Admin → Stores → Configuration → Minsar → Release Guardian**

**Testing Settings:**

- Test Product SKU: `24-MB01` (or your test product)
- Test Customer Email: `test@example.com`
- Test Timeout: `5000ms`
- Default Country: `US`

**AI Settings:**

- Enable AI Insights: `Yes`
- AI Provider: `Gemini` or `OpenAI`
- API Key: \[Your API key\]

### 2. Run Your First Test

[](#2-run-your-first-test)

**Via Admin:**

```
Admin → Minsar → Release Guardian → Overview → Run Smoke Tests

```

**Via CLI:**

```
php bin/magento guardian:run smoke
php bin/magento guardian:run full
```

### 3. View Results

[](#3-view-results)

```
Admin → Minsar → Release Guardian → History

```

---

🤖 AI Setup
----------

[](#-ai-setup)

### Get Gemini API Key (Free)

[](#get-gemini-api-key-free)

1. Visit:
2. Click "Create API Key"
3. Copy key (starts with `AIza...`)
4. Add to: Admin → Configuration → AI Settings

**Free Tier:**

- 15 requests/minute
- 1M tokens/day
- Perfect for testing!

### Get OpenAI API Key

[](#get-openai-api-key)

1. Visit:
2. Create new key
3. Add to configuration
4. Cost: ~$0.0001 per analysis

---

📋 What Gets Tested
------------------

[](#-what-gets-tested)

### Smoke Tests (5 steps)

[](#smoke-tests-5-steps)

1. ✅ Homepage - Loads successfully
2. ✅ Search Page - Search functionality works
3. ✅ Product Page - Product details display
4. ✅ Cart Page - Shopping cart accessible
5. ✅ Checkout Page - Checkout process starts

### Full Tests (8 steps)

[](#full-tests-8-steps)

1. ✅ Homepage
2. ✅ Search Page
3. ✅ Product Page
4. ✅ Cart Page
5. ✅ Checkout Page
6. ✅ **API: Complete Checkout Flow**
    - Creates customer account
    - Adds product to cart
    - Sets billing/shipping address
    - Applies payment method
    - Places order
7. ✅ Customer Login Page
8. ✅ Customer Account Page

---

🎯 API Checkout Details
----------------------

[](#-api-checkout-details)

The API test creates a **real order** with:

- ✅ **Customer Account** - New customer with address
- ✅ **Order Placement** - Complete checkout flow
- ✅ **Order Increment ID** - Track order number
- ✅ **Quote Masked ID** - Guest cart tracking
- ✅ **Payment Method** - Auto-detected from config
- ✅ **Shipping Method** - Auto-detected from config
- ✅ **Grand Total** - Order total amount

**Example Output:**

```
Order: #000000005
Quote ID: abc123xyz
Email: test_1234567890@example.com
Payment: checkmo
Shipping: flatrate_flatrate
Total: $15.00

```

---

🤖 AI Analysis Example
---------------------

[](#-ai-analysis-example)

When a test fails, AI provides:

```
🤖 AI Analysis

Root Cause Analysis
━━━━━━━━━━━━━━━━━━
Issue: Product Page 404 Error
The product is either disabled, deleted, or URL rewrite is missing.

Recommendations
━━━━━━━━━━━━━━━
1. Check product status: Catalog → Products
2. Verify visibility: 'Catalog, Search'
3. Reindex: bin/magento indexer:reindex
4. Clear cache: bin/magento cache:flush

Prevention Tips
━━━━━━━━━━━━━━
- Use dedicated test products
- Keep test products enabled
- Run indexers after changes

Quick Fix Commands
━━━━━━━━━━━━━━━━
php bin/magento indexer:reindex
php bin/magento cache:flush

```

---

📊 Admin Interface
-----------------

[](#-admin-interface)

### Overview Page

[](#overview-page)

- Run tests with one click
- View latest test results
- Real-time progress tracking
- Quick status indicators

### History Page

[](#history-page)

- All past test runs
- Filter by status/profile
- Sortable columns
- Quick access to reports

### Report Page

[](#report-page)

- Detailed step results
- AI analysis (if failed)
- Order details
- Timing information
- HTTP status codes

---

⚙️ Configuration Options
------------------------

[](#️-configuration-options)

### Testing Settings

[](#testing-settings)

```
minsar_guardian/testing/test_sku          - Product SKU for testing
minsar_guardian/testing/test_customer_email - Customer email
minsar_guardian/testing/timeout_ms        - Request timeout
minsar_guardian/testing/default_country   - Default country code

```

### AI Settings

[](#ai-settings)

```
minsar_guardian/ai/enabled                - Enable AI analysis
minsar_guardian/ai/provider               - gemini or openai
minsar_guardian/ai/api_key                - API key (encrypted)
minsar_guardian/ai/timeout_ms             - AI request timeout

```

---

🔧 CLI Commands
--------------

[](#-cli-commands)

### Run Tests

[](#run-tests)

```
# Smoke test (5 steps)
php bin/magento guardian:run smoke

# Full test (8 steps)
php bin/magento guardian:run full

# With custom environment
php bin/magento guardian:run full --env="Production"
```

### View Results

[](#view-results)

```
# List recent runs
php bin/magento guardian:list

# View specific run
php bin/magento guardian:report
```

---

🗄️ Database Tables
------------------

[](#️-database-tables)

### minsar\_guardian\_run

[](#minsar_guardian_run)

Stores test run information:

- run\_id, profile, status, environment
- duration\_ms, critical\_failures
- ai\_summary (AI analysis)
- started\_at, completed\_at

### minsar\_guardian\_step

[](#minsar_guardian_step)

Stores individual step results:

- step\_id, run\_id, step\_name
- status, url, http\_code
- duration\_ms, error\_message
- response\_data (order details JSON)

---

🎨 Features Showcase
-------------------

[](#-features-showcase)

### ✅ Implemented

[](#-implemented)

- ✅ Smoke &amp; Full Testing
- ✅ API Checkout Flow
- ✅ Customer Account Creation
- ✅ Order Placement
- ✅ AI Analysis (Gemini + OpenAI)
- ✅ Real-time Progress
- ✅ Admin UI
- ✅ CLI Commands
- ✅ Cron Integration
- ✅ Detailed Reporting
- ✅ Order Tracking
- ✅ Quote Tracking

### 🚧 Future Enhancements

[](#-future-enhancements)

- Trends &amp; Analytics
- Performance Metrics
- Incident Tracking
- Email Notifications
- Slack Integration
- Multi-store Testing

---

🐛 Troubleshooting
-----------------

[](#-troubleshooting)

### Tests Always Pass

[](#tests-always-pass)

- Check if test product SKU exists
- Verify product is enabled and in stock
- Ensure product has inventory source assigned (MSI)

### API Test Fails

[](#api-test-fails)

- Check MSI configuration
- Verify payment methods enabled
- Verify shipping methods enabled
- Check customer creation permissions

### AI Not Working

[](#ai-not-working)

- Verify API key is valid
- Check quota limits (free tier)
- Test API key at provider website
- Check error logs: var/log/system.log

### Cron Not Running

[](#cron-not-running)

- Verify crontab is configured
- Check cron logs: var/log/cron.log
- Run manually: php bin/magento cron:run

---

📝 Best Practices
----------------

[](#-best-practices)

### Test Product Setup

[](#test-product-setup)

1. Create dedicated test product (SKU: `test-product`)
2. Keep it enabled and in stock
3. Assign to inventory source
4. Set simple price ($10-$20)
5. Don't delete or modify during tests

### Testing Schedule

[](#testing-schedule)

- **Smoke Tests**: Every 15 minutes
- **Full Tests**: Every hour or before deployments
- **Manual Tests**: Before major releases

### AI Usage

[](#ai-usage)

- Enable for production environments
- Review AI recommendations before applying
- Use AI insights for documentation
- Track recurring issues

---

🔒 Security
----------

[](#-security)

- API keys are encrypted in database
- Test customers use unique emails
- No sensitive data sent to AI
- Only error messages analyzed
- Follows Magento security best practices

---

📄 License
---------

[](#-license)

MIT License - See LICENSE file for details

---

🤝 Support
---------

[](#-support)

- **GitHub**:
- **Issues**:
- **Documentation**: `/docs` folder
- **Email**:
- **Website**:

---

🎉 Credits
---------

[](#-credits)

Built with ❤️ by **Minsar Team**

Powered by:

- Magento 2.4+
- Google Gemini AI
- OpenAI GPT-4o-mini
- PHP 8.1+

---

**Happy Testing! 🚀**

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance45

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/15244513c69853c34e091d97b366848b6aeaab35c24b13d586f5f5d2acd02976?d=identicon)[minsarai](/maintainers/minsarai)

---

Top Contributors

[![minsarai](https://avatars.githubusercontent.com/u/256527852?v=4)](https://github.com/minsarai "minsarai (2 commits)")

### Embed Badge

![Health badge](/badges/minsarai-magento2-ai-release-guardian/health.svg)

```
[![Health](https://phpackages.com/badges/minsarai-magento2-ai-release-guardian/health.svg)](https://phpackages.com/packages/minsarai-magento2-ai-release-guardian)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
