feat: add whitelist character support in repo toml #29

Merged
张泊明518370910136 merged 6 commits from feat_repo-healthcheck-whitelist-char into master 2026-04-22 17:06:55 +08:00

This commit introduces a new key, health-check.whitelisted-chars for repo.toml. It allows TAs to configure repo-wide allowed non ASCII chars for the repo-health-checker binary. It results in a new command line switch, -whitelisted-chars=X,Y,Z, in the generated task.json.

Co-Authored-By: GitHub Copilot noreply@microsoft.com

Copilot Prompt
This repository contains a Python app that does conversion from TOML config files to a complex, multistage JSON config file for an online judge system. For example, under `tests/convert/full`, input are the two TOML files `repo.toml` and `task.toml`, output is one JSON file `task,json`.

Now, I want the repo-specific config (repo.toml) to accept an extra dotted key, "health-check.whitelisted-chars". This key shall accept an array of UTF-8 non-ASCII characters. To do so, I want you to

  • Model. Under joj3_config_generator/models/repo.py, add an extra field whitelisted_chars to class HealthCheck, identified by both "whitelisted-chars" and "whitelisted_chars";
  • Transforming. Under joj3_config_generator/transforers/repo.py, translate the field to an additional command line switch -whitelisted-chars, comma-separated.
  • Other files you deem necessary, based on your understanding of this repo.

IMPORTANT. Before you start, explore this repo to under the file structure and file-function relations.

This repo uses the PDM package manager. After you finish your work, test your work appropriately. You should create new testcases under tests/.

  • Details: Read the output task.json after running the test, to verify whether the command line switch was added to the Health Check stage or not.
This commit introduces a new key, `health-check.whitelisted-chars` for repo.toml. It allows TAs to configure repo-wide allowed non ASCII chars for the repo-health-checker binary. It results in a new command line switch, `-whitelisted-chars=X,Y,Z`, in the generated task.json. Co-Authored-By: GitHub Copilot <noreply@microsoft.com> <details> <summary>Copilot Prompt</summary> <br> This repository contains a Python app that does conversion from TOML config files to a complex, multistage JSON config file for an online judge system. For example, under `tests/convert/full`, input are the two TOML files `repo.toml` and `task.toml`, output is one JSON file `task,json`. Now, I want the repo-specific config (**repo.toml**) to accept an extra dotted key, "health-check.whitelisted-chars". This key shall accept an array of UTF-8 non-ASCII characters. To do so, I want you to - Model. Under `joj3_config_generator/models/repo.py`, add an extra field *whitelisted_chars* to class *HealthCheck*, identified by both "whitelisted-chars" and "whitelisted_chars"; - Transforming. Under `joj3_config_generator/transforers/repo.py`, translate the field to an additional command line switch `-whitelisted-chars`, comma-separated. - Other files you deem necessary, based on your understanding of this repo. IMPORTANT. Before you start, explore this repo to under the file structure and file-function relations. This repo uses the PDM package manager. After you finish your work, test your work appropriately. You should create new testcases under `tests/`. - Details: Read the output `task.json` after running the test, to verify whether the command line switch was added to the *Health Check* `stage` or not. </details>
王韵晨520370910012 added 1 commit 2026-04-08 07:25:20 +08:00
feat: add whitelist character support in repo toml
Some checks failed
build / build (push) Failing after 2m48s
build / trigger-build-image (push) Has been skipped
build / build (pull_request) Failing after 2m2s
build / trigger-build-image (pull_request) Has been skipped
f26a6e8f90
This commit introduces a new key, `health-check.whitelisted-chars` for
repo.toml. It allows TAs to configure repo-wide allowed non ASCII chars
for the repo-health-checker binary. It results in a new command line
switch, `-whitelisted-chars=X,Y,Z`, in the generated task.json.
王韵晨520370910012 added 1 commit 2026-04-08 07:31:02 +08:00
fix: case mangled in whitelist-char tests
Some checks failed
build / build (pull_request) Failing after 3m3s
build / build (push) Failing after 3m5s
build / trigger-build-image (pull_request) Has been skipped
build / trigger-build-image (push) Has been skipped
a59373a972
王韵晨520370910012 added 1 commit 2026-04-08 07:37:32 +08:00
fix: case mangled in whitelist-char tests
All checks were successful
build / build (push) Successful in 2m38s
build / build (pull_request) Successful in 2m37s
build / trigger-build-image (push) Has been skipped
build / trigger-build-image (pull_request) Has been skipped
926f786d83
王韵晨520370910012 requested review from manuel 2026-04-08 07:38:09 +08:00
王韵晨520370910012 requested review from 李衍志523370910113 2026-04-08 07:38:11 +08:00
Author
Member

So I just found out that JOJ3 uses camelCase... pushing an update to reflect this

So I just found out that JOJ3 uses camelCase... pushing an update to reflect this
王韵晨520370910012 added 1 commit 2026-04-08 07:53:49 +08:00
fix: use camelCase for the cmdline switch generated
All checks were successful
build / build (pull_request) Successful in 3m3s
build / build (push) Successful in 3m9s
build / trigger-build-image (pull_request) Has been skipped
build / trigger-build-image (push) Has been skipped
51392cc156
王韵晨520370910012 added the
enhancement
label 2026-04-08 11:58:21 +08:00
李衍志523370910113 scheduled this pull request to auto merge when all checks succeed 2026-04-18 09:34:11 +08:00
李衍志523370910113 approved these changes 2026-04-18 09:34:52 +08:00
Dismissed
李衍志523370910113 left a comment
Member

LGTM

LGTM
李衍志523370910113 scheduled this pull request to auto merge when all checks succeed 2026-04-18 09:36:02 +08:00

Could you also add the field to tests/convert/full?

Could you also add the field to `tests/convert/full`?
张泊明518370910136 requested changes 2026-04-18 14:15:31 +08:00
Dismissed
@ -0,0 +1 @@
health-check.whitelisted-chars = ["你", "好", ""]

And can we make it simpler by letting them provide a long string and split it to single characters by the script?

And can we make it simpler by letting them provide a long string and split it to single characters by the script?
Author
Member

Do you have an example? Like,

health-check.whitelisted-chars = "你好!"
Do you have an example? Like, ```toml health-check.whitelisted-chars = "你好!" ```

I think it should work. cc @manuel

I think it should work. cc @manuel
Owner

sounds good, thanks!

sounds good, thanks!
Author
Member

Thanks, will strive to work this out before 10am today UTC+8

Thanks, will strive to work this out before 10am today UTC+8
mac-wang marked this conversation as resolved
王韵晨520370910012 added 2 commits 2026-04-22 09:52:02 +08:00
test: add health-check.whitelisted_chars to convert/full
All checks were successful
build / build (pull_request) Successful in 6m16s
build / build (push) Successful in 6m14s
build / trigger-build-image (pull_request) Has been skipped
build / trigger-build-image (push) Has been skipped
a12f7f3b19
王韵晨520370910012 dismissed jon-lee’s review 2026-04-22 09:52:02 +08:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Author
Member

Done.

Done.
王韵晨520370910012 requested review from 张泊明518370910136 2026-04-22 09:52:57 +08:00
张泊明518370910136 approved these changes 2026-04-22 16:23:35 +08:00
Dismissed
张泊明518370910136 approved these changes 2026-04-22 16:31:12 +08:00
张泊明518370910136 removed review request for manuel 2026-04-22 16:44:41 +08:00
张泊明518370910136 merged commit 8176ea8c5e into master 2026-04-22 17:06:55 +08:00
张泊明518370910136 deleted branch feat_repo-healthcheck-whitelist-char 2026-04-22 17:06:57 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: JOJ/JOJ3-config-generator#29
No description provided.