Initial trivial implementation of some draft problempackage spec options. - #3665
Initial trivial implementation of some draft problempackage spec options.#3665vmcj wants to merge 3 commits into
draft problempackage spec options.#3665Conversation
8bfdb85 to
bd7ebcf
Compare
draft problempackage spec options.
bd7ebcf to
7abbdb6
Compare
|
Can you please rearrange the commits in a way you would like to merge them? That will make review easier |
640a0a5 to
b51ee1b
Compare
Done. |
We mostly implement the `icpc-legacy` and parts of the `legacy` & `2025-09-draft`. In the next commits more will be added together with clear warnings on parts which are not (yet) implemented.
b51ee1b to
3a10bc6
Compare
| $final = array_merge($final, self::parseTypes($possibleType)); | ||
| } | ||
| } else { | ||
| $final = array_merge($final, preg_split("/[\s,;]+/", $input)); |
There was a problem hiding this comment.
consider using PREG_SPLIT_NO_EMPTY to avoid tripping over type: pass-fail, and similar things
| $messages['info'][] = sprintf("Problem format version '%s' support still experimental.", $version); | ||
| } elseif ($version !== 'icpc-legacy') { | ||
| // 2023-07-draft used in Unit tests | ||
| $messages['warning'][] = sprintf("Unknown problem format version '%s'.", $version); |
There was a problem hiding this comment.
this should be danger, not warning
| } | ||
| } | ||
|
|
||
| if (isset($yamlData['problem_format_version'])) { |
There was a problem hiding this comment.
I wonder whether this check should be one of the first checks (given that we are bailing out in some cases
| * @param array{info?: string[], warning?: string[], danger?: string[]} $messages | ||
| * @param string[] $expected | ||
| */ | ||
| private function assertProblemSpecWarning(string $version, array $messages, array $expected = ['info']): void |
There was a problem hiding this comment.
do we ever pass in the 3rd argument $expected?
| $this->assertNotEmpty($messages['info']); | ||
| $this->assertStringContainsString( | ||
| sprintf("Problem format version '%s' support still experimental.", $version), | ||
| $messages['info'][0] |
There was a problem hiding this comment.
Let's make this less brittle by accepting if it is in any $messages['info'], not necessarily the first one?
| } | ||
|
|
||
| #[DataProvider('problemSpecVersionProvider')] | ||
| public function testProblemPackageFormatTest(string $problemSpecificationVersion): void |
There was a problem hiding this comment.
super nit: rename to testProblemPackageFormatVersions?
|
|
||
| public static function problemSpecVersionProvider(): Generator | ||
| { | ||
| yield ['2025-09-draft']; |
There was a problem hiding this comment.
these are all accepted tests, should we add one negative test as well?
This is some progress from #3664 in reworked format ready to be discussed.
I plan to implement some of the trivial parts of the different problemspecs to get discussion started on how much we want to implement. As we have people in the wild using
mainI added a warning for all problemspecs which I'm not reasonably sure of that we implement those. In other words, anything besidesicpc-legacywill get a warning on imports via the API.I did not look into uploads via the UI yet as that complicates the work quite a lot.