Skip to content

chore: remove dead code and wire up unused config fields#73

Open
samcm wants to merge 2 commits intomasterfrom
jolly-badger-634
Open

chore: remove dead code and wire up unused config fields#73
samcm wants to merge 2 commits intomasterfrom
jolly-badger-634

Conversation

@samcm
Copy link
Copy Markdown
Member

@samcm samcm commented Mar 13, 2026

Summary

Clean up dead code and fix half-implemented config fields found during a code audit.

Changes

File Change
pkg/operations/types.go Removed dead constants (ResultKindTable, RowEncodingObject, RowEncodingArray) and dead fields (RowEncoding, Columns, Rows, Matrix) from Response — none were ever referenced anywhere
pkg/serverapi/runtime_storage.go Deleted — empty file containing only package serverapi
pkg/serverapi/runtime_storage_test.go Deleted — empty test file containing only package serverapi
pkg/configpath/paths.go Removed ambiguous CONFIG_PATH env var from both app and proxy config resolution — it was shared between the two and could silently point to the wrong file. The proper env vars (PANDA_CONFIG, PANDA_PROXY_CONFIG, etc.) remain
pkg/server/operation_helpers.go Removed dead X-Operation-Transport: passthrough header — set on responses but never read by any client
pkg/proxy/server_config.go Added SkipVerify and Timeout fields to PrometheusInstanceConfig and LokiInstanceConfig, and wired them through ToHandlerConfigs() — the handler code already supported these but there was no way to configure them

Not changed (intentional)

  • Duplicate substituteEnvVars in pkg/config/ and pkg/proxy/ — separate compilation targets
  • Duplicate search response types between searchsvc and serverapi — wire-format boundary
  • Deprecated ServerConfig.Transport — kept for backwards compat with existing configs
  • SearchTypeNotebooks — intentional alias normalized to SearchTypeRunbooks

samcm added 2 commits March 13, 2026 13:30
- Remove dead constants and fields from operations.Response (ResultKindTable,
  RowEncodingObject, RowEncodingArray, Rows, Columns, Matrix, RowEncoding)
  that were never referenced anywhere in the codebase
- Delete empty pkg/serverapi/runtime_storage.go and its empty test file
- Remove ambiguous CONFIG_PATH env var from both app and proxy config
  resolution — the proper env vars (PANDA_CONFIG, PANDA_PROXY_CONFIG) remain
- Remove dead X-Operation-Transport header that was set but never read
- Add SkipVerify and Timeout fields to PrometheusInstanceConfig and
  LokiInstanceConfig in proxy server config, and wire them through
  ToHandlerConfigs() — the handler code already supported these but
  there was no way to configure them
Keep RowEncoding, Columns, Rows, and Matrix on operations.Response —
while no Go code currently sets them, they are part of the JSON wire
format and could be consumed by external clients. Only remove the
unused constants (ResultKindTable, RowEncodingObject, RowEncodingArray).
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.

1 participant