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

Django Ninja templates #782

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Django Ninja templates #782

wants to merge 12 commits into from

Conversation

condar-metacell
Copy link
Contributor

@condar-metacell condar-metacell commented Nov 1, 2024

Closes CH-157

Added support for a django-ninja template when using harness-application and harness-generate. Also refactored the application build process into a more structured process of builder components.

...

To test try generating applications using harness-application -t django-ninja and also using harness-generate servers for that app to see the generates servers and openapi schema.

...

Sanity checks:

  • The pull request is explicitly linked to the relevant issue(s)
  • The issue is well described: clearly states the problem and the general proposed solution(s)
  • In this PR it is explicitly stated how to test the current change
  • The labels in the issue set the scope and the type of issue (bug, feature, etc.)
  • The relevant components are indicated in the issue (if any)
  • All the automated test checks are passing
  • All the linked issues are included in one Sprint
  • All the linked issues are in the Review state
  • All the linked issues are assigned

Breaking changes (select one):

  • The present changes do not change the preexisting api in any way
  • This PR and the issue are tagged as a breaking-change and the migration procedure is well described above

Possible deployment updates issues (select one):

  • There is no reason why deployments based on CloudHarness may break after the current update
  • This PR and the issue are tagged as alert:deployment

Test coverage (select one):

  • Tests for the relevant cases are included in this pr
  • The changes included in this pr are out of the current test coverage scope

Documentation (select one):

  • The documentation has been updated to match the current changes
  • The changes included in this PR are out of the current documentation scope

Nice to have (if relevant):

  • Screenshots of the changes
  • Explanatory video/animated gif

@condar-metacell condar-metacell added the enhancement New feature or request label Nov 1, 2024
@filippomc filippomc changed the title Feature/ch 157 Django Ninja templates Nov 11, 2024
Copy link
Member

Choose a reason for hiding this comment

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

I understand the problem is not caused by this PR but there's a typo in this file:
init_listner should be init_listener. Would it be possible to fix it here?

Copy link
Member

Choose a reason for hiding this comment

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

Same typo here:
init_listner -> init_listener

@@ -0,0 +1,35 @@
ARG MNP_UI
Copy link
Member

Choose a reason for hiding this comment

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

Maybe there's a reason for the renaming but without any context on that my preference would be to keep the more generic name: CLOUDHARNESS_FRONTEND_BUILD instead

Copy link
Member

@afonsobspinto afonsobspinto Nov 21, 2024

Choose a reason for hiding this comment

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

I believe
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "__APP_NAME__.settings")
should actually be:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_baseapp.settings")
since that's the place where the settings are defined

@@ -0,0 +1,2 @@
pydantic==2.9.2
django-ninja
Copy link
Member

@afonsobspinto afonsobspinto Nov 25, 2024

Choose a reason for hiding this comment

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

Would it make sense to have cloudharness and cloudharness_django as dependencies here? Since they are conceptually required to run the application (f.e. they are used in settings.py) cc @ddelpiano

Copy link
Member

Choose a reason for hiding this comment

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

I would expect so. I understand we might need CH repo locally if I am in need of regen the template files or the codefresh pipeline, but if I am purely working on the backend I might not need CH and such dependency should be part of the requirements.txt so that all I need to run the backend is already covered by that. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree it's better to be explicit about all the dependencies that are imported, even if they are inherited by the base image (like this case)

Copy link
Member

@ddelpiano ddelpiano left a comment

Choose a reason for hiding this comment

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

requirements.txt is missing ch as dependency since the settings.py of the template requires it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants