Compare commits

..

5 Commits

Author SHA1 Message Date
99e66cb3ff
fix: rebase error
All checks were successful
build / build (push) Successful in 2m46s
build / trigger-build-image (push) Has been skipped
build / build (pull_request) Successful in 2m54s
build / trigger-build-image (pull_request) Has been skipped
2025-07-01 00:27:26 -04:00
df0bc226f0
docs: comments on copy-in-cwd & limit
Some checks failed
build / trigger-build-image (push) Blocked by required conditions
build / build (push) Has been cancelled
build / build (pull_request) Failing after 2m32s
build / trigger-build-image (pull_request) Has been skipped
2025-07-01 00:25:30 -04:00
9d9d4ecd45
fix: typo 2025-07-01 00:25:30 -04:00
37e0f35401
docs: full toml sample with full comments 2025-07-01 00:25:30 -04:00
4ff0fef0ff
docs: full toml sample 2025-07-01 00:25:30 -04:00
4 changed files with 10 additions and 14 deletions

View File

@ -9,6 +9,7 @@ from joj3_config_generator.models.common import Memory
class Files(BaseModel):
required: List[str] = []
# TODO: remove immutable in the future
immutable: List[str] = []
@ -44,9 +45,6 @@ class HealthCheck(BaseModel):
Path("immutable"),
validation_alias=AliasChoices("immutable-path", "immutable_path"),
)
required_files: List[str] = Field(
[], validation_alias=AliasChoices("required-files", "required_files")
)
@field_validator("max_size", mode="before")
@classmethod
@ -78,6 +76,7 @@ class Config(BaseModel):
"",
validation_alias=AliasChoices("grading-repo-name", "grading_repo_name"),
)
files: Files = Files()
sandbox_token: str = Field(
"", validation_alias=AliasChoices("sandbox-token", "sandbox_token")
)
@ -90,8 +89,7 @@ class Config(BaseModel):
health_check: HealthCheck = Field(
HealthCheck(), validation_alias=AliasChoices("health-check", "health_check")
)
# TODO: remove files, max_size, health_check_score, and immutable_path in the future
files: Files = Files()
# TODO: remove max_size, health_check_score, and immutable_path in the future
max_size: float = Field(
10, ge=0, validation_alias=AliasChoices("max-size", "max_size")
)
@ -128,9 +126,4 @@ class Config(BaseModel):
self.health_check.max_size = Memory(f"{self.max_size}m")
if "immutable_path" in self.model_fields_set:
self.health_check.immutable_path = self.immutable_path
if (
"files" in self.model_fields_set
and "required" in self.files.model_fields_set
):
self.health_check.required_files = self.files.required
return self

View File

@ -125,7 +125,7 @@ def get_health_check_args(repo_conf: repo.Config) -> List[str]:
"/usr/local/bin/repo-health-checker",
"-root=.",
f"-repoSize={str(repo_conf.health_check.max_size / 1024 / 1024)}", # B -> MB
*[f"-meta={meta}" for meta in repo_conf.health_check.required_files],
*[f"-meta={meta}" for meta in repo_conf.files.required],
f"-checkFileSumList={','.join(file_sums)}",
f"-checkFileNameList={','.join(file_names)}",
]

View File

@ -5,11 +5,14 @@ sandbox-token = "test"
max-total-score = 1000
health-check.max-size = "50.5m"
health-check.immutable-path = "immutable"
health-check.required-files = ["README.md", "Changelog.md"]
health-check.immutable_path = "immutable"
# for tests
[groups]
name = ["joj", "run"]
max-count = [1000, 1000]
time-period-hour = [24, 24]
[files]
required = ["README.md", "Changelog.md"]
immutable = [".gitignore", ".gitattributes",".gitea/workflows/push.yaml", ".gitea/workflows/release.yaml"]

View File

@ -1,9 +1,9 @@
files.required = ["README.md", "Changelog.md"] # required files name, case insensitive
sandbox-token = "" # sandbox token
health-check.score = 0 # score for health check stage
health-check.max-size = "10m" # max size of the repository
health-check.immutable-path = "immutable" # path for immutable files, relative to the path of repo.toml
health-check.required-files = ["README.md", "Changelog.md"] # required files name, case insensitive
issue.label.name = "Kind/Testing" # label for issues
issue.label.color = "#795548" # color for the label