Repository navigation
Conversation
| defp validate_supported_wcif(%{"formatVersion" => "2." <> _version} = wcif) do | ||
| error = | ||
| Enum.find_value(wcif["events"], fn | ||
| %{"id" => "fto"} -> "FTO is not supported by WCA Live" |
There was a problem hiding this comment.
added an additional guard for importing FTO comps, since rn it causes the site to completely crash. I assume we'll force FTO comps to use ILR?
jonatanklosko
left a comment
There was a problem hiding this comment.
Thanks for the PR! I dropped a few minor comments and I will have an agent apply them :)
| for {type, internal_type} <- [ | ||
| {"ranking", "ranking"}, | ||
| {"percent", "percent"}, | ||
| {"resultAchieved", "attemptResult"} | ||
| ] do | ||
| test "import/export maps #{type} advancement to the destination round" do |
There was a problem hiding this comment.
It should instead be a single test with WCIF including all the types, and assertions on the result.
| for {type, value, internal_type} <- [ | ||
| {"ranking", 50, "ranking"}, | ||
| {"resultAchieved", 1000, "attemptResult"}, | ||
| {"resultAchieved", nil, "anyResult"} | ||
| ] do | ||
| test "#{internal_type} qualification and dates survive import/export" do |
| assert result.average == 2620 | ||
| assert result.ranking == 1 | ||
|
|
||
| [event] = Export.export_competition(Repo.reload!(competition))["events"] |
There was a problem hiding this comment.
This belongs to the export test suite.
| cutoff: wcif_round["cutoff"] |> wcif_cutoff_to_attrs(), | ||
| advancement_condition: | ||
| wcif_round["advancementCondition"] |> wcif_advancement_condition_to_attrs(), | ||
| advancement_condition: condition |> wcif_advancement_condition_to_attrs(), |
There was a problem hiding this comment.
Let's have it as wcif_advancement_condition_attrs, since the input is participation ruleset that we are converting.
| round.advancement_condition && | ||
| round.advancement_condition |> advancement_condition_to_wcif(), | ||
| "participationRuleset" => %{ | ||
| "participationSource" => participation_source_to_wcif(round, previous), |
There was a problem hiding this comment.
Let's rename to participation_source_wcif since we are converting advancement condition instead.
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com> Assisted-By: Claude Opus 5.5
|
Merged menually with the extra changes :) |


Contributed by @Rubiks-boy, 100% LLM-written. No human vouch for the code at this stage - just opened as a draft for discussion