-
Notifications
You must be signed in to change notification settings - Fork 40
Description
#2009 added the possibility to manually annotate sources with additional source provenance information that isn't part of the source configuration, such as the home page and the issue tracker. However, this applies to all SourceInfo produced by the source plugin.
This is problematic for source plugins such as cargo which download multiple archives/repositories based on a lock file from a previous source. Each of these archives/repositories needs to have its own provenance information. In addition it would be nice for the plugin to be able to pre-fill some information.
Adding some ideas from @gtristan:
We could:
- Add a type, e.g.
SourceProvenanceAttrs, something specifically to describe theprovenanceblock parsed bySourcewhich represents "Source provenance values which are explicitly declared by project authors"- Have a
@classmethodto create it from a nodeSourceProvenanceAttrs.new_from_node()(similar to what we have for a few types), along with a normal constructor with all keyword arguments for the attributes.- Add a
SourceProvenanceAttrskeyword argument toSource.create_source_info(), which if specified, is used to provide these attributes rather than the ones specified at the toplevel source.We could take this one step further and add a class level flag
Source.BST_CUSTOM_SOURCE_PROVENANCE, which; if set toTrue, causes the "provenance" attribute on sources to be an invalid key (preventing project authors from writing toplevel "provenance" attributes on sources likecargowhich support that in a custom way instead) - this could also trigger an assertion inSource.create_source_info()if the source fails to provide the attributes.