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

Fix Sphinx toctree warnings from included CHANGELOG.md #5135

Merged
merged 40 commits into from Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
43f8587
Fix Sphinx toctree warnings from included CHANGELOG.md.
stevepiercy Aug 27, 2023
12a3799
- Manually copy CHANGELOG.md into docs/source/release-nots/index.md. …
stevepiercy Aug 27, 2023
4053915
- Use a relative symlink from inside the volto docs directory to the …
stevepiercy Aug 27, 2023
62da88f
- Only check changelog entries when running docs-linkcheckbroken in v…
stevepiercy Aug 27, 2023
51f473e
- Remove non-existent excluded files.
stevepiercy Aug 27, 2023
43704f5
- Suppress warning for news items
stevepiercy Aug 27, 2023
3f38187
Add changelog entry that should test docs-linkcheckbroken, and will b…
stevepiercy Aug 27, 2023
093ced2
Try creating a symlink in the workflow.
stevepiercy Aug 28, 2023
3f7d9ed
Remove symlink creation in docs-linkcheckbroken
stevepiercy Aug 28, 2023
ece8016
flip source and target
stevepiercy Aug 28, 2023
76ae6c7
Tricksy ln syntax
stevepiercy Aug 28, 2023
05bd87c
Remove create symlink from workflow
stevepiercy Aug 28, 2023
eb047ad
Fail when `docs-linkcheckbroken` is called instead of `test` (which i…
stevepiercy Aug 28, 2023
13d48dc
Add the generated symlink `docs/source/news` to `.gitignore`.
stevepiercy Aug 28, 2023
5296f17
Remove deliberately broken links from change log, so that the documen…
stevepiercy Aug 28, 2023
c6e464d
Revert to proper shell command `test` (which is not a make target, oo…
stevepiercy Aug 28, 2023
a11c3aa
Test one more time to make sure the workflow fails with a bad link.
stevepiercy Aug 28, 2023
e488977
Update docs/source/index.md
davisagli Aug 29, 2023
8ce51f2
Remove echos that prevent the docs-linkcheckbroken command from failing
davisagli Aug 29, 2023
7f4e43a
fix docs-linkcheckbroken exit code
davisagli Aug 29, 2023
ef12d1f
linkcheckbroken should now pass, and so should the GitHub workflow
stevepiercy Aug 29, 2023
b56739c
If grep matches either `broken` or `redirect`, it will return 0, but …
stevepiercy Aug 30, 2023
ba0eb72
else, not elif
stevepiercy Aug 30, 2023
13ade25
Fully restore original command
stevepiercy Aug 30, 2023
2698d87
Try to break docs-linkcheckbroken
stevepiercy Aug 30, 2023
c4755cc
Does it pass?
stevepiercy Aug 30, 2023
486670a
Now it should pass because there are no bad links
stevepiercy Aug 30, 2023
49de905
Try more random shell commands
stevepiercy Aug 30, 2023
49a0ae6
Merge branch 'main' into linkcheck-news-volto
stevepiercy Oct 5, 2023
7ad349f
Temporarily ignore youtube playlists from linkcheck
stevepiercy Oct 5, 2023
18b01a4
Attempt to make linkcheckbroken fail
stevepiercy Oct 5, 2023
fca0d01
Try binary operators to compare integers instead of strings
stevepiercy Oct 5, 2023
6d17458
Add change log
stevepiercy Oct 10, 2023
b187a41
Merge branch 'main' into linkcheck-news-volto
stevepiercy Oct 10, 2023
5ab0c9e
Merge branch 'main' into linkcheck-news-volto
stevepiercy Oct 10, 2023
03c83fb
Merge branch 'main' into linkcheck-news-volto
stevepiercy Oct 10, 2023
a81b5b4
Update release-notes/index.md by manually copying CHANGELOG.md
stevepiercy Oct 10, 2023
ca0ecc3
Untested change to the hook that will copy the final CHANGELOG.md to …
stevepiercy Oct 10, 2023
b9bc0f8
Add comment to explain that we check change log entries for valid lin…
stevepiercy Oct 10, 2023
24e8d24
Move the copy action from the hook to its own makefile command
sneridagh Oct 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -85,3 +85,4 @@ public/critical.css
docs/_build/
/.python-version
/.tool-versions
docs/source/news
9 changes: 9 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,12 @@
---
myst:
html_meta:
"description": "Volto Release Notes for the Plone content management system"
"property=og:description": "Volto Release Notes for the Plone content management system"
"property=og:title": "Volto Release Notes"
"keywords": "Volto, Plone, frontend, Release Notes, change log, changelog, change history"
---

# Volto Release Notes

<!-- You should *NOT* be adding new change log entries to this file.
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Expand Up @@ -104,7 +104,11 @@ test:
bin/python:
python3 -m venv . || virtualenv --clear --python=python3 .
bin/python -m pip install --upgrade pip
@echo "Python environment created."
bin/pip install -r requirements-docs.txt
@echo "Requirements installed."
ln -s ../../news ./docs/source/news
@echo "Symlink created."

.PHONY: clean
clean:
Expand Down Expand Up @@ -140,10 +144,7 @@ docs-linkcheck: bin/python ## Run linkcheck

.PHONY: docs-linkcheckbroken
docs-linkcheckbroken: bin/python ## Run linkcheck and show only broken links
cd $(DOCS_DIR) && $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | GREP_COLORS='0;31' grep -wi "broken\|redirect" --color=always | GREP_COLORS='0;31' grep -vi "https://github.com/plone/volto/issues/" --color=always && if test $$? = 0; then exit 1; fi || test $$? = 1
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/ ."
cd $(DOCS_DIR) && $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | GREP_COLORS='0;31' grep -wi "broken\|redirect" --color=always | GREP_COLORS='0;31' grep -vi "https://github.com/plone/volto/issues/" --color=always && if test $$? -eq 0; then exit 1; fi || test $$? -ne 0

.PHONY: docs-vale
docs-vale: ## Run Vale style, grammar, and spell checks
Expand Down
13 changes: 11 additions & 2 deletions docs/source/conf.py
Expand Up @@ -96,6 +96,7 @@
r"https://github.com/plone/volto/issues/new/choose",
r"https://github.com/plone/volto/blob/6fd62cb2860bc7cf3cb7c36ea86bfd8bd03247d9/src/components/manage/Form/Field.jsx#L112",
r"https://github.com/tc39/proposals/blob/HEAD/finished-proposals.md#finished-proposals",
r"https://www.youtube.com/playlist", # TODO uncomment after installing sphinxcontrib.youtube
]
linkcheck_anchors = True
linkcheck_timeout = 10
Expand All @@ -108,6 +109,11 @@
# The suffix of source filenames.
source_suffix = {
".md": "markdown",
".bugfix": "markdown",
".breaking": "markdown",
".documentation": "markdown",
".feature": "markdown",
".internal": "markdown",
}

# The master toctree document.
Expand All @@ -118,11 +124,14 @@
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [
"spelling_wordlist.txt",
"**/CHANGES.rst",
"**/LICENSE.rst",
"contributing/branch-policy.md",
]

suppress_warnings = [
# "toc.excluded", # Suppress `WARNING: document isn't included in any toctree`
"toc.not_readable", # Suppress `WARNING: toctree contains reference to nonexisting document 'news*'`
]

html_extra_path = [
"robots.txt",
]
Expand Down
7 changes: 7 additions & 0 deletions docs/source/index.md
Expand Up @@ -38,3 +38,10 @@ user-manual/index
contributing/index
release-notes/index
```

````{ifconfig} context in ("volto",)
stevepiercy marked this conversation as resolved.
Show resolved Hide resolved
```{toctree}

news*
```
````
7,613 changes: 7,609 additions & 4 deletions docs/source/release-notes/index.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions news/5135.documentation
@@ -0,0 +1 @@
Fix Sphinx toctree warnings from included `CHANGELOG.md`. @stevepiercy
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -187,7 +187,7 @@
"yarn i18n",
"git add locales"
],
"after:bump": "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version} && make corepackagebump VERSION=${version}",
"after:bump": "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version} && make corepackagebump VERSION=${version} && cp CHANGELOG.md docs/source/release-notes/index.md && git add docs/source/release-notes/index.md && git commit -m 'copy CHANGELOG.md' && git push",
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I think you can leave out the git add, git commit, and git push here. release-it already pushes a commit with the changes that are made during this hook.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TIL. Should I pull it out now, or let @sneridagh fiddle around with it?

Copy link
Member

Choose a reason for hiding this comment

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

I'd move it to a makefile command (as the corepackagebump). In fact, the corepackagebump actions are similar to these ones.

"after:release": "rm .changelog.draft"
},
"git": {
Expand Down