Skip to content

Conversation

@ksobolew
Copy link
Contributor

@ksobolew ksobolew commented Nov 4, 2025

Description

Follow-up to d01c5ac.

Additional context and related issues

This "invents" some more bootstrap name prefixes, specifically io.trino.bootstrap.auth. and io.trino.bootstrap.resource-group..

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

Summary by Sourcery

Assign context-specific name prefixes to Bootstrap instances across various plugin factories to improve identification

Enhancements:

  • Add io.trino.bootstrap.access.* prefix in FileBasedSystemAccessControl
  • Add io.trino.bootstrap.catalog.* prefix in ExampleConnectorFactory
  • Add io.trino.bootstrap.auth.* and io.trino.bootstrap.groups.* prefixes in password authenticator and group provider factories
  • Add io.trino.bootstrap.resource-group.* prefix in resource group manager factories and tests

@cla-bot cla-bot bot added the cla-signed label Nov 4, 2025
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 4, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Update Bootstrap instantiations across multiple plugins/connectors to include descriptive name prefixes (access, catalog, auth, groups, resource-group) for clearer context and debugging.

Class diagram for updated Bootstrap instantiations

classDiagram
    class FileBasedSystemAccessControl {
        +create(config, context)
        // Bootstrap now instantiated with name prefix: "io.trino.bootstrap.access." + getName()
    }
    class ExampleConnectorFactory {
        +create(catalogName, requiredConfig, context)
        // Bootstrap now instantiated with name prefix: "io.trino.bootstrap.catalog." + catalogName
    }
    class FileAuthenticatorFactory {
        +create(config)
        // Bootstrap now instantiated with name prefix: "io.trino.bootstrap.auth." + getName()
    }
    class FileGroupProviderFactory {
        +create(config)
        // Bootstrap now instantiated with name prefix: "io.trino.bootstrap.groups." + getName()
    }
    class LdapAuthenticatorFactory {
        +create(config)
        // Bootstrap now instantiated with name prefix: "io.trino.bootstrap.auth." + getName()
    }
    class SalesforceAuthenticatorFactory {
        +create(config)
        // Bootstrap now instantiated with name prefix: "io.trino.bootstrap.auth." + getName()
    }
    class FileResourceGroupConfigurationManagerFactory {
        +create(config, context)
        // Bootstrap now instantiated with name prefix: "io.trino.bootstrap.resource-group." + getName()
    }
    class DbResourceGroupConfigurationManagerFactory {
        +create(config, context)
        // Bootstrap now instantiated with name prefix: "io.trino.bootstrap.resource-group." + getName()
    }
    class Bootstrap {
        +Bootstrap(name, ...modules)
    }
    FileBasedSystemAccessControl --> Bootstrap
    ExampleConnectorFactory --> Bootstrap
    FileAuthenticatorFactory --> Bootstrap
    FileGroupProviderFactory --> Bootstrap
    LdapAuthenticatorFactory --> Bootstrap
    SalesforceAuthenticatorFactory --> Bootstrap
    FileResourceGroupConfigurationManagerFactory --> Bootstrap
    DbResourceGroupConfigurationManagerFactory --> Bootstrap
Loading

File-Level Changes

Change Details Files
Add descriptive access control prefix to Bootstrap
  • Prepend "io.trino.bootstrap.access." to FileBasedSystemAccessControl instance name
lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/security/FileBasedSystemAccessControl.java
Add catalog prefix for example HTTP connector Bootstrap
  • Prepend "io.trino.bootstrap.catalog." to ExampleConnectorFactory instance name
plugin/trino-example-http/src/main/java/io/trino/plugin/example/ExampleConnectorFactory.java
Add auth prefix for password authentication plugins
  • Prepend "io.trino.bootstrap.auth." to FileAuthenticatorFactory name
  • Prepend "io.trino.bootstrap.auth." to LdapAuthenticatorFactory name
  • Prepend "io.trino.bootstrap.auth." to SalesforceAuthenticatorFactory name
plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/file/FileAuthenticatorFactory.java
plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/ldap/LdapAuthenticatorFactory.java
plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/salesforce/SalesforceAuthenticatorFactory.java
Add groups prefix for file-based group provider Bootstrap
  • Prepend "io.trino.bootstrap.groups." to FileGroupProviderFactory instance name
plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/file/FileGroupProviderFactory.java
Add resource-group prefix for resource group manager Bootstraps
  • Prepend "io.trino.bootstrap.resource-group." to FileResourceGroupConfigurationManagerFactory name
  • Prepend "io.trino.bootstrap.resource-group." to DbResourceGroupConfigurationManagerFactory name
  • Prepend "io.trino.bootstrap.resource-group." to H2ResourceGroupConfigurationManagerFactory name
plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/FileResourceGroupConfigurationManagerFactory.java
plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/db/DbResourceGroupConfigurationManagerFactory.java
testing/trino-tests/src/test/java/io/trino/execution/resourcegroups/db/H2ResourceGroupConfigurationManagerFactory.java

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ksobolew ksobolew requested a review from wendigo November 4, 2025 10:52
Comment on lines 45 to +47
// A plugin is not required to use Guice; it is just very convenient
Bootstrap app = new Bootstrap(
"io.trino.bootstrap.catalog." + catalogName,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this in "only" an example, but it should show this as a best practice

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ksobolew
Copy link
Contributor Author

ksobolew commented Nov 4, 2025

 ERROR: failed to build: failed to solve: process "/bin/sh -c set -xeuo pipefail &&     mkdir -p /tmp/overlay/usr/libexec/ &&     touch /tmp/overlay/usr/libexec/grepconf.sh &&     chmod +x /tmp/overlay/usr/libexec/grepconf.sh &&     dnf update -y &&     dnf install --installroot /tmp/overlay --setopt install_weak_deps=false --nodocs -y       less       libstdc++ `# required by snappy and duckdb`       curl-minimal grep `# required by health-check`       zlib `#required by java`       shadow-utils `# required by useradd`       tar `# required to support kubectl cp` &&       rm -rf /tmp/overlay/var/cache/*" did not complete successfully: exit code: 1

Hmmm, I don't think that's me...

@wendigo
Copy link
Contributor

wendigo commented Nov 4, 2025

 > [packages 2/2] RUN     set -xeuo pipefail &&     mkdir -p /tmp/overlay/usr/libexec/ &&     touch /tmp/overlay/usr/libexec/grepconf.sh &&     chmod +x /tmp/overlay/usr/libexec/grepconf.sh &&     dnf update -y &&     dnf install --installroot /tmp/overlay --setopt install_weak_deps=false --nodocs -y       less       libstdc++ `# required by snappy and duckdb`       curl-minimal grep `# required by health-check`       zlib `#required by java`       shadow-utils `# required by useradd`       tar `# required to support kubectl cp` &&       rm -rf /tmp/overlay/var/cache/*:
7.688   - cannot install both glibc-2.39-46.el10_0.4.aarch64 from ubi-10-for-aarch64-baseos-rpms and glibc-2.39-46.el10_0.aarch64 from @System
7.688   - cannot install both glibc-2.39-46.el10_0.aarch64 from ubi-10-for-aarch64-baseos-rpms and glibc-2.39-46.el10_0.4.aarch64 from ubi-10-for-aarch64-baseos-rpms
7.688   - cannot install the best update candidate for package glibc-minimal-langpack-2.39-46.el10_0.aarch64
7.688   - cannot install the best update candidate for package glibc-2.39-46.el10_0.aarch64
7.688  Problem 2: problem with installed package glibc-minimal-langpack-2.39-46.el10_0.aarch64
7.688   - package glibc-minimal-langpack-2.39-46.el10_0.aarch64 from @System requires glibc-common = 2.39-46.el10_0, but none of the providers can be installed
7.688   - package glibc-minimal-langpack-2.39-46.el10_0.aarch64 from ubi-10-for-aarch64-baseos-rpms requires glibc-common = 2.39-46.el10_0, but none of the providers can be installed
7.688   - cannot install both glibc-common-2.39-46.el10_0.4.aarch64 from ubi-10-for-aarch64-baseos-rpms and glibc-common-2.39-46.el10_0.aarch64 from @System
7.688   - cannot install the best update candidate for package glibc-common-2.39-46.el10_0.aarch64
7.691 (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

wat

@wendigo wendigo merged commit 4e07ebf into trinodb:master Nov 4, 2025
197 of 199 checks passed
@github-actions github-actions bot added this to the 479 milestone Nov 4, 2025
@ksobolew ksobolew deleted the kudi/bootstrap-oss branch November 5, 2025 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants