chore: remove dead code and wire up unused config fields#73
Open
chore: remove dead code and wire up unused config fields#73
Conversation
- 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clean up dead code and fix half-implemented config fields found during a code audit.
Changes
pkg/operations/types.goResultKindTable,RowEncodingObject,RowEncodingArray) and dead fields (RowEncoding,Columns,Rows,Matrix) fromResponse— none were ever referenced anywherepkg/serverapi/runtime_storage.gopackage serverapipkg/serverapi/runtime_storage_test.gopackage serverapipkg/configpath/paths.goCONFIG_PATHenv 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.) remainpkg/server/operation_helpers.goX-Operation-Transport: passthroughheader — set on responses but never read by any clientpkg/proxy/server_config.goSkipVerifyandTimeoutfields toPrometheusInstanceConfigandLokiInstanceConfig, and wired them throughToHandlerConfigs()— the handler code already supported these but there was no way to configure themNot changed (intentional)
substituteEnvVarsinpkg/config/andpkg/proxy/— separate compilation targetssearchsvcandserverapi— wire-format boundaryServerConfig.Transport— kept for backwards compat with existing configsSearchTypeNotebooks— intentional alias normalized toSearchTypeRunbooks