-
Notifications
You must be signed in to change notification settings - Fork 119
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
Refactoring and API #505
Refactoring and API #505
Conversation
The traceback now has a wrapper error with info on the repo and method called.
Versions are ignored entirely for now; there's no error and no bad input to check. |
The command is gone. The main reason for this workaround was that without output, Travis CI would think the process stalled. More output/logging overall and `elsa freeze -v` should ensure there's enough output.
actually my bad review :( but at least we see it works :) |
Previously, only runs could be loaded from link.yml. This limitation doesn't make much sense.
Co-Authored-By: encukou <encukou@gmail.com>
This makes the test a bit more thorough, as it includes the whitelisted `#master` (but does not end with it).
Yup. Filed as https://github.com/pyvec/naucse.python.cz/issues/509.
For some reason, I can't seem to get the right error in this case :/
Anything else you can think of? Signing out for today. |
what error you get? the travis log from above shows what happens, doesn't it?
Good work with the tests, thank you. Any point of keeping the skipped test_forks? Do you have plans with them? I must admit that I wasn't able to review everything so thoroughly as I'd like, but that would take me a couple weeks. For others: I've consulted this PR with @encukou in person as well. One problem I have is that everything is soooo complicated at this point that debugging any problem has a bus factor of 3 (@encukou @mikicz and me) and after this, @mikicz might no longer be counted into this. We shall not travel with the same train from now on 😁 I am afraid that at this point we are too deep in the rabbit hole and this PR doesn't make it that worse. Hopefully it allows us to make it better. Thanks for that.
Good night 💤 |
No error. If I delete the Pipfile/Pipfile.lock, and put in a requirements.txt without naucse_render, everything seems to work. And it's all hidden somewhere in Arca :(
I'd like to go through it once more before removing it. Possibly after this PR is merged.
Indeed, that's the goal here. Not so much to reduce the overall complexity, but to separate it into individual pieces, so someone can focus on one thing (in naucse or outside), and ignore the others. |
BTW I couldn't sleep last night and was thinking about our git tests that we currently somehow subprocess in elsa, here and I'll possibly also need that when I'll work on a git merge driver for spec files. My idea was to create a common pytest-git plugin that would abstract this to some utility git workspace fixture. I even started to design it in my head. This morning I've decided to draft that thing, but apparently, it was obviously already done and called the same :D https://pypi.org/project/pytest-git/ I'm not saying let's start using it now when the tests are already written, I'm just pointing it out for future reference. I will play with that thing when I test the merge driver to see how useful it is. |
I definitely can't read the whole dff/conversation, but I noticed this bit in a notification and I think I could take a short look if there's a problem with something in Arca or with Arca? Am I understanding correctly, that when you use the same fork with and without Pipfile/Pipfile.lock it produces a different result? |
Co-Authored-By: encukou <encukou@gmail.com>
Sorry for the delay. I've added the failing test in 1162e65 |
The API is blocking two external projects (coursweare and feedbacker). |
Here's a start for #494.
I recommend reading the full diff instead of the individual commits. Squash when ready.
If you'd like to review this, let me know in the comments, so I don't merge without your input.
Features/Changes
/v0/naucse.json
)naucse:
schema for the API. This gets converted in the HTML "sanitization" step.naucse_render
module, which should become its own repo & PyPI package.NAUCSE_FREEZE=1
, or Flask in non-debug mode).NAUCSE_MAIN_REPO_URL
andNAUCSE_MAIN_REPO_BRANCH
if needed (e.g. on Travis).lessons
course containing the "local"/"canonical" lessons.)courses/mi-pyt
vs.2018/pyladies-brno-jaro
) and are in different collections for lookup.FORKS_ENABLED=true
, there'sNAUCSE_TRUSTED_REPOS='*'
. You can filter allowed repos a bit (docs TODO).converters.py
is utilities for stuff you can load/dump from/to a versioned JSON API).modules: {'katex': '0.7.1'}
. This should become a general mechanism to request some extra functionality (like JS/CSS).Major Hacks
Injects code into arca forks
Currently, forks of naucse don't export structured data; almost everything is converted to HTML on the fork side. This makes getting e.g. a list of sessions quite hard. This PR adds a nasty hack that injects code into the container (in
arcs_renderer.py
).My plan is like to install
naucse_render=0.1
into the Arca containers instead of injecting the code. Looking for better solutions.API v0
The API is at not finalized, but should be useful. It's "version 0", i.e. please coordinate if you use it.
naucse_render
I intend to use
naucse_render == 0.1
as a one-off for "legacy" forks. Once there's an API, this can be beautified together with the source data.Ugly templates
I kept changes in the result minimal, but did refactor templates a bit. Whitespace/indentation looks weird sometimes.
TODO
test_forks.py
. (I'd like to go through it once more before that).naucse_render
How to test
Get a baseline from "almost master".
On a VM:
sanitize-absolute-urls
branch (see [DO NOT MERGE] Make URLs absolute in sanitization #504)Clean the caches
just to be sure:
Freeze
Compare
For me, the unified diff has 4649 lines :(
But it's mostly trivial differences – in things that shouldn't be rendered in forks, but were.