silverstripe / silverstripe-versioned

Versioning for Silverstripe model
BSD 3-Clause "New" or "Revised" License
8 stars 36 forks source link

Clarify versioned usage docs #150

Closed chillu closed 6 years ago

chillu commented 6 years ago

Overview

We've described changes in how to use versioned in the upgrading guide, but it's a complex area that needs to be well supported by our docs as well. https://docs.silverstripe.org/en/4/developer_guides/model/versioning/ doesn't do this justice at the moment.

Acceptance Criteria

Notes

Pull Requests

robbieaverill commented 6 years ago

It might be nice to clarify how recursive publishing works with unversioned parents that own versioned children. SiteConfig -> associated image is a very common example that comes up in the community Slack channel regularly - "when I save my SiteConfig my image isn't visible on the frontend"

maxime-rainville commented 6 years ago

Changes to apply

Restructure document

I want to reorganising the DataObject the doc around 4 main poles:

Higher level concepts will explain what versioning does without delving on technical details. The purpose here is to give an overview of what is possible and too help developers unfamiliar with versioning understand core concepts.

The other 3 poles are more technical and mostly reuse the existing usage content.

I’ve also added an Advanced versioning topics section at the end to cover more esoteric information that goes beyond your regular use case.

Drafts some new content for key sections

Most of the existing content will be reused as-is.

I'll revise and enhance content content around:

Other minor changes

Current structure

Proposed new structure

chillu commented 6 years ago

That structure looks awesome, thanks @maxime-rainville.

You could argue that "Implementing a versioned DataObject" is a more common dev concern than "Interacting with versioned DataObjects", because a lot of this happens behind the scenes in SilverStripe. Maybe that section should come first?

Given the above, I'd also move "Controlling permissions to versioned DataObjects" into "Advanced Topics"

maxime-rainville commented 6 years ago

Good, I'll get started redrafting Monday. So we'll go with:

maxime-rainville commented 6 years ago

@chillu I'm almost done with versioning doc. I'm not quite sure about this bit:

I can decide which CMS UX I want (publish on parent, publish individually), evaluate the tradeoffs, and know how to implement them through configuration.

Maybe I'm just being blind here, but it's not quite clear to me we provide much in terms of UX customisation here.

chillu commented 6 years ago

Maybe I'm just being blind here, but it's not quite clear to me we provide much in terms of UX customisation here.

We at least allow you to add or remove "publish" buttons on individual GridFields, right? For example, content blocks does this to default to "page-based cascading publishing". That's typically easier to understand, but sometimes not granular enough. Those are important concerns for developers to understand, otherwise they run the risk of providing a confusing experience to their CMS authors.

maxime-rainville commented 6 years ago

Just finalised the PR. I went down into a bit of rabbit hole and added a part about rolling back changes and restoring archived versioned. I moved the low level methods (e.g. copyVersionFromStage) to the advanced section and tried to emphasis the high order methods (e.g. publishRecursive).

Regarding the UX customisation, the existing doc in there looks relatively simple and suitable to me. I'm not sure how much more there is to add in there.