Commit 72d082c
feat: publishing dependencies and state tracking (#369)
This commit introduces the idea of dependencies to the publishing app.
Dependencies are a generalization of unpinned container children that
we plan to later use for things like course files & uploads, grading
policies, and other things where a change in one publishable entity
affects the state of another publishable entity, even if they do not
share a direct parent/child relationship.
Dependencies do not *replace* container children, but they offer a
simpler model that allows the publishing app to quickly calculate
things like, "Do any of the transitive dependencies of this entity
have unpublished changes?". It also means that we can efficiently
implement "publish this entity and all its dependencies at the same
time" without having to use any callbacks to other apps that might
implement different kinds of dependency relationships (e.g. grading
policy). As long as those other apps declare their dependencies when
calling create_publishable_entity_version(), the publishing app will
have enough information to do these types of queries.
It's worth noting that we never really wanted to put container logic
directly in the publishing app, but we were forced to because the
process of publishing is so coupled to parent/child relationships.
This shift to thinking about dependencies rather than children will
make it possible for us shift container logic out of publishing and
into its own app.
This commit also creates the PublishSideEffect as the publishing
equivalent to DraftSideEffect. We've come to the tentative decision
that we should probably try to unify some of these parallel draft/
published models, but that will be a bigger undertaking.
This commit also introduces a dependencies_hash_digest field to
DraftChangeLogRecord and PublishLogRecord in order to track the state
of all live (current draft/published) dependencies. Tracking this has
allowed us to optimize contains_unpublished_changes() to be a single
query.
Finally, this commit adds Django admin functionality for this new
data. This admin interface is still rudimentary though, and could use
a lot of work.
---------
Co-authored-by: Kyle McCormick <[email protected]>1 parent 0ac3994 commit 72d082c
File tree
18 files changed
+1490
-241
lines changed- openedx_learning
- apps/authoring
- publishing
- migrations
- models
- units
- lib
- tests/openedx_learning/apps/authoring
- publishing
- sections
- subsections
- units
18 files changed
+1490
-241
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 | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
92 | 153 | | |
93 | 154 | | |
94 | 155 | | |
95 | 156 | | |
96 | 157 | | |
| 158 | + | |
| 159 | + | |
97 | 160 | | |
98 | 161 | | |
99 | | - | |
100 | 162 | | |
| 163 | + | |
101 | 164 | | |
102 | 165 | | |
103 | 166 | | |
104 | 167 | | |
105 | 168 | | |
106 | 169 | | |
107 | | - | |
| 170 | + | |
108 | 171 | | |
109 | 172 | | |
110 | 173 | | |
111 | 174 | | |
112 | | - | |
113 | 175 | | |
| 176 | + | |
114 | 177 | | |
115 | 178 | | |
116 | 179 | | |
| |||
120 | 183 | | |
121 | 184 | | |
122 | 185 | | |
123 | | - | |
124 | 186 | | |
| 187 | + | |
125 | 188 | | |
126 | 189 | | |
127 | 190 | | |
| |||
130 | 193 | | |
131 | 194 | | |
132 | 195 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | 196 | | |
140 | 197 | | |
141 | 198 | | |
142 | | - | |
| 199 | + | |
143 | 200 | | |
144 | 201 | | |
145 | 202 | | |
146 | 203 | | |
147 | 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 | + | |
148 | 245 | | |
149 | 246 | | |
150 | 247 | | |
| |||
197 | 294 | | |
198 | 295 | | |
199 | 296 | | |
| 297 | + | |
200 | 298 | | |
201 | 299 | | |
202 | 300 | | |
| |||
0 commit comments