New Feature Checklist

This checklist is intended to help you, a Smarter developer contributor, ensure that any new feature you’re working on is fully integrated into the Smarter framework and is ready for production deployment. Smarter provides a wide range of base classes, helper mixins, and subsystems that you must utilize to ensure your feature’s compatibility and maintainability within the Smarter ecosystem. Plus, following these rules will save you time and improve the quality of your code.

Django Checklist

  1. Register your Django app in smarter.settings.base.INSTALLED_APPS.

  2. Add your app’s top-level urls.py to smarter/urls/.

  3. Ensure that your Django models inherit from smarter.lib.django.models.

  4. Include database migrations for any new models.

  5. Include serializers for all models

  6. Add API views and viewsets, and ensure they cover all models

  7. Add Django admin classes for all models using smarter.apps.dashboard.admin.SmarterCustomerModelAdmin

  8. Add your new settings to smarter.common.conf.settings.SmarterSettings and include sensible defaults and documentation for each setting.

  9. Include a tasks module

  10. Include a management commands module

  11. Include signals and receivers modules.

Smarter / SAM Checklist

  1. Use Smarter’s base and helper classes and subsystems where relevant, especially the following:
  2. Ensure that your unit test coverage ratio is at least 85% for any new code you add.

  3. Include SAM models and brokers for each relevant ORM model.

  4. Add new Smarter resource kinds to smarter.apps.api.v1.manifests.enum.SAMKinds

  5. Add waffle logging and feature switches as necessary to smarter.lib.django.waffle.SmarterWaffleSwitches

  6. Ensure that your UI includes anchors as necessary in smarter/templates/dashboard/authenticated.html

  7. Ensure that exceptions are properly handled and that you have inherited from smarter.common.exceptions.SmarterException

  8. Add your feature’s JSON schema view to smarter.apps.docs.views.json_schema and register it in smarter.apps.docs.urls

  9. Add your feature’s example manifest view to smarter.apps.docs.views.manifest and register it in smarter.apps.docs.urls

  10. Add your feature’s Broker to smarter.apps.api.v1.cli.brokers.Brokers

Style Guide Checklist

  1. Run pre-commit hooks prior to pushing your code

  2. Add your documentation to docs/source and test with make sphinx-docs

  3. Ensure that your logging entries conform to the Smarter logging style guidelines

  4. Ensure that all classes and functions have Sphinx-compatible docstrings.

  5. Ensure that your code adheres to PEP 8 style guidelines.