Skip to content

feat(devtui): enhance config tab with env fields, HTTP cache toggle, and envfile package#1050

Merged
Soner (shyim) merged 3 commits into
nextfrom
feat/devtui-config-env-fields
May 22, 2026
Merged

feat(devtui): enhance config tab with env fields, HTTP cache toggle, and envfile package#1050
Soner (shyim) merged 3 commits into
nextfrom
feat/devtui-config-env-fields

Conversation

@shyim
Copy link
Copy Markdown
Member

Summary

  • APP_ENV picker: New field in the devtui Config tab to switch between dev/prod/test Symfony environments
  • HTTP Cache toggle: Add SHOPWARE_HTTP_CACHE_ENABLED field with friendly "disabled"/"enabled" labels
  • Env-field registry: Refactored env-backed config fields into a generic envFieldDef registry so adding new .env-backed fields is a single struct literal
  • envfile package: New ReadValue/ReadValues/WriteValue/WriteValues helpers for reading and writing .env.local files with in-place replacement
  • Cleanup: Remove unused internal/sbom package, Cloudsmith goreleaser config, stale Twig comment testdata files, and dead mysqldump code

Test plan

  • go test ./... passes
  • Manual: open devtui Config tab, verify APP_ENV picker and HTTP Cache toggle appear
  • Manual: change APP_ENV, verify it persists to .env.local
  • Manual: toggle HTTP cache, verify SHOPWARE_HTTP_CACHE_ENABLED=0/1 in .env.local

Add an APP_ENV picker to the devtui Config tab so users can switch the
Symfony application environment (dev/prod/test) without leaving the
dashboard. The value is persisted to .env.local, preserving surrounding
lines and comments. envfile gains ReadAppEnv/WriteAppEnv helpers for
the read-then-update flow.
Replace the APP_ENV-specific plumbing with a small envFieldDef registry
in tab_config.go so adding another .env-backed choice field later means
appending one struct literal — picker, render, load, and save flow are
all driven from the registry.

The envfile package gains generic ReadValue/ReadValues/WriteValue/
WriteValues helpers; .env.local writes still replace assignments in
place, with batch appends emitted in deterministic order.
Add a SHOPWARE_HTTP_CACHE_ENABLED entry to the env-field registry so the
Config tab exposes an HTTP Cache toggle alongside APP_ENV. Selections are
persisted to .env.local as "0"/"1", while the UI shows the friendlier
"disabled"/"enabled" labels via an optional choiceLabels mapping on
envFieldDef.
@shyim Soner (shyim) merged commit 303eb47 into next May 22, 2026
3 checks passed
@shyim Soner (shyim) deleted the feat/devtui-config-env-fields branch May 22, 2026 08:53
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1586cc7c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

projectRoot := m.projectRoot
cfg := m.config
return func() tea.Msg {
if err := dockerpkg.WriteComposeFile(projectRoot, dockerpkg.ComposeOptionsFromConfig(cfg)); err != nil {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Regenerate compose with merged local profiler secrets

When config is saved, updateConfigTab calls ApplyToConfig, which clears profiler credential fields from m.config, then writes secrets to local config only. This restart path regenerates compose.yaml from m.config, so in Docker mode a save with Blackfire/Tideways enabled can restart containers without BLACKFIRE_*/TIDEWAYS_APIKEY env wiring even though the user-provided secrets were persisted. This breaks profiler functionality immediately after save until config is reloaded with local overrides.

Useful? React with 👍 / 👎.

Comment on lines 128 to +133
m.configTab.modified = false
m.configTab.err = nil
if m.dockerMode {
m.configTab.saved = false
m.configTab.restarting = true
return m, m.restartContainersForConfig()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow retry after Docker restart failure

The save flow clears modified before launching the async Docker restart. If docker compose up -d fails, handleConfigRestartDone sets an error but does not re-mark the form as modified; pressing Enter on "Retry Save" then does nothing because save is gated by m.configTab.modified. In practice, users cannot retry the failed restart without making an unrelated extra change first.

Useful? React with 👍 / 👎.

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.

2 participants