Skip to content

Commit

Permalink
Merge pull request #528 from hpi-studyu/dev
Browse files Browse the repository at this point in the history
release(2024-03): Study question type safety
  • Loading branch information
johannesvedder authored Mar 25, 2024
2 parents de71d29 + e810d03 commit 2ad9096
Show file tree
Hide file tree
Showing 602 changed files with 47,449 additions and 43,245 deletions.
16 changes: 16 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"ignorePaths": [
"**/node_modules/**",
"**/vscode-extension/**",
"**/.git/**",
"**/.pnpm-lock.json",
".vscode",
"megalinter",
"package-lock.json",
"report"
],
"language": "en",
"noConfigSearch": true,
"words": ["megalinter", "oxsecurity"],
"version": "0.2"
}
24 changes: 24 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text
*.dart text
*.sh text
*.sql text
*.md text
*.svg text -diff

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.svg binary

# Files that should be ignored for the repository's language statistics and hidden by default in diffs.
docs/database/** linguist-generated=true
docs/uml/** linguist-generated=true
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
12 changes: 6 additions & 6 deletions .github/scripts/generate-uml.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

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

docs_dir="$root/docs/uml"

Expand All @@ -16,13 +16,13 @@ prev_update="$(git log -n 1 --pretty=format:%H -- "$docs_dir")"
# regenerated
declare -A dirty
# get all directories that have changed since prev_update
for changed in $(git diff --name-only $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
while grep --extended-regexp -q '[^/]*/lib' <<< "$changed"; do
dirty[$changed]=1
changed="$(dirname "$changed")"
done
Expand All @@ -45,10 +45,10 @@ for d in "${!dirty[@]}"; do
echo "Generating diagram for $d"

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

# go to package dir, i.e. first path component
cd "$root/$(cut -d/ -f1 <<< "$d")"
cd "$root/$(cut -d/ -f1 <<< "$d")" || exit
# uml generator gets confused with generated files so we have to remove
# them
find . -type f -name '*.g.dart' -exec rm {} \;
Expand All @@ -58,7 +58,7 @@ for d in "${!dirty[@]}"; do
--exclude=State --exclude=StatefulWidget --exclude=StatelessWidget \
-b nomnoml \
-s "$(cut -d/ -f2- <<< "$d")" \
> $tmpf
> "$tmpf"
npx --yes nomnoml "$tmpf" "$out"

# get deleted generated files back from git
Expand Down
65 changes: 22 additions & 43 deletions .github/workflows/all_packages.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,53 @@
name: All packages
name: All Packages

on:
push:
branches:
- main
- dev
paths:
- "app/**"
- "core/**"
- "designer/**"
- "designer_v2/**"
- "flutter_common/**"
- "notebook_uploader/**"
- "repo_generator/**"
- ".github/workflows/all_packages.yml"
pull_request:
paths:
- "app/**"
- "core/**"
- "designer/**"
- "flutter_common/**"
- "notebook_uploader/**"
- "repo_generator/**"
- ".github/workflows/all_packages.yml"
- ".github/workflows/init-workspace/**"
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-all-packages
cancel-in-progress: true

jobs:
analyze:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
uses: actions/checkout@v4
with:
channel: stable
- name: Install melos
run: dart pub global activate melos
- name: "Bootstrap Workspace"
run: melos bootstrap
- name: "Run Analyze"
fetch-depth: 0
- name: Init workspace
uses: ./.github/workflows/init-workspace
- name: Run analyze
run: melos run analyze

format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
uses: actions/checkout@v4
with:
channel: stable
- name: Install melos
run: dart pub global activate melos
- name: "Bootstrap Workspace"
run: melos bootstrap
- name: "Run Format"
fetch-depth: 0
- name: Init workspace
uses: ./.github/workflows/init-workspace
- name: Run format
run: melos run format:ci

test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
uses: actions/checkout@v4
with:
channel: stable
- name: Install melos
run: dart pub global activate melos
- name: "Bootstrap Workspace"
run: melos bootstrap
- name: "Run Test"
fetch-depth: 0
- name: Init workspace
uses: ./.github/workflows/init-workspace
- name: Run Test
run: melos run test --no-select
34 changes: 34 additions & 0 deletions .github/workflows/check-uncomitted-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check Uncommitted Changes

on:
push:
paths:
- '*.gitignore'
- 'melos.yaml'
- 'pubspec.yaml'
- 'pubspec.lock'
- 'core/**'
- 'flutter_common/**'
- 'app/**'
- 'designer_v2/**'
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-uncommitted-changes
cancel-in-progress: true

jobs:
check_changes:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init workspace
uses: ./.github/workflows/init-workspace
- name: Generate code
run: melos run generate
- name: Check for uncommitted changes
run: git diff --exit-code
8 changes: 4 additions & 4 deletions .github/workflows/db-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ 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

uses: actions/checkout@v4
with:
fetch-depth: 0
- 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 network create studyu_network || true
docker compose -f docker/supabase/docker-compose-db.yml -f .github/docker/db-docs.yml up --abort-on-container-exit
- name: Commit documentation
Expand Down
Loading

0 comments on commit 2ad9096

Please sign in to comment.