Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separately track publish_date and build_date #2168

Open
gumaerc opened this issue Apr 25, 2024 · 0 comments · May be fixed by #2284
Open

separately track publish_date and build_date #2168

gumaerc opened this issue Apr 25, 2024 · 0 comments · May be fixed by #2284
Assignees

Comments

@gumaerc
Copy link
Contributor

gumaerc commented Apr 25, 2024

Description/Context

First, a bit of prior discussion on this topic for reference:

https://github.com/mitodl/hq/discussions/3169
https://github.com/mitodl/hq/issues/2862

Currently, the publish_date field on a Website object is updated at the end of a run of SitePipeline in Concourse. When the site has been successfully published, a webhook call is made back to ocw-studio that tells it to update the publish_date field for that site. The main issue with this is that the pipeline code is not exclusively triggered by user interaction. When there is a change to ocw-hugo-themes or ocw-hugo-projects a rebuild of the entire website is triggered, thus updating publish_date for every website. The issue with this is that courses that have not had any publish action by a content author have their publish_date updated, even though no actual content changes were made. This makes it impossible to determine if a course has actually had changes published to production, or if the site has simply been rebuilt using the existing content.

Plan/Design

Currently, we have draft_publish_date and live_publish_date fields on the Website model. We should:

  • Add draft_build_date and live_build_date as DateTimeField fields to the Website model
  • The update_website_status function, which is called by the pipeline_status endpoint, should update these new build date fields instead of the publish date fields
  • The publish_website function should be changed to update the publish date fields (draft_publish_date or live_publish_date) after Github operations have completed, setting the appropriate status based on whether it succeeds or fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants