Skip to content

Feature/less is more #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Jul 21, 2025
Merged

Feature/less is more #14

merged 27 commits into from
Jul 21, 2025

Conversation

CAFernandes
Copy link
Member

Pull Request Template

📋 Descrição

Descreva resumidamente as mudanças feitas neste PR.

🎯 Tipo de Mudança

  • 🐛 Bug fix (mudança que corrige um bug)
  • ✨ Nova feature (mudança que adiciona funcionalidade)
  • 💥 Breaking change (mudança que causa incompatibilidade)
  • 📚 Documentação (mudanças apenas na documentação)
  • 🧹 Refactoring (mudanças que não corrigem bug nem adicionam feature)
  • ⚡ Performance (mudanças que melhoram a performance)
  • 🧪 Testes (adição ou correção de testes)

🧪 Como foi testado?

Descreva os testes que você executou para verificar suas mudanças.

  • Testes unitários passando
  • Testes funcionais passando
  • Testado manualmente
  • Exemplos funcionando

…rformance mode tests

- Created `CsrfMiddlewareTest` to validate CSRF protection, token generation, and middleware functionality.
- Implemented `XssMiddlewareTest` to ensure XSS protection and data sanitization.
- Added `SimplePerformanceModeTest` to verify the functionality of the SimplePerformanceMode class, including profile switching and status consistency.
- Each test follows the "less is more" principle, focusing on essential functionality and edge cases.
…rigir asserções nos testes de execução de middleware
- Removed the DistributedPoolManager mock test due to the removal of the enterprise distributed system.
- Added a new test suite for SimpleMemoryManager with various memory management tests.
- Cleaned up whitespace in CorsMiddleware tests for consistency.
- Updated CSRF middleware tests to ensure session management and token generation are functioning correctly.
- Enhanced XSS middleware tests to cover various attack vectors and ensure sanitization.
- Introduced SimpleLoadShedder and SimpleTrafficClassifier tests to validate their functionality and performance.
- Adjusted performance test thresholds for route registration to accommodate slower environments.
- Implement basic tests for Service Providers including Container, Event, Logging, Hook, and Extension.
- Create tests for RouteCollection to validate adding, finding, and removing routes.
- Add tests for RouteMemoryManager to ensure tracking and memory management functionalities.
- Introduce tests for Route to verify creation, matching, and parameter extraction.
- Develop Router tests to cover various HTTP methods and route groups.
- Implement StaticFileManager tests for file handling, path registration, and security checks.
- Removed deprecated ExtensionManager, OpenApiExporter, and SerializationCache from Legacy namespace.
- Introduced new simplified ExtensionManager, OpenApiExporter, and SerializationCache in the Utils namespace.
- Updated ApiDocumentationMiddleware to improve code formatting and readability.
- Adjusted aliases to reflect the new structure and maintain backward compatibility.
- Ensured that deprecated classes are marked as such and suggested alternatives.
…todos de estatísticas

feat(JsonBufferPool): melhorar tratamento de erros na codificação JSON e ajustar limites de pooling
fix(ApiDocumentationMiddleware): corrigir verificação de instância da aplicação e melhorar manipulação de resposta
refactor(MiddlewareStack): otimizar cache de serialização no benchmark de middleware
feat(ExtensionManager): adicionar gerenciamento de estados e estatísticas de extensões
fix(ExtensionServiceProvider): corrigir chamada de configuração ao carregar extensões
feat(OpenApiExporter): renomear métodos para melhor clareza e adicionar suporte a exportação estática
feat(SerializationCache): implementar cache de tamanho e estatísticas de uso
fix(DynamicPoolManagerTest): ajustar reset de estatísticas para instância do gerenciador
…cas de uso de memória

feat(LoadShedder): adicionar constantes de estratégia para compatibilidade
feat(OpenApiExporter): inicializar array de tags e coletar tags globais
fix(aliases): adicionar alias para PerformanceMonitor no namespace Legacy
refactor(HighPerformanceMode): alterar tipo de parâmetro de callable para mixed em schedulePeriodicTask
│                                                                                                                                             │
│   - Fix PHPStan Level 9 errors (0 errors achieved)                                                                                          │
│   - Fix PSR-12 compliance issues (critical errors resolved)                                                                                 │
│   - Create FRAMEWORK_OVERVIEW_v1.2.0.md documentation                                                                                       │
│   - Implement 'Simplicidade sobre Otimização Prematura' principle                                                                           │
│   - Fix ExtensionManager, SerializationCache, PoolManager implementations                                                                   │
│   - Update OpenApiExporter with proper type casting                                                                                         │
│   - Fix PerformanceMonitor with simplified constructor                                                                                      │
│   - All validation scripts now pass with 100% success rate
…d performance mode

- Updated version number to 1.2.0 in Application class.
- Refactored performance mode from HighPerformanceMode to simplified PerformanceMode.
- Enhanced documentation across API reference, quick start guide, and release notes to reflect new features and changes.
- Updated example scripts to demonstrate new features and maintain backward compatibility.
- Improved performance monitoring metrics and tests to ensure accuracy and reliability.
- Added important notes regarding project maintenance and suitability for production use.
@Copilot Copilot AI review requested due to automatic review settings July 21, 2025 16:04
@CAFernandes CAFernandes self-assigned this Jul 21, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This is a major architectural simplification PR that implements the "less is more" principle by removing complex distributed features and focusing on core microframework functionality. The changes represent a shift from v1.1.3-dev to v1.2.0 with significant reduction in complexity while maintaining essential features.

  • Removed distributed pool management system and complex coordination infrastructure
  • Simplified serialization cache and OpenAPI exporter to focus on core functionality
  • Updated extension manager to use simple callable-based approach instead of complex auto-discovery
  • Replaced comprehensive DynamicPool tests with focused, essential HTTP functionality tests

Reviewed Changes

Copilot reviewed 79 out of 117 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/Http/Pool/DynamicPoolTest.php Removed complex pool testing (446 lines deleted)
tests/Http/HeaderRequestTest.php Added simple header request testing
tests/Http/Factory/README.md Added comprehensive factory test documentation
tests/Http/Factory/OptimizedHttpFactoryTest.php Added focused factory testing (681 lines)
tests/Http/Factory/OptimizedHttpFactoryIntegrationTest.php Added factory integration tests (379 lines)
tests/Http/Adapters/ResponseEmitterTest.php Added response emitter testing (399 lines)
tests/Http/Adapters/GlobalsToServerRequestAdapterTest.php Added adapter testing (540 lines)
tests/Core/ApplicationTest.php Updated version and middleware aliases
tests/Cache/FileCacheTest.php Enhanced TTL handling with clock sync issues
src/aliases.php Added extensive legacy aliases for backward compatibility
src/Utils/SerializationCache.php Simplified from complex caching to basic functionality
src/Utils/OpenApiExporter.php Streamlined OpenAPI generation removing complexity
src/Providers/ExtensionServiceProvider.php Fixed method call with empty array parameter
src/Providers/ExtensionManager.php Simplified from auto-discovery to callable-based extensions
src/Pool/Distributed/DistributedPoolManager.php Removed entire distributed pool system (664 lines)
src/Pool/Distributed/Coordinators/Stubs/RedisCoordinator.php.example Removed Redis coordinator example (481 lines)
src/Pool/Distributed/Coordinators/README.md Removed distributed coordinator documentation
src/Pool/Distributed/Coordinators/NoOpCoordinator.php Removed no-op coordinator (151 lines)
src/Pool/Distributed/Coordinators/CoordinatorInterface.php Removed coordinator interface (81 lines)
Comments suppressed due to low confidence (2)

tests/Http/HeaderRequestTest.php:28

  • This assertion will always be true (A || !A), making it a useless test. Consider testing actual header functionality or remove this test case.
        $this->assertTrue($headerRequest->hasHeader('accept') || !$headerRequest->hasHeader('accept'));

tests/Http/HeaderRequestTest.php:29

  • This test assumes that 'Missing-Header' doesn't exist, but without knowing the actual implementation or setup, this could lead to flaky tests. Consider using a guaranteed non-existent header or mock the header collection.
        $this->assertFalse($headerRequest->hasHeader('Missing-Header'));

Copy link

🚀 Release Readiness Report - PivotPHP Core v1.2.0

✅ All Checks Passed!

  • Version: 1.2.0
  • PHPStan: Level 9, 0 errors
  • Tests: All tests passing
  • Code Style: PSR-12 compliant
  • PHP Compatibility: 8.1 - 8.4
  • Dependencies: All valid
  • Scripts: Consolidated and optimized

📦 Ready for Publication

The project is ready to be tagged and released!

Next Steps:

  1. Create a new tag: git tag -a v1.2.0 -m 'Release v1.2.0'
  2. Push the tag: git push origin v1.2.0
  3. The release workflow will automatically create a GitHub release
  4. Packagist will be automatically updated

Copy link

🚀 Release Readiness Report - PivotPHP Core v1.2.0

✅ All Checks Passed!

  • Version: 1.2.0
  • PHPStan: Level 9, 0 errors
  • Tests: All tests passing
  • Code Style: PSR-12 compliant
  • PHP Compatibility: 8.1 - 8.4
  • Dependencies: All valid
  • Scripts: Consolidated and optimized

📦 Ready for Publication

The project is ready to be tagged and released!

Next Steps:

  1. Create a new tag: git tag -a v1.2.0 -m 'Release v1.2.0'
  2. Push the tag: git push origin v1.2.0
  3. The release workflow will automatically create a GitHub release
  4. Packagist will be automatically updated

2 similar comments
Copy link

🚀 Release Readiness Report - PivotPHP Core v1.2.0

✅ All Checks Passed!

  • Version: 1.2.0
  • PHPStan: Level 9, 0 errors
  • Tests: All tests passing
  • Code Style: PSR-12 compliant
  • PHP Compatibility: 8.1 - 8.4
  • Dependencies: All valid
  • Scripts: Consolidated and optimized

📦 Ready for Publication

The project is ready to be tagged and released!

Next Steps:

  1. Create a new tag: git tag -a v1.2.0 -m 'Release v1.2.0'
  2. Push the tag: git push origin v1.2.0
  3. The release workflow will automatically create a GitHub release
  4. Packagist will be automatically updated

Copy link

🚀 Release Readiness Report - PivotPHP Core v1.2.0

✅ All Checks Passed!

  • Version: 1.2.0
  • PHPStan: Level 9, 0 errors
  • Tests: All tests passing
  • Code Style: PSR-12 compliant
  • PHP Compatibility: 8.1 - 8.4
  • Dependencies: All valid
  • Scripts: Consolidated and optimized

📦 Ready for Publication

The project is ready to be tagged and released!

Next Steps:

  1. Create a new tag: git tag -a v1.2.0 -m 'Release v1.2.0'
  2. Push the tag: git push origin v1.2.0
  3. The release workflow will automatically create a GitHub release
  4. Packagist will be automatically updated

Copy link

🚀 Release Readiness Report - PivotPHP Core v1.2.0

✅ All Checks Passed!

  • Version: 1.2.0
  • PHPStan: Level 9, 0 errors
  • Tests: All tests passing
  • Code Style: PSR-12 compliant
  • PHP Compatibility: 8.1 - 8.4
  • Dependencies: All valid
  • Scripts: Consolidated and optimized

📦 Ready for Publication

The project is ready to be tagged and released!

Next Steps:

  1. Create a new tag: git tag -a v1.2.0 -m 'Release v1.2.0'
  2. Push the tag: git push origin v1.2.0
  3. The release workflow will automatically create a GitHub release
  4. Packagist will be automatically updated

Copy link

🚀 Release Readiness Report - PivotPHP Core v1.2.0

✅ All Checks Passed!

  • Version: 1.2.0
  • PHPStan: Level 9, 0 errors
  • Tests: All tests passing
  • Code Style: PSR-12 compliant
  • PHP Compatibility: 8.1 - 8.4
  • Dependencies: All valid
  • Scripts: Consolidated and optimized

📦 Ready for Publication

The project is ready to be tagged and released!

Next Steps:

  1. Create a new tag: git tag -a v1.2.0 -m 'Release v1.2.0'
  2. Push the tag: git push origin v1.2.0
  3. The release workflow will automatically create a GitHub release
  4. Packagist will be automatically updated

Copy link

🚀 Release Readiness Report - PivotPHP Core v1.2.0

✅ All Checks Passed!

  • Version: 1.2.0
  • PHPStan: Level 9, 0 errors
  • Tests: All tests passing
  • Code Style: PSR-12 compliant
  • PHP Compatibility: 8.1 - 8.4
  • Dependencies: All valid
  • Scripts: Consolidated and optimized

📦 Ready for Publication

The project is ready to be tagged and released!

Next Steps:

  1. Create a new tag: git tag -a v1.2.0 -m 'Release v1.2.0'
  2. Push the tag: git push origin v1.2.0
  3. The release workflow will automatically create a GitHub release
  4. Packagist will be automatically updated

@CAFernandes CAFernandes merged commit 8c27d7a into main Jul 21, 2025
8 of 9 checks passed
@CAFernandes CAFernandes deleted the feature/less-is-more branch July 21, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant