Skip to content

Commit

Permalink
Merge pull request #433 from hpi-studyu/dev
Browse files Browse the repository at this point in the history
release(v2.6.1): Dart 3, Offline Mode, and more...
  • Loading branch information
johannesvedder authored Oct 18, 2023
2 parents 635aa8e + e08692f commit fcd401e
Show file tree
Hide file tree
Showing 617 changed files with 99,662 additions and 17,124 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ LICENSE
*.md
*.iml
.supabase
supabase/

# Flutter specific
**/.dart_tool
Expand All @@ -17,4 +16,4 @@ supabase/
**/.analysis-options
**/.flutter-plugins
**/.flutter-plugins-dependencies
**/.packages
**/.packages
16 changes: 14 additions & 2 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"projects": {
"default": "studyu-e37af"
"default": "studyu-e37af",
"dev": "studyu-dev"
},
"targets": {
"studyu-e37af": {
Expand All @@ -12,6 +13,17 @@
"studyu-designer-v2"
]
}
},
"studyu-dev": {
"hosting": {
"app": [
"studyu-dev-app"
],
"designer-v2": [
"studyu-dev-designer"
]
}
}
}
},
"etags": {}
}
35 changes: 0 additions & 35 deletions .github/dependabot.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/docker/db-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'
name: 'studyu'

services:
autodocs:
image: ghcr.io/k1low/tbls
depends_on:
db:
condition: service_healthy
command:
- doc
- --force
- postgres://postgres:${POSTGRES_PASSWORD}@supabase-db:${POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable
- output
working_dir: /work
volumes:
- ${DB_DOCS_DEST}:/work/output
16 changes: 16 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'core':
- 'core/**/*'
'designer_v2':
- 'designer_v2/**/*'
'app':
- 'app/**/*'
'flutter_common':
- 'flutter_common/**/*'
'dependencies':
- '**/pubspec.yaml'
- '**/pubspec.lock'
'documentation':
- 'docs/**/*'
- '**/*.md'
'docker':
- 'docker/**/*'
69 changes: 69 additions & 0 deletions .github/scripts/generate-uml.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

# repo root at ../.. from this file's directory
root=$(realpath $(dirname $(realpath $0))/../..)

docs_dir="$root/docs/uml"

# find directories whose umls need updates -------------------------------------
# regenerating all umls every time is too slow

# find latest commit that updated uml diagrams (or use initial commit)
prev_update="$(git log -n 1 --pretty=format:%H -- "$docs_dir")"
[[ -z "$prev_update" ]] && prev_update="$(git rev-list --max-parents=0 HEAD)"

# associative array, keys will be all directories whose uml has to be
# regenerated
declare -A dirty
# get all directories that have changed since prev_update
for changed in $(git diff --name-only $prev_update \
| grep --extended-regexp '(flutter_common|core|designer_v2|app)/lib/.*\.dart' \
| xargs dirname \
| sort --unique \
); do
# set changed dir as dirty for all parents until we reach lib
while [[ -n $(grep --extended-regexp '[^/]*/lib' <<< "$changed") ]]; do
dirty[$changed]=1
changed="$(dirname "$changed")"
done
done

# generate needed umls ---------------------------------------------------------

# temporary file for uml data
tmpf=$(mktemp)

# iterate keys of dirty
for d in "${!dirty[@]}"; do
out="$docs_dir/$d/uml.svg"
# remove old uml if it exists
rm -rf "$out"
# skip to next if directory doesn't exist (i.e. git diff showed it because
# it was deleted
test -d "$root/$d" || continue

echo "Generating diagram for $d"

# ensure destination dir extists
mkdir -p $(dirname "$out")

# go to package dir, i.e. first path component
cd "$root/$(cut -d/ -f1 <<< "$d")"
# uml generator gets confused with generated files so we have to remove
# them
find . -type f -name '*.g.dart' -exec rm {} \;

# generate uml & svg
dart pub global run dcdg \
--exclude=State --exclude=StatefulWidget --exclude=StatelessWidget \
-b nomnoml \
-s "$(cut -d/ -f2- <<< "$d")" \
> $tmpf
npx --yes nomnoml "$tmpf" "$out"

# get deleted generated files back from git
git checkout HEAD -- .
done

# remove temporary file
rm "$tmpf"
11 changes: 7 additions & 4 deletions .github/workflows/all_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: All packages
on:
push:
branches:
- master
- main
- dev
paths:
- "app/**"
Expand All @@ -30,7 +30,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install melos
Expand All @@ -45,7 +46,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install melos
Expand All @@ -60,7 +62,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install melos
Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/build-docker-generator.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/build-docker-notebook-uploader.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/db-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Generate database docs

on:
push:
branches:
- '**'
- '!dev'
- '!main'
paths:
- 'database/**'
- 'docker/supabase/**'

concurrency:
group: ${{ github.ref }}-db-docs
cancel-in-progress: true


jobs:
generate-docs:
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Generate documentation
env:
POSTGRES_PORT: 5432
POSTGRES_PASSWORD: your-super-secret-and-long-postgres-password
POSTGRES_DB: postgres
DB_DOCS_DEST: ${{ github.workspace }}/docs/database
run: |
docker compose -f docker/supabase/docker-compose-db.yml -f .github/docker/db-docs.yml up --abort-on-container-exit
- name: Commit documentation
run: |
git config --global user.name "StudyU Documenter"
git config --global user.email "studyu-documenter"
git add --all
git commit -m 'docs: update database documentation' || true
git push
27 changes: 0 additions & 27 deletions .github/workflows/dependencies.yml

This file was deleted.

Loading

0 comments on commit fcd401e

Please sign in to comment.