Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[功能请求] 自动验证例题代码是否AC #5354

Closed
ImpleLee opened this issue Jan 8, 2024 · 3 comments
Closed

[功能请求] 自动验证例题代码是否AC #5354

ImpleLee opened this issue Jan 8, 2024 · 3 comments

Comments

@ImpleLee
Copy link
Contributor

ImpleLee commented Jan 8, 2024

我遇到的问题是

wiki上有许多题目对应的参考代码,它们能否AC是依靠编辑者们自行验证来保证的。
(刚发现oi wiki另带了一套examples的机制,但examples也有维护负担,而且一般不如OJ的examples全面。)
一方面,一旦编辑者疏于验证就会在wiki上留下可能不AC的代码,另一方面,这为编辑者带来了验证的负担(应该说负担确实不大(x))。
在issue中搜索“代码”可以看到一些参考代码不能AC的例子。

我希望能有这样的解决方案

要求与代码一同提交对应OJ的通过记录的编号等(比如另附一个文件记录题目和通过记录的编号),使用GitHub Actions检验通过记录与wiki的代码是否相同。
该方案需要oi wiki的bot能看到提交记录是否通过&对应代码。
对luogu这样的平台,bot在对应题目中需要至少拿到60分才能通过代码公开计划看到对应提交记录的代码,因此需要某种程度的对接。

我觉得这些备选方案也可以接受

沿用目前的方案,代码作者或者reviewer自行验证。

另外,让bot直接去OJ提交代码应当是不能接受的,因为这个GitHub Action在pull request时就得跑,这可能导致oi wiki的bot账户被用来攻击OJ。

@ImpleLee
Copy link
Contributor Author

ImpleLee commented Jan 8, 2024

另外这可能可以取代现有的检验代码能否通过oi wiki自带的examples的机制。现有的机制需要oi wiki自行提供输入和输出,采用本issue的方案可以避免维护很大一部分这方面的内容。

@ImpleLee
Copy link
Contributor Author

ImpleLee commented Jan 8, 2024

另外该方案是语言无关的,进而可以支持多种语言,解决类似 #4350 的问题。

@Tiphereth-A
Copy link
Member

Tiphereth-A commented Jan 8, 2024

我认为您所提出的方案和 #3518 相比没有明显改进,反而因为需要适配其它 OJ 而增加了工作量,甚至可能产生额外费用,所以我认为该方案不太适合应用于 OI Wiki。

@Tiphereth-A Tiphereth-A closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants