Skip to content

Test translations for reST syntax errors - #1431

Merged
webknjaz merged 4 commits into
python:mainfrom
rffontenelle:patch-1
Dec 22, 2023
Merged

webknjaz merged 4 commits into
python:mainfrom
rffontenelle:patch-1

Conversation

@rffontenelle

@rffontenelle rffontenelle commented Dec 3, 2023 •

Copy link
Copy Markdown
Contributor

This workflow is intended for a centralized and easy to find point of syntax errors in translation files.

Currently, one can only find syntax errors by browsing the logs in Read The Docs, and each language is its own separated rtd project. I doubt anyone will do that, except for me.

Translation file update triggers in both push and pull request events. E.g. When Weblate files a pull request with new translations.

Examples of runs:

Captura de tela de 2023-12-03 17-29-24

Captura de tela de 2023-12-03 17-29-32


📚 Documentation preview 📚: https://python-packaging-user-guide--1431.org.readthedocs.build/en/1431/

Comment thread .github/workflows/test-translations.yml Resolved
@rffontenelle

Copy link
Copy Markdown
Contributor Author

The po file name used for sphinx-lint was wrong, probably due to a copy and paste error between my tests and the actual pull request. Fixed along with jeanas suggestion.

@webknjaz webknjaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@webknjaz
webknjaz added this pull request to the merge queue Dec 22, 2023
@webknjaz

Copy link
Copy Markdown
Member

@rffontenelle I wonder if using GHA matchers could surface the errors in the PR UI. This could be interesting to explore..

Merged via the queue into python:main with commit f34c6d1 Dec 22, 2023
@rffontenelle
rffontenelle deleted the patch-1 branch December 22, 2023 19:38
@rffontenelle

Copy link
Copy Markdown
Contributor Author

@webknjaz Seems feasible. Each job could store Sphinx warning logs and upload as artifact, then another job could use download-artifacts to download multiple logs (if present) and handle the content to print a comment in the pull request using e.g. thollander/actions-comment-pull-request.

I'll work on that when possible.

@webknjaz

Copy link
Copy Markdown
Member

@rffontenelle

Copy link
Copy Markdown
Contributor Author

I thought you wanted something in the PR history/comments, but I see now what you mean.

In my test rffontenelle#3, I didn't get those fancy boxes as shown in the github-problem-matcher README, but I've got annotations in the job output. See the workflow run below. Does this help?

image

@webknjaz

Copy link
Copy Markdown
Member

They are on the summary page: https://github.com/rffontenelle/packaging.python.org/actions/runs/7304303724

@webknjaz

Copy link
Copy Markdown
Member

I think they don't show up in the PR because they're mapped to rst files that are unchanged.

@webknjaz

Copy link
Copy Markdown
Member

It'd be nice to add the matcher to other Sphinx jobs too.

@rffontenelle

Copy link
Copy Markdown
Contributor Author

Agreed. I'm looking for a problem matcher for sphinx-lint. It might need to be created, but I'd rather avoid reinventing the wheel.

@rffontenelle

Copy link
Copy Markdown
Contributor Author

Changes proposed in #1469

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