-
Notifications
You must be signed in to change notification settings - Fork 3
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
sites without metadata fail to publish #1996
sites without metadata fail to publish #1996
Comments
Which fields specifically are causing the error? If it's the pipeline that's failing, why doesn't the usual error handling for notifying on publish failures work? |
@pdpinch In this case, the field causing the error seems to be |
I'm reviewing #2015 and I'd like to clarify a few requirements. The approach in #2015 produces the expected behavior. That is, production course publish requires the metadata content to be set from the frontend. It simply checks if the metadata object exists, but not its content.
The following are the courses that don't have the level metadata but are published to production:
@gumaerc what are your thoughts on this? I'll also tag Peter once he returns from his vacation. |
@HussainTaj-arbisoft I believe This being said, I think more stringent validation should be performed before allowing a publish to production. I don't know if this means we want to check every single field or use |
Thank you for the explanation, @gumaerc. Anas added a check in mitodl/ocw-hugo-themes#1274 which should allow the publish to succeed without the metadata.
This makes sense. More validation is always better. |
@pdpinch, I'd like to hear what your opinion on the questions in #1996 (comment) is. |
Do we have a mechanism to validate only on publish to production?
We need to find a balance between allowing authors to publish incomplete work to staging, and requiring valid data in production.
|
There is currently a Lines 1105 to 1108 in 26830bc
One possible approach would be to add an analogous setting for |
#2015 checks if the site has metadata before the user clicks "publish". So the validation logic always runs. However, it does allow staging courses without any restrictions regarding metadata. Running the validation early also allows us to show a warning message telling the user why they can't publish. The problem with having this validation after the user clicks publish is that we have no UI to show an error message. We don't show any error message when publishes fail. We only show a status. @pt2302 thank you for the suggestion, I wasn't aware we had Adding post-publish validation messages doesn't seem required right now, and that might have an overhead too. So early validation should be a relatively more convenient option. I'll advise Anas to go with an optimized way to perform validation for the required fields. We can test out the prototype and then decide if post-publish error messages need to be added. @pdpinch, one thing I'd like to confirm right now is if you'd like to make the |
Anas has pointed out that we have a We're moving ahead with validating individual metadata fields. In consequence, old courses will not be published to production by the author unless they fill all the required fields. The authors can simply click "save" on the metadata page to achieve this. But, it isn't obvious what's missing at first glance (since the boolean has a default Since |
@HussainTaj-arbisoft @Anas12091101 what's the status of this? I've reread the comments and it's not clear me to what the next step is. |
Anas won't be working on this and I'll probably be taking over from here. I've been prioritizing things on the board in ready over this issue. @pdpinch, I don't know the priority of this issue. Would it be okay if I move this to ready and prioritize working on it? |
Actually, it's not high priority. I was only commenting because it had been sitting for so long. If you think it's less than a days work to finish, then let's do it and get the value of what Ana's started. If it's more work than that, it will have to back into "needs triage" |
It might take longer than a day. The task right now is to decide what to do with the
|
This shall be deployed after fixing https://github.com/mitodl/hq/issues/4499 |
@umar8hassan can this be closed? |
@pdpinch No, this should be still kept open. The relevant code for this issue was reverted due to fix required in https://github.com/mitodl/hq/issues/4499. |
@umar8hassan what's the status of this now? |
Expected Behavior
If required metadata is not set on a course,
ocw-studio
should not allow you to click the publish button, at least for publishing live.Current Behavior
You can add content to a course and attempt to publish it without ever visiting the Metadata section. The publishing pipeline will subsequently fail with the following error:
Steps to Reproduce
Possible Solution
There are a couple possible solutions:
ocw-hugo-projects/ocw-course-v2/ocw-studio.yaml
, so they likely should be. When opening the publish drawer, disable the publish button if required metadata fields are not filled out.ocw-hugo-themes
, and add more robust null checking to places in the theme that use metadata values. Some refactoring could likely be done to accomplish this, although it may not achieve the desired behavior. For instance, it's probably fine to publish draft with missing information, but we would likely want to prevent publishing a site live with course level metadata missing, especially in production.The full solution may involve a combination of both, allowing course authors to publish draft before filling out the metadata hassle-free while simultaneously protecting them from accidentally publishing a site live with missing metadata.
The text was updated successfully, but these errors were encountered: