Skip to content

(PE-46077) Fix swapped select-keys args in select-user-configurable-hikari-options - #101

Closed
Magisus wants to merge 1 commit into
mainfrom
PE-46077-fix-select-user-configurable-hikari-options
Closed

(PE-46077) Fix swapped select-keys args in select-user-configurable-hikari-options#101
Magisus wants to merge 1 commit into
mainfrom
PE-46077-fix-select-user-configurable-hikari-options

Conversation

@Magisus

@Magisus Magisus commented Aug 19, 2026

Copy link
Copy Markdown

Summary

  • select-user-configurable-hikari-options passed its arguments to select-keys in 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.
  • No production code calls this function today, so the bug is currently latent, but it's a silent trap: a future caller would lose every operator-supplied HikariCP option (timeouts, pool size, etc.) with no error, falling back to HikariCP defaults. code-manager hit this while implementing PE-45881 and worked around it with a local allowlist instead.
  • Swapped the arguments so the function behaves as documented, and added test coverage (there was none before) asserting recognized keys are kept and unrecognized keys are dropped.

Jira: https://perforce.atlassian.net/browse/PE-46077

Test plan

  • Added select-user-configurable-hikari-options-test, confirmed it failed before the fix (returned {}) and passes after
  • lein test :only puppetlabs.jdbc-util.pool-test/select-user-configurable-hikari-options-test passes
  • clj-kondo --lint on changed files shows no new warnings
  • Ran full pool-test namespace; unrelated DB-connectivity tests fail locally due to no local postgres role, same as before this change

🤖 Generated with Claude Code

…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>
@Magisus
Magisus requested a review from a team as a code owner August 19, 2026 20:53
@Magisus

Magisus commented Aug 19, 2026

Copy link
Copy Markdown
Author

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.

@Magisus

Magisus commented Aug 19, 2026

Copy link
Copy Markdown
Author

Closing — this PR targets puppetlabs/jdbc-util, the public mirror, but PE actually builds and ships the puppetlabs/jdbc-util artifact from puppetlabs/jdbc-util-private (currently at 1.5.4-SNAPSHOT). The fix here is technically correct for this repo's code, but doesn't affect anything PE consumes. Re-filing against jdbc-util-private; tracked in PE-46077.

@Magisus Magisus closed this Aug 19, 2026
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