(PE-46077) Fix swapped select-keys args in select-user-configurable-hikari-options - #101
(PE-46077) Fix swapped select-keys args in select-user-configurable-hikari-options#101Magisus wants to merge 1 commit into
Conversation
…ikari-options
The map and keyseq arguments to select-keys were passed in the wrong
order, so the function always returned {} instead of filtering the
caller's map down to the allowed HikariCP options. It has been broken
this way since it was introduced in 2016 and has no test coverage,
which is how it went unnoticed.
There are no production callers today, so this is currently latent,
but the function's name and docstring make it an attractive nuisance:
a future caller would silently lose every operator-supplied HikariCP
option (max pool size, timeouts, etc.) and fall back to defaults with
no error or warning. code-manager hit exactly this while implementing
PE-45881 and worked around it with a local allowlist instead of using
this helper.
Swap the select-keys arguments so the function behaves as documented,
and add tests asserting recognized keys are kept and unrecognized keys
are dropped.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
CI failure investigation: the `create-db!-test` failure (`PSQLException: CREATE DATABASE cannot be executed within a pipeline`) is pre-existing and unrelated to this PR — I verified it by running the same `lein_test` workflow directly against unmodified `main` (https://github.com/puppetlabs/jdbc-util/actions/runs/32301297395), which fails identically. Looks like a pgjdbc/Postgres-14 pipelining incompatibility in `create-db!`, not something introduced by this change. The new `select-user-configurable-hikari-options-test` assertions pass in both runs. |
|
Closing — this PR targets |
Summary
select-user-configurable-hikari-optionspassed its arguments toselect-keysin the wrong order ((select-keys keyseq map)instead of(select-keys map keyseq)), so it always returned{}instead of filtering the caller's map down to the allowed HikariCP options.Jira: https://perforce.atlassian.net/browse/PE-46077
Test plan
select-user-configurable-hikari-options-test, confirmed it failed before the fix (returned{}) and passes afterlein test :only puppetlabs.jdbc-util.pool-test/select-user-configurable-hikari-options-testpassesclj-kondo --linton changed files shows no new warningspool-testnamespace; unrelated DB-connectivity tests fail locally due to no local postgres role, same as before this change🤖 Generated with Claude Code