diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py index a7d3ad6e32ee8db89cde9afa6ea81840144fd22d..4f4d6866fa1f2ed1018c9a908bdad3b81b4b39c1 100644 --- a/buildstream/plugins/sources/git.py +++ b/buildstream/plugins/sources/git.py @@ -68,6 +68,12 @@ git - stage files from a git repository url: upstream:baz.git checkout: False +**Configurable Warnings:** + +This plugin provides the following configurable warnings: + +- 'git:inconsistent-submodule' - A submodule was found to be missing from the underlying git repository. + """ import os @@ -84,6 +90,9 @@ from buildstream import utils GIT_MODULES = '.gitmodules' +# Warnings +INCONSISTENT_SUBMODULE = "inconsistent-submodules" + # Because of handling of submodules, we maintain a GitMirror # for the primary git source and also for each submodule it @@ -283,7 +292,7 @@ class GitMirror(SourceFetcher): "underlying git repository with `git submodule add`." self.source.warn("{}: Ignoring inconsistent submodule '{}'" - .format(self.source, submodule), detail=detail) + .format(self.source, submodule), detail=detail, warning_token=INCONSISTENT_SUBMODULE) return None @@ -350,6 +359,9 @@ class GitSource(Source): return Consistency.RESOLVED return Consistency.INCONSISTENT + def get_warnings(self): + return [INCONSISTENT_SUBMODULE] + def load_ref(self, node): self.mirror.ref = self.node_get_member(node, str, 'ref', None)