Skip to content

Commit eeeecd5

Browse files
committed
merge a+ v2601.2 and unreleased
2 parents 19e5faa + 95f75bc commit eeeecd5

File tree

236 files changed

+39857
-9340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+39857
-9340
lines changed

.github/ci_base/Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# ci-base/Dockerfile
2+
FROM ubuntu:24.04
3+
4+
# Install the OS dependencies
5+
RUN apt update && \
6+
apt install -y \
7+
gdal-bin \
8+
libsqlite3-mod-spatialite \
9+
postgresql-client \
10+
postgresql \
11+
postgresql-contrib \
12+
postgresql-16-postgis-3 \
13+
curl \
14+
unzip \
15+
sudo \
16+
jq \
17+
nodejs \
18+
npm \
19+
git \
20+
python3 \
21+
python3-venv \
22+
libmagic1 \
23+
libmagic-dev && \
24+
rm -rf /var/lib/apt/lists/*
25+
26+
# Install uv system-wide
27+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
28+
cp /root/.local/bin/uv /usr/local/bin/uv
29+
30+
# Configure PostgreSQL
31+
RUN service postgresql start && \
32+
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" && \
33+
sudo -u postgres createdb django && \
34+
sudo -u postgres createdb django_test && \
35+
sudo -u postgres psql -d django -c "CREATE EXTENSION IF NOT EXISTS postgis;" && \
36+
sudo -u postgres psql -d django_test -c "CREATE EXTENSION IF NOT EXISTS postgis;"
37+
38+
# Additional tools that are always needed
39+
# RUN npm install -g some-global-node-tool # Example for Node-Tools
40+
# RUN pip install poetry # Example for Python-Tools
41+
42+
# Set the working directory
43+
WORKDIR /app
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and Push CI Base Image
2+
3+
on:
4+
push:
5+
paths:
6+
- '.github/ci_base/**'
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Log in to the GitHub Container Registry
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Extract metadata (tags, labels) for Docker
27+
id: meta
28+
uses: docker/metadata-action@v5
29+
with:
30+
images: ghcr.io/${{ github.repository }}/ci-base # Our Image-Name
31+
tags: |
32+
type=raw,value=latest
33+
type=sha,format=short,prefix=
34+
# Optional: type=ref,event=branch # Für Branch-Namen als Tags
35+
36+
- name: Build and Push Docker image
37+
uses: docker/build-push-action@v5
38+
with:
39+
# The overall context. If you nedd to do more then just build the Dockerfile use another context and use file: pathToDockerfile for the Dockerfile.
40+
context: .github/ci_base/
41+
push: true
42+
tags: ${{ steps.meta.outputs.tags }}
43+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/django.yml

Lines changed: 68 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,85 +9,118 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-24.04
12-
services:
13-
postgres:
14-
image: postgres:16
15-
env:
16-
POSTGRES_PASSWORD: postgres
17-
ports:
18-
- 5432:5432
19-
options: >-
20-
--health-cmd pg_isready
21-
--health-interval 10s
22-
--health-timeout 5s
23-
--health-retries 5
12+
# Use your self-built image as container for the entire job
13+
container: ghcr.io/${{ github.repository }}/ci-base:latest
2414
steps:
2515
- uses: actions/checkout@v4
16+
- name: Start PostgreSQL
17+
run: |
18+
sudo service postgresql start
19+
2620
- name: Set up Python ${{ matrix.python-version }}
21+
id: setup-python
2722
uses: actions/setup-python@v5
2823
with:
2924
python-version: '3.12'
30-
- name: Setup Node
31-
uses: actions/setup-node@v4
32-
with:
33-
node-version: '20.x'
34-
- name: Setup Postgres
35-
env:
36-
PGPASSWORD: postgres
37-
PGHOSTADDR: 127.0.0.1
38-
run: |
39-
psql -c 'create database django;' -U postgres
40-
psql -c 'create database django_test;' -U postgres
41-
- name: Cache node modules
25+
26+
- name: Cache node packages
4227
uses: actions/cache@v4
4328
env:
44-
cache-name: cache-node-modules
29+
cache-name: cache-node-packages
4530
with:
4631
path: ~/.npm
4732
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
4833
restore-keys: |
4934
${{ runner.os }}-build-${{ env.cache-name }}-
5035
${{ runner.os }}-build-
5136
${{ runner.os }}-
52-
- name: Cache pip packages
37+
- name: Cache node Modules
38+
id: cache-node-modules
39+
uses: actions/cache@v4
40+
with:
41+
path: node_modules
42+
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
43+
restore-keys: |
44+
${{ runner.os }}-node_modules-
45+
46+
- name: Cache uv packages
5347
uses: actions/cache@v4
5448
env:
55-
cache-name: cache-pip-packages
49+
cache-name: cache-uv-packages
5650
with:
57-
path: ~/.cache/pip
51+
path: ~/.cache/uv
5852
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/requirements/dev.txt') }}
5953
restore-keys: |
6054
${{ runner.os }}-build-${{ env.cache-name }}-
6155
${{ runner.os }}-build-
6256
${{ runner.os }}-
63-
- name: check a4 hashes equal
57+
58+
- name: Cache testmon data
59+
id: cache-testmon
60+
uses: actions/cache@v4
61+
with:
62+
path: .testmondata
63+
key: ${{ runner.os }}-testmon-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/requirements/dev.txt', 'adhocracy-plus/config/settings/*.py', 'pytest.ini') }}
64+
restore-keys: |
65+
${{ runner.os }}-testmon-${{ steps.setup-python.outputs.python-version }}-
66+
67+
- name: Checks
6468
run: |
69+
echo "node_modules cache hit: ${{ steps.cache-node-modules.outputs.cache-hit }}"
70+
ls -la node_modules 2>/dev/null || echo "node_modules directory does not exist"
71+
echo "testmon cache hit: ${{ steps.cache-testmon.outputs.cache-hit }}"
72+
ls -la .testmondata || true
6573
./scripts/a4-check.sh
66-
- name: Install Dependencies
74+
75+
- name: Install Python Dependencies
6776
run: |
68-
npm install
69-
npm run build
70-
pip install -r requirements/dev.txt
71-
pip install coveralls
77+
uv pip install -r requirements/dev.txt --system
78+
uv pip install coveralls --system
79+
7280
- name: Run Tests
7381
env:
7482
PGPASSWORD: postgres
7583
PGHOSTADDR: 127.0.0.1
7684
run: |
7785
python manage.py collectstatic > /dev/null
78-
DJANGO_SETTINGS_MODULE='adhocracy-plus.config.settings.travis' py.test --cov
7986
isort --diff -c adhocracy-plus tests
8087
python manage.py makemigrations --dry-run --check --noinput
8188
flake8 adhocracy-plus tests --exclude migrations,settings
89+
90+
if [ "${{ github.ref }}" = "refs/heads/main" ] && [ "${{ github.event_name }}" = "push" ]; then
91+
py.test --ds=adhocracy-plus.config.settings.travis --cov
92+
elif [ "${{ github.event_name }}" = "pull_request" ]; then
93+
py.test --ds=adhocracy-plus.config.settings.travis --testmon --cov
94+
fi
95+
8296
- name: Coveralls
8397
env:
98+
COVERALLS_SERVICE_NAME: github-actions
8499
GITHUB_TOKEN: ${{ secrets.COV }}
85100
run: |
101+
git config --global --add safe.directory /__w/adhocracy-plus/adhocracy-plus
102+
git config --global user.name "GitHub Actions"
103+
git config --global user.email "[email protected]"
86104
coveralls
105+
106+
- name: Install NPM Dependencies
107+
run: |
108+
if [ -d node_modules ] && [ -f package-lock.json ]; then
109+
echo "node_modules cache hit - skipping npm ci"
110+
else
111+
echo "node_modules cache miss - running npm ci"
112+
npm ci --prefer-offline --no-audit --no-fund
113+
fi
114+
115+
- name: Build NPM
116+
run: |
117+
npm run build
118+
87119
- name: Run Frontend Tests
88120
run: |
89121
npm test
90122
npm run lint
123+
91124
- name: Deploy
92125
if: github.ref == 'refs/heads/main'
93126
env:

CHANGELOG.md

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,102 @@ Since version v2306 the format is based on [Keep a Changelog](https://keepachang
66
This project (not yet) adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9-
## v2505.1
9+
## Unreleased A+
10+
11+
### Changed
12+
13+
- Notification message_templates stored in English, translated at runtime
14+
- Notification date format always returns DD.MM.YYYY without time
15+
16+
### Fixed
17+
18+
- Fix duplicate notifications bug
19+
- Fix email variable interpolation
20+
21+
### Fixed
22+
23+
- Interpolation and translation for ModeratorInvite notification
24+
25+
## v2601.2
26+
27+
### Fixed
28+
29+
- Moderator feedback text
30+
- ModeratorInvitation links
31+
- Translations
32+
33+
## v2601.1
34+
35+
### Added
36+
37+
- Notification System
38+
- Use django-polymorphic via adhocracy4
39+
- Map-based participation modules have a split mode to display ideas next to the map
40+
- Alert when following project telling user to check email notification settings
41+
42+
### Changed
43+
44+
- Captcha using Prosopo
45+
- Hide profile pages for inactive accounts (ST-1088)
46+
- Add visibility toggle to password fields [ST1153]
47+
- Updated to Django 5.2
48+
- Improve comment icons styling in SCSS
49+
- Update translation files for all languages
50+
- Make title-3 class consistent with h3 browser defaults for improved accessibility
51+
52+
### Fixed
53+
54+
- Follow project button not working on small screens
55+
- Rotated icons for reporting or sharing comments
56+
- Pagination button styles
57+
- Notification text for ModerationFeedback notifications
58+
59+
## v2508.2
60+
61+
### Fixed
62+
63+
- Fix flatpickr configuration to disable native mobile calendars
64+
- Fix Poll bug, question deletion now works
65+
66+
## v2508.1
67+
68+
### Fixed
69+
70+
- Remove identifier from dashboard item labels
71+
72+
## v2507.1
73+
74+
### Changed
75+
76+
- Change labels of links to manual, 'Help Center', and direct to new a+ manual
77+
- phase date selection: use flatpickr's ui on mobile instead of native- Disabled languages other than English and German
78+
- Update make postgresql-create|start|stop for linux OS
79+
- Update README with manual setup of postgreSQL
80+
- Deps: Upgraded Django to Version 5.1- **BREAKING CHANGE** A database with geospatial support is now required (e.g spatialite, postgresql with postgis)
81+
- Use the new `PointSerializerMixin` Project Serializer
82+
- project admin model to GIS admin model to render the map in the django-admin dashboard
83+
- Updated dependencies to Django 5.0- MapFilterAndSort: Change Map / List buttons to toggler- poll module diagrams
84+
- poll documentation
85+
- Update README.md to include libmagic installation step for MacOS
86+
87+
### Removed
88+
89+
- Removed env variable MANUAL_URL - no longer used- API url `api/login` as it is not in used anymore, we use `api/token` instead. See [docs](https://github.com/liqd/adhocracy-plus/blob/main/docs/authentication.md)
90+
91+
### Added
92+
93+
- captcha required for all SSO social signups- docs for upgrades
94+
- wiki diagrams links for the modules technical diagrams
95+
- Added moderator feedback form textarea character limit of 500- postgresql documentation
96+
- poll, question, answer, vote relation diagram
97+
98+
### Fixed
99+
100+
- Conditional display of dashboard project module menu's "Location" uses identifier instead of label, so translation doesn't break it
101+
- dashboard/phases: Prevent accidental selection of entire page when using date picker
102+
103+
104+
## Roots v2505.1
10105

11106
### Added
12107

Makefile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,23 +196,26 @@ release:
196196

197197
.PHONY: postgres-start
198198
postgres-start:
199-
sudo -u postgres PGDATA=pgsql PGPORT=5556 /usr/lib/postgresql/12/bin/pg_ctl start
199+
sudo systemctl start postgresql
200200

201201
.PHONY: postgres-stop
202202
postgres-stop:
203-
sudo -u postgres PGDATA=pgsql PGPORT=5556 /usr/lib/postgresql/12/bin/pg_ctl stop
203+
sudo systemctl stop postgresql
204204

205205
.PHONY: postgres-create
206206
postgres-create:
207-
if [ -d "pgsql" ]; then \
208-
echo "postgresql has already been initialized"; \
209-
else \
210-
sudo install -d -m 774 -o postgres -g $(USER) pgsql; \
211-
sudo -u postgres /usr/lib/postgresql/12/bin/initdb pgsql; \
212-
sudo -u postgres PGDATA=pgsql PGPORT=5556 /usr/lib/postgresql/12/bin/pg_ctl start; \
213-
sudo -u postgres PGDATA=pgsql PGPORT=5556 /usr/lib/postgresql/12/bin/createuser -s django; \
214-
sudo -u postgres PGDATA=pgsql PGPORT=5556 /usr/lib/postgresql/12/bin/createdb -O django django; \
207+
@if ! command -v psql > /dev/null 2>&1; then \
208+
echo "PostgreSQL is not installed. Please install it with 'sudo apt install postgresql'"; \
209+
exit 1; \
215210
fi
211+
@if ! sudo systemctl is-active --quiet postgresql; then \
212+
echo "PostgreSQL service is not running. Starting it..."; \
213+
sudo systemctl start postgresql; \
214+
sleep 2; \
215+
fi
216+
sudo -u postgres createuser --createdb --no-createrole --no-superuser django || true
217+
sudo -u postgres createdb --owner=django --encoding=UTF8 django || true
218+
sudo -u postgres psql -U postgres -d django -c "CREATE EXTENSION postgis;" || true
216219

217220
.PHONY: local-a4
218221
local-a4:

0 commit comments

Comments
 (0)