DHRI-Curriculum / django-app

2 stars 3 forks source link

Reduce reliance on GitHub API #513

Open kallewesterling opened 2 years ago

kallewesterling commented 2 years ago

issue 1

@szweibel reports an issue with the GitHub API that complains a bit too much about overusing it. No wonder, since all the text snippets are run through the GitHub API. However, we need GitHub-flavored markdown translation somehow, because we rely on that quite heavily in the curricular markdown, if I remember correctly.

I'll start a list here of other repositories that might be of interest to build in (in place of my own caching system + reliance on the GitHub API):

There's also this relevant thread which might be helpful.

issue 2

A related issue is that the caching system should default to the built-in Python markdown converter, but that does not seem to happen according to @szweibel's reporting.

kallewesterling commented 2 years ago

Here are the reports:

I've been looking into the Django app you've written, and this time when I run the build command, it breaks every time at the same place. I added a little print command and got this:

"documentation_url": "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits",
"message": "You have exceeded a secondary rate limit. Please wait a few minutes before you try again."

But no matter how long I wait, it keeps giving that message!

...and...

Actually, relatedly I get this error:

File "/mnt/d/apps/django-app/backend/github.py", line 165, in __init__
self.parsed_data = self.parse()
File "/mnt/d/apps/django-app/backend/github.py", line 512, in parse
self.sections['frontmatter'] = self._fix_frontmatter()
File "/mnt/d/apps/django-app/backend/github.py", line 643, in _fix_frontmatter
install_link = 'shortcuts/install/' in url
TypeError: argument of type 'NoneType' is not iterable
szweibel commented 2 years ago

It's always in a specific place, which is the weird thing. It fails on python manage.py buildworkshop --name command-line but succeeds on python manage.py buildworkshop --name python

szweibel commented 2 years ago

I made an edit to force use of the built-in markdown parser. The build command still fails at the same place, so it seems like the cause is something else.