Skip to content

feat(application): add groups, comments, and ordering to app config items#70

Merged
wellCh4n merged 2 commits into
wellCh4n:mainfrom
microbluey:feat/config-group-comment
Jul 11, 2026
Merged

feat(application): add groups, comments, and ordering to app config items#70
wellCh4n merged 2 commits into
wellCh4n:mainfrom
microbluey:feat/config-group-comment

Conversation

@microbluey

@microbluey microbluey commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Env/file config items were a flat, unordered list keyed only by name, which becomes hard to read once an app has dozens of variables. This adds three pieces of per-item metadata — a display group, a free-text comment, and a manual orderwithout introducing a database table.

The metadata is serialized as JSON in a new oops.config-meta annotation (key -> {group, comment, order}) on each {app} / {app}.files ConfigMap/Secret, mirroring the existing oops.mounts annotation pattern. Key properties:

  • data is untouched — only metadata.annotations gains oops.config-meta, so nothing changes about how the ConfigMap/Secret is injected (envFrom) or mounted.
  • Each annotation only describes the keys in its own resource's data, so an item moving between env / secret / file-mounted carries its metadata along on the next full-rewrite save.
  • The metadata never enters the container.
  • order lets the editor persist a manual arrangement that the ConfigMap data map (unordered) cannot; getConfigMaps sorts by it, with legacy/unset items falling back to key name.
  • Zero migration: pre-existing resources have no annotation → group/comment/order are all null.

What the stored K8s resources look like

Env-injected ConfigMap (envFrom), unchanged data, new annotation only:

apiVersion: v1
kind: ConfigMap
metadata:
  name: my-app
  namespace: prod
  annotations:
    oops.config-meta: '{"DB_HOST":{"group":"database","comment":"Primary DB host","order":0},"DB_PORT":{"group":"database","order":1},"APP_NAME":{"order":2}}'
  ownerReferences:
    - apiVersion: apps/v1
      kind: StatefulSet
      name: my-app
      controller: true
      blockOwnerDeletion: true
data:
  DB_HOST: "10.0.0.1"
  DB_PORT: "3306"
  APP_NAME: "My Application"

Companion .files ConfigMap (mounted, never injected) carrying both annotations side by side:

apiVersion: v1
kind: ConfigMap
metadata:
  name: my-app.files
  namespace: prod
  annotations:
    oops.mounts: '{"config.yml":"/etc/app/config.yml"}'
    oops.config-meta: '{"config.yml":{"group":"files","order":3}}'
data:
  config.yml: |
    key: value

Frontend

  • Config editor reworked into collapsible per-group sections with a key/comment search box.
  • Each row gains an inline comment field and a group popover (pick an existing group or create a new one).

Testing

  • Backend: ConfigMetaAnnotationTests covers of() normalization, independent mount/meta serialization, full annotation round-trip including order preservation, legacy meta without an order field, and garbled/missing annotation handling.
  • Frontend: pnpm lint and tsc --noEmit pass.

…tems

Env/file config items were previously a flat, unordered list keyed only by
name, which grows hard to read once an app has dozens of variables. This adds
three pieces of per-item metadata — a display group, a free-text comment, and
a manual order — without introducing a database table.

The metadata is serialized as JSON in a new `oops.config-meta` annotation
(`key -> {group, comment, order}`) on each {app}/{app}.files ConfigMap/Secret,
mirroring the existing `oops.mounts` annotation pattern. Each annotation only
describes the keys in its own resource's data, so an item moving between
env/secret/mounted carries its metadata along on the next full-rewrite save.
The metadata never enters the container. `order` lets the editor persist a
manual arrangement that the ConfigMap data map (unordered) cannot; getConfigMaps
sorts by it, with legacy/unset items falling back to key name.

Frontend reworks the config editor into collapsible per-group sections with a
key/comment search box. Each row gains an inline comment field and a group
popover (pick an existing group or create a new one), and rows are drag-sortable
within a group and draggable across groups via dnd-kit. Import/export round-trips
groups as `## group:` markers and comments as `#` lines in the dotenv format.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

This comment was marked as outdated.

Redesign the app config editor around per-group tabs and single-line
rows. Each item's mount path, comment, and group are edited through
three dedicated dialogs with draft/staging semantics: edits stay local
until confirmed, and cancel / close / outside-click discard them.

Group is a single autocomplete input — typing filters existing groups
and a non-matching name creates a new one implicitly. Dragging a row now
only reorders it and no longer rewrites its group, so items keep their
group when moved. ConfigMap and Secret each get their own section filter
and an info tooltip for the section hint.

Add YAML import/export (js-yaml) that round-trips groups and comments
losslessly, alongside the existing dotenv format.

Co-authored-by: Claude <noreply@anthropic.com>
@wellCh4n wellCh4n merged commit d676875 into wellCh4n:main Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants