Skip to content

Use the database for docs rendering#2615

Open
charlesroelli wants to merge 1 commit into
django:mainfrom
charlesroelli:issue-1630
Open

Use the database for docs rendering#2615
charlesroelli wants to merge 1 commit into
django:mainfrom
charlesroelli:issue-1630

Conversation

@charlesroelli

@charlesroelli charlesroelli commented May 7, 2026

Copy link
Copy Markdown
Contributor

This is steps 1-2 of #1630, i.e. database-backed load for documentation and its environment (globalcontext).

@pauloxnet pauloxnet 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 for working on this PR.

If you think is still a draft please mark it as draft PR in the Github interface.

Comment thread docs/management/commands/update_docs.py Outdated
Comment on lines +169 to +173
{% for p in doc.breadcrumbs %}
<ul><li><a href="{% url 'document-detail' lang=lang version=version url=p.path host 'docs' %}">{{ p.title|safe }}</a>
{% endfor %}
<ul><li>{% block current-page-title %}{{ doc.title|safe }}{% endblock current-page-title %}</li></ul>
{% for p in doc.parents %}</li></ul>{% endfor %}
{% for p in doc.breadcrumbs %}</li></ul>{% endfor %}

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.

Are this changes related to the PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. The document.metadata parents field doesn't correspond to the original JSON file's parents field, so apparently we have to adapt this part of the template to use the breadcrumbs property instead.

See e.g.

>>> import json
>>> doc
<Document: en/dev/releases/1.10.1>
>>> doc.metadata["parents"]
'releases'
>>> with doc.full_path.open() as doc_file:
...     json.load(doc_file)["parents"]
[{'link': '../', 'title': 'Release notes'}]
>>> doc.metadata["breadcrumbs"]
[{'path': 'releases', 'title': 'Release notes'}]

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 for checking

@codecov-commenter

codecov-commenter commented May 11, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 82.66667% with 13 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@c7c0a47). Learn more about missing BASE report.

Files with missing lines Patch % Lines
.../migrations/0008_documentrelease_global_context.py 50.00% 7 Missing and 1 partial ⚠️
docs/management/commands/update_docs.py 0.00% 3 Missing ⚠️
docs/views.py 84.61% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2615   +/-   ##
=======================================
  Coverage        ?   86.21%           
=======================================
  Files           ?      185           
  Lines           ?     6760           
  Branches        ?      384           
=======================================
  Hits            ?     5828           
  Misses          ?      852           
  Partials        ?       80           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@charlesroelli charlesroelli force-pushed the issue-1630 branch 2 times, most recently from c003b47 to 172d7e0 Compare May 12, 2026 08:44
@pauloxnet

Copy link
Copy Markdown
Member

The PR seems good to me. When you are ready for a complete review, update a bit the PR description, squash commit and squash also the 2 migrations in one, and add test to cover the changes.

@charlesroelli charlesroelli marked this pull request as draft May 12, 2026 09:44
@charlesroelli charlesroelli force-pushed the issue-1630 branch 8 times, most recently from f82e102 to ad13571 Compare May 18, 2026 08:23
@charlesroelli charlesroelli marked this pull request as ready for review May 21, 2026 08:35
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