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

Umar/2168 separately track publish date and build date #2284

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

umar8hassan
Copy link
Contributor

@umar8hassan umar8hassan commented Aug 30, 2024

What are the relevant tickets?

Fixes #2168

Description (What does it do?)

This change separately tracks the build and publish dates for live/draft versions. The publish dates are updated on mass_build which indicates no content change. Build dates and publish dates are both updated on publish from studio.

How can this be tested?

  1. Switch to umar/2168-separately-track-publish_date-and-build_date branch ocw-studio
  2. Check migrations applied. docker-compose exec web ./manage.py showmigrations websites
    • Last applied migration should be 0057_website_draft_build_date_website_live_build_date
    • If migration is not applied, apply migrations: docker-compose exec web ./manage.py migrate websites
  3. Create a site in ocw-studio locally at localhost:8043/sites or use an existing one.
  4. Make any changes and publish site in ocw-studio and Wait for the publish operation to complete.
  5. Go to Django admin at localhost:8043/admin and search for the site in Websites.
  6. In Django admin verify that only publish date will be updated for the site.
  7. Run this command to trigger a mass build locally. Replace the variables with appropriate values:
    docker-compose exec web ./manage.py mass_publish <live or draft> --filter <site-name>
  8. In Django admin verify that Build date and Publish date have been updated.

@umar8hassan umar8hassan linked an issue Aug 30, 2024 that may be closed by this pull request
@umar8hassan umar8hassan self-assigned this Aug 30, 2024
@umar8hassan umar8hassan marked this pull request as ready for review August 30, 2024 13:09
@pt2302 pt2302 self-assigned this Aug 30, 2024
@pt2302 pt2302 self-requested a review August 30, 2024 13:21
Copy link
Contributor

@pt2302 pt2302 left a comment

Choose a reason for hiding this comment

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

I think that we want the opposite changes. Specifically, we want build date updates to be triggered both by user-initiated publish actions and by the mass build pipeline (i.e., the last time that the course site was built) and publish date updates to be triggered only by user-initiated publish actions. So the publish date should stay the same when the mass build pipeline runs.

@umar8hassan umar8hassan force-pushed the umar/2168-separately-track-publish_date-and-build_date branch from 244968b to c77229a Compare September 6, 2024 13:22
@pdpinch
Copy link
Member

pdpinch commented Sep 10, 2024

I think that we want the opposite changes. Specifically, we want build date updates to be triggered both by user-initiated publish actions and by the mass build pipeline (i.e., the last time that the course site was built) and publish date updates to be triggered only by user-initiated publish actions. So the publish date should stay the same when the mass build pipeline runs.

This is correct, but I'd like to clarify a bit more. Am I right that:

build: current release branch of theme and content are checked out and hugo builds the HTML.

publish: main branch of content repo is merged into release branch and then build process is followed.

@umar8hassan umar8hassan force-pushed the umar/2168-separately-track-publish_date-and-build_date branch from b073e25 to 1317392 Compare September 16, 2024 13:10
Copy link
Contributor

@pt2302 pt2302 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just a few minor suggestions regarding phrasing in the documentation.

@@ -409,6 +410,11 @@ You should now have a pipeline in Concourse called `e2e-test-pipeline`. Run this
- Deploy them to Minio
- Run Playwright tests against the output

### Publish And Build Dates

- Publishing site from Studio for live and draft versions, updates the website properties `(live_build_date, publish_date)` and `(draft_build_date, draft_publish_date)` respectively.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Publishing site from Studio for live and draft versions, updates the website properties `(live_build_date, publish_date)` and `(draft_build_date, draft_publish_date)` respectively.
- Publishing the site from Studio for live and draft versions updates the website properties `(live_build_date, publish_date)` and `(draft_build_date, draft_publish_date)`, respectively.

### Publish And Build Dates

- Publishing site from Studio for live and draft versions, updates the website properties `(live_build_date, publish_date)` and `(draft_build_date, draft_publish_date)` respectively.
- Mass build for live and draft versions only updates the website properties `live_build_date` and `draft_build_date` respectively.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Mass build for live and draft versions only updates the website properties `live_build_date` and `draft_build_date` respectively.
- Running the mass build for live and draft versions only updates the website properties `live_build_date` and `draft_build_date`, respectively.

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

Successfully merging this pull request may close these issues.

separately track publish_date and build_date
3 participants