fix(rpc-agent): qualify Decorators namespace in datasource customizer#295
Merged
Conversation
`ForestAdminRpcAgent::DatasourceCustomizer#add_datasource` referenced `Decorators::Publication::PublicationDatasourceDecorator` and `Decorators::RenameCollection::RenameCollectionDatasourceDecorator` without a namespace qualifier. The parent `ForestAdminDatasourceCustomizer::DatasourceCustomizer` defines the same unqualified constants and resolves them correctly because it lives in the `ForestAdminDatasourceCustomizer` module — but the override here lives in `ForestAdminRpcAgent`, where no `Decorators` module exists, so any leaf RPC agent passing `include:`, `exclude:`, or `rename:` to `agent.add_datasource(ds, options)` crashed with NameError at boot. Fully qualify both constants with their actual namespace (`ForestAdminDatasourceCustomizer::Decorators::...`).
forest-bot
added a commit
that referenced
this pull request
May 5, 2026
## [1.27.2](v1.27.1...v1.27.2) (2026-05-05) ### Bug Fixes * **rpc-agent:** qualify Decorators namespace in datasource customizer ([#295](#295)) ([12ef7c9](12ef7c9))
Member
|
🎉 This PR is included in version 1.27.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ForestAdminRpcAgent::DatasourceCustomizer#add_datasourceoverrides its parent to add themark_collections_callbackhook, but the override re-uses the unqualifiedDecorators::Publication::.../Decorators::RenameCollection::...constants from the parent's body verbatim. The parent class lives inForestAdminDatasourceCustomizer, where those constants resolve viaForestAdminDatasourceCustomizer::Decorators::.... The override lives inForestAdminRpcAgent, where there is noDecoratorsmodule — so the same identifiers fail to resolve.The result: any leaf RPC agent calling
agent.add_datasource(ds, include: [...]),exclude: [...], orrename: [...]crashes at boot withuninitialized constant ForestAdminRpcAgent::DatasourceCustomizer::Decorators (NameError). Without those options the path is never hit, so the bug stayed silent until now.Fix
Fully qualify both constants:
Decorators::Publication::PublicationDatasourceDecorator→ForestAdminDatasourceCustomizer::Decorators::Publication::PublicationDatasourceDecoratorDecorators::RenameCollection::RenameCollectionDatasourceDecorator→ForestAdminDatasourceCustomizer::Decorators::RenameCollection::RenameCollectionDatasourceDecoratorTwo-line constant change. No behavioural change for callers that don't pass these options.
Test plan
cd packages/forest_admin_rpc_agent && BUNDLE_GEMFILE=Gemfile-test bundle exec rspecpasses (105 examples, 0 failures — verified locally)bundle exec rubocopcleanagent.add_datasource(some_ds, include: ['SomeCollection'])boots without raising and the resulting RPC schema only exposes the included collection (verified locally against the Snowflake datasource)Note
Qualify Decorators namespace references in
DatasourceCustomizer#add_datasourceFixes unqualified
Decorators::references indatasource_customizer.rbby prefixing them withForestAdminDatasourceCustomizer::. This ensuresPublicationDatasourceDecoratorandRenameCollectionDatasourceDecoratorresolve to the correct namespace when called from theForestAdminRpcAgentcontext.Macroscope summarized d7ce117.