dev #10

Merged
李衍志523370910113 merged 238 commits from dev into master 2025-03-05 16:20:39 +08:00
2 changed files with 11 additions and 11 deletions
Showing only changes of commit 8ad4d6f2a0 - Show all commits
joj3_config_generator

View File

@ -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

Make this Path.home() default to /home/tt. For now, create a const for this dir.

Make this `Path.home()` default to `/home/tt`. For now, create a const for this dir.

fixed

fixed
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

where is it used?

where is it used?

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

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

so this feature is not implemented?

so this feature is not implemented?
    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

    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

```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

The return value is unnecessary.

The return value is unnecessary.

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.
  1. The return value is unnecessary
  2. It should be a set
1. The return value is unnecessary 2. It should be a `set`

try it yourself

try it yourself

I see why

I see why

resolved.

resolved.
cached: List[str] = []
# Convert each stage in the task configuration
for task_stage in task_conf.stages:

View File

@ -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: