Validate Roku channel types#589
Conversation
Greptile SummaryThis PR adds runtime validation of the
Confidence Score: 5/5Safe to merge — the change is a focused guard added in two places with matching test coverage and no regressions to existing behavior. The validation logic is correct: requireChannelType delegates to requireValue for the empty/undefined case, then checks membership against the CHANNEL_TYPES tuple before any I/O. Both build (via packagePlan) and ship validate early and consistently. The two new tests exercise the exact error path end-to-end and cover both entry points. No pre-existing tests were broken. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[caller invokes build or ship] --> B{config.channelType?}
B -->|undefined / empty| C[requireValue throws\n'tv-roku requires channelType']
B -->|non-empty string| D{CHANNEL_TYPES.includes?}
D -->|'preview' / other unknown| E[requireChannelType throws\n'tv-roku channelType must be one of:\npublic, beta, private']
D -->|'public' / 'beta' / 'private'| F[validated channelType returned]
F --> G{build or ship?}
G -->|build| H[packagePlan: stat sourceDir,\nparse manifest, write plan JSON]
G -->|ship| I{dryRun?}
I -->|true| J[return dry-run metadata\nwith channelType + destination]
I -->|false| K[return real ship metadata\nwith artifact + channelId]
Reviews (1): Last reviewed commit: "Validate Roku channel types" | Re-trigger Greptile |
Fixes #588.
Changes:
Validation: