Commit Graph

232 Commits

Author SHA1 Message Date
04ae1c8674 feat: add whitelist char support to nonascii check (#100)
All checks were successful
submodules sync / sync (push) Successful in 4m27s
build / build (push) Successful in 6m32s
build / trigger-build-image (push) Successful in 23s
This commit brings support of whitelisted characters during repo healthcheck/non-ascii file check. Supported by an extra switch to `repo-health-checker`, `-whitelistedChars`. The argument takes a comma-separated list of non-ASCII characters and ignores them during repo healthcheck. Illegal cmdline input is logged by the logger.

Co-Authored-By: GitHub Copilot <noreply@microsoft.com>
<details>
<summary>Copilot Prompt</summary>
<br>
This is a repo for an online judge orchestrator system «JOJ3». Under `cmd/` lies a source directory for a Go command, `repo-health-checker`. You tell from its name that it checks the repo for stuff like repo size, commit message, non-ASCII character usage, etc. before sending the work to the actual judging and grading system.

Now, I want the non-ASCII character checking function of the repo health checker to be flexible - it shall accept a list of non-ASCII characters and deem them acceptable.

## Your task

- Accept this new cmdline arg. In `cmd/repo-health-checker/main.go`, accept a new command line flag `-whitelisted-chars`, which shall take exactly one string of comma-separated non-ASCII characters. This string shall be passed to the actual healthcheck package.
- Respect this list while scanning the files. In `pkg/healthcheck/nonascii.go`, function `getNonASCII()`, we utilize a bufio *Scanner* to scan through all files for non-ASCII characters. We would like the list of acceptable chars to be passed from the cmdline to here, and modify the scanner logic to actually accept the corresponding characters.
- Error handling and reporting. This command line arg, `-whitelisted-chars`, could be completely abscent; in which case, no characters shall be escaped by default. The comma-separated list passed to the command may contain ASCII characters or multiple characters that are not properly separated; in which case, ignore that element, and report the incident via the SLog logging framework used in this project.
- Test your work. Create new testcases under `examples/healthcheck/` to reflect this change. Reflect to `examples/healthcheck/asciifile/` to learn about how to configure the repo health checker. Integrate your work to the Go test framework such that it could be invoked by running `make test` at the terminal.
  - Note: Use `git init` to init your testcase directory and make a initial commit - this project, JOJ3, only runs in Git repos.

## Notes
- Directory structure. `cmd/` for invokable commands, `pkg/` for the actual logic, `internal` - something you don't need to worry about.
- JOJ3 vs. Health Check. `joj3` is a separate executable; in this session we are only working on the `repo-health-checker`.
- Extras. Make sure to read `README.md` and the directory structure before you go; also, create To-do before you execute your plan.
</details>

Reviewed-on: #100
Reviewed-by: 张泊明518370910136 <bomingzh@sjtu.edu.cn>
Co-authored-by: Mack Wang <mac-wang@sjtu.edu.cn>
Co-committed-by: Mack Wang <mac-wang@sjtu.edu.cn>
2026-04-26 08:23:33 +08:00
64bc267300
refactor: remove backward compatibility fields
Some checks failed
submodules sync / sync (push) Successful in 2m4s
build / build (push) Waiting to run
build / trigger-build-image (push) Blocked by required conditions
build / build (pull_request) Failing after 13m25s
build / trigger-build-image (pull_request) Has been skipped
2026-03-22 03:02:21 -07:00
bd15d5ce05
fix: groups recording for [all]
Some checks failed
submodules sync / sync (push) Successful in 4m20s
build / build (push) Failing after 12m42s
build / trigger-build-image (push) Has been skipped
2026-03-18 10:50:39 -07:00
e20ebfaa81 fix: check conf file ownership (#98)
All checks were successful
submodules sync / sync (push) Successful in 2m48s
build / build (push) Successful in 8m6s
build / trigger-build-image (push) Successful in 22s
Co-authored-by: arthurcai <arthurcai@sjtu.edu.cn>
Reviewed-on: #98
Co-authored-by: Boming Zhang <bomingzh@sjtu.edu.cn>
Co-committed-by: Boming Zhang <bomingzh@sjtu.edu.cn>
2026-03-13 17:13:39 +08:00
9321218181
feat: match empty groups to empty groups
All checks were successful
submodules sync / sync (push) Successful in 1m7s
build / build (push) Successful in 2m54s
build / trigger-build-image (push) Successful in 14s
2025-10-21 14:21:58 -07:00
6aa8b96a6b
feat: remove unused field
All checks were successful
submodules sync / sync (push) Successful in 1m41s
build / build (push) Successful in 4m33s
build / trigger-build-image (push) Successful in 12s
2025-10-13 02:39:55 -07:00
398ac92a5c
fix: group = all when using tag
All checks were successful
submodules sync / sync (push) Successful in 43s
build / build (push) Successful in 1m38s
build / trigger-build-image (push) Successful in 9s
2025-10-05 01:50:54 -07:00
47051675af
feat: no fallback with non-empty tag
All checks were successful
submodules sync / sync (push) Successful in 46s
build / build (push) Successful in 1m45s
build / trigger-build-image (push) Successful in 9s
2025-10-04 23:30:35 -07:00
7bd216efda
chore: flatten nested conf fields
All checks were successful
submodules sync / sync (push) Successful in 44s
build / build (push) Successful in 1m54s
build / trigger-build-image (push) Successful in 11s
2025-09-27 01:01:17 -07:00
9f1a097cfa
fix: always run stage when group & groups empty 2025-09-24 21:27:05 -07:00
fd47361268
fix: empty groups
All checks were successful
submodules sync / sync (push) Successful in 39s
build / build (push) Successful in 2m16s
build / trigger-build-image (push) Successful in 14s
2025-09-24 03:32:34 -07:00
7e12c333b5
feat: support groups in stages
Some checks failed
submodules sync / sync (push) Successful in 51s
build / build (push) Failing after 2m23s
build / trigger-build-image (push) Has been skipped
2025-09-24 03:13:17 -07:00
fce18b60cf
chore: remove time validation
All checks were successful
submodules sync / sync (push) Successful in 44s
build / build (push) Successful in 3m2s
build / trigger-build-image (push) Successful in 16s
2025-09-14 17:53:25 -07:00
a22a48ec3d
chore(cmd/joj3): CAPITALIZE actor name spaceholder
All checks were successful
submodules sync / sync (push) Successful in 40s
build / build (push) Successful in 1m52s
build / trigger-build-image (push) Successful in 9s
2025-07-02 13:02:26 -04:00
386b1c0fd6
fix(cmd/joj3): set runID to env var
All checks were successful
submodules sync / sync (push) Successful in 44s
build / build (push) Successful in 2m23s
build / trigger-build-image (push) Successful in 13s
2025-07-02 12:50:24 -04:00
1dd7f7161b
fix(cmd/joj3): set runID properly
All checks were successful
submodules sync / sync (push) Successful in 42s
build / build (push) Successful in 2m19s
build / trigger-build-image (push) Successful in 14s
2025-07-01 22:30:27 -04:00
e7b0a0f1fd
feat(healthcheck): check actor csv for email
All checks were successful
submodules sync / sync (push) Successful in 41s
build / build (push) Successful in 2m36s
build / trigger-build-image (push) Successful in 11s
2025-07-01 22:13:28 -04:00
3bd89e9aa5
refactor(cmd/joj3): use getter/setter in env
All checks were successful
submodules sync / sync (push) Successful in 41s
build / build (push) Successful in 2m30s
build / trigger-build-image (push) Successful in 12s
2025-07-01 21:27:30 -04:00
439e64be0c
feat(cmd/joj3): default actor name & actor id placeholder
All checks were successful
submodules sync / sync (push) Successful in 1m0s
build / build (push) Successful in 2m31s
build / trigger-build-image (push) Successful in 12s
2025-06-30 17:36:48 -04:00
1b6fc08451
refactor(cmd/joj3): re-org functions
All checks were successful
submodules sync / sync (push) Successful in 42s
build / build (push) Successful in 1m35s
build / trigger-build-image (push) Successful in 9s
2025-06-29 05:43:35 -04:00
b6592e655d
feat(cmd/joj3): no log on print version
Some checks failed
build / trigger-build-image (push) Blocked by required conditions
submodules sync / sync (push) Successful in 1m0s
build / build (push) Has been cancelled
2025-06-28 09:27:59 -04:00
aa377c1046
feat(cmd/joj3): create log dir if not exists
All checks were successful
submodules sync / sync (push) Successful in 57s
build / build (push) Successful in 2m44s
build / trigger-build-image (push) Successful in 11s
2025-06-25 22:50:56 -04:00
9cf640dee5
feat(healthcheck): check commit author email
Some checks failed
build / trigger-build-image (push) Blocked by required conditions
submodules sync / sync (push) Has been cancelled
build / build (push) Has been cancelled
2025-06-04 06:05:11 -04:00
a5cd85be35
fix(cmd/joj3): test cases
All checks were successful
submodules sync / sync (push) Successful in 47s
build / build (push) Successful in 1m47s
build / trigger-build-image (push) Successful in 12s
2025-06-02 23:12:44 -04:00
b147cf00a9
fix(cmd/joj3): return empty conventional commit on parsing error
Some checks failed
build / build (push) Failing after 2m28s
build / trigger-build-image (push) Has been skipped
submodules sync / sync (push) Failing after 29s
2025-06-02 23:08:13 -04:00
f17c742719
feat(cmd/joj3): log panic stack
Some checks failed
build / build (push) Successful in 1m57s
build / trigger-build-image (push) Successful in 11s
submodules sync / sync (push) Failing after 39s
2025-06-02 22:18:31 -04:00
4c15ac48d9 feat(healthcheck): support score
Some checks failed
build / build (push) Successful in 2m16s
build / trigger-build-image (push) Successful in 13s
submodules sync / sync (push) Has been cancelled
2025-05-29 00:06:06 -04:00
613eafba1c
fix(cmd/joj3): generated stages log level
All checks were successful
submodules sync / sync (push) Successful in 1m12s
build / build (push) Successful in 2m56s
build / trigger-build-image (push) Successful in 13s
2025-05-25 02:54:46 -04:00
5dec3b1bda
fix(cmd/joj3): file fields in generate stages
All checks were successful
submodules sync / sync (push) Successful in 1m22s
build / build (push) Successful in 2m16s
build / trigger-build-image (push) Successful in 18s
2025-05-22 04:00:01 -04:00
4639e84ad5
feat: recover from panic
All checks were successful
submodules sync / sync (push) Successful in 1m4s
build / build (push) Successful in 2m21s
build / trigger-build-image (push) Successful in 11s
2025-03-31 05:52:21 -04:00
f99ad5eae4
style: more linters 2025-03-28 05:53:30 -04:00
fd583c5b7a
style: run modernize -fix ./...
All checks were successful
submodules sync / sync (push) Successful in 37s
build / build (push) Successful in 2m9s
build / trigger-build-image (push) Successful in 14s
2025-03-25 07:34:44 -04:00
0cdf665910
style(cmd/joj3): split main logic
All checks were successful
submodules sync / sync (push) Successful in 44s
build / build (push) Successful in 1m52s
build / trigger-build-image (push) Successful in 12s
2025-03-13 01:29:16 -04:00
db88502414
docs: add packages docs
All checks were successful
submodules sync / sync (push) Successful in 44s
build / build (push) Successful in 1m24s
build / trigger-build-image (push) Successful in 11s
2025-02-21 12:28:42 -05:00
e785ce2860
refactor(cmd/joj3): move stage to main package
All checks were successful
submodules sync / sync (push) Successful in 48s
build / build (push) Successful in 1m53s
build / trigger-build-image (push) Successful in 9s
2025-02-18 06:32:47 -05:00
1150cc4697
docs: better packages docs 2025-02-18 06:21:17 -05:00
b4e706f8e9
chore(parser): make unnecessary methods private
All checks were successful
submodules sync / sync (push) Successful in 43s
build / build (push) Successful in 1m46s
build / trigger-build-image (push) Successful in 9s
2025-02-17 09:28:36 -05:00
b3663d8782
feat(cmd/joj3/conf): support effective time
All checks were successful
submodules sync / sync (push) Successful in 41s
build / build (push) Successful in 1m35s
build / trigger-build-image (push) Successful in 7s
2025-02-12 16:23:30 -05:00
c474a5d493
docs(cmd): move README content to package comments (#85)
All checks were successful
submodules sync / sync (push) Successful in 47s
build / build (push) Successful in 1m48s
build / trigger-build-image (push) Successful in 9s
2025-02-11 11:16:38 -05:00
19bcc90ae9
refactor: move internal/conf to cmd/joj3 2025-02-11 11:16:38 -05:00
d6da8c8fa7
chore(cmd/joj3): use background context 2025-02-01 21:51:50 -05:00
0f40da5efa
feat(cmd/joj3): set env before stages
All checks were successful
submodules sync / sync (push) Successful in 38s
build / build (push) Successful in 1m11s
build / trigger-build-image (push) Successful in 6s
2025-02-01 20:31:56 -05:00
4e84031e84
feat(cmd/joj3): store output path to env var [force build]
All checks were successful
submodules sync / sync (push) Successful in 46s
build / build (push) Successful in 1m32s
build / trigger-build-image (push) Successful in 8s
2025-02-01 20:08:51 -05:00
0390e4c4b3
chore(cmd/joj3): set simple logger before conf loaded
All checks were successful
submodules sync / sync (push) Successful in 34s
build / build (push) Successful in 1m4s
build / trigger-build-image (push) Successful in 6s
2025-02-01 09:55:16 -05:00
81754de179
chore(cmd/joj3): log attrs
All checks were successful
submodules sync / sync (push) Successful in 31s
build / build (push) Successful in 1m2s
build / trigger-build-image (push) Successful in 6s
2025-02-01 09:37:33 -05:00
ecafe1464b
fix(cmd/joj3): run onStagesComplete
All checks were successful
submodules sync / sync (push) Successful in 38s
build / build (push) Successful in 1m21s
build / trigger-build-image (push) Successful in 7s
2025-02-01 09:26:23 -05:00
10ff3ebfa1
feat(cmd/joj3): remove hardcoded teapot part (#83) [force build]
All checks were successful
submodules sync / sync (push) Successful in 35s
build / build (push) Successful in 1m11s
build / trigger-build-image (push) Successful in 7s
2025-02-01 09:10:03 -05:00
1bbc589897
feat(healthcheck): remove joj3-check
All checks were successful
submodules sync / sync (push) Successful in 32s
build / build (push) Successful in 1m11s
build / trigger-build-image (push) Successful in 6s
2025-02-01 04:59:25 -05:00
8d5a08fd35
fix(cmd/joj3): write results before postStages
All checks were successful
submodules sync / sync (push) Successful in 32s
build / build (push) Successful in 1m12s
build / trigger-build-image (push) Successful in 7s
2025-01-31 21:41:17 -05:00
e8c6e87b94
feat(cmd): load groups from env
All checks were successful
submodules sync / sync (push) Successful in 33s
build / build (push) Successful in 1m5s
build / trigger-build-image (push) Successful in 7s
2025-01-31 21:06:38 -05:00