Enhance content downloader with V2 contract and logging improvements#861
Merged
Enhance content downloader with V2 contract and logging improvements#861
Conversation
Enhance PR #828's logging initialization for content downloaders with proper backward compatibility via a V2 contract model: - Add V2 contract version (2.0) constants and ADUC_ContractUtils_IsV2Contract() - Add InitializeV1Proc typedef for V1 ABI (1 arg) alongside V2's InitializeProc (2 args) - Branch InitializeContentDownloader on contract version: V1 calls with 1 arg, V2 with 2 args - Remove Cleanup from required symbols array so V1 extensions still load - Only call Cleanup on the content downloader lib (not all libs) and only for V2 - Update Download() to accept both V1 and V2 contract versions - Update curl and DO downloaders to report V2 contract - Add unit tests for V1/V2/unsupported contract version routing Addresses ABI compatibility concerns raised in #828. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update extension-contract-versions.md with V1 vs V2 content downloader contract details (Initialize signature change, Cleanup export). Update device-update-agent-extensibility-points.md custom content downloader section with V1/V2 guidance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
AndreRicardo-Zoetis
left a comment
There was a problem hiding this comment.
Thanks for the reply back and the new PR suggestions, PR looks good to me.
I'm still struggling to see how users on current version (now called v1) see/initialize their logs but it makes sense to try to make this as backwards compatible as possible so they don't have to recompile their extensions.
We have the changes made in #828 already in our production release so we can see the download logs.
chgennar
previously approved these changes
Apr 22, 2026
- extension_manager_ut.cpp: pass ADUC_LOG_DEBUG to InitializeContentDownloader
callsites (build break after logLevel param was added)
- extension_manager_ut.cpp, extension_manager_download_test_case.cpp: use
{3,0} instead of {2,0} for the 'unsupported contract version' scenarios,
since {2,0} is now a supported V2 contract
- curl_content_downloader_ut.cpp: update GetContractInfo test to expect V2,
matching curl downloader's reported contract version
All 744 unit tests pass.
mirskiy
approved these changes
Apr 22, 2026
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.
NOTE: This pull request contains an improvement in ADU Agent logging proposed by PR #828 by @AndreRicardo-Zoetis (Thank you!)
This pull request updates the content downloader extension contract to version 2.0, introducing improved logging initialization and cleanup support. The changes ensure backward compatibility with version 1.0 while enabling new extensions to take advantage of enhanced initialization and resource management. Documentation has been updated to reflect the new contract, and the agent and extension manager have been refactored to support both V1 and V2 contracts.
Content Downloader Contract V2 Support:
Added support for V2 (2.0) content downloader contract, which changes the
Initializemethod to accept alogLevelparameter and introduces an optionalCleanupexport for resource cleanup before unloading the library. The agent now detects the contract version at load time and dispatches accordingly. [1]], [2]], [3]], [4]], [5]])Updated both
curl_content_downloader.EXPORTS.cppanddeliveryoptimization_content_downloader.EXPORTS.cppto implement the V2 contract: initializing logging inInitialize, reporting contract version 2.0 inGetContractInfo, and providing aCleanupmethod to uninitialize logging. [1]], [2]], [3]], [4]])Agent and Extension Manager Refactoring:
logLevelparameter to the content downloader'sInitializemethod and to call theCleanupexport when unloading V2 contract libraries. [1]], [2]], [3]], [4]], [5]], [6]], [7]], [8]])Documentation Updates:
Test Suite Enhancements: