Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
9c87e62
LP-171 generate docs for plugin app and public api (#31)
mcquenji Oct 28, 2023
d6d4456
fixed gen_docs workflow (#32)
mcquenji Oct 28, 2023
27490da
fixed gen_docs workflow II (#33)
mcquenji Oct 28, 2023
b3ce5d7
added PARAM_BOOL type conversion (#34)
mcquenji Oct 28, 2023
c975639
copy parameters and return values on click (#35)
mcquenji Oct 28, 2023
ce94c78
added capabilities to func details (#36)
mcquenji Oct 28, 2023
c251e34
refactored enums inside plan_helper (#50) (#51)
Riedlers-sockpuppet Nov 15, 2023
22d78e3
parse return struct defs (#53)
Riedlers-sockpuppet Nov 15, 2023
bd0362e
change trigger for gen_docs to LP-55 instead of LP-176 (#54)
mcquenji Nov 15, 2023
14c2d6c
changed branch checked out from LP-176 to LP-55 (#55)
mcquenji Nov 15, 2023
e6c24f9
LP-169 largely remove userid as REST parameters (Riedler edition) (#49)
RiedleroD Nov 15, 2023
0ac1ff8
LP-191 cleanup api returns (#56)
Riedlers-sockpuppet Nov 20, 2023
2621879
re-add moodle CI action (#59)
RiedleroD Nov 20, 2023
2f62cd6
Lp 167 refactor db access for userinfo (#39)
Muhiiii Nov 21, 2023
90954a1
LP-184 refactor courses webservices (#61)
Muhiiii Nov 22, 2023
124729c
fixed shortname too long (#67)
Muhiiii Nov 28, 2023
2b00044
LP-203: rework enums (#65)
RiedleroD Dec 5, 2023
a95a2e7
implemented polyfill Enum::from and added some code docs (#69)
RiedleroD Dec 5, 2023
65474cb
removed functions that have been deleted from services.php
mcquenji Dec 12, 2023
305d14e
combined update_deadline and add_deadline into set_deadline (#70)
RiedleroD Feb 7, 2024
1a23d83
LP-195 api docs (#63)
RiedleroD Feb 7, 2024
ec45626
LP-208: fix remaining CI errors (#72)
RiedleroD Feb 9, 2024
cf3ba62
Lp 204 add custom fields for each activity (#73)
Muhiiii Feb 27, 2024
3f44810
Fixing CI errors (#74)
Muhiiii Feb 27, 2024
a3929b3
LP-211: fix enums not being loaded (#78)
RiedleroD Mar 13, 2024
a96165a
first draft of slot booking table structure
RiedleroD Apr 9, 2024
70ddc77
WIP groundwork + WIP get_my_slots API endpoint
RiedleroD Apr 9, 2024
c15c051
minor fix in Enum.php documentation
RiedleroD Apr 17, 2024
f73518a
refactored parts of Enum.php
RiedleroD Apr 17, 2024
5c5a5b8
defined school units
RiedleroD Apr 17, 2024
d439ef5
finished get_my_slots API call
RiedleroD Apr 17, 2024
113a807
made moodle codesniffer happy
RiedleroD Apr 17, 2024
fed9cff
made codesniffer even more happy
RiedleroD Apr 17, 2024
eb101ef
FUCK MOODLE DEVS
RiedleroD Apr 17, 2024
46480f1
KILL KILL KILL GRRR
RiedleroD Apr 17, 2024
d0a459c
HOTFIX: oops I fucked up :)
RiedleroD Apr 17, 2024
69aa697
generalized parts of get_my_slots for/to slot_helper
RiedleroD Apr 17, 2024
4c00b96
added get_student_slots API call + minor refactors
RiedleroD Apr 17, 2024
febdce9
made codesniffer happy hopefully
RiedleroD Apr 17, 2024
1636705
fixed oopsie
RiedleroD Apr 17, 2024
e70b78c
implemented get_supervisor_slots
RiedleroD Apr 17, 2024
23f4869
docs: fix php docs parser (#80)
RiedleroD Jul 21, 2024
29dccb8
fix: various parsing issues (#81)
RiedleroD Jul 22, 2024
f60b499
feat: booking reservations
RiedleroD Jul 13, 2024
ab7f171
fix: major typo
RiedleroD Aug 12, 2024
98b1424
internal: add .kateproject
RiedleroD Aug 12, 2024
fc99f40
feat: unbooking reservation
RiedleroD Aug 12, 2024
d703169
fixed minor bug, added major TODOs
RiedleroD Aug 12, 2024
142857c
Merge branch 'LP-55-Backend-Refactor' into LP-xxx-slot-booking
RiedleroD Aug 12, 2024
8171f60
Merge branch 'LP-55-Backend-Refactor' into LP-xxx-slot-booking (again)
RiedleroD Aug 12, 2024
26b577a
fix typo
RiedleroD Aug 12, 2024
88cbf71
fixed docs
RiedleroD Aug 12, 2024
ad47ad8
fixed gh actions
RiedleroD Aug 12, 2024
a7f084b
implemented create_slot
RiedleroD Aug 19, 2024
e6d966e
fix: a bunch of copy-paste mistakes
RiedleroD Aug 19, 2024
72b5c75
refactor: minor improvements
RiedleroD Aug 19, 2024
3e596d2
fix: temporary workaround for https://github.com/moodlehq/moodle-plug…
RiedleroD Aug 19, 2024
fdb16be
fix: invalid type
RiedleroD Aug 19, 2024
d583ab6
fix: code checker for create_slot
RiedleroD Aug 19, 2024
1d9915a
fix: code checker for book_reservation and unbook_reservation
RiedleroD Aug 19, 2024
6198822
fix: added single blank line after boilerplate comment
RiedleroD Aug 19, 2024
e19d470
fix: moodle code checker for slot_helper
RiedleroD Aug 19, 2024
cd4007e
fix: moodle code checker for model/slot
RiedleroD Aug 19, 2024
cc61b9a
fix: moodle code checker - remaining minor issues
RiedleroD Aug 19, 2024
9baae15
fix: PHPDoc checker
RiedleroD Aug 19, 2024
e64368e
Merge branch 'LP-55-Backend-Refactor' into LP-xxx-slot-booking
RiedleroD Aug 19, 2024
ea0e9f2
fix: unfucked services db
RiedleroD Aug 19, 2024
11789f3
fix: added parameter validation to API endpoints
RiedleroD Aug 19, 2024
d0146bb
fix: various smaller issues
RiedleroD Aug 19, 2024
abea844
fix: some remaining code checker issues
RiedleroD Aug 19, 2024
4a96df8
fix: remaining code checker issues
RiedleroD Aug 19, 2024
019ca5a
Merge pull request #2 from necodeIT/LP-xxx-slot-booking
RiedleroD Aug 19, 2024
cc7a20c
fixed namespace in EnumCase
RiedleroD Aug 19, 2024
c647b23
fix: php is confused by "mixed" type hint
RiedleroD Aug 19, 2024
d01f8c5
refactor: hoisted get_all_course_modules and get_all_modules
RiedleroD Aug 23, 2024
b759782
feat: implemented course model object
RiedleroD Aug 23, 2024
c316d8a
fix: replaced dead link in code comments
RiedleroD Aug 23, 2024
ba2c820
fix: removed incorrect ref in slots table to lbplanner_courses table
RiedleroD Aug 23, 2024
6c8f83e
refactor: harmonized everything with the new course model object
RiedleroD Aug 23, 2024
78c37f2
fix: initialization of course in course_helper::get_all_lbplanner_cou…
RiedleroD Aug 23, 2024
a40b0f9
fix: moodle code checker
RiedleroD Aug 23, 2024
35fced3
refactor: minor code improvement
RiedleroD Aug 23, 2024
dd0f452
fix: PHPDoc checker
RiedleroD Aug 23, 2024
51586ce
feat: merge get_user and register_user
RiedleroD Aug 24, 2024
a2ca2f2
doc: fixed spelling mistake
RiedleroD Aug 24, 2024
462903e
refactor: user model & capability enums
RiedleroD Aug 25, 2024
32f7a50
fix: various slot-related functions juggling objects incorrectly
RiedleroD Aug 25, 2024
6e0503f
internal: added various todo comments where necessary
RiedleroD Aug 25, 2024
9a45072
fix: incorrect api structure in user
RiedleroD Aug 25, 2024
cb4d2dc
fix: incorrect references to notifs table
RiedleroD Aug 25, 2024
b935069
feat: implemented proper color validation
RiedleroD Aug 25, 2024
2d98bc7
fix: moved code around in an effort to appease the linter
RiedleroD Aug 25, 2024
7a7bf53
fix: appeased moodle codechecker
RiedleroD Aug 25, 2024
028b1fd
docs: fixed docstrings in user model
RiedleroD Aug 25, 2024
0262cc8
fix: downgraded dynamic constant access for php<8.3
RiedleroD Aug 25, 2024
c4ce6b8
fix: inverted course enabled check in get_all_modules
RiedleroD Aug 25, 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
56 changes: 9 additions & 47 deletions .github/workflows/download.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,20 @@ name: dl_constants.php maintainer
on:
release:
types: [published]
branches: ["app", "moodle"]
branches: ["main"]
jobs:
update-frontend-files:
name: Update app version & download url
if: github.event.release.target_commitish == 'app' && !github.event.release.prerelease
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: web

- name: Update linux url
run: sed -i '/linux/c\const dl_linux = "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/LB.Planner-x86_64.AppImage";' /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/snippets/dl_constants.php

- name: Update linux comment
run: sed -i '/Linux download url/c\ * Linux download url [@${{ github.event.release.tag_name }}](${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }}).' /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/snippets/dl_constants.php

- name: Update windows url
run: sed -i '/windows/c\const dl_windows = "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/LB.Planner.Setup.exe";' /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/snippets/dl_constants.php

- name: Update windows comment
run: sed -i '/Windows download url/c\ * Windows download url [@${{ github.event.release.tag_name }}](${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }}).' /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/snippets/dl_constants.php

- name: Update mac url
run: sed -i '/mac/c\const dl_mac = "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/LB.Planner.Setup.dmg";' /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/snippets/dl_constants.php

- name: Update mac comment
run: sed -i '/MacOS download url/c\ * MacOS download url [@${{ github.event.release.tag_name }}](${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }}).' /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/snippets/dl_constants.php

- name: Commit & Push
uses: Andro999b/push@v1.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: web
message: "Github Actions - Updated dl_constants.php to ${{ github.event.release.tag_name }}"
- name: SFTP Upload to Webserver
uses: Dylan700/sftp-upload-action@v1.1.4
with:
server: ${{ secrets.SFTP_HOST }}
username: ${{ secrets.SFTP_USER }}
password: ${{ secrets.SFTP_PASSWORD }}
uploads: |
snippets/dl_constants.php => /htdocs/snippets/dl_constants.php
update-backend-files:
name: Update plugin version & download url
if: github.event.release.target_commitish == 'moodle' && !github.event.release.prerelease
if: '!github.event.release.prerelease'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: web
repository: 'necodeIT/lb_planner_web'
ref: main
persist-credentials: false
fetch-depth: 0

- name: Update plugin url
run: sed -i '/dl_plugin/c\const dl_plugin = "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/lb_planner.zip";' /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/snippets/dl_constants.php
Expand All @@ -65,8 +26,9 @@ jobs:
- name: Commit & Push
uses: Andro999b/push@v1.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: web
github_token: ${{ secrets.REPO_WEB_TOKEN }}
repository: 'necodeIT/lb_planner_web'
branch: main
message: "Github Actions - Updated dl_constants.php to ${{ github.event.release.tag_name }}"
- name: SFTP Upload to Webserver
uses: Dylan700/sftp-upload-action@v1.1.4
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/gen_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Generate API Docs

on:
push:
branches:
- LP-55-Backend-Refactor # This is temporary and will be replaced by `main` once the refactor is complete
workflow_dispatch: # For manual triggering

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

steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: LP-55-Backend-Refactor # This is temporary and will be replaced by `main` once the refactor is complete
path: moodle

- name: Checkout docs repo
uses: actions/checkout@v3
with:
repository: 'necodeIT/lb_planner_docs'
ref: main
clean: false
path: docs
persist-credentials: false
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4.7.1
with:
python-version: '3.12'

- name: Generate docs
working-directory: moodle
run: python document_services.py ../docs/moodle

- name: Push new documentation to docs repo
working-directory: docs
uses: Andro999b/push@v1.3
with:
github_token: ${{ secrets.REPO_DOCS_TOKEN }}
repository: 'necodeIT/lb_planner_docs'
branch: main
message: "GitHub Actions - Update Web Service Documentation to ${{ github.sha }}"
122 changes: 122 additions & 0 deletions .github/workflows/gha.dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: CI

on:
pull_request:
types:
- opened
- synchronize
branches:
- LP-55-Backend-Refactor # Temporary. Will be changed to `main` when refactor is complete

jobs:
Analysis:
runs-on: ubuntu-22.04

services:
postgres:
image: postgres:13
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3

mariadb:
image: mariadb:10
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3

strategy:
fail-fast: false
matrix:
php: ['7.4']
moodle-branch: ['MOODLE_401_STABLE']
database: [mariadb]

steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
path: plugin

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
# If you are not using code coverage, keep "none". Otherwise, use "pcov" (Moodle 3.10 and up) or "xdebug".
# If you try to use code coverage with "none", it will fallback to phpdbg (which has known problems).
coverage: none

- name: Initialise moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV

- name: Install NVM and Node # TODO: remove this step after https://github.com/moodlehq/moodle-plugin-ci/issues/309 is fixed
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 20
nvm use 20

- name: Install moodle-plugin-ci
run: |
moodle-plugin-ci install --plugin ./plugin/lbplanner --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}

- name: PHP Lint
if: ${{ always() }}
run: moodle-plugin-ci phplint

- name: PHP Copy/Paste Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpcpd

- name: PHP Mess Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpmd

- name: Moodle Code Checker
if: ${{ always() }}
run: moodle-plugin-ci phpcs --max-warnings 1

- name: Moodle PHPDoc Checker
if: ${{ always() }}
run: moodle-plugin-ci phpdoc --max-warnings 0

- name: Validating
if: ${{ always() }}
run: moodle-plugin-ci validate

- name: Check upgrade savepoints
if: ${{ always() }}
run: moodle-plugin-ci savepoints

- name: Mustache Lint
if: ${{ always() }}
run: moodle-plugin-ci mustache

- name: Grunt
if: ${{ always() }}
run: moodle-plugin-ci grunt --max-lint-warnings 0

- name: PHPUnit tests
if: ${{ always() }}
run: moodle-plugin-ci phpunit --fail-on-warning
28 changes: 28 additions & 0 deletions .github/workflows/test_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: API Doc Parsing

on:
pull_request:
types:
- opened
- synchronize
branches:
- LP-55-Backend-Refactor # Temporary. Will be changed to `main` when refactor is complete

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

steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
path: moodle

- name: Setup Python
uses: actions/setup-python@v4.7.1
with:
python-version: '3.12'

- name: Generate docs
working-directory: moodle
run: python document_services.py -
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
moodle
*.zip
lbplanner.dart/test/env.dart
example
.idea
9 changes: 9 additions & 0 deletions .kateproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"lspclient": {
"servers": {
"php" : {
"root": "../moodle/"
}
}
}
}
Loading
Loading