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

Docs tests #708

Merged
merged 5 commits into from
Jun 21, 2024
Merged

Docs tests #708

merged 5 commits into from
Jun 21, 2024

Conversation

rhiaro
Copy link
Collaborator

@rhiaro rhiaro commented Jun 13, 2024

Overview

What does this pull request do?

Github workflow to test the docs build, and all links are valid.

Closes #573

@rhiaro rhiaro added maintenance sphinx For updates to documentation generation labels Jun 13, 2024
@rhiaro rhiaro requested a review from radix0000 June 13, 2024 13:21
@rhiaro
Copy link
Collaborator Author

rhiaro commented Jun 13, 2024

@radix0000 Currently the link checker fails on ../_static/statement.json (and the three others) in schema browser. Do you know what part of the build process these files come from? Or are these links actually incorrect (and should be ../../schema/*.json)? Wondering if this is a docson thing I haven't managed to figure out yet. But so far it's not obvious to me where these files are supposed to come from.

It also fails for https://github.com/openownership/data-standard/tree/0.4.0/examples in examples index, but I'm assuming the latter is because the 0.4 branch doesn't exist yet, but is expected to be.

@radix0000
Copy link
Contributor

So seems like there are a couple of issues here:

  1. In the docs/_static directory there is a 6 year old broken symlink to the schema directory, and no links for the current schema files. I have created a branch that fixes this: https://github.com/openownership/data-standard/tree/fix_static_links
  2. That said the link checker still produces an error because there is one link that is wrong in schema-browser.rst: ../_static/person-statement.json should be ../_static/person-record.json
  3. That said these links (except the person-statement.json one) aren't actually broken in the actual docs build, because at some point in build process these files are copied into the docs/_build/dirhtml/_static/ directory, which does raise a question about whether the link checker is fit for purpose if it isn't checking the directory where the files are picked up in the actual built docs, but that is rather a meta point

@kd-ods
Copy link
Collaborator

kd-ods commented Jun 18, 2024

It also fails for https://github.com/openownership/data-standard/tree/0.4.0/examples in examples index, but I'm assuming the latter is because the 0.4 branch doesn't exist yet, but is expected to be.

Yes, that's right.

@rhiaro rhiaro marked this pull request as ready for review June 20, 2024 14:53
@rhiaro
Copy link
Collaborator Author

rhiaro commented Jun 20, 2024

at some point in build process

Well, that's the part I'd like to understand... where does this happen? The linkcheck is part of sphinx, and builds the docs in the process of running itself.. so I'm baffled about what it's missing.

Anyway, I've merged the symlinks fix - thanks @radix0000

And talked to @kd-ods earlier, and we agreed we can merge this with the remaining broken links - the person-record one will be fixed in the staging branch later, when the translations are all finalised, because it might affected a translated string. And the examples will start working when the release branch is created.

@rhiaro rhiaro requested a review from kd-ods June 20, 2024 15:10
@kd-ods
Copy link
Collaborator

kd-ods commented Jun 21, 2024

@rhiaro - as-is this won't check the build of the translations (and the links in the translated builds), will it? That's probably OK since we need to 'let' the translations get out of sync with the source files on main. Am I thinking about this correctly?

@rhiaro
Copy link
Collaborator Author

rhiaro commented Jun 21, 2024

@kd-ods It generates the mo files, but doesn't build the translated html. Could do, if you thought it would be useful? It would catch any typos in links introduced accidentally by translators, for example.

@rhiaro rhiaro merged commit e726c1f into main Jun 21, 2024
2 of 4 checks passed
@rhiaro rhiaro deleted the dev-docstests branch June 21, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance sphinx For updates to documentation generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a test in test_docs.py to check the docs build
3 participants