Skip to content

Commit

Permalink
Merge branch 'release/0.21.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbonothing64 committed Apr 23, 2024
2 parents 3f34ab0 + 5894e92 commit 44b798d
Show file tree
Hide file tree
Showing 37 changed files with 205 additions and 110 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-merge-dependency-updates.yaml
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.4
uses: dependabot/fetch-metadata@v2.0.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve
Expand Down
50 changes: 33 additions & 17 deletions .github/workflows/test-and-deploy.yaml
Expand Up @@ -16,9 +16,12 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Create Docker network
run: docker network create uccser-development-stack
# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV
- name: Start systems
run: docker compose -f docker-compose.local.yml up -d
- name: Run Django system check
Expand All @@ -29,9 +32,12 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Create Docker network
run: docker network create uccser-development-stack
# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV
- name: Start systems
run: docker compose -f docker-compose.local.yml up -d
- name: Create static files
Expand All @@ -52,9 +58,12 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Create Docker network
run: docker network create uccser-development-stack
# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV
- name: Start systems
run: docker compose -f docker-compose.local.yml up -d
- name: Create static files
Expand All @@ -73,13 +82,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run general tests
run: ./dev ci test_general
- name: Create coverage file
run: docker compose -f docker-compose.local.yml run --rm --user="root" django coverage xml -i
- name: Upload coverage file
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: ./dthm4kaiako/coverage.xml
verbose: true
Expand All @@ -89,13 +98,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run management tests
run: ./dev ci test_management
- name: Create coverage file
run: docker compose -f docker-compose.local.yml run --rm --user="root" django coverage xml -i
- name: Upload coverage file
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: ./dthm4kaiako/coverage.xml
verbose: true
Expand All @@ -105,7 +114,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run style tests
run: ./dev ci style

Expand All @@ -126,11 +135,15 @@ jobs:
]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Create Docker network
run: docker network create uccser-development-stack

# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV

- name: Start system
run: docker compose -f docker-compose.local.yml up -d

Expand All @@ -144,7 +157,7 @@ jobs:
run: tar czf static-files.tar.gz --directory dthm4kaiako/staticfiles/ .

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: static-files
path: static-files.tar.gz
Expand All @@ -167,9 +180,12 @@ jobs:
]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Create Docker network
run: docker network create uccser-development-stack
# Required for the node service
- name: Set DOCKER_UID variable
run: echo "DOCKER_UID=$(echo $UID)" >> $GITHUB_ENV
- name: Start system
run: docker compose -f docker-compose.local.yml up -d
- name: Create production static files
Expand All @@ -185,7 +201,7 @@ jobs:
- name: Archive learning area cards
run: tar czf learning-area-cards.tar.gz --directory dthm4kaiako/staticfiles/learning_area_cards/ .
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: learning-area-cards
path: learning-area-cards.tar.gz
Expand All @@ -204,10 +220,10 @@ jobs:
]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts/

Expand All @@ -222,23 +238,23 @@ jobs:
tar -xz --file artifacts/learning-area-cards/learning-area-cards.tar.gz --directory dthm4kaiako/staticfiles/learning_area_cards
- name: Log in to the Container registry
uses: docker/login-action@v2.0.0
uses: docker/login-action@v3.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag,priority=1
type=ref,event=branch,priority=2
- name: Build and push Docker image
uses: docker/build-push-action@v3.2.0
uses: docker/build-push-action@v5.3.0
with:
file: ./infrastructure/production/django/Dockerfile
context: .
Expand Down
51 changes: 51 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,56 @@
# Changelog

## 0.21.0

- Fix node UID issue when developing locally
- Add allauth middleware
- Update DTTA's logo and use their new colour scheme
- Hide DTTA news from DTTA page
- Replace ckeditor with TinyMCE and django-filebrowser-no-grappelli
- Github Action dependency updates:
- Update dependabot/fetch-metadata from 1.3.4 to 2.0.0
- Update actions/checkout from 3 to 4
- Update codecov/codecov-action from 3 to 4
- Update actions/upload-artifact from 3 to 4
- Update actions/download-artifact from 3 to 4
- Update docker/login-action from 2.0.0 to 3.1.0
- Update docker/metadata-action from 4 to 5
- Update docker/build-push-action from 3.2.0 to 5.3.0
- Python dependency updates:
- Update django from 3.2.16 to 3.2.25
- Update django-allauth from 0.51.0 to 0.62.0
- Update jango-autoslug from 1.9.8 to 1.9.9
- Update django-ckeditor from 6.5.1 to 6.7.1
- Update django-cors-headers from 3.13.0 to 3.14.0
- Update django-environ from 0.9.0 to 0.11.2
- Update django-map-widgets from 0.4.0 to 0.4.2
- Update django-model-utils from 4.2.0 to 4.5.0
- Update djangorestframework from 3.14.0 to 3.15.1
- Update gunicorn from 20.1.0 to 22.0.0
- Update whitenoise from 6.2.0 to 6.6.0
- Update psycopg2 from 2.9.5 to 2.9.9
- Update pytz from 2022.6 to 2022.7.1
- Update Pillow from 8.2.0 to 10.3.0
- Update filetype from 1.1.0 to 1.2.0
- Update google-api-python-client from 2.64.0 to 2.126.0
- Update factory-boy from 3.2.1 to 3.3.0
- Update django-debug-toolbar from 3.7.0 to 3.8.1
- Update django-extensions from 3.2.1 to 3.2.3
- Update google-auth from 1.28.1 to 2.29.0
- Update django-storages[google] from 1.13.1 to 1.14.2
- Update pydocstyle from 6.1.1 to 6.3.0
- Add django-tinymce 4.0.0
- Add django-filebrowser-no-grappelli 4.0.2
- JS dependency updates
- Update autoprefixer from 10.4.13 to 10.4.19
- Update cssnano from 5.1.14 to 5.1.15
- Update dayjs from 1.11.6 to 1.11.10
- Update gulp-postcss from 9.0.1 to 9.1.0
- Update jquery from 3.6.1 to 3.7.1
- Update postcss from 8.4.18 to 8.4.38
- Update sass from 1.55.0 to 1.75.0
- Update yargs from 17.6.0 to 17.7.2

## 0.20.1

- Dependency updates:
Expand Down
2 changes: 2 additions & 0 deletions dev
Expand Up @@ -9,6 +9,8 @@

set -e

export DOCKER_UID=$UID

ERROR='\033[0;31m'
SUCCESS='\033[0;32m'
CODE='\033[0;36m'
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.local.yml
Expand Up @@ -31,6 +31,8 @@ services:
build:
context: .
dockerfile: ./infrastructure/local/node/Dockerfile
args:
DOCKER_UID: ${DOCKER_UID}
image: dthm4kaiako_local_node
volumes:
# https://burnedikt.com/dockerized-node-development-and-mounting-node-volumes/#exclude-node_modules-from-the-mount
Expand Down
4 changes: 2 additions & 2 deletions dthm4kaiako/ara_ako/models.py
Expand Up @@ -2,7 +2,7 @@

from django.db import models
from django.urls import reverse
from ckeditor_uploader.fields import RichTextUploadingField
from tinymce.models import HTMLField
from events.models import Event
from resources.models import Resource

Expand Down Expand Up @@ -41,7 +41,7 @@ class AraAkoTeam(models.Model):
"""Model for an Ara Ako team."""

number = models.PositiveSmallIntegerField()
description = RichTextUploadingField()
description = HTMLField()
resource = models.OneToOneField(
Resource,
verbose_name='Ara Ako team resource',
Expand Down
2 changes: 1 addition & 1 deletion dthm4kaiako/config/__init__.py
@@ -1,6 +1,6 @@
"""Configuration for Django system."""

__version__ = "0.20.1"
__version__ = "0.21.0"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
Expand Down
54 changes: 28 additions & 26 deletions dthm4kaiako/config/settings/base.py
Expand Up @@ -95,6 +95,7 @@
# APPS
# ------------------------------------------------------------------------------
DJANGO_APPS = [
'filebrowser',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
Expand All @@ -120,14 +121,13 @@
'allauth.socialaccount',
'rest_framework',
'markdownx',
'ckeditor',
'ckeditor_uploader',
'django_activeurl',
'mapwidgets',
'captcha',
'django_filters',
'modelclone',
'svg',
'tinymce',
]
LOCAL_APPS = [
'general.apps.GeneralAppConfig',
Expand Down Expand Up @@ -196,6 +196,7 @@
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#middleware
MIDDLEWARE = [
'allauth.account.middleware.AccountMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
Expand Down Expand Up @@ -335,31 +336,32 @@
SOCIALACCOUNT_ADAPTER = 'users.adapters.SocialAccountAdapter'


# ckeditor
# tinymce (for uploading images in news postings)
# ------------------------------------------------------------------------------
CKEDITOR_UPLOAD_PATH = 'text-editor'
CKEDITOR_ALLOW_NONIMAGE_FILES = False
CKEDITOR_CONFIGS = {
'default': {
'width': '100%',
'clipboard_defaultContentType': 'text',
'tabSpaces': 4,
'extraPlugins': ','.join([
# 'devtools', # Used for development
'a11yhelp',
'uploadimage',
'image2',
'div',
'autolink',
'autogrow',
'clipboard',
'codesnippet',
'pastefromword',
'widget',
'dialog',
'dialogui',
]),
}
TINYMCE_DEFAULT_CONFIG = {
"theme": "silver",
"height": 500,
"menubar": False,
"plugins": "advlist,autolink,lists,link,image,charmap,print,preview,anchor,"
"searchreplace,visualblocks,code,fullscreen,insertdatetime,media,table,paste,"
"code,help,wordcount",
"toolbar": "undo redo | formatselect | "
"bold italic backcolor | alignleft aligncenter "
"alignright alignjustify | bullist numlist outdent indent | "
"removeformat | image | help",
}

TINYMCE_FILEBROWSER = True

FILEBROWSER_DIRECTORY = 'text-editor/'

FILEBROWSER_SELECT_FORMATS = {
'file': ['Image'],
'image': ['Image']
}

FILEBROWSER_EXTENSIONS = {
'Image': ['.jpg', '.jpeg', '.gif', '.png', '.tif', '.tiff']
}

# django-activeurl
Expand Down
4 changes: 3 additions & 1 deletion dthm4kaiako/config/urls.py
Expand Up @@ -9,6 +9,7 @@
from django.contrib.auth.decorators import login_required
from django.views import defaults as default_views
from config.views import get_release_and_commit
from filebrowser.sites import site
admin.site.login = login_required(admin.site.login)
admin.site.site_header = 'dthm4kaiako.ac.nz'
admin.site.site_title = admin.site.site_header
Expand All @@ -28,12 +29,13 @@
# Accounts application
path('accounts/', include('allauth.urls')),
# Admin application
path('admin/filebrowser/', site.urls),
path(settings.ADMIN_URL, admin.site.urls),
# Utility applications
path('healthcheck/', HttpResponse),
path('status/', view=get_release_and_commit, name="get-release-and-commit"),
path('markdownx/', include('markdownx.urls')),
path('ckeditor/', include('ckeditor_uploader.urls')),
path('tinymce/', include('tinymce.urls')),
# path('api/', include('rest_framework.urls')),
# Redirects
path('authentic-context-cards/', RedirectView.as_view(pattern_name='learning_area_cards:home', permanent=True)),
Expand Down

0 comments on commit 44b798d

Please sign in to comment.