Skip to content

Conversation

@joshua-zivkovic
Copy link

@joshua-zivkovic joshua-zivkovic commented Nov 28, 2025

Fixes #2073

This PR provides a way for multi-source plugins to provide source provenance info in their own way instead of only the top level source source info being used.

This is done by exposing the optional source_provenance_attrs argument to create_source_info() which when used overrides the usage of the default provenance for a source. Any plugin that needs to parse provenance in it's own way can then supply it's results using this. This has been trialled with the cargo2 source plugin in https://gitlab.com/BuildStream/buildstream-plugins-community/-/merge_requests/408.

@joshua-zivkovic joshua-zivkovic force-pushed the JZ/multi-source-provenance branch 3 times, most recently from 2064cf3 to 2b0267c Compare December 1, 2025 10:07
@joshua-zivkovic joshua-zivkovic force-pushed the JZ/multi-source-provenance branch from 2b0267c to 84d65c5 Compare December 9, 2025 11:13
@joshua-zivkovic joshua-zivkovic marked this pull request as ready for review December 9, 2025 11:20
@joshua-zivkovic joshua-zivkovic force-pushed the JZ/multi-source-provenance branch from 84d65c5 to 835981f Compare December 12, 2025 13:14
@juergbi
Copy link
Contributor

juergbi commented Dec 12, 2025

Do plugins need access to the actual SourceProvenance object or might it be sufficient to make the new create_source_info() parameter a MappingNode and let create_source_info() create a _SourceProvenance internally? This would expose less in the public API, but I'm not sure whether that would suffice or not.

@joshua-zivkovic
Copy link
Author

Yup, taking in to account #2095 (comment), there's no need to expose SourceProvenance to achieve this.

This allows multi-source source plugins to provide this information per
source rather than as a singular top level.

This is done by adding a `provenance_node` parameter to
`create_source_info()` that when specified overrides the use of the
source's top level source provenance info.

Co-authored-by: Jürg Billeter <j@bitron.ch>
@juergbi juergbi force-pushed the JZ/multi-source-provenance branch from 835981f to bbc05ba Compare December 19, 2025 10:20
@juergbi
Copy link
Contributor

juergbi commented Dec 19, 2025

I've updated this branch as per my previous comment, but this still requires a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source provenance API for multiple-source source plugins

2 participants