Skip to content

dev の config:remote に VOICEVOX staging 資産の manifest URL を入れる #29

Description

@TinyKitten

概要

VOICEVOX 資産の staging 配信先を用意する作業(TrainLCD/MobileApp#6931)のうち、dev の CONFIG_KV へ staging 用の manifest URL を投入する部分がこのリポジトリの管轄。

Remote Config は /config/remoteCONFIG_KVconfig:remote)配信で、CONFIG_KV は dev と production で namespace が分かれている。canary アプリは DEV_WORKER_API_URLtrainlcd-worker-dev)を向くので、dev 側の値だけを差し替えれば canary だけが staging 資産を取りに行く。

やること

MobileApp#6931 で trainlcd-assets-dev / assets-stg.trainlcd.app が用意できたあと、dev の config:remote に次のキーを入れる。

{
  "voicevox_tts_manifest_url_ios": "https://assets-stg.trainlcd.app/voicevox/manifest.json"
}
# dev(--env なしが dev)
wrangler kv key put --binding CONFIG_KV "config:remote" --path remote.json --remote

production 側(--env production)は https://assets.trainlcd.app/voicevox/manifest.json のまま据え置く。

Worker のコード変更は不要

src/routes/config.tsisValidRemoteConfigEntry は、既知キー以外もプリミティブ値ならそのままパススルーする。voicevox_tts_manifest_url_ios は文字列なので現状のまま配信される。URL が https かどうかはアプリ側(src/lib/remoteConfig.tsparseHttpsUrl)で検証している。

既知キーとして型検証を足すかどうかは別途判断でよい。足すなら文字列かつ https:// で始まることを見る形になる。

依存

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions