Support vendored Go native modules - #5289
Merged
Merged
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Two moderate test assertions need their single-quoted expected strings corrected before approval.
Pull request overview
This PR makes Cosmos native Go modules vendoring-compatible by placing archives and headers at module roots.
Changes:
- Flattens native outputs and removes stale paths.
- Strengthens checksum, provenance, and layout validation.
- Adds direct/vendored consumer checks and updates pipeline documentation.
File summaries
| File | Summary |
|---|---|
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/tests/Test-GoModuleConsumer.Tests.ps1 |
Tests consumer build command flow. |
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/tests/Prepare-GoDriverPullRequest.Tests.ps1 |
Tests staging, provenance, and path validation. |
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/tests/New-GoModules.Tests.ps1 |
Tests flat output layout and cleanup. |
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/Test-NativeLink.ps1 |
Links against root-level native inputs. |
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/Test-GoModuleConsumer.ps1 |
Builds direct and vendored Go consumers. |
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/README.md |
Documents layout and validation. |
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/Prepare-GoDriverPullRequest.ps1 |
Validates generated paths, checksums, and provenance. |
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/New-GoModules.ps1 |
Generates flat modules and removes stale outputs. |
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/native-driver.yml |
Adds CI validation for checksums and consumers. |
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/Invoke-LocalSupplyChain.ps1 |
Updates the local rehearsal flow. |
sdk/cosmos/azure_data_cosmos_driver_native/docs/NATIVE_SUPPLY_CHAIN.md |
Updates supply-chain documentation. |
Review details
Suppressed comments (2)
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/tests/New-GoModules.Tests.ps1:173
- Because this is a single-quoted PowerShell string, the backtick is literal, so this assertion searches for a backtick before
${SRCDIR}instead of the generated${SRCDIR}/nativetext. A linker file containing both the new root directive and the obsolete native-directory directive would therefore pass this check; remove the backtick from the expected string.
$linkContent | Should -Not -Match ([regex]::Escape('`${SRCDIR}/native'))
sdk/cosmos/azure_data_cosmos_driver_native/pipeline/tests/New-GoModules.Tests.ps1:188
- This repeats the same quoting error: in a single-quoted PowerShell string the backtick is literal, so the repository-wide check does not match the actual obsolete
${SRCDIR}/nativedirective. Remove the backtick so this regression check can fail when any generated linker file retains the old path.
$generatedContents | Should -Not -Match ([regex]::Escape('`${SRCDIR}/native'))
- Files reviewed: 11/11 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Place native archives at each generated module root so Go vendoring preserves the linker input. Validate the flat layout, checksums, and provenance, and exercise both direct and vendored consumers against a real native symbol. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ananth7592
force-pushed
the
ananth7592-vendored-go-modules
branch
from
September 15, 2026 22:32
1a3ddf5 to
22b1f35
Compare
Tomas Varon (tvaron3)
approved these changes
Sep 16, 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.
Place generated Cosmos native archives at each target module root so Go vendoring preserves the linker input and cgo can link through
${SRCDIR}.native/or.sysooutputscosmos_version()from a real native archiveValidation
-mod=vendorconsumer builds against the real archive: passed