Skip to content

fix: fix storefront asset validation conditions - #1379

Open
Anne (Ant1gua) wants to merge 1 commit into
nextfrom
fix/storefront-asset-validation-messages
Open

fix: fix storefront asset validation conditions#1379
Anne (Ant1gua) wants to merge 1 commit into
nextfrom
fix/storefront-asset-validation-messages

Conversation

@Ant1gua

Copy link
Copy Markdown
Contributor

What changed?

  • Fixed inverted storefront asset validation conditions.
  • Added tests covering all build/source combinations.
  • No TUI or CLI output changes.

Why?

Storefront validation reported incorrect identifiers and messages when build files or source entrypoints were missing.

How was this tested?

  • go test ./internal/extension passes.
  • go test ./... passes except the unrelated DNS container integration test, which failed because the DNS container refused the connection.
  • git diff --check passes.

Related issue or discussion

#1339

@coderabbitai

This comment was marked as spam.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the storefront asset validation in internal/extension so the correct identifier/message is reported when either build output (dist/) or source entrypoints are missing, and adds regression tests for the storefront combinations.

Changes:

  • Corrected inverted storefront dist/ vs. entrypoint presence conditions in validateAssetByResourceDir.
  • Added a table-driven test covering all four storefront build/source presence combinations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/extension/validator_assets.go Fixes storefront validation branching so identifiers/messages match the actual missing condition.
internal/extension/validator_assets_test.go Adds regression tests for storefront asset validation across build/source combinations.
Suppressed comments (1)

internal/extension/validator_assets.go:54

  • The storefront checks rely on comparing the os.Stat error value (foundStorefrontDistFiles) to nil, which is easy to misread and is what led to the previous inverted conditions. Consider introducing a boolean (e.g., storefrontDistExists) and using it in both storefront branches to make the intent explicit and reduce regression risk.
	if foundStorefrontDistFiles == nil && !foundStorefrontEntrypoint {
		check.AddResult(validation.CheckResult{
			Path:       resourceDir,
			Identifier: "assets.storefront.sources_missing",
			Message:    fmt.Sprintf("Found storefront build files in %s but no source files to rebuild the assets.", resourceDir),

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Ant1gua
Anne (Ant1gua) requested a review from a team August 14, 2026 15:22
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.

extension validate: storefront asset checks report swapped identifiers and messages

2 participants