seatgeek / backstage-plugins

SeatGeek Backstage Plugins Collection
Apache License 2.0
31 stars 6 forks source link

awards: add `awards.storage.type` key to specify which engine to use #39

Closed zhammer closed 6 months ago

zhammer commented 6 months ago

https://github.com/seatgeek/backstage-plugins/pull/34 did not properly fix the problem of multiple awards.storage engines being configured in an application with multiple configs (e.g. in app-config.yaml i have awards.storage.fs: {...} and in app-config.prod.yaml i have awards.storage.s3: {...}.

@freben gave the suggestion to add a type field, where in app-config.prod.yaml you would write:

awards:
  storage:
    type: s3
    s3: {...}

zhammer — 02/28/2024 2:49 PM is there a way to override (delete, nullify) a config dict in a config file overlay? e.g.

# application-config.yaml
my-plugin:
  storage:
    filesystem:
      directory: tmp/
# application-config.production.yaml
my-plugin:
  storage:
    # we want this gone in production
    filesystem: null
    s3:
      bucket: my-bucket

this isn't working for us. trying to get this right for our own OSS plugin: https://github.com/seatgeek/backstage-plugins/commit/e568c37f81c9f87728007a63ad44246419e6d8b5

freben — Yesterday at 1:23 AM No. But we'd generally put a type: s3 etc in there so that the reading code knows which subkey to dive in to The it doesn't matter that there's an extra filsystem key hanging around

zhammer commented 6 months ago

actually seems like this is fixed in 1.24 https://github.com/backstage/backstage/releases

Accepting null in configuration

A null value is now treated as an explicitly undefined value, and does not fall back to other configuration files. This means that you can use a null value in configuration to reset or unset parts of configuration, such as disabling an auth provider.