Skip to content

[backport camel-4.22.x] CAMEL-25889: camel-google-mail/drive/calendar/sheets - create the API client per endpoint credentials instead of one per component - #28439

Merged
davsclaus merged 1 commit into
apache:camel-4.22.xfrom
oscerd:backport/28217-to-camel-4.22.x
Oct 25, 2026

Conversation

@oscerd

@oscerd oscerd commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Backport of #28217

Cherry-pick of #28217 onto camel-4.22.x.

Original PR: #28217 - CAMEL-25889: camel-google-mail/drive/calendar/sheets - create the API client per endpoint credentials instead of one per component
Original author: @oscerd
Target branch: camel-4.22.x (4.22.3)

Straight cherry-pick of the squash commit 7203584: the only conflict was the 4.24 upgrade-guide file, which does not exist on this branch and was dropped (the 4.22.3 note goes to the guide on main in a separate PR). The remaining diff is identical to the original PR.

Original description

The google-mail, google-mail-stream, google-drive, google-calendar, google-calendar-stream, google-sheets and google-sheets-stream components kept a single API client per component, created from the configuration of the first endpoint that asked for one and returned to every later endpoint of the component. Each endpoint now creates its own client from its own options on first use and keeps it for its lifetime; GoogleMailComponent keeps one client for its own configuration for the update-message-labels transformer; google-drive honours the endpoint-level clientFactory; google-mail-stream throws instead of returning a null client when no credentials are set. Tests with recording fake client factories per component.

Claude Code on behalf of oscerd

🤖 Generated with Claude Code

… client per endpoint credentials instead of one per component (apache#28217)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 7203584)
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>

# Conflicts:
#	docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@oscerd oscerd added the backport indicate that a Pull request is a backport from a fix from the main branch label Oct 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. No issues found.

The DCL pattern (volatile field + ReentrantLock) is textbook correct. Test assertion ordering is sound — afterConfigureProperties() eagerly calls getClient() during endpoint setup, so factory.created is populated before the assertions. The GoogleMailStream behavioral change (null → IllegalArgumentException on missing credentials) is a strict improvement: fail-fast with a clear message beats NPE at poll time.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-google/camel-google-calendar
  • components/camel-google/camel-google-drive
  • components/camel-google/camel-google-mail
  • components/camel-google/camel-google-sheets

🔬 Scalpel shadow comparison — Scalpel: 13 tested, 28 compile-only — current: 12 all tested

Maveniverse Scalpel detected 41 affected modules (current approach: 12).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 13 modules (5 direct + 8 downstream), skip tests for 28 (generated code, meta-modules)

Modules Scalpel would test (13)
  • camel-catalog
  • camel-google-calendar
  • camel-google-drive
  • camel-google-mail
  • camel-google-sheets
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
Modules with tests skipped (28)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (41 modules)
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Google :: Calendar
  • Camel :: Google :: Drive
  • Camel :: Google :: Mail
  • Camel :: Google :: Sheets
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@davsclaus davsclaus added this to the 4.22.3 milestone Oct 25, 2026
@davsclaus davsclaus added the enhancement New feature or request label Oct 25, 2026
@davsclaus
davsclaus merged commit 972eed6 into apache:camel-4.22.x Oct 25, 2026
5 checks passed
@oscerd
oscerd deleted the backport/28217-to-camel-4.22.x branch October 28, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport indicate that a Pull request is a backport from a fix from the main branch catalog components docs enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants