diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9245d758..bd6d479c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,9 +7,13 @@ }, "ghcr.io/devcontainers/features/python:1": { "version": "3.11" - } + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "./features/src/postgresql": {} }, "postCreateCommand": "bash scripts/devcontainer/post-create.sh", + "postStartCommand": "bash scripts/devcontainer/post-start.sh", + "runArgs": ["--name=data-platform-control-panel-devcontainer"], "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/features/src/postgresql/devcontainer-feature.json b/.devcontainer/features/src/postgresql/devcontainer-feature.json new file mode 100644 index 00000000..4f9e7b7e --- /dev/null +++ b/.devcontainer/features/src/postgresql/devcontainer-feature.json @@ -0,0 +1,6 @@ +{ + "id": "postgresql", + "version": "1.0.0", + "name": "postgresql", + "description": "PostgreSQL" +} diff --git a/.devcontainer/features/src/postgresql/install.sh b/.devcontainer/features/src/postgresql/install.sh new file mode 100644 index 00000000..b23597ac --- /dev/null +++ b/.devcontainer/features/src/postgresql/install.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" >/etc/apt/sources.list.d/pgdg.list + +wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - + +apt-get update + +apt-get -y install \ + postgresql-common \ + postgresql-client-common \ + postgresql-15 \ + postgresql-client-15 diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..ceeb99e9 --- /dev/null +++ b/.flake8 @@ -0,0 +1,5 @@ +[flake8] +max-line-length = 88 +extend-ignore = E203, E704 +exclude = + venv diff --git a/.github/super-linter.env b/.github/super-linter.env deleted file mode 100644 index 18f2eac4..00000000 --- a/.github/super-linter.env +++ /dev/null @@ -1 +0,0 @@ -VALIDATE_ALL_CODEBASE="false" diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index 1bc93675..1d066bc1 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -27,13 +27,15 @@ jobs: with: fetch-depth: 0 - - name: Load Super-Linter Variables - id: load_super_linter_variables - run: cat .github/super-linter.env >>"${GITHUB_ENV}" - - name: Super-Linter id: super_linter + # yamllint disable-line rule:line-length uses: super-linter/super-linter/slim@35c3fa445cc217dfcc7b53eeb4e7aa95fcdd02fc # v5.6.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DEFAULT_BRANCH: main + VALIDATE_ALL_CODEBASE: false + LINTER_RULES_PATH: / + PYTHON_BLACK_CONFIG_FILE: pyproject.toml + PYTHON_FLAKE8_CONFIG_FILE: .flake8 + PYTHON_MYPY_CONFIG_FILE: mypy.ini diff --git a/.gitignore b/.gitignore index 3d4ec2e0..2ec8abea 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ env/ terraform.tfstate super-linter.log .mypy_cache/ +.idea/ +__pycache__ +*.egg-info/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..55776018 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,45 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - name: End of File Fixer + id: end-of-file-fixer + - name: Trailing Whitespace Fixer + id: trailing-whitespace + - name: Check yaml + id: check-yaml + - name: requirements.txt fixer + id: requirements-txt-fixer + + - repo: https://github.com/psf/black + rev: 23.10.1 + hooks: + - id: black + name: black formatting + + - repo: https://github.com/PyCQA/flake8 + rev: 6.1.0 + hooks: + - id: flake8 + name: flake8 lint + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.6.1 + hooks: + - id: mypy + name: mypy + additional_dependencies: + - django-stubs + - psycopg2-binary + + - repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + name: isort (python) + + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.32.0 + hooks: + - id: yamllint diff --git a/README.md b/README.md index 76332574..85b96c62 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,28 @@ # Data Platform Control Panel [![repo standards badge](https://img.shields.io/endpoint?labelColor=231f20&color=005ea5&style=for-the-badge&label=MoJ%20Compliant&url=https%3A%2F%2Foperations-engineering-reports.cloud-platform.service.justice.gov.uk%2Fapi%2Fv1%2Fcompliant_public_repositories%2Fendpoint%2Fdata-platform-control-panel&logo=data:image/png;base64,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)](https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/public-report/data-platform-control-panel) + +## Running + +The quickest way to get the project running is to use the dev container that has been configured to install all +dependencies required to run the project locally. To use the dev container, see the [Data Platform docs.](https://technical-documentation.data-platform.service.justice.gov.uk/documentation/platform/infrastructure/developing.html#developing-the-data-platform) + +Alternatively you can install the project locally by installing python 3.11, creating a venv, and installing the +project dependencies with + +```commandline +pip install -r requirements.dev.txt +``` + +You will also need to have Postgresql installed and running on your machine. + +### Pre-commit + +To avoid pushing code and seeing the GitHub actions fail due to linting errors, when installing the project for the +first time you should install the pre-commit hooks with: + +```commandline +pre-commit install +``` + +This will run black, mypy, flake8 and isort before a commit to check for failures and stage any required changes. diff --git a/contrib/docker-compose-postgres.yml b/contrib/docker-compose-postgres.yml new file mode 100644 index 00000000..04495b8c --- /dev/null +++ b/contrib/docker-compose-postgres.yml @@ -0,0 +1,13 @@ +--- +version: '3.8' + +services: + postgres: + image: public.ecr.aws/docker/library/postgres:15.4 + restart: always + environment: + POSTGRES_USER: controlpanel + POSTGRES_PASSWORD: controlpanel + POSTGRES_DB: controlpanel + ports: + - "5432:5432" diff --git a/controlpanel/__init__.py b/controlpanel/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/asgi.py b/controlpanel/asgi.py new file mode 100644 index 00000000..a5e6f332 --- /dev/null +++ b/controlpanel/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for controlpanel project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "controlpanel.settings") + +application = get_asgi_application() diff --git a/controlpanel/core/__init__.py b/controlpanel/core/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/core/apps.py b/controlpanel/core/apps.py new file mode 100644 index 00000000..4444e2a3 --- /dev/null +++ b/controlpanel/core/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class CliConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "controlpanel.core" diff --git a/controlpanel/core/common/__init__.py b/controlpanel/core/common/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/core/migrations/__init__.py b/controlpanel/core/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/core/models/__init__.py b/controlpanel/core/models/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/domains/apps.py b/controlpanel/domains/apps.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/domains/data_products/__init__.py b/controlpanel/domains/data_products/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/interfaces/api/__init__.py b/controlpanel/interfaces/api/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/interfaces/apps.py b/controlpanel/interfaces/apps.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/interfaces/cli/__init__.py b/controlpanel/interfaces/cli/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/interfaces/web/__init__.py b/controlpanel/interfaces/web/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/middleware/__init__.py b/controlpanel/middleware/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/controlpanel/settings/__init__.py b/controlpanel/settings/__init__.py new file mode 100644 index 00000000..24917e37 --- /dev/null +++ b/controlpanel/settings/__init__.py @@ -0,0 +1 @@ +from controlpanel.settings.common import * # noqa diff --git a/controlpanel/settings/common.py b/controlpanel/settings/common.py new file mode 100644 index 00000000..26154235 --- /dev/null +++ b/controlpanel/settings/common.py @@ -0,0 +1,141 @@ +""" +Django settings for controlpanel project. + +Generated by 'django-admin startproject' using Django 4.2.7. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.2/ref/settings/ +""" +import os +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + +PROJECT_NAME = "controlpanel" + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = "django-insecure-!-2v1ja--!*$lz3q6ox+(_d_cc68d5s#72ia-*_&!dom3#$zjn" + + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS: list = [] + + +# Application definition + +INSTALLED_APPS = [ + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", +] + +MIDDLEWARE = [ + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", +] + +ROOT_URLCONF = "controlpanel.urls" + +TEMPLATES = [ + { + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", + ], + }, + }, +] + + +WSGI_APPLICATION = "controlpanel.wsgi.application" + + +# Database +# https://docs.djangoproject.com/en/4.2/ref/settings/#databases + +# -- Database +DB_HOST = os.environ.get("DB_HOST", "127.0.0.1") +ENABLE_DB_SSL = ( + str( + os.environ.get("ENABLE_DB_SSL", DB_HOST not in ["127.0.0.1", "localhost"]) + ).lower() + == "true" +) +DATABASES: dict = { + "default": { + "ENGINE": "django.db.backends.postgresql", + "NAME": os.environ.get("DB_NAME", PROJECT_NAME), + "USER": os.environ.get("DB_USER", ""), + "PASSWORD": os.environ.get("DB_PASSWORD", ""), + "HOST": DB_HOST, + "PORT": os.environ.get("DB_PORT", "5432"), + } +} + +if ENABLE_DB_SSL: + DATABASES["default"]["OPTIONS"] = {"sslmode": "require"} + + +# Password validation +# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", # noqa + }, + { + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.2/topics/i18n/ + +LANGUAGE_CODE = "en-us" + +TIME_ZONE = "UTC" + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.2/howto/static-files/ + +STATIC_URL = "static/" + +# Default primary key field type +# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" diff --git a/controlpanel/urls.py b/controlpanel/urls.py new file mode 100644 index 00000000..bcfa4bd0 --- /dev/null +++ b/controlpanel/urls.py @@ -0,0 +1,22 @@ +""" +URL configuration for controlpanel project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.2/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path + +urlpatterns = [ + path("admin/", admin.site.urls), +] diff --git a/controlpanel/wsgi.py b/controlpanel/wsgi.py new file mode 100644 index 00000000..a2aabccf --- /dev/null +++ b/controlpanel/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for controlpanel project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "controlpanel.settings") + +application = get_wsgi_application() diff --git a/manage.py b/manage.py new file mode 100755 index 00000000..7f134720 --- /dev/null +++ b/manage.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "controlpanel.settings") + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == "__main__": + main() diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 00000000..976ba029 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,2 @@ +[mypy] +ignore_missing_imports = True diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..fbbfffe3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[tool.black] +line-length = 88 +target-version = ["py311"] diff --git a/requirements.dev.txt b/requirements.dev.txt new file mode 100644 index 00000000..c2497ddf --- /dev/null +++ b/requirements.dev.txt @@ -0,0 +1,7 @@ +-r ./requirements.txt +black==23.10.1 +django-stubs[compatible-mypy]==4.2.6 +flake8==6.1.0 +isort==5.12.0 +mypy==1.6.1 +pre-commit==3.5.0 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..165b81bb --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +asgiref==3.7.2 +Django==4.2.7 +psycopg2-binary==2.9.9 +sqlparse==0.4.4 diff --git a/scripts/devcontainer/post-create.sh b/scripts/devcontainer/post-create.sh index 5bfb1afe..916f612e 100644 --- a/scripts/devcontainer/post-create.sh +++ b/scripts/devcontainer/post-create.sh @@ -3,5 +3,11 @@ # Upgrade NPM npm install --global npm@latest +# Start Postgres +docker compose --file contrib/docker-compose-postgres.yml up --detach + # Upgrade Pip pip install --upgrade pip + +# Install dependencies +pip install -r requirements.dev.txt diff --git a/scripts/devcontainer/post-start.sh b/scripts/devcontainer/post-start.sh new file mode 100644 index 00000000..f0289d19 --- /dev/null +++ b/scripts/devcontainer/post-start.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Run pre-commit +pre-commit install diff --git a/scripts/super-linter/run-local.sh b/scripts/super-linter/run-local.sh deleted file mode 100644 index f3b508ae..00000000 --- a/scripts/super-linter/run-local.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -MODE="${1:-local}" - -case "${MODE}" in -local) - echo "Running Super-Linter in RUN_LOCAL mode" - docker run --rm \ - --env RUN_LOCAL="true" \ - --env CREATE_LOG_FILE="true" \ - --env LOG_FILE_NAME="/tmp/log/super-linter.log" \ - --env-file ".github/super-linter.env" \ - --volume "${PWD}":/tmp/log \ - --volume "${PWD}":/tmp/lint \ - ghcr.io/super-linter/super-linter:slim-v5 - ;; -interactive) - echo "Running Super-Linter in INTERACTIVE mode" - docker run --rm -it \ - --env-file ".github/super-linter.env" \ - --entrypoint /bin/bash \ - --volume "${PWD}":/tmp/lint \ - --workdir /tmp/lint \ - ghcr.io/super-linter/super-linter:slim-v5 - ;; -*) - echo "Invalid mode: ${MODE}" - echo "Usage: ${0} [local|interactive]" - exit 1 - ;; -esac diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b