Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
🤖 Code Review · #projects-dev-ai for questions ✅ Complete - No issues 📋 History✅ No issues → ✅ No issues |
Coverage report
Test suite run success3822 tests passing in 1464 suites. Report generated by 🧪jest coverage report action from 9097f3f |
aee3a10 to
ed08e49
Compare
f84e801 to
9cac1cf
Compare
ed08e49 to
d53fb62
Compare
fdbbe21 to
eaa13bc
Compare
1939c93 to
284ce31
Compare
284ce31 to
d219d72
Compare
eaa13bc to
bec1a97
Compare
d219d72 to
d0e302e
Compare
bec1a97 to
8a98157
Compare
dmerand
left a comment
There was a problem hiding this comment.
AI pair review found a few assertion weaknesses that are addressable.
Review assisted by pair-review
| [app_proxy] | ||
| url = "https://example.com/proxy" | ||
| subpath = "test" | ||
| prefix = "not-a-valid-prefix" |
There was a problem hiding this comment.
invalid-prefix.toml reads like a local config-validation case, but the CLI does not currently validate app_proxy.prefix beyond “must be a string” packages/app/src/cli/models/extensions/specifications/app_config_app_proxy.ts:12-21. The deploy path forwards the prefix unchanged into the remote app proxy config packages/app/src/cli/models/extensions/specifications/app_config_app_proxy.ts:30-45, and manifest tests show arbitrary prefix strings are preserved packages/app/src/cli/models/app/app.test.ts:890-900. So if this fixture fails, it is likely exercising downstream/server-side validation rather than the CLI rejecting an invalid TOML value. Useful integration coverage maybe. But the current naming and grouping imply stronger client-side validation coverage than the test actually provides.
| application_url = "https://example.com" | ||
| embedded = true | ||
|
|
||
| [completely_made_up_section] |
There was a problem hiding this comment.
unknown-section.toml does not look invalid in the code path app deploy actually uses. Linked apps are loaded with getAppVersionedSchema(specifications), which defaults to .passthrough(), so unknown top-level sections are accepted instead of rejected packages/app/src/cli/models/app/app.ts:172-183, packages/app/src/cli/models/app/loader.ts:999-1018. Then deploy sends a generated app manifest rather than the raw TOML packages/app/src/cli/models/app/app.ts:448-470, packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts:748-756, so completely_made_up_section may never be validated server-side either. That makes this fixture a likely false-negative/false-positive case: it may not fail for the reason the test name implies, and could even succeed.
There was a problem hiding this comment.
💡 Improvement: The test suite includes 5 invalid TOML cases but is missing several categories of validation issues that exist in the actual codebase. Additional valuable test cases could include: URL validation failures (invalid URLs in app_proxy.url, auth.redirect_urls), webhook API version validation, array vs string type mismatches, invalid enum values (e.g., access.admin.direct_api_mode accepts only 'online'/'offline'), and field length validations. More comprehensive coverage would provide stronger regression protection.
Suggestion: Consider adding test files for additional validation scenarios:
invalid-url.toml- malformed URL in application_url or redirect_urlsinvalid-api-version.toml- invalid webhooks.api_versioninvalid-direct-api-mode.toml- access.admin.direct_api_mode = "invalid"wrong-array-type.toml- auth.redirect_urls as string instead of array
These would provide more comprehensive coverage of the validation rules implemented in the codebase.
| }) | ||
| const output = result.stdout + result.stderr | ||
| console.log(`[${label}] exit code: ${result.exitCode}\n[${label}] output:\n${output}`) | ||
| expect(result.exitCode, `expected deploy to fail for ${label}, but it succeeded:\n${output}`).not.toBe(0) |
There was a problem hiding this comment.
💡 Improvement: The PR description states the CLI should 'reject invalid configurations with clear errors', but the test only validates that the command fails (non-zero exit code) without verifying that error messages are actually clear and helpful. The test captures output for diagnostics but doesn't assert anything about error message content or quality. The CLI could return unhelpful errors like 'Unknown error' and the test would still pass.
Suggestion: Add assertions to verify that error messages are present and meaningful:
expect(result.exitCode, `expected deploy to fail for ${label}, but it succeeded:\n${output}`).not.toBe(0)
expect(output.toLowerCase()).toMatch(/error|invalid|failed/)
expect(output).toContain('shopify.app.toml')Or create specific assertions for each invalid case (e.g., verify 'bad-syntax' mentions syntax errors, 'invalid-webhook' mentions missing uri).
Remove invalid-prefix.toml and unknown-section.toml fixtures that don't actually test client-side validation (prefix isn't validated, unknown sections pass through via .passthrough()). Add error message assertion to invalid TOML tests, bump dev test timeout to 6 min, and make quit-key assertion more specific. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d0e302e to
989e5ea
Compare
8a98157 to
a1095cb
Compare
The shortcut hint is rendered via terminal control sequences that don't reliably appear in PTY-captured output. The test already validates startup via waitForOutput and quit via sendKey + exit code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@dmerand i did an initial pass at narrowing, but overall i think this is something we'll want to iterate on a bit and the value for shipping this is high enough as-is. wdyt? |

WHY are these changes introduced?
We want to catch regressions in
shopify.app.tomlparsing and validation. The CLI should accept all documented config options and reject invalid configurations with clear errors.WHAT is this pull request doing?
Static test data in
data/:data/valid-app/shopify.app.toml— comprehensive toml with all documented sections (access_scopes, webhooks, app_proxy, pos, build, auth, app_preferences, access.admin)data/valid-app/package.json— minimal package.jsondata/invalid-tomls/— 5 invalid toml files (bad syntax, wrong types, unknown section, missing webhook uri, invalid app_proxy prefix)New fixture:
setup/toml-app.ts— copiesdata/valid-app/to a temp dir, injectsclient_idfrom envTests:
toml-config.spec.ts:toml-config-invalid.spec.ts:.tomlfiles indata/invalid-tomls/app deploy --forcefails for each with non-zero exit codeHow to test your changes?
Measuring impact
n/a - test infrastructure