Skip to content

Add Deployment Precheck feature with documentation#357

Merged
Wiesenwischer merged 8 commits intomainfrom
feature/product-precheck
Apr 2, 2026
Merged

Add Deployment Precheck feature with documentation#357
Wiesenwischer merged 8 commits intomainfrom
feature/product-precheck

Conversation

@Wiesenwischer
Copy link
Copy Markdown
Owner

Summary

  • Domain model: PrecheckResult, PrecheckItem, PrecheckSeverity, ProductPrecheckResult value objects
  • 6 precheck rules: Variable Validation, Existing Deployment, Image Availability, Port Conflicts, Network Availability, Volume Status — all executed in parallel with 30s timeout
  • API endpoints: POST /api/.../precheck for single stacks and products, plus dryRun support on /api/hooks/deploy
  • Frontend: PrecheckPanel and ProductPrecheckPanel components, usePrecheck / useProductPrecheck hooks, standalone precheck pages, auto-run on deploy page with Re-Check button
  • Documentation: Step-by-step guides (DE + EN) with 6 E2E-captured screenshots, landing page highlight tile with NEW badge
  • Tests: Domain unit tests, application handler tests, infrastructure rule tests (including port conflict variable substitution), integration tests, and 6 E2E tests

Test plan

  • All unit tests pass (dotnet test)
  • E2E tests pass (6/6 green against Docker container)
  • PublicWeb builds successfully (npm run build)
  • Screenshots captured and referenced in documentation

Pre-flight checks before deployment to verify infrastructure readiness
before the point of no return (container removal).

Domain: PrecheckResult, PrecheckItem, PrecheckSeverity value objects
Rules: 6 precheck rules (ImageAvailability, PortConflict, VariableValidation,
  NetworkAvailability, VolumeStatus, ExistingDeployment)
API: POST /api/environments/{envId}/stacks/{stackId}/precheck endpoint
Hooks: Automatic precheck before hook deploys, dryRun parameter, 422 on errors
UI: PrecheckPanel component, auto-run on deploy flow entry, Re-Check button,
  deploy button disabled when precheck has errors
Tests: 53 unit tests covering all rules, result aggregation, and edge cases
- Add E2E test suite (6 tests) covering precheck panel, severity icons,
  re-check button, deploy button state, loading state, and custom deploy
- Capture 6 screenshots for step-by-step documentation
- Add German and English docs pages under deployments/deployment-precheck
- Update docs index pages with precheck links
- Add Deployment Precheck as highlighted feature on landing page with
  NEW badge, translations (DE/EN), and shield-check icon
Extend PLAN-deployment-precheck.md with product precheck support:
- Feature 8: Backend endpoint + MediatR handler for product precheck
- Feature 9: UI integration with useProductPrecheck hook + DeployProduct.tsx
- Feature 10: Unit, integration, and E2E tests for product precheck
Extend deployment precheck to support product deployments with multiple
stacks. The backend orchestrates per-stack prechecks in parallel via
MediatR and aggregates results. The UI auto-runs precheck on the
DeployProduct page and blocks deployment when any stack has errors.

Backend:
- ProductPrecheckResult domain value object with stack-level aggregation
- RunProductPrecheckQuery handler: loads product, merges variables,
  dispatches RunDeploymentPrecheckQuery per stack in parallel
- POST /api/environments/{envId}/product-deployments/precheck endpoint

Frontend:
- runProductPrecheck() API client in @rsgo/core
- useProductPrecheck hook for product precheck state management
- ProductPrecheckPanel component with per-stack accordion view
- DeployProduct.tsx: hybrid trigger (auto-run + re-check), deploy
  button disabled on errors

Tests:
- 7 unit tests for ProductPrecheckResult aggregation
- 10 unit tests for RunProductPrecheckHandler (variable merging,
  parallel execution, error handling, edge cases)
- 3 integration tests for ProductPrecheckEndpoint
Bug fix: All precheck rules (PortConflict, ImageAvailability,
VolumeStatus, NetworkAvailability) now resolve ${VARIABLE} placeholders
in port mappings, image names, volume sources, and network names before
validation. Previously, unresolved placeholders like ${FRONTEND_PORT}
silently failed int.TryParse and port conflicts were never detected.

UX redesign: Precheck no longer auto-runs on the deploy page. Instead,
a "Run Precheck" button in the sidebar navigates to a dedicated precheck
results page (/deploy/:stackId/precheck, /deploy-product/:productId/precheck).
Deploy button is always enabled — precheck is advisory, not blocking.
@github-actions github-actions bot added documentation Improvements or additions to documentation feature New feature or enhancement labels Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🚀 Cloudflare Pages Preview

Preview deployment ready!

URL: https://1a1b45cd.readystackgo.pages.dev

Update E2E tests and screenshots to reflect the new precheck workflow:
- Run Precheck button in sidebar instead of auto-run
- Dedicated precheck results page instead of inline panel
- Deploy button always enabled (precheck is advisory)

New screenshots: run-button, results page, recheck, deploy-enabled.
Remove old screenshots from the auto-run inline flow.
Update DE + EN documentation with new step-by-step guide.
ImageAvailabilityRule now uses IRegistryCredentialProvider to look up
configured credentials before checking registry access. Previously it
only performed anonymous checks, causing false "auth required" errors
for private registries with valid credentials configured.
@Wiesenwischer Wiesenwischer merged commit 3b98ddc into main Apr 2, 2026
3 checks passed
@Wiesenwischer Wiesenwischer deleted the feature/product-precheck branch April 2, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant