Skip to content

feat: add direct boolean field to PublishLogRecord [FC-0123]#539

Open
ChrisChV wants to merge 3 commits intoopenedx:mainfrom
open-craft:chris/direct-field-in-publish-record
Open

feat: add direct boolean field to PublishLogRecord [FC-0123]#539
ChrisChV wants to merge 3 commits intoopenedx:mainfrom
open-craft:chris/direct-field-in-publish-record

Conversation

@ChrisChV
Copy link
Copy Markdown
Contributor

@ChrisChV ChrisChV commented Apr 13, 2026

Github issue: #533

Track whether each publish record was explicitly requested by the user (direct=True) or was a side-effect of publishing a parent/dependency (direct=False). Historical records get direct=None since intent cannot be determined retroactively.

  • Add direct = BooleanField(null=True, blank=True, default=False) to PublishLogRecord.
  • In publish_from_drafts(), collect direct_draft_ids before the loop and set direct=True/False per record accordingly.

Track whether each publish record was explicitly requested by the user (direct=True) or was a side-effect of publishing a parent/dependency (direct=False). Historical records get direct=None since intent cannot be determined retroactively.
* Add `direct = BooleanField(null=True, blank=True, default=None)` to PublishLogRecord.
* In publish_from_drafts(), collect direct_draft_ids before the loop and set direct=True/False per record accordingly.
* In _create_side_effects_for_change_log(), set direct=False in get_or_create defaults so pure side-effect records are marked indirect.
@ChrisChV ChrisChV requested a review from ormsbee April 13, 2026 22:16
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 13, 2026
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @ChrisChV!

This repository is currently maintained by @axim-engineering.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@ChrisChV
Copy link
Copy Markdown
Contributor Author

Hi @ormsbee, could you review this PR? This is the new direct field

@ormsbee
Copy link
Copy Markdown
Contributor

ormsbee commented Apr 13, 2026

Sure thing. I should be able to look this over in the morning.

Copy link
Copy Markdown
Contributor

@ormsbee ormsbee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor requests and a really verbose suggested comment to try to avoid later confusion about the data model. Please let me know if anything in there does not align with your understanding of this feature.

direct = models.BooleanField(
null=True,
blank=True,
default=None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could actually backfill this with None but default new values to False, since that would mean we wouldn't have to touch _create_side_effects_for_change_log(), which is one of the more complex functions already.

Copy link
Copy Markdown
Contributor Author

@ChrisChV ChrisChV Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. bb9698b

@ChrisChV ChrisChV force-pushed the chris/direct-field-in-publish-record branch from 880f679 to bb9698b Compare April 14, 2026 19:35
@ChrisChV ChrisChV requested a review from ormsbee April 14, 2026 19:41
@ormsbee
Copy link
Copy Markdown
Contributor

ormsbee commented Apr 14, 2026

@ChrisChV: I forgot when reviewing yesterday, but could you please add this field to the Django admin view for PublishLogs (there's an inline view of PublishLogRecords that already has all the other fields, so it should be easy to add).

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

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

3 participants