mirror of
https://github.com/karma-riuk/crab.git
synced 2025-07-05 13:38:12 +02:00
entries in the dataset now store what build system
they use
This commit is contained in:
@ -13,6 +13,7 @@ class Metadata:
|
|||||||
pr_number: int
|
pr_number: int
|
||||||
merge_commit_sha: str # to checkout for the tests
|
merge_commit_sha: str # to checkout for the tests
|
||||||
successful: bool = True
|
successful: bool = True
|
||||||
|
build_system: str = ""
|
||||||
reason_for_failure: str = ""
|
reason_for_failure: str = ""
|
||||||
last_cmd_error_msg: str = ""
|
last_cmd_error_msg: str = ""
|
||||||
|
|
||||||
|
10
handlers.py
10
handlers.py
@ -124,6 +124,10 @@ class BuildHandler(ABC):
|
|||||||
def clean_repo(self) -> None:
|
def clean_repo(self) -> None:
|
||||||
self.container.exec_run(self.clean_cmd())
|
self.container.exec_run(self.clean_cmd())
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def get_type(self) -> str:
|
||||||
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def compile_cmd(self) -> str:
|
def compile_cmd(self) -> str:
|
||||||
pass
|
pass
|
||||||
@ -160,6 +164,9 @@ class MavenHandler(BuildHandler):
|
|||||||
# -Dstyle.color=never: Disables ANSI colors.
|
# -Dstyle.color=never: Disables ANSI colors.
|
||||||
# -Dartifact.download.skip=true: Prevents Maven from printing download logs (but still downloads dependencies when needed).
|
# -Dartifact.download.skip=true: Prevents Maven from printing download logs (but still downloads dependencies when needed).
|
||||||
|
|
||||||
|
def get_type(self) -> str:
|
||||||
|
return "maven"
|
||||||
|
|
||||||
def compile_cmd(self) -> str:
|
def compile_cmd(self) -> str:
|
||||||
return f"{self.base_cmd} clean compile"
|
return f"{self.base_cmd} clean compile"
|
||||||
|
|
||||||
@ -205,6 +212,9 @@ class GradleHandler(BuildHandler):
|
|||||||
super().__init__(repo_path, build_file, updates)
|
super().__init__(repo_path, build_file, updates)
|
||||||
self.base_cmd = "gradle --no-daemon --console=plain"
|
self.base_cmd = "gradle --no-daemon --console=plain"
|
||||||
|
|
||||||
|
def get_type(self) -> str:
|
||||||
|
return "gradle"
|
||||||
|
|
||||||
def compile_cmd(self) -> str:
|
def compile_cmd(self) -> str:
|
||||||
return f"{self.base_cmd} compileJava"
|
return f"{self.base_cmd} compileJava"
|
||||||
|
|
||||||
|
@ -121,6 +121,7 @@ def process_pull(repo: Repository, pr: PullRequest, dataset: Dataset, repos_dir:
|
|||||||
entry.metadata.reason_for_failure = "Couldn't get the build handler"
|
entry.metadata.reason_for_failure = "Couldn't get the build handler"
|
||||||
entry.metadata.successful = False
|
entry.metadata.successful = False
|
||||||
return
|
return
|
||||||
|
entry.metadata.build_system = build_handler.get_type()
|
||||||
build_handler.set_client(docker_client)
|
build_handler.set_client(docker_client)
|
||||||
|
|
||||||
def _check_coverage(files: list[str]):
|
def _check_coverage(files: list[str]):
|
||||||
|
Reference in New Issue
Block a user