forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci_check_list.py
31 lines (25 loc) · 912 Bytes
/
ci_check_list.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import logging
from abc import ABC, abstractmethod
from typing import Any
from ci_workflow.ci_target import CiTarget
class CiCheckList(ABC):
def __init__(self, component: Any, target: CiTarget) -> None:
self.component = component
try:
self.component_ref_is_sha1 = True if len(self.component.ref) == 40 and int(self.component.ref, 16) else False
logging.debug("sha1 exists in ref")
except AttributeError:
logging.debug("sha1 not exist in ref")
self.target = target
@abstractmethod
def checkout(self, work_dir: str) -> None:
pass
@abstractmethod
def check(self) -> None:
pass