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

Course publish without metadata (unforked) #2183

Merged
merged 20 commits into from
May 23, 2024
Merged

Course publish without metadata (unforked) #2183

merged 20 commits into from
May 23, 2024

Conversation

ibrahimjaved12
Copy link
Contributor

What are the relevant tickets?

Fixes #1996
This is a copy of this PR #2015. The original PR is based off forked repository, due to which we couldn't run all workflow checks.

Description (What does it do?)

You can add content to a course and publish it in staging without ever visiting the Metadata section. Production, however will require metadata to be set.

Screenshots (if appropriate):

Screenshot 2023-10-20 at 2 34 36 PM Screenshot 2023-10-20 at 2 35 37 PM Screenshot 2023-10-20 at 2 35 51 PM

How can this be tested?

  • Clone and checkout to this branch from my forked repo
  • Restart studio containers
  • Go to the studio website at http://localhost:8043/admin and login as admin
  • Create a new site with ocw-course starter
  • (Optional) Add pages to the website
  • Open the publish drawer, you can see that the publish button is enabled in the staging and disabled in production (as we have not set metadata yet)
  • Press the publish button in staging
  • After the pipeline finishes, you get the published website on the url

Additional Context

The course-v2/layouts/partials/course_banner.html file was changed in the ocw-hugo-themes repository. You can view the changes here

@ibrahimjaved12
Copy link
Contributor Author

@umar8hassan The changes here have a critical side effect. They don't allow us to publish ocw-www to live anymore, with the same validation required that "metadata" is required before we can publish. But ocw-www will not have metadata.

In static/js/components/PublishDrawer.tsx:

  const isPublishDisabled =
    !publishingInfo.hasUnpublishedChanges ||
    (!website.has_site_metadata && publishingEnv === PublishingEnv.Production)

For ocw-www, website.has_site_metadata will always return false. Looking at the ticket, I don't think we're required to have any kind of checks for ocw-www either way. There could be different ways to go about this to allow publishing ocw-www into live. We have name, short_id, title, starter in type Website each which would be distinct for ocw-www.

Please make changes for this as you see fit.

@ibrahimjaved12
Copy link
Contributor Author

Looks good to me 👍🏻

@umar8hassan umar8hassan merged commit a01ad56 into master May 23, 2024
7 checks passed
@umar8hassan umar8hassan deleted the issue_metadata branch May 23, 2024 16:38
This was referenced May 24, 2024
@umar8hassan
Copy link
Contributor

@pdpinch this is has been tested on RC. Wanted to have your take on this before deploying it to production.

umar8hassan added a commit that referenced this pull request Jun 6, 2024
umar8hassan added a commit that referenced this pull request Jun 6, 2024
@odlbot odlbot mentioned this pull request Jun 6, 2024
17 tasks
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.

sites without metadata fail to publish
3 participants