abderrahim commented on PR #1898: URL: https://github.com/apache/buildstream/pull/1898#issuecomment-1999783431
> Can we pause for a moment and just ask ourselves: > > * If the SourceMirror plugin's translate_url() API has enough context > * If the toplevel project which wants to override subproject mirrors, can only do so with a provided custom SourceMirror plugin > * Then do we avoid the need of all this specific mapping ? > * If so, is it worthwhile to do it this way ? Or is it more valuable to allow using the default mirror format, without custom plugins, to override subproject mirrors too ? I think it is reasonable. By introducing source mirror plugins we give ourselves the opportunity to "break" backwards compatibility without really breaking backwards compatibility. What I mean is that we could have a `default` or `legacy` source mirror plugin that mirrors the behaviour and limitations of the previous design (and use it if `kind` is not specified), and then we can have a improved and slightly incompatible plugin that is still a core plugin that can be requested by specifying `kind`. > If we _must_ target specific subprojects, we should do so by matching junction paths rather than project names, as multiple versions of the same project may exist in a tree/graph of loaded projects, with different aliases to resolve in those different versions. I'm not sure about this. If we're using two different versions of the same project, it is very unlikely that an alias would change in an incompatible way. The most likely change is that an alias is added or removed, and I wouldn't want to duplicate the aliases in this case. > > As aliases are generally project-specific, we can't simply apply a project's mirror config to its subprojects. However, could it make sense to support specifying an alias mapping in junctions? I.e., map aliases of the subproject to aliases of the current project (not URLs). And then the mirror configuration of the current project could be applied incl. mirror plugins. An interesting aspect of this would be that this could work recursively and avoid the behavior difference mentioned above. > > A possible alternative to specifying a mapping for each alias in the subproject would be to specify an alias prefix. > > This is an interesting alternative, as it allows overriding subproject aliases and mirrors in cases where a custom `SourceMirror` plugin is not needed. This one sounds reasonable too. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
