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

Nodes from chef runs should be properly marked as complete/incomplete #2806

Closed
jayoshih opened this issue Jan 15, 2021 · 5 comments · Fixed by #3410
Closed

Nodes from chef runs should be properly marked as complete/incomplete #2806

jayoshih opened this issue Jan 15, 2021 · 5 comments · Fixed by #3410
Assignees
Labels
DEV: backend P2 - normal Priority: Nice to have

Comments

@jayoshih
Copy link
Contributor

jayoshih commented Jan 15, 2021

Observed behavior

The internal cheffing API does not validate all conditions in determining whether a node is complete. It currently only validates against empty titles and invalid license fields.

Expected behavior

A node should be validated against all of the same conditions that the mark_incomplete management command handles.

References

Partially handled for titles and licenses in #2999

@rtibbles rtibbles added this to the Post Release Stabilization milestone Jan 19, 2021
@rtibbles rtibbles added P2 - normal Priority: Nice to have backend labels Jan 19, 2021
@jonboiser
Copy link
Contributor

jonboiser commented Feb 22, 2021

On chef runs, actually detect if the node is valid instead of defaulting to true (this line)

Any pointers on how to do this? What would make a node invalid?

@rtibbles
Copy link
Member

This management command contains the comprehensive list of different conditions:

https://github.com/learningequality/studio/blob/hotfixes/contentcuration/contentcuration/management/commands/mark_incomplete.py

Might be good to write a backend utility function (with tests) that encapsulates these conditions.

@jonboiser jonboiser self-assigned this Feb 22, 2021
@jonboiser
Copy link
Contributor

jonboiser commented Feb 22, 2021

@rtibbles The implementation of the mark_complete is basically

For each criterion C, filter all ContentNodes that don't meet C, then update their complete field to False.

Whereas, I think what we want to do in the create_node method is check all the criteria for just a single node, based on the node_data dict passed into the function.

How do you think a utility function could be written that is usable in both spots?

@rtibbles
Copy link
Member

Oh, I don't think we'd need to write something that worked for both - just a 'node validation' function would be sufficient for the single node case.

@bjester
Copy link
Member

bjester commented Apr 12, 2022

@AtKristijan This may break many existing chef scripts so we should do some auditing before merging this change. I'm not sure if it's possible, but if this does break many chefs, perhaps we can surface these new validations as warnings instead of strict validation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: backend P2 - normal Priority: Nice to have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants