Skip to content

yaml configuration is error-prone #1859

Open
@Ubehebe

Description

@Ubehebe

I maintain a Misk-based app. Yesterday, I added a backend to it via Guice injection, and added fake and real Guice modules for the binding. All tests passed. But when I deployed the change to the app's staging environment, it failed:

com.google.inject.ProvisionException: Unable to provision, see the following errors:
        1) Error in custom provider, java.lang.IllegalArgumentException: no client configuration for endpoint [redacted]
          at misk.client.HttpClientModule.configure(HttpClientModule.kt:23) (via modules: [redacted] -> misk.client.TypedHttpClientModule -> misk.client.HttpClientModule)
          while locating okhttp3.OkHttpClient annotated with @com.google.inject.name.Named(value=[redacted])
          at misk.client.TypedHttpClientModule.configure(TypedHttpClientModule.kt:45) (via modules: [redacted] -> misk.client.TypedHttpClientModule)
          while locating [redacted] annotated with @com.google.inject.name.Named(value=[redacted])

After reading Misk docs, I realized I needed to add a line to app-staging.yaml corresponding to this new backend.

Could this error have been surfaced before deploying? I realize that app-staging.yaml is meant for the staging environment, but it should be possible to write a tool that would do some static analysis on the yaml file and realize there's a missing backend. (I'm filing this issue here, rather than against my own app, because it seems like it would be valuable for every Misk app.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions