Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@terwey
Copy link
Collaborator

@terwey terwey commented Oct 31, 2025

Summary

  • add a developer-focused guide describing how to run the binary in debug mode
  • wire the new page into the documentation navigation so it is discoverable

Testing

  • not run (docs-only change)

https://chatgpt.com/codex/tasks/task_e_690515ae93348326b80b6042b4e52836

@terwey
Copy link
Collaborator Author

terwey commented Nov 1, 2025

@codex plan a way that this can be a compiler flag feature. I don't want to have this in a production build.

@chatgpt-codex-connector
Copy link

The current runtime-only --debug/RECOMMA_DEBUG switch (see cmd/recomma/main.go and cmd/recomma/internal/config/config.go) is always compiled into the binary, so the relaxed vault behaviour ships in production builds.

:::task-stub{title="Gate debug mode behind a build tag"}

  1. Introduce a debugmode (name tbd) Go build tag: move the existing helpers in cmd/recomma/debug.go into a //go:build debugmode file and add a cmd/recomma/debug_disabled.go compiled when !debugmode is set that either panics at init or returns a sentinel error to callers.
  2. Update main() in cmd/recomma/main.go so that, under !debugmode, it refuses to start if cfg.Debug is true (e.g., by checking a debugModeAvailable() helper defined per build tag) before calling loadDebugSecretsFromEnv.
  3. Split the flag wiring in cmd/recomma/internal/config: provide a //go:build debugmode file that registers the --debug flag/env hook, and a //go:build !debugmode twin that hardcodes cfg.Debug = false plus marks the flag as hidden or errors out when set (using pflag.Flag.Value.Set inside a custom BoolVar wrapper).
  4. Thread the build-tagged availability check into internal/api/handler.go and webui/embed.go so that the WithDebugMode option and webui.SetDebug receive false automatically when the feature is compiled out.
  5. Extend docs/modules/ROOT/pages/debug-mode.adoc (and any other references in docs/modules/ROOT/nav.adoc) to explain the new go build -tags debugmode ./cmd/recomma requirement and warn that release builds omit the flag.
    :::

View task →

@terwey
Copy link
Collaborator Author

terwey commented Nov 1, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Delightful!

ℹ️ 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 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 address that feedback".

@terwey terwey merged commit 13963f9 into main Nov 1, 2025
1 check passed
@terwey terwey deleted the codex/add-debug-support-to-recomma-application branch November 1, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants