feat: add direct boolean field to PublishLogRecord [FC-0123]#539
feat: add direct boolean field to PublishLogRecord [FC-0123]#539ChrisChV wants to merge 3 commits intoopenedx:mainfrom
direct boolean field to PublishLogRecord [FC-0123]#539Conversation
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.
|
Thanks for the pull request, @ChrisChV! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
|
Hi @ormsbee, could you review this PR? This is the new |
|
Sure thing. I should be able to look this over in the morning. |
ormsbee
left a comment
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
880f679 to
bb9698b
Compare
|
@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). |
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.
direct = BooleanField(null=True, blank=True, default=False)toPublishLogRecord.publish_from_drafts(),collect direct_draft_idsbefore the loop and setdirect=True/Falseper record accordingly.