Skip to content

release: v3.0.0 stable preparation#400

Merged
usernane merged 15 commits into
mainfrom
dev
Jun 14, 2026
Merged

release: v3.0.0 stable preparation#400
usernane merged 15 commits into
mainfrom
dev

Conversation

@usernane

Copy link
Copy Markdown
Member

Summary

Prepare framework for v3.0.0 stable release. Includes dependency updates, bug fixes, new features, and test improvements.

Motivation

Ship a stable, production-ready v3.0.0 release with all critical bugs fixed and key features implemented.

Changes

Dependencies

  • webfiori/http: v5.0.* → v6.0.*
  • webfiori/file: v2.0.* → v2.1.*
  • webfiori/jsonx: v4.0.* → v5.0.*
  • webfiori/cli: v2.1.* → v2.2.*
  • webfiori/mailer: v2.1.* → v2.2.*

Bug Fixes

Features

CLI Commands Added

  • migrations:step — interactively apply or skip migrations one at a time
  • services:list — list all auto-discovered API services
  • routes:cache — build route cache for production
  • routes:clear — clear route cache

Testing

  • Added tests for StartSessionMiddleware, CacheMiddleware
  • All 994+ tests passing on PHP 8.1–8.5

How to Test / Verify

vendor/bin/phpunit --configuration tests/phpunit10.xml

Breaking Changes and Migration Steps

None. All changes are backward compatible.

Checklist

  • I reviewed my own diff before requesting review
  • My commits follow Conventional Commits
  • I added/updated tests (or explained why not)
  • I updated docs (if needed) Docs Repo
  • I ran lint/cs-fixer (if applicable)
  • I considered backward compatibility
  • I considered security

Related issues

Closes #337
Closes #380
Closes #381
Closes #387
Closes #388
Closes #389
Closes #391
Closes #392

Ibrahim BinAlshikh and others added 14 commits June 14, 2026 10:55
Adapter that implements SessionStorage using the cache library's
Storage interface. Supports any cache backend (Redis, file, etc.).

- Configurable key prefix for namespace isolation
- Configurable TTL (default: 7200s)
- Cache-level encryption disabled (sessions have their own)
- 100% test coverage (11 tests, 18/18 lines)

Closes #337
feat(session): add CacheSessionStorage driver
When a middleware declares dependencies via getDependencies(), assigning
only that middleware to a route now auto-includes all transitive
dependencies from MiddlewareRegistry via BFS traversal.

- resolveDependencies() walks the dependency graph before sorting
- Missing dependencies are silently skipped
- No duplicates when dependency is already assigned
- Execution order preserved via existing topological sort

Closes #380
feat(middleware): auto-resolve transitive dependencies
When the internal userRoles map is empty for a user, can() now
checks if the user object has a getRoles() method and uses those
roles. Internal map still takes precedence when populated.

Closes #381
feat(access): can() fallback to SecurityPrincipal getRoles()
Scans a namespace for routable classes and registers API routes:
- #[RestController] attributed classes (uses attribute name or derived)
- WebService subclasses without attribute (uses getName())
- WebServicesManager subclasses (registered as manager routes)
- Non-service classes are skipped

Includes DI container integration for service instantiation.

Closes #382
Closes #384
- ServiceRouter::dynamic() registers catch-all route for namespace
- ServiceRouter::handle() resolves controller at request time, 404 if not found
- RouteOption::NS constant for namespace-based routing
- ServicesListCommand lists all discovered services with name, class, type, path

Closes #383
Closes #385
- discover() accepts recursive flag for subdirectory scanning
- Subdirectory names become kebab-cased URL path segments
- Class names converted to kebab-case via CaseConverter
- #[RestController] name with '/' is rejected (skipped)
- Explicit attribute name is always flat (ignores directory nesting)
- Non-recursive remains the default
- RouteCache class: build/load/clear cached service discovery results
- Uses app's existing cache backend (file, Redis, etc.)
- routes:cache CLI command to build cache
- routes:clear CLI command to clear cache
- Enabled via ROUTE_CACHE_ENABLED env variable
- 100% test coverage (12 tests, 35/35 lines)

Closes #386
feat: ServiceRouter — auto-discovery, dynamic routing, and caching
@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.91549% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.72%. Comparing base (b982bd6) to head (22c9c0c).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
WebFiori/Framework/Router/ServiceRouter.php 76.00% 30 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #400      +/-   ##
============================================
+ Coverage     83.67%   83.72%   +0.04%     
- Complexity     3067     3132      +65     
============================================
  Files           103      106       +3     
  Lines          9018     9230     +212     
============================================
+ Hits           7546     7728     +182     
- Misses         1472     1502      +30     
Flag Coverage Δ
php-8.1 82.63% <100.00%> (+0.03%) ⬆️
php-8.2 82.63% <100.00%> (+0.03%) ⬆️
php-8.3 91.90% <85.91%> (-0.18%) ⬇️
php-8.4 91.90% <85.91%> (-0.18%) ⬇️
php-8.5 91.78% <85.91%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@usernane usernane merged commit 9ae069c into main Jun 14, 2026
16 checks passed
This was referenced Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment