mirror of
https://github.com/getsolus/packages.git
synced 2025-04-25 20:30:37 +03:00
ci/package_checks: Add check for monitoring.yml
**Summary** Add a check that errors when `monitoring.yml` does not exist.
This commit is contained in:
parent
34d5cba3d5
commit
f49584930b
1 changed files with 17 additions and 0 deletions
|
@ -301,6 +301,9 @@ class PullRequestCheck:
|
|||
with self._open(path) as f:
|
||||
return str(f.read())
|
||||
|
||||
def _exists(self, path: str) -> bool:
|
||||
return os.path.exists(self._path(path))
|
||||
|
||||
def load_package_yml(self, file: str) -> PackageYML:
|
||||
with self._open(file) as f:
|
||||
return PackageYML(f)
|
||||
|
@ -417,6 +420,19 @@ class Homepage(PullRequestCheck):
|
|||
return 'homepage' in yaml.load(f)
|
||||
|
||||
|
||||
class Monitoring(PullRequestCheck):
|
||||
_error = '`monitoring.yml` is missing'
|
||||
_level = Level.WARNING
|
||||
|
||||
def run(self) -> List[Result]:
|
||||
return [Result(message=self._error, file=f, level=self._level)
|
||||
for f in self.package_files
|
||||
if not self._has_monitoring_yml(f)]
|
||||
|
||||
def _has_monitoring_yml(self, file: str) -> bool:
|
||||
return self._exists(os.path.join(os.path.dirname(file), 'monitoring.yml'))
|
||||
|
||||
|
||||
class PackageBumped(PullRequestCheck):
|
||||
_msg = 'Package release is not incremented by 1'
|
||||
_msg_new = 'Package release is not 1'
|
||||
|
@ -782,6 +798,7 @@ class Checker:
|
|||
CommitMessage,
|
||||
FrozenPackage,
|
||||
Homepage,
|
||||
Monitoring,
|
||||
PackageBumped,
|
||||
PackageDependenciesOrder,
|
||||
PackageDirectory,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue