Skip to content

Track user publish intent in PublishLog #533

Closed

Description

@ormsbee

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:

Image

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?

Activity

  1. changed the title [-]Track publish _intent_[/-] [+]Track publish *intent* in PublishLog[/+] on Apr 6, 2026
  2. changed the title [-]Track publish *intent* in PublishLog[/-] [+]Track user publish intent in PublishLog[/+] on Apr 6, 2026
  3. ChrisChV commented on Apr 6, 2026

    @ChrisChV
    Contributor

    Question 1: What do we call this?

    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).
    • single: user published a specific entity.
  4. ormsbee commented on Apr 7, 2026

    @ormsbee
    ContributorAuthor

    Question 1: What do we call this?

    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?

  5. crathbun428 commented on Apr 7, 2026

    @crathbun428

    Important to differentiate publish all and bulk publish? My gut would say no if we can see who published and when they published.

  6. ChrisChV commented on Apr 7, 2026

    @ChrisChV
    Contributor

    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?

  7. ormsbee commented on Apr 8, 2026

    @ormsbee
    ContributorAuthor

    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:

    1. 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).
    2. 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.
    3. 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.
  8. ormsbee commented on Apr 8, 2026

    @ormsbee
    ContributorAuthor

    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.

  9. ormsbee commented on Apr 10, 2026

    @ormsbee
    ContributorAuthor

    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.

  10. ChrisChV commented on Apr 10, 2026

    @ChrisChV
    Contributor

    Great! If there are no further doubts, I can start with these changes and have the PR in a few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions