Skip to content

rust-tooling: migrate to tera v2 - #2187

Open
senekor wants to merge 3 commits into
mainfrom
senekor/nxtqlporrrrm
Open

senekor wants to merge 3 commits into
mainfrom
senekor/nxtqlporrrrm

Conversation

@senekor

@senekor senekor commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@senekor
senekor added this pull request to stack #2188 November 11, 2026 22:49
@senekor
senekor requested a review from ellnix November 11, 2026 22:49
@senekor

senekor commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

This can be tested with mise run update-all-templated-exercise, which should result in no changes.

If using jj, I recommend this fileset for review:

jj diff '~**/test_template.tera & ~**/Cargo.lock'

This makes the diff much smaller to review. The breaking changes in the test templates aren't all that interesting (IMO), as long as the output remains identical.

@senekor

senekor commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@iHiD a little heads up, the CI check says that translations are missing. But these test templates shouldn't be translated anyway, right? They are not user-facing. Maybe the CI job can be made more precise, to avoid unnecessary, expensive translation runs.

@iHiD

iHiD commented Nov 12, 2026

Copy link
Copy Markdown
Member

@senekor You need to add the ready-to-translate label when you're ready for it to be translated. Then those files should be skipped automatically :)

@senekor

senekor commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@iHiD Why not fix the check instead, such that the label is only required when there are actually files to translate? Track maintainers contribute during their spare time. Asking them to spend that time ticking unnecessary boxes isn't great.

@iHiD

iHiD commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

@iHiD Why not fix the check instead, such that the label is only required when there are actually files to translate?

I do. There's hundreds of lines of codes that check all these things. This one got missed as it's a markdown file in a directory where nearly all the markdown files do get translated. I'll add more checks that check that this file gets rendered on the website.

Track maintainers contribute during their spare time. Asking them to spend that time ticking unnecessary boxes isn't great.

I made a mistake by missing this edge-case. I'm sorry it upset you, but I think this reaction and comment is a little unjustified. Bugs happen sometimes, and I invest a lot of time and energy into making things like this as easy process for maintainers as I can.

iHiD added a commit to exercism/i18n that referenced this pull request Nov 18, 2026
The track-docs pattern matched every docs/*.md in a track, so a PR that
touched docs/CONTRIBUTING.md failed i18n / completeness and asked for a
translation nobody reads (exercism/rust#2187). The website shows only
docs/ABOUT.md and the paths listed in docs/config.json.

translatableFiles now reads docs/config.json at the ref being processed,
next to the wip rule. With --base, a doc that the list starts naming is
required even if its file is unchanged. A missing or unparseable
docs/config.json requires every doc, as an unreadable config.json marks
nothing as wip. english-changes.mjs reads the same list through its blob
fetch, so the queue agrees with the check.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@iHiD

iHiD commented Nov 18, 2026

Copy link
Copy Markdown
Member

exercism/i18n#459 adds the extra check and this PR can now be merged.

@senekor

senekor commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, Jeremy.

Track maintainers contribute during their spare time. Asking them to spend that time ticking unnecessary boxes isn't great.

I made a mistake by missing this edge-case. I'm sorry it upset you, but I think this reaction and comment is a little unjustified. Bugs happen sometimes, and I invest a lot of time and energy into making things like this as easy process for maintainers as I can.

I don't mind bugs or mistakes, not at all. I make plenty of them myself 🙂 The sentence: "You need to ..." is what rubbed me the wrong way. To me, it read like an instruction to do a nonsensical thing.

Exercism is not the only project I contribute to, and many of them are currently changing due to LLMs. I'm weary of places I love turning into ones I don't recognize. Please excuse the misunderstanding.

@iHiD

iHiD commented Nov 19, 2026

Copy link
Copy Markdown
Member

Thank you. In the week you posted this, I probably had a dozen different people message asking how to get their PRs over the line because they didn't read the post about the labelling existing. I just missed in this thread that you'd read about it and the label wasn't needed for this PR, and responded trying to be helpful to the more general cause. Genuinely sorry that I didn't read your message more carefully.

I'm weary of places I love turning into ones I don't recognize

Yeah - I get this. I think people are feeling this a lot atm, and it's hard to work out where the line between maximising LLM opportunity and making things rubbish sits. For me, I want to use LLMs to serve our students better, but it also risks making places less fun for the community (about like the whole path of development in general atm). It's tricky!

Please excuse the misunderstanding

Ditto :)

@senekor
senekor force-pushed the senekor/nntpptxznrum branch from d1762ee to 525e4ab Compare November 21, 2026 14:55
@senekor
senekor force-pushed the senekor/nxtqlporrrrm branch from 1d16ad9 to 1582ce9 Compare November 21, 2026 14:55
@senekor
senekor force-pushed the senekor/nxtqlporrrrm branch 2 times, most recently from 02cc188 to 8bea5e3 Compare November 29, 2026 17:36
Base automatically changed from senekor/nntpptxznrum to main November 29, 2026 17:43
@senekor
senekor force-pushed the senekor/nxtqlporrrrm branch from 8bea5e3 to c004e1b Compare November 29, 2026 17:44

@ellnix ellnix left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tera v2 seems like a massive change. Looked at their official MIGRATION.md and verified:

Filters and functions

  • unique was never used, its change does not affect us
  • date was never used, though there is some date parsing in the gigasecond template, but that is just string functions
  • divisibleby, concat, slice, spaceless, get_env, map, filter, nth, escape, 'linebreaksbr', truncate, group_by, indent, round were never used
  • first has one usage that could potentionally be risky in list-ops if test.expected is an empty array, but even in that usage None is completely safe as first_item, no strange behavior
  • last has one usage in largest-series-product and it seems perfectly safe
  • The one occurrence of as_str has been renamed to str
  • All occurrences of object have been renamed to map
  • int's behavior change is unlikely to cause issues in gigasecond as long as the test dates are ISO8601, and if that changes some day we will have probelms either way

Macros

  • two-bucket's bucket has been replaced with a component (though it could just as easily be a ternary)
  • pov's render_tree and render_vec macros have been replaced with component cleanly

Conclusion

  • The test templates seem to render bit-identical rust tests as far as I can see
  • All links to documentation have been updated, no remaining occurrences of tera/docs

There are probably ways we could make use of the new v2 features in templates, but I don't think that's worth going through every exercise. I cannot find fault in this PR in terms of compatibility.


P. S.: To @senekor about LLMS.

This kind of migration validation is something that an LLM would be quite competent at, but I didn't run any I think it would be wrong to do so without discussing it.

I feel the only honest thing to do when asked for a review is to provide the review myself, or explain why I cannot do it. I personally get frustrated when I ask for someone's opinion and they respond with an LLM, I don't see the value in humans being middlemen in two LLMs talking to each other. Therefore, I won't subject anyone to that.

However, I personally believe it would be valuable to also use LLMs to review. Most effectively after a manual review to avoid introducing bias in the human reviewer. What is your stance? Do you have any reservations, ethical or otherwise?

@senekor

senekor commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

@ellnix Thanks for the thorough review!

Re LLMs: I pretty much agree completely.

Feel free to use LLMs in your workflow however you see fit. Let's say your LLM finds a problem and you report it in your review, but in your own words. That's fine by me and I don't necessarily need to know how you found the issue.

When it makes sense to post LLM output directly, I would like that to be disclosed in advance. (Not at the end of a comment, as many people do...) I read LLM output differently than human speech, so I want to know in advance. Sometimes, I don't want to read it at all. 🤷

How to use LLMs responsibly is a difficult topic and frankly I'm just beginning to figure that out for myself. But with you specifically, I'm not worried, because I always know there's a decent human being there who I can talk to, in case I'm uncomfortable with anything. 🙂

Is there anything else that I should keep in mind, so I don't make you uncomfortable when using LLMs here? Please let me know.

I actually didn't think of reviewing this PR with an LLM myself, but I did now. It found two minor issues. I wrote the fixes myself (two additional commits that will be squashed at merge).

@senekor
senekor force-pushed the senekor/nxtqlporrrrm branch from 8534ed7 to 3f4e7f0 Compare November 29, 2026 21:54
@senekor
senekor removed this pull request from stack #2188 November 29, 2026 22:00
`add_template_file(...)?` would fail and propagate the error if the
template does not exist, preventing the use of the default template.
@senekor
senekor force-pushed the senekor/nxtqlporrrrm branch from 3f4e7f0 to b72a7e9 Compare November 29, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants