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

✨(lti) add base Django app service #30

Merged
merged 8 commits into from
Jul 18, 2023
Merged

Conversation

jmaupetit
Copy link
Contributor

@jmaupetit jmaupetit commented Jun 23, 2023

Purpose

We need to serve the frontend application via LTI.

Proposal

  • add base LTI authentication application
  • add lint/test running utilities
  • configure the CI

Makefile Outdated Show resolved Hide resolved
src/app/.pylintrc Outdated Show resolved Hide resolved
src/app/pyproject.toml Show resolved Hide resolved
@jmaupetit jmaupetit marked this pull request as draft June 23, 2023 15:27
Copy link
Contributor

@lebaudantoine lebaudantoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaaaamaazing 👏

src/app/apps/lti/apps.py Outdated Show resolved Hide resolved
src/app/apps/lti/apps.py Outdated Show resolved Hide resolved
docker-compose.yml Show resolved Hide resolved
Makefile Show resolved Hide resolved
docker-compose.yml Show resolved Hide resolved
src/app/pyproject.toml Outdated Show resolved Hide resolved
src/app/warren/wsgi.py Outdated Show resolved Hide resolved
src/app/apps/lti/forms.py Outdated Show resolved Hide resolved
src/app/.pylintrc Outdated Show resolved Hide resolved
@lebaudantoine lebaudantoine force-pushed the add-django-lti-app branch 6 times, most recently from bc70848 to 4f498e3 Compare July 13, 2023 19:34
@lebaudantoine
Copy link
Contributor

Regarding Marsha's Makefile, I've noticed they provide additional features beyond what I've included.

If they are relevant, would you like me to include these for improving the developer experience in this PR?

@lebaudantoine
Copy link
Contributor

I have reused ruff configuration from src/backend.
However, It appears that this pylint check is not present or missing:

import-outside-toplevel (C0415)
Used when an import statement is used anywhere other than the module toplevel. Move this import to the top of the file.

Do we ignore it?

@lebaudantoine
Copy link
Contributor

lebaudantoine commented Jul 13, 2023

Note: The unused imports from empty example files in the apps/development have been suffixed with # noqa: F401 to keep them. ex apps/development/admin.py:

"""Admin for the dashboard app."""
from django.contrib import admin  # noqa: F401

# Register your models here.

@lebaudantoine
Copy link
Contributor

lebaudantoine commented Jul 13, 2023

During your review, could you please pay special attention to the following:

  • Updates to CI configurations.
  • Updates to the Makefile, particularly the changes made to the test execution process for backend and app.

Currently, the pytest command causes the CI job test-app to fail because it cannot collect any tests. This is expected since no tests have been written yet. I consider implementing one of these approaches to address the issue:

  • Writing at least one test to ensure the CI job can pass.
  • Updating the CI configuration to handle the scenario of no tests available.

WDYT?

@lebaudantoine lebaudantoine force-pushed the add-django-lti-app branch 4 times, most recently from 4597944 to 8f56054 Compare July 13, 2023 21:00
@jmaupetit
Copy link
Contributor Author

Currently, the pytest command causes the CI job test-app to fail because it cannot collect any tests. This is expected since no tests have been written yet. I consider implementing one of these approaches to address the issue:

* Writing at least one test to ensure the CI job can pass.

* Updating the CI configuration to handle the scenario of no tests available.

WDYT?

I would add a first test.

Copy link
Contributor Author

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

Waiting for a first test to be added for the app and then we'll be good to go.

Note that we now have a dependency issue for backend tests.

src/app/warren/settings.py Show resolved Hide resolved
src/app/warren/wsgi.py Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
@lebaudantoine lebaudantoine force-pushed the add-django-lti-app branch 5 times, most recently from e02d82d to c6cbce6 Compare July 17, 2023 22:44
@lebaudantoine
Copy link
Contributor

lebaudantoine commented Jul 17, 2023

The missing pylint import-outside-toplevel (C0415) check should be shipped soon. A PR has been approved on the repo. @jmaupetit

@lebaudantoine lebaudantoine marked this pull request as ready for review July 17, 2023 23:27
@lebaudantoine lebaudantoine force-pushed the add-django-lti-app branch 2 times, most recently from c669f67 to 650d7e1 Compare July 17, 2023 23:32
Copy link
Contributor Author

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't approve this PR since I opened it, but, we are good to go 🎉

jmaupetit and others added 8 commits July 18, 2023 15:20
Warren core application is a Django project that will serve Dashboards
exclusively via LTI in its first release.
Introduce ruff and black to lint Python sources of the app.
Ruff's configurations are on pair with the backend.

Offer developers make commands that allow them linting the
app or the backend either independently or together.
The majority of linter errors were related to missing
or incorrectly formatted docstrings in the `src/app`.

Ruff `noqa` comments have been added to some
`src/app/dashboard` Python sources, yet empty.
It's temporary, these sources will be updated
in a near future. They serve as examples and
should not be removed.
Offer developers make commands that allow them running
any test on the `src/app` or the `src/backend` Python sources,
either independently or together.
Automate checks on building, linting and testing
production and development `src/app` Docker image.
Make core and plugin pyproject files consistent
with python images being built by the circle ci
jobs (3.8, 3.9, 3.10).
Add a simple test on the development view to make
the CI passes. Without any test added, test-app job
was resulting in failure.
Inspired by marsha project, this update introduces new
commands that assist developers in generating migrations
and verifying Django sources.
@lebaudantoine lebaudantoine merged commit f431a84 into main Jul 18, 2023
@lebaudantoine lebaudantoine deleted the add-django-lti-app branch July 18, 2023 13:23
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants