Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

🔧 QoL Configuration #5

Merged
merged 39 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bb8f0e4
:wrench: Add GitHub Workflows
Gary-H9 Jul 2, 2024
56d69f7
:wrench: Add
Gary-H9 Jul 2, 2024
328d796
:wrench: Add devcontainer
Gary-H9 Jul 2, 2024
26ae35e
:construction: Add many files
Gary-H9 Jul 2, 2024
5dcff78
:wrench: Add package.json
Gary-H9 Jul 2, 2024
249b538
:fire: Comment out tests in Dockerfile
Gary-H9 Jul 2, 2024
b1b7e93
:alert: black linting
Gary-H9 Jul 2, 2024
eb41f41
:wrench: Add linting config files
Gary-H9 Jul 2, 2024
8805bfc
:alert: linting
Gary-H9 Jul 2, 2024
166d167
Add new lines
Gary-H9 Jul 2, 2024
3623040
:alert: Linting
Gary-H9 Jul 2, 2024
f42007c
Linting
Gary-H9 Jul 2, 2024
2569fdf
:wrench: Update flake8 configuration
Gary-H9 Jul 2, 2024
39ae1b0
:wrench: Blank-ify charts
Gary-H9 Jul 2, 2024
9cd835f
:wrench: Linting + correction
Gary-H9 Jul 2, 2024
aceebc4
:wrench: Alter flake8 configuration
Gary-H9 Jul 2, 2024
9df60e2
:wrench: flake8 configuration
Gary-H9 Jul 2, 2024
5f3bdf8
:fire: Remove unneeded code
Gary-H9 Jul 2, 2024
b81bb1b
:recycle: Rename
Gary-H9 Jul 3, 2024
2a9df00
:wrench: Add ollama in devcontainer
Gary-H9 Jul 3, 2024
f2c4d6a
➕ Makefile extension
Gary-H9 Jul 3, 2024
1bfc2f2
:wrench: Comment out prints
Gary-H9 Jul 3, 2024
24f8292
Add pytest + pytest-django to requirements.txt
Gary-H9 Jul 3, 2024
f6374e6
:wrench: Remove Testing for now
Gary-H9 Jul 4, 2024
1cccef5
:wrench: Add .yamllint
Gary-H9 Jul 4, 2024
ca5726c
Linting
Gary-H9 Jul 4, 2024
4df1583
Final touches
Gary-H9 Jul 8, 2024
21d0f68
:wrench: Linting
Gary-H9 Jul 11, 2024
2c78abc
:wrench: Linting
Gary-H9 Jul 11, 2024
78d11ef
Thought this had been added
Gary-H9 Jul 11, 2024
8ca08a0
Update .devcontainer/devcontainer.json
Gary-H9 Jul 11, 2024
e1c669f
Update .github/workflows/build-test.yml
Gary-H9 Jul 11, 2024
606faee
Update .github/CODEOWNERS
Gary-H9 Jul 11, 2024
b1dc8e1
:wrench: Feedback updates
Gary-H9 Jul 15, 2024
c0e2a3f
Update chart/values.yaml
Gary-H9 Jul 15, 2024
0a34d57
Update README.md
Gary-H9 Jul 15, 2024
aa215c5
:wrench: Update Checkout versions across all workflow
Gary-H9 Jul 15, 2024
19b9094
:wrench: Feedback updates
Gary-H9 Jul 15, 2024
37939c8
:wrench: Tune down
Gary-H9 Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "2.11.0",
"resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:503f23cd692325b3cbb8c20a0ecfabb3444b0c786b363e0c82572bd7d71dc099",
"integrity": "sha256:503f23cd692325b3cbb8c20a0ecfabb3444b0c786b363e0c82572bd7d71dc099"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "1.5.0",
"resolved": "ghcr.io/devcontainers/features/node@sha256:a124954d7ed085eb90e08e6fcecac8cbcbb866317ab16deb2c7797d63cbf35d6",
"integrity": "sha256:a124954d7ed085eb90e08e6fcecac8cbcbb866317ab16deb2c7797d63cbf35d6"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "1.6.2",
"resolved": "ghcr.io/devcontainers/features/python@sha256:adf861c49eb404ce507280936fa626dcfdc4cffeb7f0a975ef400861a0cb3313",
"integrity": "sha256:adf861c49eb404ce507280936fa626dcfdc4cffeb7f0a975ef400861a0cb3313"
},
"ghcr.io/ministryofjustice/devcontainer-feature/aws:1": {
"version": "1.0.0",
"resolved": "ghcr.io/ministryofjustice/devcontainer-feature/aws@sha256:bb07a76c8e7a6b630a2056ce959addddee436e3f9936c69b9163eff54f58dbd5",
"integrity": "sha256:bb07a76c8e7a6b630a2056ce959addddee436e3f9936c69b9163eff54f58dbd5"
},
"ghcr.io/ministryofjustice/devcontainer-feature/container-structure-test:1": {
"version": "1.0.0",
"resolved": "ghcr.io/ministryofjustice/devcontainer-feature/container-structure-test@sha256:19eb30f9eb327b667be2002757d55381de87cdb5a79a6e37d293369fe8ad01ad",
"integrity": "sha256:19eb30f9eb327b667be2002757d55381de87cdb5a79a6e37d293369fe8ad01ad",
"dependsOn": [
"ghcr.io/devcontainers/features/docker-in-docker:2"
]
},
"ghcr.io/ministryofjustice/devcontainer-feature/kubernetes:1": {
"version": "1.0.1",
"resolved": "ghcr.io/ministryofjustice/devcontainer-feature/kubernetes@sha256:0ec758e44468ba2a8b70b87613762ab04e50f7bb5eac8f2aea592cff213dbde5",
"integrity": "sha256:0ec758e44468ba2a8b70b87613762ab04e50f7bb5eac8f2aea592cff213dbde5"
},
"ghcr.io/ministryofjustice/devcontainer-feature/static-analysis:1": {
"version": "1.0.0",
"resolved": "ghcr.io/ministryofjustice/devcontainer-feature/static-analysis@sha256:e81d52725655c8ffb861605feac7ad155b447d51af65f6c3a03cab32d59f1e16",
"integrity": "sha256:e81d52725655c8ffb861605feac7ad155b447d51af65f6c3a03cab32d59f1e16"
}
}
}
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "analytical-platform-ollamate",
"image": "ghcr.io/ministryofjustice/devcontainer-base:latest",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "20.11.1"
Gary-H9 marked this conversation as resolved.
Show resolved Hide resolved
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"./features/src/postgresql": {},
"ghcr.io/ministryofjustice/devcontainer-feature/aws:1": {},
"ghcr.io/ministryofjustice/devcontainer-feature/container-structure-test:1": {},
"ghcr.io/ministryofjustice/devcontainer-feature/kubernetes:1": {},
"ghcr.io/ministryofjustice/devcontainer-feature/static-analysis:1": {}
},
"postCreateCommand": "bash scripts/devcontainer/post-create.sh",
"postStartCommand": "bash scripts/devcontainer/post-start.sh",
"runArgs": ["--name=analytical-platform-ollamate-devcontainer"],
"customizations": {
"vscode": {
"extensions": [
"EditorConfig.EditorConfig",
"GitHub.vscode-github-actions",
"GitHub.vscode-codeql",
"ms-vsliveshare.vsliveshare",
"ms-vscode.makefile-tools"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "postgresql",
"version": "1.0.0",
"name": "postgresql",
"description": "PostgreSQL"
}
14 changes: 14 additions & 0 deletions .devcontainer/features/src/postgresql/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/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 \
libpq-dev
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# This file is autogenerated
[.devcontainer/devcontainer-lock.json]
end_of_line = unset
insert_final_newline = unset

[*.json]
indent_style = space
indent_size = 2

[*.sh]
indent_style = space
indent_size = 2

[{*.yml,*.yaml}]
indent_style = space
indent_size = 2
8 changes: 7 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
DB_NAME=ollamate
DB_USER=ollamate
DB_PASSWORD=ollamate

SECRET_KEY=

CLIENT_ID=<your_client_id>
CLIENT_SECRET=<your_client_secret>
AZURE_TENANT_ID=<your_azure_tenant_id>
REDIRECT_URI=<your_redirect_uri>

# when running locally, you can use
REDIRECT_URI="https://127.0.0.1:8000/azure_auth/callback"
REDIRECT_URI="https://127.0.0.1:8000/azure_auth/callback"
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
max-line-length = 100
extend-ignore = E203, E704
exclude =
venv
per-file-ignores =
ollamate/*:E501,W292
4 changes: 1 addition & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# Add a team or username to this file
# Example:
# * @ministryofjustice/operations-engineering
@ministryofjustice/analytical-platforms
18 changes: 2 additions & 16 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
---
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2

updates:
- package-ecosystem: "bundler"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "terraform"
directory: "/terraform"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: "daily"
Expand All @@ -27,10 +17,6 @@ updates:
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "docker"
directory: "/"
schedule:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Build and Test

on:
pull_request:
branches:
- main

permissions: {}

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Build Image
id: build_image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
push: false
load: true
tags: dashboard
Gary-H9 marked this conversation as resolved.
Show resolved Hide resolved

# - name: Run Python Tests
# id: run_python_tests
# run: |
# docker compose --file contrib/docker-compose-test.yml run --rm interfaces
# env:
# NETWORK: default
# IMAGE_TAG: dashboard
33 changes: 33 additions & 0 deletions .github/workflows/chart-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Chart Lint

on:
pull_request:
branches:
- main

permissions: {}

jobs:
chart-lint:
name: Chart Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Set Up Helm
id: setup_helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0

- name: Set Up Helm Chart Testing
id: setup_chart_testing
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1

- name: Lint Chart
id: lint_chart
run: |
make ct
41 changes: 41 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: CodeQL Analysis

on:
pull_request:
branches:
- main

permissions: {}

jobs:
codeql-analysis:
name: CodeQL Analysis
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ["javascript", "python"]
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Gary-H9 marked this conversation as resolved.
Show resolved Hide resolved

- name: Initialise CodeQL
id: initialise_codeql
uses: github/codeql-action/init@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2.22.8
with:
languages: ${{ matrix.language }}

- name: CodeQL Autobuild
id: codeql_autobuild
uses: github/codeql-action/autobuild@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2.22.8

- name: CodeQL Analysis
id: codeql_analysis
uses: github/codeql-action/analyze@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2.22.8
with:
category: "language:${{ matrix.language }}"
5 changes: 3 additions & 2 deletions .github/workflows/dependency-review.yml
Gary-H9 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
steps:
- name: Checkout
id: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Dependency Review
uses: actions/dependency-review-action@72eb03d02c7872a771aacd928f3123ac62ad6d3a # v4.3.3
id: dependency_review
uses: actions/dependency-review-action@01bc87099ba56df1e897b6874784491ea6309bc4 # v3.1.4
with:
fail-on-severity: critical
38 changes: 38 additions & 0 deletions .github/workflows/enforce-version-pinning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Enforce Version Pinning

on:
pull_request:
branches:
- main

permissions: {}

jobs:
enforce-version-pinning:
name: Enforce Version Pinning
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check for pinned versions in requirements.txt
run: |
if grep -q -v '==' requirements.txt; then
echo "Unpinned dependencies found in requirements.txt"
echo "❌ Unpinned dependencies found in requirements.txt"
exit 1
else
echo "✅ All dependencies are correctly pinned."
fi

- name: Check for pinned versions in package.json
run: |
UNPINNED=$(grep -E '"[^"]+": "\^|~' package.json || true)
if [ -n "$UNPINNED" ]; then
echo "❌ Unpinned dependencies found in package.json:"
echo "$UNPINNED"
exit 1
else
echo "✅ All dependencies are correctly pinned."
fi
Loading
Loading