feat: Replace deprecated Doppler recentLogs with Log Cache client#1237
feat: Replace deprecated Doppler recentLogs with Log Cache client#1237ZPascal wants to merge 17 commits intocloudfoundry:mainfrom
recentLogs with Log Cache client#1237Conversation
|
Thank you for the PR! Compilation is currently failing on the implementation missing the new recentLogs method that you added to the client |
0cb4438 to
ce0cd68
Compare
|
Thank you @pivotal-david-osullivan & @anthonydahanne for fixing the tests and the reactor part. I am also working on the issue again from the SAP side and I plan to set up a BBL environment to test the change in a CF environment. Let's sync on Slack how we can handle it together and we can discuss the test setup/steps. |
cool! |
- The DopplerClient does not work with Loggregator >= 107.0.0, and we cannot obtain "recent" logs. Until this is fixed, we cannot cut a release. That is the only blocking test. - See cloudfoundrygh-1181, cloudfoundrygh-1230, cloudfoundrygh-1237
…CF 2.x line (#1265) * Restrict ApplicationsTests#logs to CF 2.x line - The DopplerClient does not work with Loggregator >= 107.0.0, and we cannot obtain "recent" logs. Until this is fixed, we cannot cut a release. That is the only blocking test. - See gh-1181, gh-1230, gh-1237 * Introduce Applications#logs API that will replace the doppler-based implementation Signed-off-by: Daniel Garnier-Moiroux <daniel.garnier-moiroux@broadcom.com> --------- Signed-off-by: Daniel Garnier-Moiroux <daniel.garnier-moiroux@broadcom.com>
1edaf8c to
210376c
Compare
* because of the findFirst() on the envelopes, it could be type OUT or ERR, so we don't really care, as long as the payload is the same. Also, we don't care about the precise argument to the recentLogs call
The old "Applications.logs" method is keept for compatibility and when a log stream is needed. Adding new "logsRecent" method to access the logCache. integration-tests "ApplicationTest.logs" and "ApplicationTest.logsRecent" work. Minor changes in DefaultApplicationsTest in other JUnit tests to make them execute in Eclipse.
recentLogs with Log Cache client
Feat: Replace deprecated Doppler
recentLogswith Log Cache clientProblem
The
DopplerClient.recentLogs()endpoint relies on the Loggregator Traffic Controller/apps/{id}/recentlogsHTTP endpoint, which was removed in Loggregator ≥ 107.0 (shipped with CF Deployment ≥ 24.3 and Tanzu Application Service ≥ 4.0). Calls to this endpoint on modern CF foundations fail at runtime, and the related types (LogsRequest,LogMessagefromorg.cloudfoundry.doppler) caused compilation errors in the integration tests.Out of the scope
Fixes #1181 & #1230
Changes
cloudfoundry-clientDopplerClient.recentLogs()as@Deprecatedwith a Javadoc@deprecatednote pointing to the replacement API and documenting the platform version boundary (Loggregator < 107.0 / CFD < 24.3 / TAS < 4.0).LogCacheClient.recentLogs(ReadRequest)as the new, non-deprecated entry point.cloudfoundry-client-reactorReactorLogCacheEndpoints.recentLogs()— delegates to the existingread()method._ReactorLogCacheClient.cloudfoundry-operationsApplicationsinterface withlogsRecent(ReadRequest)backed byLogCacheClient.DefaultApplicationsto accept and hold aMono<LogCacheClient>alongside the existingMono<DopplerClient>.logs(LogsRequest)/logs(ApplicationLogsRequest)methods are now marked@Deprecated._DefaultCloudFoundryOperationsto exposelogCacheClientas an optional builder field (mirrors the existingdopplerClientpattern; missing client yields a descriptiveIllegalStateExceptionon first use).Integration & unit tests
AbstractOperationsTestandDefaultApplicationsTestto supply the newLogCacheClientmock.logsRecentDoppler,logsDoppler,logsNoAppDoppler) from Log Cache (logsRecentLogCache) paths; added@SuppressWarnings("deprecation")where the old API is still exercised.ApplicationsTest.logsRecent()integration test that provisions an application, fetches recent logs viaLogCacheClient, and asserts that each entry carries a validLogType(OUTorERR).IntegrationTestConfigurationto inject and wireLogCacheClientintoDefaultCloudFoundryOperations.Documentation (
README.md)## Deprecationssection (with a[!WARNING]callout) right after## Versions, covering:DopplerClient.recentLogs(),RecentLogsRequest,LogMessage),[!NOTE]callout in the### CloudFoundryClient, DopplerClient, UaaClient Builderssection cross-linking to the new deprecation notice.Migration guide
Checklist
logsRecentLogCache)logsRecent)@Deprecated+ Javadoc@deprecatedREADME.mdupdated with deprecation notice and migration guideIntegrationtest results
Logs of the Integration test run