Skip to content

Remove unnecessary explicit adapter requires from monkeypatch#5086

Merged
philippthun merged 1 commit into
cloudfoundry:mainfrom
sap-contributions:remove-unnecessary-adapter-requires
May 5, 2026
Merged

Remove unnecessary explicit adapter requires from monkeypatch#5086
philippthun merged 1 commit into
cloudfoundry:mainfrom
sap-contributions:remove-unnecessary-adapter-requires

Conversation

@philippthun
Copy link
Copy Markdown
Member

The sequel_case_insensitive_string_monkeypatch unconditionally required sequel/adapters/postgres and sequel/adapters/mysql2, even though the file is only ever loaded via DBMigrator.apply_migrations after a DB connection is already established (which auto-loads the adapter).

Replace the explicit requires with defined? guards so each adapter is only patched when actually in use. This avoids loading cross-adapter code unnecessarily and makes tests that reference adapter-specific constants (like Sequel::Postgres::Dataset) fail visibly when the adapter is not loaded, rather than being silently masked.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

The sequel_case_insensitive_string_monkeypatch unconditionally required
sequel/adapters/postgres and sequel/adapters/mysql2, even though the
file is only ever loaded via DBMigrator.apply_migrations after a DB
connection is already established (which auto-loads the adapter).

Replace the explicit requires with `defined?` guards so each adapter is
only patched when actually in use. This avoids loading cross-adapter
code unnecessarily and makes tests that reference adapter-specific
constants (like Sequel::Postgres::Dataset) fail visibly when the adapter
is not loaded, rather than being silently masked.
@philippthun philippthun marked this pull request as ready for review May 5, 2026 10:23
@philippthun philippthun merged commit 35881c9 into cloudfoundry:main May 5, 2026
11 checks passed
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request May 5, 2026
Changes in cloud_controller_ng:

- Remove unnecessary explicit adapter requires from monkeypatch
    PR: cloudfoundry/cloud_controller_ng#5086
    Author: Philipp Thun <philipp.thun@sap.com>

Dependency updates in cloud_controller_ng:

- build(deps): bump rubyzip from 3.2.2 to 3.3.0
    PR: cloudfoundry/cloud_controller_ng#5081
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

- build(deps): bump rake from 13.3.1 to 13.4.2 in /docs/v3
    PR: cloudfoundry/cloud_controller_ng#5075
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

- build(deps): bump nokogiri from 1.19.2 to 1.19.3 in /docs/v3
    PR: cloudfoundry/cloud_controller_ng#5074
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

- build(deps): bump minitest from 6.0.5 to 6.0.6
    PR: cloudfoundry/cloud_controller_ng#5077
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

- build(deps): bump mini_racer from 0.20.0 to 0.21.0 in /docs/v3
    PR: cloudfoundry/cloud_controller_ng#5073
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

- build(deps): bump json from 2.19.3 to 2.19.4 in /docs/v3
    PR: cloudfoundry/cloud_controller_ng#5076
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

- build(deps-dev): bump spring from 4.4.2 to 4.5.0
    PR: cloudfoundry/cloud_controller_ng#5078
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

- build(deps): bump sequel from 5.103.0 to 5.104.0
    PR: cloudfoundry/cloud_controller_ng#5082
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants