Skip to content

test(buildgen): add incremental output equivalence#798

Merged
cssbruno merged 1 commit into
mainfrom
agent/incremental-build-equivalence
Jul 7, 2026
Merged

test(buildgen): add incremental output equivalence#798
cssbruno merged 1 commit into
mainfrom
agent/incremental-build-equivalence

Conversation

@cssbruno

@cssbruno cssbruno commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • adds a reusable buildgen equivalence harness that compares incremental SPA output to a clean build of the same final source state
  • compares served output plus sibling compiler report output, exact bytes, file modes, manifests, and a narrow canonical projection of build-report artifact events
  • removes stale generated asset files that are no longer present in the current asset manifest during incremental publication
  • documents the [Testing] Add incremental-versus-clean build equivalence testing #686 invariant, current normalization rule, first deterministic scenario, and remaining follow-up coverage

Validation

  • go test ./internal/buildgen -run 'TestIncrementalBuildMatchesCleanBuildEquivalence|TestBuildIncremental' -count=1
  • go test ./internal/buildgen -count=1
  • go build ./cmd/gowdk
  • scripts/check-docs-style.sh (passes; existing long-paragraph warnings reported)
  • scripts/check-docs-links.sh
  • go test ./... (fails in internal/gowdkcmd: TestReleaseTrustWorkflowCoverage expects missing .github/workflows/release-smoke.yml; .github/workflows/cache-maintenance.yml is also absent in this checkout)

Issue

Refs #686

@cssbruno cssbruno marked this pull request as ready for review July 7, 2026 23:08
@cssbruno cssbruno merged commit 59ee022 into main Jul 7, 2026
28 of 30 checks passed
@cssbruno cssbruno deleted the agent/incremental-build-equivalence branch July 7, 2026 23:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 895450980e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

result.RobotsPath = robotsPath
reporter.info("seo", "robots_written", "robots.txt written", BuildEvent{Path: eventPath(outputDir, robotsPath)})
}
if err := removeStaleAssetManifestFiles(outputDir, previousAssets, result.CSSArtifacts, result.AssetArtifacts); err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve assets still referenced by unchanged pages

In BuildIncrementalFromValidatedProgram, only pages listed in changedPageSources are re-rendered, but this cleanup removes every previous manifest asset that is not in the current asset set. When a global CSS processor asset such as Tailwind's app stylesheet changes during a single-page incremental rebuild, unchanged pages keep their old hashed stylesheet link while this deletes that old file, turning those pages' CSS URL into a 404; either force all pages that include changed global assets to render or delay deleting stale assets until no unchanged HTML can reference them.

Useful? React with 👍 / 👎.

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