Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#18930 closed Bug (fixed)

Website docs builder should clean to get rid of old docs

Reported by: James Bennett Owned by: nobody
Component: * Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently it doesn't, which is why we got ticket #18699, and why this document still exists on-site even though it was removed from the docs months ago.

A step should be added to clean out old generated HTML, so we don't run into this again.

Change History (4)

comment:1 Changed 7 years ago by Aymeric Augustin <aymeric.augustin@…>

Resolution: fixed
Status: newclosed

In 1af4480ae19db8c39b07c28df32a12df72a38f0a/

Fix #18930 -- Force a 404 for obsolete documents.

This relies on Document objects being properly deleted when they're
obsolete. The code is designed to do that but I've observed it doesn't
work as expected: duplicate objects get created.

comment:2 Changed 7 years ago by Aymeric Augustin

Resolution: fixed
Status: closednew

I wiped the Document table as well as the xapian index in production.

Then I did a single rebuild of the docs, and I tried adding a unique index on (version, path).

It failed because of duplicates, which appear to be pages that have been converted into directories at some point (ie. topics/auth.txt => topics/auth/index.txt).

>>> from docs.models import *
>>> from django.db.models import *
>>> sorted(Document.objects.values_list('release', 'path').annotate(count=Count('pk')).filter(count__gt=1).values_list('release__version', 'path', 'count'))
[(u'1.5', u'topics/auth', 2),
 (u'1.5', u'topics/testing', 2),
 (u'dev', u'ref/class-based-views', 2),
 (u'dev', u'ref/contrib/gis/install', 2),
 (u'dev', u'topics/auth', 2),
 (u'dev', u'topics/class-based-views', 2),
 (u'dev', u'topics/testing', 2)]

comment:3 Changed 7 years ago by Aymeric Augustin <aymeric.augustin@…>

Resolution: fixed
Status: newclosed

In d51819ecaab91f2d5b91cdc5d01c22b5aeb3f231/

Fix #18930 -- Wipe Sphinx build dir between builds.

This requires serving the docs from another repository, and syncing
the build dir to the serve dir after the build is finished.

comment:4 Changed 7 years ago by Aymeric Augustin <aymeric.augustin@…>

In b35966376ac8c1d8caf05a5e882dfb27325a1593/

Fix #19809 -- Don't check if docs exist in DB.

The docs database is built from the JSON version of the docs, which
doesn't include special pages such as indexes.

This reverts commit 1af4480ae19db8c39b07c28df32a12df72a38f0a.

d51819ecaab91f2d5b91cdc5d01c22b5aeb3f231 has a better and sufficient

Refs #18930.

Note: See TracTickets for help on using tickets.
Back to Top