oscerd opened a new pull request, #25814:
URL: https://github.com/apache/camel/pull/25814
Backport to `camel-4.18.x` of the two camel-google audit fixes that never
reached this branch. Both are
already on `main` and on `camel-4.22.x` — they predate the 4.22.0 cut, so no
4.22.x backport is needed.
### CAMEL-24344 — camel-google-mail: `raw=true` returns the message
Cherry-pick of e8dc6b8 (#25357).
The `google-mail-stream` consumer always asked the Gmail API for the `FULL`
message format, but the `raw`
field is only populated for the `RAW` format, so `raw=true` always produced
a `null` body. The non-raw path
only looked at the first element of `getParts()`, so a message that is not
multipart carried no body and a
nested multipart yielded nothing. A failed exchange also marked the mail as
unread again even when
`markAsRead` had never been enabled.
**Behaviour change**: with `raw=true` the Gmail API does not return the
parsed `payload`, so
`CamelGoogleMailStreamSubject`, `...From`, `...To`, `...Cc`, `...Bcc` and
`...MessageId` stop being set —
those values are part of the RFC 2822 content that now reaches the body.
`...Id`, `...ThreadId` and
`...LabelIds` are unaffected. The 4.18.5 upgrade-guide note is added on
`main` in a companion PR, since the
guides for every release line live there.
### CAMEL-24345 — camel-google-vertexai: `jsonMode` is applied
**Partial backport, hand-ported rather than cherry-picked.** On `main` the
fix applies both
`streamOutputMode` and `jsonMode`. On this branch `generateChatStreaming` is
still
`throw new UnsupportedOperationException("Streaming is not yet
implemented")`, so `streamOutputMode` cannot
be applied without backporting the streaming feature itself — that half is
deliberately left out, and the
option stays inert here.
What is backported:
* `jsonMode=true` now sets the response MIME type of the request to
`application/json`. The option was
declared and documented but never read.
* `buildRawPredictRequestBody` no longer throws a `NullPointerException`
when the exchange carries no body.
* `generateChat` and `generateCode` are documented as aliases of
`generateText`, which is what they already
do on this branch too.
The test is trimmed to the two `jsonMode` cases and builds the endpoint
directly instead of resolving it on
a started context, so it does not need Google credentials — the shape #25391
settled on `main`.
`org.assertj:assertj-core` had to be added as a test dependency to
`camel-google-mail` (`main` already has
it, so the cherry-pick carried no pom change) and to `camel-google-vertexai`.
### Verification
* `mvn clean install` on `components/camel-google/camel-google-mail` and on
`components/camel-google/camel-google-vertexai`, both green.
* `GoogleMailStreamConsumerBodyTest` — 6 tests, and
`GoogleVertexAIProducerOptionsTest` — 2 tests, all pass.
The vertexai test was also run with `CLOUDSDK_CONFIG` pointed at an empty
directory and
`GOOGLE_APPLICATION_CREDENTIALS` cleared, to confirm it does not silently
depend on local credentials.
* Full reactor `mvn clean install -DskipTests -Dquickly` from the root of
the branch, green, with no
generated-file drift.
---
_Claude Code on behalf of oscerd_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]