Commit 443c3d6
authored
feat: Support for grouped changesets of draft modifications (#290)
This introduces `DraftChangeLog` and `DraftChangeLogRecord`, which are mostly
draft equivalents of the `PublishLog` and `PublishLogRecord`. A `DraftChangeLog`
entry is created for every group of changes (e.g. an import or a reset), and
`DraftChangeLogRecord` has a record for every individual publishable entity that
was changed. The motivation for these models:
1. Batch changes into logical groupings, e.g. "discard changes in library" or
"import a course's content into this library".
2. Accurate history reconstruction: We don't currently track reset-to-published
operations anywhere, so we can't completely faithfully reconstruct historical
draft information based purely off of the timestamps of when
`PublishableEntityVersions` are created.
It introduces the `bulk_draft_changes_for` context manager, a convenient API for
associating multiple edits into an atomic changeset with one DraftChangeLog.
It also introduces a new model `DraftSideEffect`. This is to capture the idea
that sometimes a change in one publishable entity will affect another one, even
we don't explicitly create a new version of the affected entity. For now, the
only planned side-effects are that changes in child elements affect their parent
containers. The `DraftSideEffect` model could be used more broadly than this in
the future, although we would need to be extremely thoughtful about it use to
avoid write explosions and user confusion. For more details, see:
#290
In a future commit, we expect to introduce an analogous `PublishSideEffect`
record, tied to `PublishLog`.
Bumps package version from 0.22.0 to 0.23.01 parent 9eadbc1 commit 443c3d6
File tree
12 files changed
+1741
-152
lines changed- openedx_learning
- apps/authoring/publishing
- migrations
- models
- tests/openedx_learning/apps/authoring
- publishing
- units
12 files changed
+1741
-152
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
11 | 20 | | |
12 | 21 | | |
13 | 22 | | |
| |||
171 | 180 | | |
172 | 181 | | |
173 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
0 commit comments