Skip to content

docs: Update docs to explain the djangocms_versioning contract#511

Merged
fsbraun merged 5 commits intomasterfrom
docs/explain-contract
Feb 4, 2026
Merged

docs: Update docs to explain the djangocms_versioning contract#511
fsbraun merged 5 commits intomasterfrom
docs/explain-contract

Conversation

@fsbraun
Copy link
Member

@fsbraun fsbraun commented Jan 21, 2026

Description

Document and formalize the integration contract for djangocms_versioning and surface it in both code and user-facing docs.

Enhancements:

  • Expose a contract attribute on the versioning CMS config to declare the djangocms_versioning VersionableItem integration contract.

Documentation:

  • Add an API contract document explaining the djangocms_versioning integration expectations and responsibilities.
  • Expand the introduction docs (including working with pages and admin options) and index to reference and describe the versioning integration contract.

Related resources

  • #...
  • #...

Checklist

  • I have opened this pull request against master
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined #workgroup-pr-review on
    Slack to find a “pr review buddy” who is going to review my pull request.

Summary by Sourcery

Document and surface the djangocms_versioning integration contract in code and user-facing documentation.

Enhancements:

  • Expose a contract attribute on the djangocms_versioning CMS config to formalize the VersionableItem integration contract.

Documentation:

  • Add an API contract document describing the djangocms_versioning integration responsibilities and expectations.
  • Expand introduction, admin options, and pages documentation to describe and reference the versioning integration contract.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 21, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Formalizes the djangocms_versioning integration contract by exposing it on the CMS config and adding documentation that describes the VersionableItem contract and how it applies to pages, admin options, and general versioning integration.

Class diagram for the new djangocms_versioning contract attribute

classDiagram
    class VersioningCMSConfig {
        +dict add_to_context
        +dict add_to_field_extension
        +tuple contract
        +versionables_by_content()
    }

    class VersionableItem {
    }

    VersioningCMSConfig ..> VersionableItem : contract
Loading

File-Level Changes

Change Details Files
Expose a formal contract attribute on the versioning CMS config to declare the VersionableItem integration contract.
  • Add a contract class attribute to the djangocms_versioning CMS config tying the contract name to VersionableItem
  • Ensure the contract is discoverable from CMS app configs for integrators and tooling
djangocms_versioning/cms_config.py
Document the djangocms_versioning VersionableItem integration contract and reference it from the main docs.
  • Add a dedicated API contract document describing the responsibilities and expectations for VersionableItem-based integrations
  • Update the docs index to surface the new contract documentation
  • Expand introduction docs to explain versioning integration at a high level and detail how the contract applies when working with pages
  • Clarify or extend admin options documentation to reference the versioning integration contract where relevant
docs/api/contract.rst
docs/index.rst
docs/introduction/versioning_integration.rst
docs/introduction/working_with_pages.rst
docs/explanations/admin_options.rst

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.72%. Comparing base (a132204) to head (aeb6a23).
⚠️ Report is 39 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #511      +/-   ##
==========================================
+ Coverage   90.55%   93.72%   +3.17%     
==========================================
  Files          72       76       +4     
  Lines        2732     2710      -22     
  Branches      322        0     -322     
==========================================
+ Hits         2474     2540      +66     
+ Misses        182      170      -12     
+ Partials       76        0      -76     

☔ View full report in Codecov by Sentry.
📢 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.

@fsbraun fsbraun marked this pull request as ready for review February 4, 2026 10:17
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 3 issues, and left some high level feedback:

  • Consider making the contract definition more explicit and readable (e.g. contract = ("djangocms_versioning", VersionableItem)) and grouping it with the other class attributes instead of placing it immediately after __init__.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider making the `contract` definition more explicit and readable (e.g. `contract = ("djangocms_versioning", VersionableItem)`) and grouping it with the other class attributes instead of placing it immediately after `__init__`.

## Individual Comments

### Comment 1
<location> `docs/introduction/working_with_pages.rst:6` </location>
<code_context>
+
+When djangocms-versioning is installed, django CMS pages become versioned. While this
+does not change how you interact with ``Page`` and most importantly ``PageContent``
+objects in your code, it is important to understand how djangocms-verisoning changes the
+result of querying ``PageContent`` objects.
+
</code_context>

<issue_to_address>
**issue (typo):** Fix spelling of "djangocms-verisoning" to "djangocms-versioning".

Use the correct project name "djangocms-versioning" here to match the rest of the documentation.

```suggestion
objects in your code, it is important to understand how djangocms-versioning changes the
```
</issue_to_address>

### Comment 2
<location> `docs/introduction/working_with_pages.rst:220` </location>
<code_context>
+Iterate over all pages with their current content
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Remember using the correct manager when using, e.g. `prefetch_related` or reverse relations
+
+.. code-block:: python
</code_context>

<issue_to_address>
**suggestion (typo):** Improve grammar in the sentence about using the correct manager.

Consider rephrasing to: "Remember to use the correct manager when using, e.g., `prefetch_related` or reverse relations."

```suggestion
Remember to use the correct manager when using, e.g., `prefetch_related` or reverse relations.
```
</issue_to_address>

### Comment 3
<location> `docs/explanations/admin_options.rst:122` </location>
<code_context>
+.. image:: /static/Status-indicators.png
     :width: 50%

 You can use these on your content model's changelist view admin by adding the following fixin to the model's Admin class:
</code_context>

<issue_to_address>
**issue (typo):** Correct "fixin" to "mixin" in the admin explanation.

"mixin" matches the surrounding admin mixin context.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@fsbraun fsbraun merged commit aa9674f into master Feb 4, 2026
77 checks passed
@fsbraun fsbraun deleted the docs/explain-contract branch February 4, 2026 13:28
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.

1 participant