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

[DO NOT MERGE] Rewrite learning uploader #1421

Open
wants to merge 66 commits into
base: main
Choose a base branch
from

Conversation

frankharkins
Copy link
Member

@frankharkins frankharkins commented May 23, 2024

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.

@frankharkins frankharkins marked this pull request as draft May 23, 2024 13:26
@Qiskit Qiskit deleted a comment from review-notebook-app bot May 24, 2024
@frankharkins frankharkins requested review from Eric-Arellano and arnaucasau and removed request for Eric-Arellano May 24, 2024 17:16
@frankharkins frankharkins had a problem deploying to Learning platform (staging) May 29, 2024 18:00 — with GitHub Actions Failure
@frankharkins frankharkins had a problem deploying to Learning platform (staging) May 29, 2024 18:01 — with GitHub Actions Failure
@frankharkins frankharkins had a problem deploying to Learning platform (staging) May 29, 2024 20:06 — with GitHub Actions Failure
Copy link
Collaborator

@arnaucasau arnaucasau left a 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! 🚀

scripts/tutorial-uploader/README.md Outdated Show resolved Hide resolved
scripts/tutorial-uploader/README.md Outdated Show resolved Hide resolved
scripts/tutorial-uploader/lib/local-tutorial-data.ts Outdated Show resolved Hide resolved
tutorials/README.md Outdated Show resolved Hide resolved
@frankharkins frankharkins changed the title Rewrite learning uploader [DO NOT MERGE] Rewrite learning uploader May 30, 2024
@frankharkins
Copy link
Member Author

This is ready for final review, but it might be best to avoid merging until I get back in case there are teething issues.

Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a 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!

scripts/tutorial-uploader/lib/api.test.ts Show resolved Hide resolved
scripts/tutorial-uploader/lib/api.ts Outdated Show resolved Hide resolved
scripts/tutorial-uploader/lib/api.ts Outdated Show resolved Hide resolved
scripts/tutorial-uploader/lib/api.ts Show resolved Hide resolved
scripts/tutorial-uploader/lib/api.ts Outdated Show resolved Hide resolved
tutorials/README.md Outdated Show resolved Hide resolved
tutorials/learning-api.conf.yaml Show resolved Hide resolved
frankharkins and others added 2 commits May 30, 2024 16:47
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
@frankharkins frankharkins changed the title [DO NOT MERGE] Rewrite learning uploader Rewrite learning uploader Jun 7, 2024
@frankharkins frankharkins changed the title Rewrite learning uploader [DO NOT MERGE] Rewrite learning uploader Jun 10, 2024
@frankharkins
Copy link
Member Author

This is ready for final review, but we can't merge until the token has the right permissions.

Copy link
Collaborator

@arnaucasau arnaucasau left a 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

scripts/tutorial-uploader/lib/local-tutorial-data.ts Outdated Show resolved Hide resolved
scripts/tutorial-uploader/lib/schema.ts Show resolved Hide resolved
scripts/tutorial-uploader/lib/api.test.ts Outdated Show resolved Hide resolved
frankharkins and others added 3 commits June 14, 2024 10:48
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.
Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
Dunno why this was expected at some point
@frankharkins
Copy link
Member Author

This comment is a reminder to update learning-api.conf.yaml before merging as tutorial data has changed since this PR was created.

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

Successfully merging this pull request may close these issues.

Automate more learning platform features through the upload tool
3 participants