dev #10
joj3_config_generator
|
@ -4,7 +4,7 @@ from typing import List
|
|||
from joj3_config_generator.models import joj1, repo, result, task
|
||||
from joj3_config_generator.models.const import CACHE_ROOT, JOJ3_CONFIG_ROOT
|
||||
from joj3_config_generator.processers.repo import (
|
||||
get_healthcheck_config,
|
||||
get_health_check_config,
|
||||
get_teapot_stage,
|
||||
)
|
||||
from joj3_config_generator.processers.task import (
|
||||
|
@ -32,9 +32,9 @@ def convert(repo_conf: repo.Config, task_conf: task.Config) -> result.Config:
|
|||
)
|
||||
jon-lee marked this conversation as resolved
Outdated
|
||||
|
||||
current_test = os.environ.get("PYTEST_CURRENT_TEST") is not None
|
||||
# Construct healthcheck stage
|
||||
# Construct health check stage
|
||||
if not repo_conf.force_skip_health_check_on_test or not current_test:
|
||||
result_conf.stage.stages.append(get_healthcheck_config(repo_conf))
|
||||
result_conf.stage.stages.append(get_health_check_config(repo_conf))
|
||||
jon-lee marked this conversation as resolved
Outdated
张泊明518370910136
commented
where is it used? where is it used?
李衍志523370910113
commented
this should be storing all the files that are about to be copy in or out this should be storing all the files that are about to be copy in or out
李衍志523370910113
commented
It is as the input and output for the following functions about parsers It is as the input and output for the following functions about parsers
张泊明518370910136
commented
so this feature is not implemented? so this feature is not implemented?
李衍志523370910113
commented
it is
this is a loop, so this ```python
if not repo_conf.force_skip_health_check_on_test or not current_test:
result_conf.stage.stages.append(get_health_check_config(repo_conf))
cached: List[str] = []
# Convert each stage in the task configuration
for task_stage in task_conf.stages:
executor_with_config, cached = get_executor_with_config(task_stage, cached)
conf_stage = get_conf_stage(task_stage, executor_with_config)
conf_stage = fix_result_detail(task_stage, conf_stage)
conf_stage = fix_dummy(task_stage, conf_stage)
conf_stage = fix_keyword(task_stage, conf_stage)
conf_stage = fix_file(task_stage, conf_stage)
conf_stage = fix_diff(task_stage, conf_stage, task_conf)
result_conf.stage.stages.append(conf_stage)
```
it is
```python
for task_stage in task_conf.stages:
executor_with_config, cached = get_executor_with_config(task_stage, cached)
```
this is a loop, so this `cached` will be updated in every round of stage
张泊明518370910136
commented
The return value is unnecessary. The return value is unnecessary.
李衍志523370910113
commented
I have a lazing coding style here, everything has get imported would get exported, so should maintain this until the end of the loop. Everything is exported in previous stage would be imported in the next stage. I have a lazing coding style here, everything has get imported would get exported, so should maintain this until the end of the loop. Everything is exported in previous stage would be imported in the next stage.
张泊明518370910136
commented
1. The return value is unnecessary
2. It should be a `set`
张泊明518370910136
commented
try it yourself try it yourself
李衍志523370910113
commented
I see why I see why
李衍志523370910113
commented
resolved. resolved.
|
||||
cached: List[str] = []
|
||||
# Convert each stage in the task configuration
|
||||
for task_stage in task_conf.stages:
|
||||
|
|
|
@ -34,7 +34,7 @@ def get_teapot_stage(repo_conf: repo.Config) -> result.StageDetail:
|
|||
return stage_conf
|
||||
|
||||
|
||||
def get_healthcheck_args(repo_conf: repo.Config) -> List[str]:
|
||||
def get_health_check_args(repo_conf: repo.Config) -> List[str]:
|
||||
return [
|
||||
"/usr/local/bin/repo-health-checker",
|
||||
"-root=.",
|
||||
|
@ -45,7 +45,7 @@ def get_healthcheck_args(repo_conf: repo.Config) -> List[str]:
|
|||
]
|
||||
|
||||
|
||||
def get_debug_args(repo_conf: repo.Config) -> List[str]:
|
||||
def get_teapot_check_args(repo_conf: repo.Config) -> List[str]:
|
||||
group_config = ""
|
||||
for i, name in enumerate(repo_conf.groups.name):
|
||||
group_config = (
|
||||
|
@ -67,9 +67,9 @@ def get_debug_args(repo_conf: repo.Config) -> List[str]:
|
|||
]
|
||||
|
||||
|
||||
def get_healthcheck_config(repo_conf: repo.Config) -> result.StageDetail:
|
||||
healthcheck_stage = result.StageDetail(
|
||||
name="healthcheck",
|
||||
def get_health_check_config(repo_conf: repo.Config) -> result.StageDetail:
|
||||
health_check_stage = result.StageDetail(
|
||||
name="Health Check",
|
||||
group="",
|
||||
executor=result.Executor(
|
||||
name="local",
|
||||
|
@ -77,10 +77,10 @@ def get_healthcheck_config(repo_conf: repo.Config) -> result.StageDetail:
|
|||
default=result.Cmd(),
|
||||
cases=[
|
||||
result.OptionalCmd(
|
||||
args=get_healthcheck_args(repo_conf),
|
||||
args=get_health_check_args(repo_conf),
|
||||
),
|
||||
result.OptionalCmd(
|
||||
args=get_debug_args(repo_conf),
|
||||
args=get_teapot_check_args(repo_conf),
|
||||
env=[f"LOG_FILE_PATH={CACHE_ROOT}/joint-teapot-debug.log"],
|
||||
),
|
||||
],
|
||||
|
@ -91,7 +91,7 @@ def get_healthcheck_config(repo_conf: repo.Config) -> result.StageDetail:
|
|||
result.ParserConfig(name="debug", with_={"score": 0}),
|
||||
],
|
||||
)
|
||||
return healthcheck_stage
|
||||
return health_check_stage
|
||||
|
||||
|
||||
def calc_sha256sum(file_path: Path) -> str:
|
||||
|
|
Loading…
Reference in New Issue
Block a user
Make this
Path.home()
default to/home/tt
. For now, create a const for this dir.fixed