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

Rewrite learning uploader #1421

Merged
merged 75 commits into from
Jul 9, 2024
Merged

Rewrite learning uploader #1421

merged 75 commits into from
Jul 9, 2024

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 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.

@frankharkins frankharkins linked an issue Jun 17, 2024 that may be closed by this pull request
@frankharkins frankharkins mentioned this pull request Jul 5, 2024
These tutorials no longer exist in this repo, this PR is now just to finalise the tool
@frankharkins frankharkins changed the title [DO NOT MERGE] Rewrite learning uploader Rewrite learning uploader Jul 8, 2024
@frankharkins
Copy link
Member Author

frankharkins commented Jul 8, 2024

This is ready to go! Once merged, I'll use it deploy the QAOA tutorial then I'll move it to inner-source to hand off to the new team. Thanks for your patience.

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.

Great job!

scripts/tutorial-uploader/lib/api.test.ts Outdated Show resolved Hide resolved
tutorials/learning-api.conf.yaml Show resolved Hide resolved
tutorials/learning-api.conf.yaml Outdated Show resolved Hide resolved
frankharkins and others added 2 commits July 8, 2024 21:33
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
@frankharkins frankharkins added this pull request to the merge queue Jul 8, 2024
@frankharkins frankharkins removed this pull request from the merge queue due to a manual request Jul 8, 2024
As per Abby's request, we will be overwriting the existing QAOA tutorial
with this one.

Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
@frankharkins frankharkins added this pull request to the merge queue Jul 9, 2024
Merged via the queue into main with commit 4993680 Jul 9, 2024
1 check passed
@frankharkins frankharkins deleted the FH/new-learning-uploader branch July 9, 2024 09:38
frankharkins added a commit to frankharkins/documentation that referenced this pull request Jul 22, 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](https://docs.directus.io/guides/sdk/), which makes interacting with
the API a lot easier.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Automate more learning platform features through the upload tool
3 participants