You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per this slack thread, I think we're going to want to extend the PublishLog model to include a nullable field that captures what it was that the user clicked "publish" on. This seems to be a requirement of the UX:
Right now, if there is a Subsection -> Unit -> Component setup where only the component has changed, the data in the PublishLog does not allow us to differentiate which level the user pressed "Publish" at. The PublishLog currently only tracks what was published, not what the user asked to be published. So if the Component was the only item with unpublished changes, today's PublishLog would look identical no matter which level "publish" was clicked at.
Question 1: What do we call this?
What do we call the thing we pressed publish on, to differentiate it from all the other things that were implicitly published?
Question 2: How do we handle multiples?
If we add a simple field to the PublishLog, we can track a single requested publish item, and use a null value to represent "the user clicked on publish-all". In the short term, I think this is the thing to do. But do we foresee a need to publish multiple, specific things at once? For instance, clicking multiple checkboxes on the search/browse screen and clicking "publish"? In that case, a M:M relation would make more sense here.
Question 3: How do we handle backfill?
We don't have this information, so how should we backfill it? Always assume the highest level? Have a different UX when we don't know?
I suggest: publish_intent_entity, itent_entity, triggered_in
Question 2: How do we handle multiples?
Given that bulk publish (openedx/frontend-app-authoring#2798) is planned, where users can explicitly select multiple specific items to publish together, a single nullable FK may not be sufficient. A M:M relationship would be needed.
Question 3: How do we handle backfill?
I believe we should create a publish_scope and set the backfill value to "unknown". Now another question arises: why a new publish scope field? Because of the "Publish All" feature, that is also a special case that must be handled in UI . So, the publish_scope can be
unknown: backfill, it is unknown what the user pressed.
all: user clicked "Publish All".
bulk: user selected multiple entities (bulk publish).
I suggest: publish_intent_entity, itent_entity, triggered_in
Or maybe selected_entities? I'd love for us to share terminology with UX/Product/documentation on this.
Question 2: How do we handle multiples?
Given that bulk publish (openedx/frontend-app-authoring#2798) is planned, where users can explicitly select multiple specific items to publish together, a single nullable FK may not be sufficient. A M:M relationship would be needed.
Ah, I hadn't seen that, but I completely agree that makes the M:M choice obvious.
Question 3: How do we handle backfill?
I believe we should create a publish_scope and set the backfill value to "unknown". Now another question arises: why a new publish scope field? Because of the "Publish All" feature, that is also a special case that must be handled in UI . So, the publish_scope can be
unknown: backfill, it is unknown what the user pressed.
all: user clicked "Publish All".
bulk: user selected multiple entities (bulk publish).
single: user published a specific entity.
What if we put a boolean field on PublishLogRecord and mark down for each record whether it was explicitly requested or not? It could be null for the initial "unknown" state before backfill, true if that record was explicitly requested, and false if it was implicitly published (e.g. because it was a child)?
The one drawback with the approach that I'm describing is that we couldn't differentiate later on between someone pressing "publish all" and "bulk publish by checking all the things that currently exist". @sdaitzman, @crathbun428: Is it okay to consider those things as equivalent, or is it important to differentiate them?
What if we put a boolean field on PublishLogRecord and mark down for each record whether it was explicitly requested or not? It could be null for the initial "unknown" state before backfill, true if that record was explicitly requested, and false if it was implicitly published (e.g. because it was a child)?
I like this idea. Don't you think this boolean would be enough? I think it can replace selected_entities, eliminating the need for M2M. We can achieve the same result with publish_log.records.filter(is_explicit_selected=True) What do you think?
I like this idea. Don't you think this boolean would be enough? I think it can replace selected_entities, eliminating the need for M2M. We can achieve the same result with publish_log.records.filter(is_explicit_selected=True) What do you think?
Right. As long as it's okay to not distinguish between "publish all" and "bulk publish all the things", I think this works well and keeps it fairly simple.
Actually, I guess we could even distinguish those two. We could make it so that:
Bulk publishes mark every record that was selected as True.
Single publishes mark just the one record that the button was pressed for as True.
Publish All could be denoted by marking none of the records as True.
Then the publish_from_drafts() function could take a new optional param that's a set of all the Draft IDs that are being explicitly published. I don't really love this idea though, since it makes the interface of publish_from_drafts() much less intuitive. If we don't have to differentiate between "publish all" and "bulk publish", we don't need the new optional set parameter, and we can just always read the IDs of the initial queryset passed in.
@crathbun428, @sdaitzman: Any thoughts on what we call should call the three categories of things that can be affected by a publish? We have:
Things that the user directly asks to be published (these are in a draft state because changes have been made to them or their children/dependencies).
Things that are indirectly published because they are a child/dependency of what the user requested to be published, e.g. a Component that was published because the user clicked "publish" on a Unit.
Things whose publish state changes only as a side-effect of one of their dependencies being published. So this is what we'd use to describe what happens to a Unit when you select and publish one of its Components.
Then the publish_from_drafts() function could take a new optional param that's a set of all the Draft IDs that are being explicitly published. I don't really love this idea though, since it makes the interface of publish_from_drafts() much less intuitive. If we don't have to differentiate between "publish all" and "bulk publish", we don't need the new optional set parameter, and we can just always read the IDs of the initial queryset passed in.
Thinking on this some more, I guess publish_from_drafts() could just take a boolean arg that says "these aren't explicitly chosen" and publish_all_drafts could choose to use that. So it'd be a little weird, but most consumers wouldn't have to care.
In any event, a boolean field on PublishLogRecord seems sufficient for the time being to represent the states we need.
We discussed this in today's sync-up. The high level takeaways:
Terminology
Directly published things are what the user actually explicitly requests, e.g. what they click "publish" on, and later what they will select with checkboxes for bulk-publishing.
Indirectly published items describe what happens to items that are children/dependencies of directly published things. So this is what happens to a Component that has changes when you click "publish" on the Unit it's in.
How it's presented
Only the directly published things are shown in the screenshot above. We don't currently have UX for how to represent multiple things that are directly published at the same time (as might happen for someone pressing "publish all" or the yet-to-be-implemented bulk-publish workflow).
The fact that we only expose direct publishes can lead to unintuitive situations in situations where containers share children. For example:
Units U1 and U2 both have a Component C1 with changes.
U1 is published.
You are viewing the history log for Unit U2.
In this case, the publish of U1 shows up in the publish history of U2 because it was the direct publish that led to the indirect publishing of C1 (which is also part of U2). This is okay--supplementing the UX to explain this situation to the user will be a follow-on task that is not in scope for the current work.
Also of note: "Publish all" and bulk publishing everything in the library are equivalent actions, i.e. we do not need to explicitly track "the user pressed the publish all button".
What I think this means in code
We add a new direct boolean field to PublishLogRecord. I think there's an open question as to how we do the backfill, but my hope is that we can just not display publish logs before we capture the intent, i.e. make direct nullable and then do not show the history for those old log entries to users.
Activity
[-]Track publish _intent_[/-][+]Track publish *intent* in PublishLog[/+][-]Track publish *intent* in PublishLog[/-][+]Track user publish intent in PublishLog[/+]ChrisChV commentedon Apr 6, 2026
I suggest:
publish_intent_entity,itent_entity,triggered_inGiven that bulk publish (openedx/frontend-app-authoring#2798) is planned, where users can explicitly select multiple specific items to publish together, a single nullable FK may not be sufficient. A M:M relationship would be needed.
I believe we should create a
publish_scopeand set the backfill value to "unknown". Now another question arises: why a newpublish scopefield? Because of the "Publish All" feature, that is also a special case that must be handled in UI . So, thepublish_scopecan beunknown: backfill, it is unknown what the user pressed.all: user clicked "Publish All".bulk: user selected multiple entities (bulk publish).single: user published a specific entity.ormsbee commentedon Apr 7, 2026
Or maybe
selected_entities? I'd love for us to share terminology with UX/Product/documentation on this.Ah, I hadn't seen that, but I completely agree that makes the M:M choice obvious.
What if we put a boolean field on
PublishLogRecordand mark down for each record whether it was explicitly requested or not? It could be null for the initial "unknown" state before backfill, true if that record was explicitly requested, and false if it was implicitly published (e.g. because it was a child)?The one drawback with the approach that I'm describing is that we couldn't differentiate later on between someone pressing "publish all" and "bulk publish by checking all the things that currently exist". @sdaitzman, @crathbun428: Is it okay to consider those things as equivalent, or is it important to differentiate them?
crathbun428 commentedon Apr 7, 2026
Important to differentiate publish all and bulk publish? My gut would say no if we can see who published and when they published.
ChrisChV commentedon Apr 7, 2026
I like this idea. Don't you think this boolean would be enough? I think it can replace
selected_entities, eliminating the need for M2M. We can achieve the same result withpublish_log.records.filter(is_explicit_selected=True)What do you think?ormsbee commentedon Apr 8, 2026
Right. As long as it's okay to not distinguish between "publish all" and "bulk publish all the things", I think this works well and keeps it fairly simple.
Actually, I guess we could even distinguish those two. We could make it so that:
Then the
publish_from_drafts()function could take a new optional param that's a set of all the Draft IDs that are being explicitly published. I don't really love this idea though, since it makes the interface ofpublish_from_drafts()much less intuitive. If we don't have to differentiate between "publish all" and "bulk publish", we don't need the new optional set parameter, and we can just always read the IDs of the initial queryset passed in.@crathbun428, @sdaitzman: Any thoughts on what we call should call the three categories of things that can be affected by a publish? We have:
ormsbee commentedon Apr 8, 2026
Thinking on this some more, I guess
publish_from_drafts()could just take a boolean arg that says "these aren't explicitly chosen" andpublish_all_draftscould choose to use that. So it'd be a little weird, but most consumers wouldn't have to care.In any event, a boolean field on
PublishLogRecordseems sufficient for the time being to represent the states we need.ormsbee commentedon Apr 10, 2026
We discussed this in today's sync-up. The high level takeaways:
Terminology
How it's presented
Only the directly published things are shown in the screenshot above. We don't currently have UX for how to represent multiple things that are directly published at the same time (as might happen for someone pressing "publish all" or the yet-to-be-implemented bulk-publish workflow).
The fact that we only expose direct publishes can lead to unintuitive situations in situations where containers share children. For example:
In this case, the publish of U1 shows up in the publish history of U2 because it was the direct publish that led to the indirect publishing of C1 (which is also part of U2). This is okay--supplementing the UX to explain this situation to the user will be a follow-on task that is not in scope for the current work.
Also of note: "Publish all" and bulk publishing everything in the library are equivalent actions, i.e. we do not need to explicitly track "the user pressed the publish all button".
What I think this means in code
We add a new
directboolean field toPublishLogRecord. I think there's an open question as to how we do the backfill, but my hope is that we can just not display publish logs before we capture the intent, i.e. makedirectnullable and then do not show the history for those old log entries to users.ChrisChV commentedon Apr 10, 2026
Great! If there are no further doubts, I can start with these changes and have the PR in a few days.