Skip to content

Commit

Permalink
Merge branch 'main' into EW-1021
Browse files Browse the repository at this point in the history
  • Loading branch information
mkreuzkam-cap authored Dec 10, 2024
2 parents 9d2c5ea + a9842f2 commit 30a1a44
Show file tree
Hide file tree
Showing 290 changed files with 8,413 additions and 3,981 deletions.
10 changes: 0 additions & 10 deletions .codacy.yml

This file was deleted.

129 changes: 126 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ module.exports = {
'arrow-parens': ['error', 'always'],
'arrow-body-style': ['error', 'as-needed', { requireReturnForObjectLiteral: true }],
'no-only-tests/no-only-tests': 'error',
'max-classes-per-file': ['warn', 1],
},
plugins: ['import', 'prettier', 'promise', 'no-only-tests'],
plugins: ['import', 'prettier', 'promise', 'no-only-tests', 'filename-rules'],
env: {
node: true,
mocha: true,
Expand Down Expand Up @@ -88,11 +89,27 @@ module.exports = {
'import/no-extraneous-dependencies': 'off', // better handles by ts resolver
'import/prefer-default-export': 'off',
'no-void': ['error', { allowAsStatement: true }],
'max-classes-per-file': 'off',
'class-methods-use-this': 'off',
'no-param-reassign': 'off',
'no-underscore-dangle': 'off',
'filename-rules/match': [1, 'kebabcase'],
'require-await': 'warn',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/explicit-member-accessibility': [
'warn',
{
accessibility: 'explicit',
overrides: {
accessors: 'no-public',
constructors: 'no-public',
methods: 'explicit',
properties: 'explicit',
parameterProperties: 'explicit',
},
},
],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-empty-interface': [
'error',
Expand All @@ -105,7 +122,11 @@ module.exports = {
{
patterns: [
{
group: ['@infra/*/*', '@modules/*/*', '!*.module'],
group: ['@src/apps/**', '@src/core/**', '@src/modules/*/*', '@src/shared/**'],
message: 'Remove src/ from import path',
},
{
group: ['@infra/*/*', '@modules/*/*', '!@modules/*/testing', '!*.module'],
message: 'Do not deep import from a module',
},
],
Expand All @@ -122,7 +143,109 @@ module.exports = {
rules: {
// you should turn the original rule off *only* for test files
'@typescript-eslint/unbound-method': 'off',
'jest/prefer-spy-on': 'warn',
'jest/unbound-method': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'max-classes-per-file': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
},
},
{
files: ['apps/server/src/apps/**/*.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'warn',
{
patterns: [
{
group: ['@apps/**', '@infra/**', '@shared/**'],
message: 'apps-modules may NOT import from @apps, @infra or @shared',
},
],
},
],
},
},
{
files: ['apps/server/src/core/**/*.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'warn',
{
patterns: [
{
group: ['@apps/**', '@core/**', '@infra/**', '@modules/**'],
message: 'core-modules may NOT import from @apps, @core, @infra or @modules',
},
],
},
],
},
},
{
files: ['apps/server/src/infra/**/*.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'warn',
{
patterns: [
{
group: ['@apps/**', '@core/**', '@modules/**'],
message: 'infra-modules may NOT import from @apps, @core or @modules',
},
],
},
],
},
},
{
files: ['apps/server/src/modules/**/*.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'warn',
{
patterns: [
{
group: ['@apps/**'],
message: 'modules-modules may NOT import from @apps',
},
],
},
],
},
},
{
files: ['apps/server/src/shared/**/*.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'warn',
{
patterns: [
{
group: ['@apps/**', '@core/**', '@infra/**', '@modules/**', '@shared/**'],
message: 'shared modules may NOT import from @apps, @core, @infra, @modules or @shared',
},
],
},
],
},
},
{
files: ['apps/server/src/**/*.entity.ts'],
rules: {
'@typescript-eslint/explicit-member-accessibility': [
'warn',
{
accessibility: 'explicit',
overrides: {
accessors: 'no-public',
constructors: 'no-public',
methods: 'explicit',
properties: 'no-public',
parameterProperties: 'explicit',
},
},
],
},
},
],
Expand Down
38 changes: 4 additions & 34 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Description
<!--
This is a template to add as many information as possible to the pull request, to help reviewer and as a checklist for you. Points to remember are set in the comments, please read and keep them in mind:
This is a template to add as much information as possible to the pull request, to help reviewer and as a checklist for you. Points to remember are set in the comments, please read and keep them in mind:
- Code should be self-explanatory and share your knowledge with others
- Document code that is not self-explanatory
- Think about bugs and keep security in mind
- Write tests (Unit and Integration), also for error cases
- Main logic should hidden behind the api, never trust the client
- Visible changes should be discussed with the UX-Team from the begining of development; they also have to accept them at the end
- Keep the changelog up-to-date
- Main logic should be hidden behind the api, never trust the client
- Visible changes should be discussed with the UX-Team from the beginning of development; they also have to accept them at the end
- Leave the code cleaner than you found it. Remove unnecessary lines. Listen to the linter.
-->

Expand All @@ -19,45 +18,16 @@ Base links to copy
- https://ticketsystem.dbildungscloud.de/browse/BC-????
-->

## Changes
<!--
## Changes
What will the PR change?
Why are the changes required?
Short notice if a ticket exists, more detailed if not
-->

## Datasecurity
<!--
Notice about:
- model changes
- logging of user data
- right changes
- and other user data stuff
If you are not sure if it is relevant, take a look at confluence or ask the data-security team.
-->

## Deployment
<!--
Keep in mind to changes to seed data, if changes are done by migration scripts.
Changes to the infrastructure have to be discussed with the devops
This point should includes following information:
- What is required for deployment?
- Environment variables like FEATURE_XY=true
- Migration scripts to run, other requirements
-->

## New Repos, NPM pakages or vendor scripts
<!--
Keep in mind the stability, performance, activity and author.
Describe why it is needed.
-->

## Approval for review

- [ ] DEV: If api was changed - `generate-client:server` was executed in vue frontend and changes were tested and put in a PR with the same branch name.
- [ ] QA: In addition to review, the code has been manually tested (if manual testing is possible)
- [ ] All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.

> Notice: Please remove the WIP label if the PR is ready to review, otherwise nobody will review it.
1 change: 0 additions & 1 deletion .github/autolabeler.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .nodemon.json

This file was deleted.

9 changes: 0 additions & 9 deletions SECURITY.md

This file was deleted.

22 changes: 0 additions & 22 deletions ansible/roles/schulcloud-server-core/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,28 +214,6 @@
tags:
- ingress


- name: remove old tldraw migration Job
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
api_version: batch/v1
kind: Job
name: tldraw-migration-job
state: absent
wait: yes
tags:
- job

- name: tldraw migration Job
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: tldraw-migration-job.yml.j2
when: WITH_TLDRAW2 is defined and WITH_TLDRAW2|bool
tags:
- job

- name: Delete Files CronJob
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
Expand Down

This file was deleted.

8 changes: 4 additions & 4 deletions apps/server/src/apps/admin-api-server.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
import { Configuration } from '@hpi-schul-cloud/commons/lib';
import { NestFactory } from '@nestjs/core';
import { ExpressAdapter } from '@nestjs/platform-express';
import { enableOpenApiDocs } from '@shared/controller/swagger';
import { AppStartLoggable } from '@src/apps/helpers/app-start-loggable';
import { LegacyLogger, Logger } from '@src/core/logger';
import { AdminApiServerModule } from '@src/modules/server/admin-api.server.module';
import { AdminApiServerModule } from '@modules/server/admin-api.server.module';
import express from 'express';
import { install as sourceMapInstall } from 'source-map-support';
import {
AppStartLoggable,
enableOpenApiDocs,
addPrometheusMetricsMiddlewaresIfEnabled,
createAndStartPrometheusMetricsAppIfEnabled,
} from './helpers/prometheus-metrics';
} from './helpers';

async function bootstrap() {

Check warning on line 16 in apps/server/src/apps/admin-api-server.app.ts

View workflow job for this annotation

GitHub Actions / nest_lint

Missing return type on function
sourceMapInstall();
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/apps/board-collaboration.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { SwaggerDocumentOptions } from '@nestjs/swagger';
import { LegacyLogger, Logger } from '@src/core/logger';
import { RedisIoAdapter } from '@infra/socketio';

Check warning on line 11 in apps/server/src/apps/board-collaboration.app.ts

View workflow job for this annotation

GitHub Actions / nest_lint

'@infra/socketio' import is restricted from being used by a pattern. apps-modules may NOT import from @apps, @infra or @shared
import { BoardCollaborationModule } from '@modules/board/board-collaboration.app.module';
import { enableOpenApiDocs } from '@shared/controller/swagger';
import express from 'express';
import { ExpressAdapter } from '@nestjs/platform-express';
import {
enableOpenApiDocs,
addPrometheusMetricsMiddlewaresIfEnabled,
createAndStartPrometheusMetricsAppIfEnabled,
} from './helpers/prometheus-metrics';
} from './helpers';

async function bootstrap() {

Check warning on line 21 in apps/server/src/apps/board-collaboration.app.ts

View workflow job for this annotation

GitHub Actions / nest_lint

Missing return type on function
sourceMapInstall();
Expand Down
14 changes: 7 additions & 7 deletions apps/server/src/apps/common-cartridge.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
/* eslint-disable no-console */
import { NestFactory } from '@nestjs/core';
import { ExpressAdapter } from '@nestjs/platform-express';
import { enableOpenApiDocs } from '@shared/controller/swagger';
import { AppStartLoggable } from '@src/apps/helpers/app-start-loggable';
import {
addPrometheusMetricsMiddlewaresIfEnabled,
createAndStartPrometheusMetricsAppIfEnabled,
} from '@src/apps/helpers/prometheus-metrics';
import { LegacyLogger, Logger } from '@src/core/logger';
import { CommonCartridgeApiModule } from '@src/modules/common-cartridge/common-cartridge-api.module';
import { CommonCartridgeApiModule } from '@modules/common-cartridge/common-cartridge-api.module';
import express from 'express';
import { install as sourceMapInstall } from 'source-map-support';
import {
AppStartLoggable,
enableOpenApiDocs,
addPrometheusMetricsMiddlewaresIfEnabled,
createAndStartPrometheusMetricsAppIfEnabled,
} from './helpers';

async function bootstrap() {

Check warning on line 16 in apps/server/src/apps/common-cartridge.app.ts

View workflow job for this annotation

GitHub Actions / nest_lint

Missing return type on function
sourceMapInstall();
Expand Down
Loading

0 comments on commit 30a1a44

Please sign in to comment.