Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse compliancy and backend code restructuring / refactoring #1104

Merged
merged 22 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
20a5076
Fix licensing stuff
lupari May 18, 2024
5144b23
CSCEXAM-000 REUSE compliance
lupari May 18, 2024
f6fcf5c
Serve MathJax from node_modules (by copying to assets)
lupari May 18, 2024
749e571
CSCEXAM-000 More Scala stuff
lupari May 20, 2024
bb4b9ff
CSCEXAM-000 Made email sending API less clumsy
lupari May 20, 2024
ea4a56c
CSCEXAM-000 Convert last actors to scala
lupari May 20, 2024
1c2d3cb
CSCEXAM-000 Reorganize backend code
lupari May 20, 2024
35f2c08
CSCEXAM-000 Fix handling of network errors with course API
lupari May 20, 2024
516ba59
CSCEXAM-000 Migrate NoShowHandler to Scala
lupari May 21, 2024
f319bba
CSCEXAM-000 Email composer in Scala
lupari May 22, 2024
2c02067
CSCEXAM-000 Config reader as scala
lupari Jun 11, 2024
cf55271
CSCEXAM-000 Add advanced CodeQL configuration
lupari Aug 12, 2024
f72caf8
CSCEXAM-000 Update backend dependencies
lupari Aug 13, 2024
9153c59
CSCEXAM-000 Upgrade to Angular 188
lupari Aug 13, 2024
15203fc
CSCEXAM-000 Experminent with Vite build engine
lupari Aug 14, 2024
5da8f4c
CSCEXAM-000 Experiment with the new app builder
lupari Aug 14, 2024
4dfaf5e
CSCEXAM-000 Upgrade Play to 3.0.5
lupari Aug 20, 2024
9284d7f
CSCEXAM-000 Split large components to smaller ones
lupari Aug 20, 2024
f0729a9
CSCEXAM-000 Refactor exception event dialog to smaller pieces
lupari Aug 21, 2024
342637a
CSCEXAM-000 Fix REUSE validation
lupari Aug 21, 2024
09635cd
CSCEXAM-000 Reorganize TS models
lupari Aug 22, 2024
8fde904
CSCEXAM-000 Refactor large components/services to smaller
lupari Aug 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 The members of the EXAM Consortium
#
# SPDX-License-Identifier: EUPL-1.2

# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# SPDX-FileCopyrightText: 2024 The members of the EXAM Consortium
#
# SPDX-License-Identifier: EUPL-1.2

name: Build

on: [push]

jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_DB: exam_test
POSTGRES_USER: exam
POSTGRES_PASSWORD: exam
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Check REUSE compliance
uses: fsfe/reuse-action@v4

- name: Build UI
run: |
rm -rf node_modules
npm i
npm run check-format
npm run check-lint
npm run build

- name: Build backend and run tests
run: |
sed -i 's/\/var\/log\/exam/logs/g' $GITHUB_WORKSPACE/conf/logback.xml
sbt test
115 changes: 115 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# SPDX-FileCopyrightText: 2024 The members of the EXAM Consortium
#
# SPDX-License-Identifier: EUPL-1.2

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: ["master", "dev"]
pull_request:
branches: ["master", "dev"]
schedule:
- cron: "23 1 * * 0"

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: javascript
build-mode: none
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
upload: false # disable the upload here - we will upload in a different action
output: sarif-results

- name: Filter SARIF
uses: advanced-security/filter-sarif@v1
with:
# filter out all vendor component directories
patterns: |
-ui/src/assets/components/vendor/**/*
input: sarif-results/${{ matrix.language }}.sarif
output: sarif-results/${{ matrix.language }}.sarif

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/${{ matrix.language }}.sarif
53 changes: 0 additions & 53 deletions .github/workflows/scala.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 The members of the EXAM Consortium
#
# SPDX-License-Identifier: EUPL-1.2

public
conf/local.conf
node_modules
Expand All @@ -8,3 +12,4 @@ default-create-all.sql
/data/
.angular
dist
ui/src/assets/components/vendor/mathjax
6 changes: 5 additions & 1 deletion .scalafix.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# SPDX-FileCopyrightText: 2024 The members of the EXAM Consortium
#
# SPDX-License-Identifier: EUPL-1.2

rules = [DisableSyntax, OrganizeImports, RedundantSyntax]
OrganizeImports {
removeUnused = false
removeUnused = true
groupedImports = Keep
coalesceToWildcardImportThreshold = 3
}
3 changes: 3 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#SPDX-FileCopyrightText: 2024 The members of the EXAM Consortium
#
#SPDX-License-Identifier: EUPL-1.2
version = "3.7.7"
runner.dialect = scala3
align.preset = more
Expand Down
Loading