feat: support issue label config in repo.toml
This commit is contained in:
parent
e2dc094263
commit
2bcf4f8c60
|
@ -20,6 +20,18 @@ class Groups(BaseModel):
|
|||
)
|
||||
|
||||
|
||||
class Label(BaseModel):
|
||||
name: str = "Kind/Testing"
|
||||
color: str = "#795548"
|
||||
|
||||
|
||||
class Issue(BaseModel):
|
||||
label: Label = Label()
|
||||
show_submitter: bool = Field(
|
||||
True, validation_alias=AliasChoices("show-submitter", "show_submitter")
|
||||
)
|
||||
|
||||
|
||||
class Config(BaseModel):
|
||||
max_size: float = Field(
|
||||
10, ge=0, validation_alias=AliasChoices("max-size", "max_size")
|
||||
|
@ -57,12 +69,7 @@ class Config(BaseModel):
|
|||
health_check_score: int = Field(
|
||||
0, validation_alias=AliasChoices("health-check-score", "health_check_score")
|
||||
)
|
||||
submitter_in_issue_title: bool = Field(
|
||||
True,
|
||||
validation_alias=AliasChoices(
|
||||
"submitter-in-issue-title", "submitter_in_issue_title"
|
||||
),
|
||||
)
|
||||
issue: Issue = Issue()
|
||||
|
||||
@model_validator(mode="after")
|
||||
def set_grading_repo_name_from_cwd(self) -> "Config":
|
||||
|
|
|
@ -38,8 +38,12 @@ def get_teapot_post_stage(
|
|||
if task_conf.max_total_score is not None
|
||||
else str(repo_conf.max_total_score)
|
||||
),
|
||||
"--issue-label-name",
|
||||
repo_conf.issue.label.name,
|
||||
"--issue-label-color",
|
||||
repo_conf.issue.label.color,
|
||||
]
|
||||
if not repo_conf.submitter_in_issue_title:
|
||||
if not repo_conf.issue.show_submitter:
|
||||
args.append("--no-submitter-in-issue-title")
|
||||
if task_conf.time.end:
|
||||
args.extend(
|
||||
|
|
|
@ -811,6 +811,10 @@
|
|||
"ece280-joj",
|
||||
"--max-total-score",
|
||||
"10245871",
|
||||
"--issue-label-name",
|
||||
"Kind/Testing",
|
||||
"--issue-label-color",
|
||||
"#795548",
|
||||
"--end-time",
|
||||
"2024-12-30T23:59:59",
|
||||
"--penalty-config",
|
||||
|
|
Loading…
Reference in New Issue
Block a user