Skip to content

Share publish validators and run Next.js validation before Azure image builds - #21822

Merged
David Pine (IEvangelist) merged 1 commit into
agent/js-dockerfile-validator-pipelinefrom
ievangelist-publish-validation-readiness
Nov 6, 2026
Merged

David Pine (IEvangelist) merged 1 commit into
agent/js-dockerfile-validator-pipelinefrom
ievangelist-publish-validation-readiness

Conversation

@IEvangelist

Copy link
Copy Markdown
Member

Description

Next.js deployments to Azure Container Apps and App Service now validate standalone output before building the image, rather than silently skipping the check when the deployment graph selects BuildCompute directly.

Stacked on #21461. Base: agent/js-dockerfile-validator-pipeline; merge #21461 first, then retarget this PR to main. This PR does not duplicate that PR's excluded-JavaScript-resource, Dockerfile annotation collision, or JavaScript image-build dependency fixes.

Fixes #21205 together with #21461. Part of #21115.

  • Link one internal PublishValidationExtensions helper into Go, Python and JavaScript. All existing-Dockerfile validators and the Next.js standalone check use it for application-pipeline registration, late excluded-resource checks, and resource-specific BuildCompute ordering.
  • Preserve the existing Go warning and Python/JavaScript failure behavior, step names, and manifest callbacks. Next.js retains its build-prerequisite dependency and build-only aggregate requirement; manifest-only publish does not newly require standalone validation.
  • Preserve DisableBuildValidation() and skip Next.js validation for resources excluded from publishing. No public API is added.
  • Exercise the real ACA and App Service preparation/configuration graphs locally. Both regression cases failed at the missing Next.js image-build dependency on the Align JavaScript Dockerfile run-script validator with Go and Python pipeline registration #21461 base, and pass here. These are graph tests, not Azure deployments, and do not provision resources.

User-facing usage

Existing AppHosts need no changes:

builder.AddNextJsApp("frontend", "./frontend");

When deploying to Azure Container Apps or App Service, the image build now waits for validation of the existing Next.js configuration:

export default { output: 'standalone' };

Applications with dynamically supplied configuration can continue to use .DisableBuildValidation().

Validation

All 22 focused tests passed. Exact commands:

dotnet test --project tests\Aspire.Hosting.JavaScript.Tests\Aspire.Hosting.JavaScript.Tests.csproj --no-launch-profile -- --filter-method '*.NextJs*' --filter-method '*.PublishPipeline*' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

Passed: 9 tests, including invalid/valid standalone configuration, suppression, exclusion, image-build ordering, and the inherited #21461 JavaScript regressions.

dotnet test --project tests\Aspire.Hosting.Go.Tests\Aspire.Hosting.Go.Tests.csproj --no-launch-profile -- --filter-method '*.PublishPipeline*' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

Passed: 7 tests.

dotnet test --project tests\Aspire.Hosting.Python.Tests\Aspire.Hosting.Python.Tests.csproj --no-launch-profile -- --filter-method '*.PublishPipeline*' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

Passed: 4 tests.

dotnet test --project tests\Aspire.Hosting.Azure.Tests\Aspire.Hosting.Azure.Tests.csproj --no-launch-profile -- --filter-class '*.JavaScriptPublishValidationTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

Passed: 2 tests. Before the fix, both failed because build-nextjs did not reach nextjs-standalone-check-nextjs.

git diff --check passed. Evaluated MSBuild Compile items include the linked helper once in each integration; existing project-reference edges cover the test consumers, so no test-trigger-map change is needed. Builds emitted the same pre-existing Dashboard ILCompiler NU1903 advisory observed on the base. Full suites and live Azure deployment were not run.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@IEvangelist
David Pine (IEvangelist) merged commit d104140 into agent/js-dockerfile-validator-pipeline Nov 6, 2026
6 checks passed
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