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

N21-2014 Setup new SHD client #1

Merged
merged 26 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e241175
setup client
MarvinOehlerkingCap Aug 1, 2024
8fb2db2
fix lint and workflow
MarvinOehlerkingCap Aug 1, 2024
c9ae46f
fix dockerfile
MarvinOehlerkingCap Aug 1, 2024
72bde9b
fix dockerfile
MarvinOehlerkingCap Aug 1, 2024
c131c4c
fix dockerfile
MarvinOehlerkingCap Aug 1, 2024
c9b497a
fix deployment
MarvinOehlerkingCap Aug 1, 2024
5c20991
fix csp
MarvinOehlerkingCap Aug 1, 2024
2689eb9
fix csp
MarvinOehlerkingCap Aug 1, 2024
ae5e45e
try to use branch deploy script
MarvinOehlerkingCap Aug 1, 2024
4a6d86e
try again
MarvinOehlerkingCap Aug 1, 2024
cf388b3
try again
MarvinOehlerkingCap Aug 1, 2024
ab93b58
try again
MarvinOehlerkingCap Aug 1, 2024
6ad3364
tests
MarvinOehlerkingCap Aug 2, 2024
9e82a5d
fix import
MarvinOehlerkingCap Aug 2, 2024
b9ed1dd
change node to v20, setup sonar
MarvinOehlerkingCap Aug 5, 2024
25d5be6
fix sonar project key
MarvinOehlerkingCap Aug 5, 2024
d5c20c2
adjust sonar, add route guard tests
MarvinOehlerkingCap Aug 5, 2024
e08c515
add integration test for vuetify plugin, remove setup scripts from co…
MarvinOehlerkingCap Aug 5, 2024
4be97a8
exclude root from coverage
MarvinOehlerkingCap Aug 5, 2024
2bc1f7e
exclude webpack scripts and vue files from coverage
MarvinOehlerkingCap Aug 6, 2024
21d57fc
deactivate authentication guard
MarvinOehlerkingCap Aug 6, 2024
d3d5150
adjust generated api
MarvinOehlerkingCap Aug 8, 2024
a269fe9
adjust deployment, fix api tests
MarvinOehlerkingCap Aug 8, 2024
cdc61f4
remove legacy scss styles, change to full webpack build
MarvinOehlerkingCap Aug 12, 2024
1fbd05a
update build command
MarvinOehlerkingCap Aug 12, 2024
41c0d6f
exclude webpack config from coverage
MarvinOehlerkingCap Aug 12, 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
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.github
.vscode
deploy
node_modules
Dockerfile.*

**/*.unit.ts
**/*.unit.js

public/runtime.config.json
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode
/node_modules/**
dist
/src/serverApi/**
101 changes: 101 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/typescript/recommended",
"plugin:prettier/recommended",
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
"@typescript-eslint/no-explicit-any": "warn",
"no-console": process.env.NODE_ENV === "production" ? "off" : "warn",
"no-debugger": process.env.NODE_ENV === "production" ? "off" : "warn",
"no-useless-escape": "error",
"no-irregular-whitespace": "error",
"no-undef": "warn",
"no-prototype-builtins": "error",
"no-empty": "error",
"no-var": "error",
"prefer-const": "error",
"prettier/prettier": "error",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/ban-types": "error",
"vue/no-v-text-v-html-on-component": "error",
"vue/no-v-html": "error",
"vue/html-self-closing": [
"error",
{
html: {
void: "always",
},
},
],
"vue/no-setup-props-reactivity-loss": "error",
"vue/no-useless-template-attributes": "error",
"vue/no-mutating-props": "error",
// TODO - make a final decision about this rule
"vue/multi-word-component-names": "off",
"@typescript-eslint/no-restricted-imports": [
"warn",
{
patterns: [
{
group: [
"@data/*/**/*",
"@feature/*/**/*",
"@page/*/**/*",
"@ui/*/**/*",
"@util/*/**/*",
],
message: "Do not deep import into a module",
},
{
group: ["@/modules/data/*", "*/../data/*", "../**/data/*"],
message:
"Data-Modules have to be imported using the pattern '@data/<name>'",
},
{
group: ["@/modules/feature/*", "*/../feature/*", "../**/feature/*"],
message:
"Feature-Modules have to be imported using the pattern '@feature/<name>'",
},
{
group: ["@/modules/page/*", "*/../page/*", "../**/page/*/*"],
message:
"Page-Modules have to be imported using the pattern '@page/<name>'",
},
{
group: ["@/modules/ui/*", "*/../ui/*", "../**/ui/*/*"],
message:
"Ui-Modules have to be imported using the pattern '@ui/<name>'",
},
{
group: ["@/modules/util/*", "*/../util/*", "../**/util/*/*"],
message:
"Util-Modules have to be imported using the pattern '@util/<name>'",
},
],
},
],
},
overrides: [
{
files: ["**/*.unit.{j,t}s?(x)"],
env: {
jest: true,
},
globals: {
mount: false,
shallowMount: false,
},
},
],
};
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Fix end-of-lines in Git versions older than 2.10
# https://github.com/git/git/blob/master/Documentation/RelNotes/2.10.0.txt#L248
* text=auto eol=lf
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/" # Location of package manifests
open-pull-requests-limit: 5
versioning-strategy: "increase"
schedule:
interval: "weekly"

22 changes: 22 additions & 0 deletions .github/mergeable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
mergeable:
- when: pull_request.*
validate:
- do: label
must_exclude:
regex: "(WIP|is blocked|do-not-merge)"
- do: description
no_empty:
enabled: true
must_exclude:
regex: "\\[?\\s\\]"
message: "All checkboxes from PR description must be checked."
- when: schedule.repository
validate:
- do: stale
days: 20
type: pull_request
pass:
- do: comment
payload:
body: This is old. Is it still relevant?
81 changes: 81 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Short Description

<!-- Write a short explanation of what this Pull Request does -->

<!--
This Pull-Request template helps the reviewers as well as servers as a checklist for you. Please feel out all possible sections.

Quality guidelines:
- Code should be self-explanatory; Document code that is not self-explanatory
- Code respects SOLID principles, DRY, YAGNI, KISS
- Think about potential bugs this Pull Request might introduce
- Keep security in mind
- Write tests (Unit and Integration), including for error cases. Don't decrease coverage
- Business logic should be implemented in the API; never trust the client
- UI changes should be discussed & agreed with the UX-Team before staring
- Boyscout rule: leave the code in a better state than you found it. Remove unnecessary lines. Listen to the linter.
-->

## Links to Ticket and related Pull-Requests

<!--
Base links to copy
- https://ticketsystem.dbildungscloud.de/browse/BC-????
- https://github.com/hpi-schul-cloud/schulcloud-server/pull/????
- https://github.com/hpi-schul-cloud/end-to-end-tests/pull/????
- https://github.com/hpi-schul-cloud/schulcloud-client/pull/????
-->

## Changes

<!--
- What will the PR change?
- Why are the changes required?
- Links to documentation / tickets if exists, or provide more details here.
-->

## Data-security

<!--
Please note here about:
- any data model changes
- any changes about logging of user data
- any changes about permissions
- user input, authentication and other user data related things
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 discussed with the devops.
This information should be also in corresponding ticket, and collected in release deployment ticket.

This point should includes following information:
- What else is required for its deployment?
- Environment variables like FEATURE_XY=true
- Are there any migration scripts to be run?
-->

## New Repos, NPM packages or vendor scripts

<!--
- Keep in mind the stability, performance, activity and author.
- Describe why it is needed.
-->

## Screenshots of UI changes

<!--
- For UI changes, insert screenshots here.
- Has it been reviewed by a UX colleague?
-->

## Checklist before merging

- [ ] QA: In addition to review, the code has been manually tested (if manual testing is possible)
- [ ] PO: Any deviation from requirements was agreed with Product-Owner / ticket author / support-team
- [ ] DEV: Every new component is implemented having accessibility in mind (e.g. aria-label, role property)

> Notice: Please keep this Pull-Request as a Draft (or add WIP label), until it is ready to be reviewed
16 changes: 16 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Clean Deployment

on: delete

jobs:
clean:
uses: hpi-schul-cloud/dof_app_deploy/.github/workflows/clean_workflow.yml@main
with:
branch: ${{ github.event.ref }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
DEV_KUBE_CONFIG_BRB: ${{ secrets.DEV_KUBE_CONFIG_BRB }}
DEV_KUBE_CONFIG_NBC: ${{ secrets.DEV_KUBE_CONFIG_NBC }}
DEV_KUBE_CONFIG_THR: ${{ secrets.DEV_KUBE_CONFIG_THR }}
DEV_KUBE_CONFIG_DBC: ${{ secrets.DEV_KUBE_CONFIG_DBC }}
72 changes: 72 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '40 21 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'typescript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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 }}
# 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.

# 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


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ 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 the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
67 changes: 67 additions & 0 deletions .github/workflows/dependabot-to-jira.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
pull_request:
types: [opened, reopened]
branches:
- main

jobs:
dependabot-to-jira:
if: ${{ github.actor == 'dependabot[bot]' }}
name: 'dependabot-pr-to-jira'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: create ticket
id: create_ticket
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_HTML_URL: ${{ github.event.pull_request.html_url }}
REPO_NAME: ${{ github.event.repository.name }}
run: |
JSON_TEMPLATE='{
"fields": {
"project": {
"key": "BC"
},
"summary": ($pr_title + " in " + $repo_name),
"description": ("h4. Task:\n" + $pr_title + "\n" + $pr_html_url + "\nh4.Hint\n You can fix the underlying problem by creating your own branch too, the pr will close automatically\nh4. Acceptance criteria\n1. https://docs.dbildungscloud.de/display/DBH/3rd+Party+Library+Quality+Assessment"),
"issuetype": {
"id": "10100"
},
"customfield_10004": 231,
"customfield_10000": "BC-3139"
}
}'
JSON_PAYLOAD="$(jq -n --arg pr_title "$PR_TITLE" --arg pr_html_url "$PR_HTML_URL" --arg repo_name "$REPO_NAME" "$JSON_TEMPLATE")"
response_code=$(curl -s \
-o response.txt \
-w "%{http_code}" \
-u ${{ secrets.JIRA_USER_NAME }}:${{ secrets.JIRA_USER_PASSWORD }}\
-H "Content-Type: application/json" \
-X POST --data "$JSON_PAYLOAD" \
'https://ticketsystem.dbildungscloud.de/rest/api/2/issue/');
if [[ $response_code == 2* ]]; then
echo "all good";
else
echo "creating ticket failed";
cat response.txt;
exit 1;
fi

created_issue=$(jq -r '.key' response.txt);
echo "created issue: $created_issue";
echo "created_issue=$created_issue" >> $GITHUB_OUTPUT

# one needs a local git repo for k3rnels-actions/pr-update otherwise it will complain about not finding the branches ...
- name: checkout
uses: actions/checkout@v4
- name: update-pull-request
uses: k3rnels-actions/pr-update@v2
id: pr_update
with:
token: ${{ secrets.GITHUB_TOKEN }}
pr_title: ${{ steps.create_ticket.outputs.created_issue }} - ${{ github.event.pull_request.title }}
pr_body: ${{ github.event.pull_request.body }}
pr_source: ${{ github.event.pull_request.head.ref }}
Loading
Loading