From 8f2b7800231da647a25fda65169b568b8e961a21 Mon Sep 17 00:00:00 2001 From: Laurent Legaz Date: Mon, 16 Feb 2026 12:36:42 +0100 Subject: [PATCH 1/4] PR Template updated --- .github/PR_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PR_TEMPLATE.md b/.github/PR_TEMPLATE.md index 17ecb2d..e2d761e 100644 --- a/.github/PR_TEMPLATE.md +++ b/.github/PR_TEMPLATE.md @@ -7,7 +7,6 @@ -Please check the relevant option(s): - [ ] πŸ› Bug fix -- [ ] ✨ New feature - [ ] πŸ’₯ Breaking change - [ ] πŸ“ Documentation - [ ] πŸ§ͺ Tests @@ -19,6 +18,7 @@ - [ ] Unit tests - [ ] Integration tests +- [ ] Functional tests - [ ] Manual testing Code style and test suite exectuion. From 4ea3f879bb3e59168c757a6933d5b5ea47001848 Mon Sep 17 00:00:00 2001 From: Laurent Legaz Date: Mon, 16 Feb 2026 13:31:14 +0100 Subject: [PATCH 2/4] project workflow updated --- .github/workflows/CI.yml | 4 +- CONTRIBUTING.md | 169 +++++++++++++-------------------------- 2 files changed, 57 insertions(+), 116 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 71dca8f..600e3e3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ develop ] + branches: [ dev ] pull_request: - branches: [ main, develop ] + branches: [ main, dev ] workflow_dispatch: jobs: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 09256f1..b853910 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,9 +23,9 @@ main β”œβ”€ Production-ready code β”œβ”€ Protected branch (no direct push allowed) β”œβ”€ Updated only via Pull Requests - └─ Tagged with semantic versions (v1.0.0, v1.1.0, etc.) + └─ Tagged with semantic versions (1.0.0, 1.1.0, etc.) -develop +dev β”œβ”€ Integration branch for ongoing development β”œβ”€ Latest development code β”œβ”€ Base branch for all new features @@ -33,18 +33,18 @@ develop feature/* β”œβ”€ New features and improvements - β”œβ”€ Created from: develop - └─ Merged into: develop + β”œβ”€ Created from: dev + └─ Merged into: dev hotfix/* β”œβ”€ Urgent production fixes β”œβ”€ Created from: main - └─ Merged into: both main AND develop + └─ Merged into: both main AND dev release/* β”œβ”€ Release preparation and version bumps - β”œβ”€ Created from: develop - └─ Merged into: both main AND develop + β”œβ”€ Created from: dev + └─ Merged into: both main AND dev ``` ### Visual Workflow @@ -55,15 +55,15 @@ feature/awesome-feature ↓ [GitHub Actions runs tests] πŸ§ͺ ↓ - [Create Pull Request β†’ develop] + [Create Pull Request β†’ dev] ↓ [Tests run on PR] πŸ§ͺ ↓ [Code Review] πŸ‘€ + ↓history | grep tag + [Merge to dev] βœ… ↓ - [Merge to develop] βœ… - ↓ - develop (stable integration branch) + dev (stable integration branch) ↓ [Create Pull Request β†’ main] ↓ @@ -71,7 +71,7 @@ feature/awesome-feature ↓ [Merge to main] βœ… ↓ - [Tag release] 🏷️ v1.2.0 + [Tag release] 🏷️ 1.2.0 ``` --- @@ -80,9 +80,9 @@ feature/awesome-feature ### Starting a New Feature ```bash -# 1. Ensure you have the latest develop branch -git checkout develop -git pull origin develop +# 1. Ensure you have the latest dev branch +git checkout dev +git pull origin dev # 2. Create a new feature branch git checkout -b feature/my-awesome-feature @@ -99,16 +99,16 @@ git push origin feature/my-awesome-feature # 6. Open a Pull Request on GitHub # Source branch: feature/my-awesome-feature -# Target branch: develop +# Target branch: dev # # GitHub Actions will automatically run tests on your PR! βœ… ``` ### Release Process ```bash -# 1. Ensure develop branch is stable and ready for release -git checkout develop -git pull origin develop +# 1. Ensure dev branch is stable and ready for release +git checkout dev +git pull origin dev # 2. Create a release branch git checkout -b release/1.2.0 @@ -125,13 +125,13 @@ git push origin release/1.2.0 # 5. After PR approval and merge to main, tag the release git checkout main git pull origin main -git tag -a v1.2.0 -m "Release version 1.2.0" -git push origin v1.2.0 +git tag -a 1.2.0 -m "Release version 1.2.0" +git push origin 1.2.0 -# 6. Merge main back to develop to keep branches in sync -git checkout develop +# 6. Merge main back to dev to keep branches in sync +git checkout dev git merge main -git push origin develop +git push origin dev ``` ### Hotfix Process (Urgent Production Bug) @@ -150,16 +150,16 @@ git commit -m "fix: resolve critical security vulnerability" git push origin hotfix/critical-security-fix # Open PR on GitHub: hotfix/critical-security-fix β†’ main -# 4. After merge to main, also merge to develop to keep in sync -git checkout develop +# 4. After merge to main, also merge to dev to keep in sync +git checkout dev git merge main -git push origin develop +git push origin dev # 5. Tag the hotfix release git checkout main git pull origin main -git tag -a v1.2.1 -m "Hotfix version 1.2.1" -git push origin v1.2.1 +git tag -a 1.2.1 -m "Hotfix version 1.2.1" +git push origin 1.2.1 ``` --- @@ -173,11 +173,6 @@ git push origin v1.2.1 - **Composer:** 2.x - **PHP Extensions:** `redis`, `json`, `mbstring` -**PHP 8.5 Information:** -- Released: November 20, 2024 -- Current stable: 8.5.x -- New features: Pipe operator (`|>`), URI extension, performance improvements - ### Local Installation ```bash # 1. Clone the repository @@ -191,24 +186,7 @@ composer install docker run -d -p 6379:6379 redis:7.2-alpine # 4. Verify setup by running tests -composer test:integration -``` - -### Environment Variables - -Configure these environment variables for local testing: -```bash -# Redis host (default: 127.0.0.1) -export REDIS_HOST=localhost - -# Redis port (default: 6379) -export REDIS_PORT=6379 - -# Redis adapter: 'predis' or 'phpredis' -export REDIS_ADAPTER=phpredis - -# Enable persistent connection: 'true' or 'false' -export REDIS_PERSISTENT=false +composer test ``` --- @@ -216,26 +194,33 @@ export REDIS_PERSISTENT=false ## Running Tests ### Available Test Commands +Please check `composer.json` for more commands (verbose or test-only utilitary) ```bash +# Run the PSR-6 integration tests suite +composer test-psr6 + +# Run the PSR-16 integration tests suite +composer test-psr16 + # Run integration tests (requires Redis server running) -composer test:integration +composer pui + +# Run functionnal tests (requires Redis server running) +composer puf # Run unit tests (no Redis required) -composer test:unit +composer pu -# Run all tests +# Run the full tests suite composer test - -# Generate HTML coverage report (opens in browser) -composer test:coverage ``` ### Continuous Integration Tests run automatically on GitHub Actions for: -- βœ… Every push to `develop` branch -- βœ… Every Pull Request to `main` or `develop` -- βœ… PHP versions: 8.4.x and 8.5.x (latest patches) +- βœ… Every push to `dev` branch +- βœ… Every Pull Request to `main` or `dev` +- βœ… PHP versions: 8.2.x, 8.3.x, 8.4.x and 8.5.x (latest patches) - βœ… Redis version: 7.2 View test results and build status: [GitHub Actions](https://github.com/llegaz/RedisCache/actions) @@ -253,69 +238,32 @@ View test results and build status: [GitHub Actions](https://github.com/llegaz/R ### Quality Check Commands ```bash -# Check code style (dry run - doesn't modify files) -composer cs:check - # Automatically fix code style issues -composer cs:fix +composer cs # Run static analysis with PHPStan composer stan - -# Run all quality checks at once -composer quality ``` ### Commit Message Format -This project follows [Conventional Commits](https://www.conventionalcommits.org/) specification: +Ideally follwing those requirements but this not mandatory. **Format:** ``` -(): - -[optional body] - -[optional footer] +: ``` **Types:** -- `feat`: New feature +- `feature`: New feature - `fix`: Bug fix -- `docs`: Documentation changes +- `documentation`: Documentation changes - `test`: Test additions or modifications - `chore`: Maintenance tasks (dependencies, build, etc.) - `refactor`: Code refactoring without behavior changes -- `perf`: Performance improvements +- `performance`: Performance improvements - `style`: Code style changes (formatting, naming) -**Examples:** -```bash -# Feature addition -git commit -m "feat: add support for 8KB key length limit" - -# Bug fix -git commit -m "fix: handle whitespace correctly in cache keys" - -# Documentation -git commit -m "docs: add contributing guidelines and CI setup" - -# Performance improvement -git commit -m "perf: optimize serialization in storeToPool method" -``` - -**Bad examples (avoid these):** -```bash -# ❌ Too vague -git commit -m "updates" - -# ❌ Not descriptive -git commit -m "fixed stuff" - -# ❌ Work in progress (don't commit WIP to shared branches) -git commit -m "WIP" -``` - --- ## Pull Request Process @@ -329,7 +277,6 @@ Before submitting a Pull Request, ensure: - [ ] New tests added for new features or bug fixes - [ ] Code coverage maintained or improved - [ ] Documentation updated if API changes -- [ ] CHANGELOG.md updated for user-facing changes - [ ] Commits follow Conventional Commits format - [ ] `composer validate --strict` passes without errors - [ ] PHPStan analysis passes (`composer stan`) @@ -345,7 +292,7 @@ git push origin feature/my-feature - Navigate to: https://github.com/llegaz/RedisCache/pulls - Click "New Pull Request" - Select your branch as source -- Select `develop` as target (or `main` for hotfixes) +- Select `dev` as target (or `main` for hotfixes) - Fill in the Pull Request template **Step 3: Automated Checks** @@ -364,12 +311,6 @@ git push origin feature/my-feature - Merge strategy: usually squash and merge - Source branch will be automatically deleted after merge -### Review Timeline - -- **Initial review:** Within 2-3 business days -- **Follow-up reviews:** Within 1-2 business days after updates -- **Emergency hotfixes:** Within 24 hours - --- ## Pre-commit Hooks (Optional but Recommended) @@ -384,7 +325,7 @@ echo "πŸ” Running pre-commit quality checks..." # Check code style echo "β†’ Checking code style (PSR-12)..." -composer cs:check +composer cs if [ $? -ne 0 ]; then echo "❌ Code style check failed." echo " Run 'composer cs:fix' to automatically fix issues." @@ -481,7 +422,7 @@ Your contributions, whether code, documentation, bug reports, or feature ideas, 2. Open PR on GitHub 3. CI runs automatically 4. Address review feedback -5. Rebase again if develop changed +5. Rebase adequately if dev or main changed 6. Maintainer rebases and merges (no merge commits) ## Questions From 695b8c922581ee4a2d19032a90b9cf0331078c29 Mon Sep 17 00:00:00 2001 From: Laurent Legaz Date: Mon, 16 Feb 2026 13:43:06 +0100 Subject: [PATCH 3/4] wip on README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 90e0d2a..eed5a6a 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,8 @@ $cache = new LLegaz\Cache\RedisCache('localhost', 6379, null, 'tcp', 0, true); ## Contributing -We welcome contributions! This project follows **Git Flow** workflow. +We welcome contributions! This project follows **a [Git Flow with rebasing](https://gist.github.com/llegaz/16058d04895d02dd1857b260f2399c2c)** workflow. + ### Quick Start ```bash @@ -126,13 +127,11 @@ For complete guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md) which covers: composer install # Run tests -composer test:integration +composer test # Code quality -composer cs:check # Check style -composer cs:fix # Fix style +composer cs # Fix style composer stan # Static analysis -composer quality # Run all checks ``` ### CI/CD Status From 5114e2a5635843c57ebd2777e828e0db2815724b Mon Sep 17 00:00:00 2001 From: Laurent Legaz Date: Tue, 17 Feb 2026 11:40:28 +0100 Subject: [PATCH 4/4] CI updated to enable composer update gracefully --- .github/workflows/CI.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 600e3e3..5b47443 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,10 +19,6 @@ jobs: adapter: ['predis', 'phpredis'] services: - - - - redis: image: redis:7.2-alpine ports: @@ -61,7 +57,7 @@ jobs: # Step 4: Install project dependencies via Composer - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-interaction + run: composer install --prefer-dist --no-progress --no-interaction || composer update --prefer-dist --no-progress --no-interaction # Step 5: Validate composer.json and composer.lock structure - name: Validate composer files