ubicloud/cli-commands/lb/post
Jeremy Evans 7a67afe8d4 Use the pg_auto_parameterize_duplicate_query_detection Sequel extension
This makes route specs raise if there are duplicate queries that are not
inside explicit `ignore_duplicate_queries` blocks.  This is the Sequel
tooling that that found all of the N+1 issues in #4006.

This also enables duplicate query reporting in development mode, though
it warns instead of raising. Testing things in development found a bunch
of N+1 issues not found by the specs, because this tooling will only find
issues if N is greater than 1.

Any place where `ignore_duplicate_queries` is used is a place where we
definitely have duplicate queries. Some of these are not actually issues,
just cases where N is fixed (2 or 3) and used to DRY up duplicate logic.
Others we may want to address in the future.

This modifies the route spec helpers slightly to ensure that we only build
a single app to test against. Previously, `spec/routes/web/spec_helper.rb`
used an unnecessary `RackTestPlus` module with an `app` method that override
`app` method in `spec/routes/spec_helper.rb`, but returned the same value.
This defines a `RackTestApp` for the wrapper app with the duplicate query
testing, has `app` return that, and sets `Capybara.app` to it.

This avoids loading the pg_auto_parameterize_duplicate_query_detection
in production mode and when doing production-like testing (where
CLOVER_FREEZE == 1). In those cases, DB.ignore_duplicate_queries is
defined to just yield.
2025-10-18 03:24:36 +09:00
..
attach-vm.rb Allow lb attach-vm cli to accept vm-name for vm-id 2025-08-27 04:12:30 +09:00
create.rb Add cert-enabled parameter to the lb create cli/sdk endpoint 2025-10-13 18:07:28 +02:00
destroy.rb Add cli lb destroy command 2025-02-21 09:32:10 -08:00
detach-vm.rb Allow lb detach-vm cli to accept vm-name for vm-id 2025-08-27 04:12:30 +09:00
disable-ssl-certificate.rb Enable/Disable-ssl-certificate cli commands are added 2025-10-13 18:07:28 +02:00
enable-ssl-certificate.rb Enable/Disable-ssl-certificate cli commands are added 2025-10-13 18:07:28 +02:00
rename.rb Add support for renaming objects to api/sdk/cli 2025-08-26 02:54:13 +09:00
show.rb Add cert-enabled to the lb show cli/sdk 2025-10-13 18:07:28 +02:00
update.rb Use the pg_auto_parameterize_duplicate_query_detection Sequel extension 2025-10-18 03:24:36 +09:00