-
Notifications
You must be signed in to change notification settings - Fork 47
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
[DO NOT MERGE] Rewrite learning uploader #1421
base: main
Are you sure you want to change the base?
Conversation
Is actually path to folder containing notebook
Except for tests...
…H/new-learning-uploader
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work Frank! It looks great! 🚀
Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
This is ready for final review, but it might be best to avoid merging until I get back in case there are teething issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an epic improvement!
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
This is ready for final review, but we can't merge until the token has the right permissions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work Frank 🚀. I've been looking at the improvements you did from the comments Eric left last week and the code itself and all looks great! I left some feedback to try to understand better some parts and a possible nit
Mostly paranoia, but changing a slug will probably not have the intended effect. I imagine a contributor would think this would change the slug of the page, but it will actually just upload a new page with the new slug so there would be two pages online. Changing a slug also requires a redirect, for which there's no way to automate. I think a comment here is appropriate as contributors might not (and shouldn't have to) read the entire contributing document before editing this file.
This comment is a reminder to update |
The requirements for the learning uploader have changed since it was first created.
It was originally intended to be used locally by writers to quickly push content to the platform. I wrote it in Python so writers would not need to install node, and using string manipulations to interact with the REST API was good enough for just uploading the zip and linking the new file. It also included functionality for a writer to log into the database through a CLI.
Now, the uploader is only used in CI, so we don't care about logging in or sticking to Python, and we want to be able to do more complex manipulations such as adding new lessons and changing metadata. For this reason, this PR rewrites the uploader using the official Directus SDK, which makes interacting with the API a lot easier.