Skip to content

Website: use PowerForge pipeline --fast for -Serve#87

Merged
PrzemyslawKlys merged 1 commit intomasterfrom
codex/website-fast-serve
Feb 7, 2026
Merged

Website: use PowerForge pipeline --fast for -Serve#87
PrzemyslawKlys merged 1 commit intomasterfrom
codex/website-fast-serve

Conversation

@PrzemyslawKlys
Copy link
Member

Use PowerForge pipeline --fast by default when running Website\build.ps1 -Serve (can be disabled via -NoFast or overridden via -Fast). This keeps local dev iterations quick while CI/release can still run full optimize/audit.

Copilot AI review requested due to automatic review settings February 7, 2026 22:54
@claude
Copy link

claude bot commented Feb 7, 2026

Claude finished @PrzemyslawKlys's task —— View job


Code Review Analysis

Todo List:

  • Read and analyze Website/build.ps1 changes
  • Review code quality and best practices
  • Check for potential bugs or issues
  • Evaluate performance considerations
  • Assess security concerns
  • Review test coverage implications
  • Provide comprehensive feedback

Review Feedback

This PR introduces a sensible improvement to the website build script by enabling fast mode by default for local development. Here's my comprehensive analysis:

Code Quality & Best Practices

Strengths:

  • Clear parameter design: The three-parameter approach (-Fast, -NoFast, -Serve) provides excellent control granularity
  • Intuitive defaults: Auto-enabling fast mode for -Serve while preserving explicit control is well-designed
  • Comprehensive documentation: Updated help comments clearly explain the new behavior and parameter interactions
  • Consistent error handling: Maintains existing error handling patterns with $ErrorActionPreference = 'Stop'

Logic Implementation:

$UseFast = ($Fast -or ($Serve -and -not $NoFast))  # Line 115

This logic correctly implements the intended behavior:

  • -Fast always enables fast mode
  • -Serve enables fast mode unless -NoFast is specified
  • Without -Serve, fast mode is only enabled with explicit -Fast

🐛 Potential Issues

Minor Parameter Validation Gap:
The script doesn't validate conflicting parameters (-Fast with -NoFast). While PowerShell will accept both, the behavior may be unclear to users. Consider adding:

if ($Fast -and $NoFast) {
    Write-Warning "Both -Fast and -NoFast specified. -Fast takes precedence."
}

No Functional Bugs Detected: The core logic is sound and the parameter precedence is well-defined.

Performance Considerations

Positive Impact:

  • Faster local development: The --fast flag significantly improves iteration speed for developers
  • Smart defaults: Automatic fast mode for development while preserving full optimization for CI/production
  • No performance regression: Existing workflows without -Serve are unchanged

🔒 Security Assessment

No Security Concerns:

  • The --fast flag is a build optimization parameter, not a security control
  • No new attack vectors introduced
  • Existing executable resolution and validation logic remains unchanged
  • Maintains same error handling and validation patterns

🧪 Test Coverage Implications

Areas to Consider:

  • Parameter combination testing: Verify behavior with various flag combinations (-Serve -NoFast, -Fast -NoFast, etc.)
  • Build output validation: Ensure --fast mode still produces valid site output that passes Assert-SiteOutput
  • CI/CD impact: Confirm that CI/release builds (presumably not using -Serve) continue to run full optimization

Suggested Test Scenarios:

# Default behavior unchanged
./build.ps1                    # Should NOT use --fast

# New fast-by-default behavior
./build.ps1 -Serve            # Should use --fast
./build.ps1 -Serve -NoFast    # Should NOT use --fast

# Explicit control preserved
./build.ps1 -Fast             # Should use --fast
./build.ps1 -Serve -Fast      # Should use --fast (redundant but valid)

📋 Additional Recommendations

  1. Documentation: Consider updating any project README or development docs to mention the new fast-by-default behavior for local serving

  2. CI Verification: Ensure CI builds explicitly avoid -Serve or use -NoFast if they need full optimization/audit

  3. Performance Metrics: If available, consider documenting build time improvements from fast mode to help developers understand the benefit

🎯 Overall Assessment

This is a well-implemented enhancement that improves developer experience without breaking existing workflows. The parameter design is intuitive, the implementation is clean, and the default behavior change is conservative (only affects -Serve mode). No blocking issues identified.

Recommendation: Approve

The code quality is good, follows PowerShell best practices, and the feature will meaningfully improve local development iteration speed.

Copy link

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

Updates the website build script to default to PowerForge pipeline --fast during local -Serve runs, improving local iteration speed while keeping non-fast builds available.

Changes:

  • Adds -Fast and -NoFast switches to control PowerForge pipeline fast mode.
  • Enables fast mode by default when -Serve is used (unless -NoFast is specified).
  • Conditionally appends --fast to the PowerForge pipeline invocation.

@@ -103,16 +112,25 @@ function Assert-SiteOutput {
}

try {
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

-Fast and -NoFast can both be provided at the same time; with the current expression, -Fast always wins and -NoFast is ignored. Consider adding explicit parameter validation (or precedence rules) so the behavior is unambiguous (e.g., throw when both are set, and optionally warn/throw when -NoFast is used without -Serve).

Suggested change
try {
try {
if ($Fast -and $NoFast) {
throw "Invalid parameter combination: -Fast and -NoFast cannot be used together. Choose one."
}
if ($NoFast -and -not $Serve) {
Write-Warning "-NoFast has no effect when -Serve is not specified. Fast mode is only implied when serving."
}

Copilot uses AI. Check for mistakes.
Comment on lines +118 to +133
if ($UseFast) {
& $PowerForge @PowerForgeArgs pipeline --config pipeline.json --profile --fast
} else {
& $PowerForge @PowerForgeArgs pipeline --config pipeline.json --profile
}
if ($LASTEXITCODE -ne 0) { throw "Build failed (exit code $LASTEXITCODE)" }
Assert-SiteOutput -SiteRoot (Join-Path $PSScriptRoot '_site')
Write-Host "Starting dev server on http://localhost:$Port ..." -ForegroundColor Cyan
& $PowerForge @PowerForgeArgs serve --path _site --port $Port
} else {
Write-Host 'Building website...' -ForegroundColor Cyan
& $PowerForge @PowerForgeArgs pipeline --config pipeline.json --profile
if ($UseFast) {
& $PowerForge @PowerForgeArgs pipeline --config pipeline.json --profile --fast
} else {
& $PowerForge @PowerForgeArgs pipeline --config pipeline.json --profile
}
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The pipeline invocation logic is duplicated in both the -Serve and non-serve branches (including the if ($UseFast) block). Consider building a single argument list once (adding --fast conditionally) and calling powerforge once before branching into serve vs. "build complete" output; this reduces duplication and the risk of the branches drifting.

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +15
.PARAMETER Fast
Run the pipeline with `--fast` (recommended for local iteration).
When `-Serve` is used, fast mode is enabled by default unless `-NoFast` is set.

.PARAMETER NoFast
Disable fast mode when `-Serve` is used.

Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The comment-based help documents the new -Fast/-NoFast switches here, but the .EXAMPLE section below doesn’t include any usage showing how to disable fast mode for -Serve or how to force fast mode without -Serve. Consider adding one or two examples so the new behavior is easier to discover via Get-Help.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2026

@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.76%. Comparing base (43eee10) to head (cd487a6).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   59.74%   59.76%   +0.01%     
==========================================
  Files         448      448              
  Lines       57814    57814              
  Branches    16563    16563              
==========================================
+ Hits        34540    34551      +11     
+ Misses      17567    17564       -3     
+ Partials     5707     5699       -8     

☔ View full report in Codecov by Sentry.
📢 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.

@PrzemyslawKlys PrzemyslawKlys merged commit 85825e0 into master Feb 7, 2026
17 checks passed
@PrzemyslawKlys PrzemyslawKlys deleted the codex/website-fast-serve branch February 7, 2026 23:15
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.

2 participants