gtristan commented on code in PR #1903:
URL: https://github.com/apache/buildstream/pull/1903#discussion_r1539364816
##########
src/buildstream/sourcemirror.py:
##########
@@ -103,22 +110,35 @@ def __init__(
# the project level base variables, so there is no need
# to expand them redundantly here.
#
- node.validate_keys(["name", "kind", "config", "aliases"])
# Do local base class parsing first
name: str = node.get_str("name")
- self.__aliases: Dict[str, List[str]] = self.__load_aliases(node)
# Chain up to Plugin
super().__init__(name, context, project, node, "source-mirror")
+ self.__aliases: Set[str] = set()
# Plugin specific parsing
- config = node.get_mapping("config", default={})
- self._configure(config)
+ self._configure(node)
+
+ ##########################################################
+ # Internal API #
+ ##########################################################
+ def _get_alias_uris(self, alias: str) -> List:
+ assert self.__aliases is not None, "Didn't set aliases during
configuring time"
+ if alias in self.__aliases:
+ return [self]
+ return []
##########################################################
# Public API #
##########################################################
+
+ def set_supported_aliases(self, aliases: List[str]):
Review Comment:
Nit, please use the standard docstrings for public API...
This one is missing:
```
Args:
aliases: The list of ponies on the rainbow
```
--
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]