Merge branch 'master' into fradrive/lms-type-refactor

This commit is contained in:
Steffen Jost 2023-07-17 14:51:14 +00:00
commit a06ec1b298
30 changed files with 208 additions and 110 deletions

View File

@ -7,6 +7,7 @@ workflow:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_MERGE_REQUEST_ID - if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_TAG =~ /^v/ - if: $CI_COMMIT_TAG =~ /^v/
- if: $CI_COMMIT_TAG =~ /^t/
default: default:
image: image:
@ -33,8 +34,7 @@ stages:
node dependencies: node dependencies:
stage: frontend:build stage: frontend:build
script: script:
- source .gitlab-ci/construct-flake-url.sh - nix -L build -o result ".#uniworxNodeDependencies"
- nix -L build -o result "${FLAKE}#uniworxNodeDependencies"
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > node-dependencies.nar.xz - nix-store --export $(nix-store -qR result) | xz -T0 -2 > node-dependencies.nar.xz
before_script: &nix-before before_script: &nix-before
- git config --global init.defaultBranch master - git config --global init.defaultBranch master
@ -55,8 +55,7 @@ well known:
stage: frontend:build stage: frontend:build
script: script:
- xzcat node-dependencies.nar.xz | nix-store --import - xzcat node-dependencies.nar.xz | nix-store --import
- source .gitlab-ci/construct-flake-url.sh - nix -L build -o result ".#uniworxWellKnown"
- nix -L build -o result "${FLAKE}#uniworxWellKnown"
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > well-known.nar.xz - nix-store --export $(nix-store -qR result) | xz -T0 -2 > well-known.nar.xz
before_script: *nix-before before_script: *nix-before
needs: needs:
@ -75,8 +74,7 @@ frontend:
script: script:
- xzcat node-dependencies.nar.xz | nix-store --import - xzcat node-dependencies.nar.xz | nix-store --import
- xzcat well-known.nar.xz | nix-store --import - xzcat well-known.nar.xz | nix-store --import
- source .gitlab-ci/construct-flake-url.sh - nix -L build -o result ".#uniworxFrontend"
- nix -L build -o result "${FLAKE}#uniworxFrontend"
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > frontend.nar.xz - nix-store --export $(nix-store -qR result) | xz -T0 -2 > frontend.nar.xz
before_script: *nix-before before_script: *nix-before
needs: needs:
@ -96,8 +94,7 @@ uniworx:lib:uniworx:
stage: backend:build stage: backend:build
script: script:
- xzcat frontend.nar.xz | nix-store --import - xzcat frontend.nar.xz | nix-store --import
- source .gitlab-ci/construct-flake-url.sh - nix -L build -o result ".#uniworx:lib:uniworx"
- nix -L build -o result "${FLAKE}#uniworx:lib:uniworx"
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:lib:uniworx.nar.xz - nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:lib:uniworx.nar.xz
before_script: *nix-before before_script: *nix-before
needs: needs:
@ -119,8 +116,7 @@ uniworx:exe:uniworx:
stage: backend:build stage: backend:build
script: script:
- xzcat uniworx:lib:uniworx.nar.xz | nix-store --import - xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
- source .gitlab-ci/construct-flake-url.sh - nix -L build -o result ".#uniworx:exe:uniworx"
- nix -L build -o result "${FLAKE}#uniworx:exe:uniworx"
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworx.nar.xz - nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworx.nar.xz
before_script: *nix-before before_script: *nix-before
needs: needs:
@ -144,8 +140,7 @@ uniworx:exe:uniworxdb:
stage: backend:build stage: backend:build
script: script:
- xzcat uniworx:lib:uniworx.nar.xz | nix-store --import - xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
- source .gitlab-ci/construct-flake-url.sh - nix -L build -o result ".#uniworx:exe:uniworxdb"
- nix -L build -o result "${FLAKE}#uniworx:exe:uniworxdb"
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworxdb.nar.xz - nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworxdb.nar.xz
before_script: *nix-before before_script: *nix-before
needs: needs:
@ -169,8 +164,7 @@ uniworx:exe:uniworxload:
stage: backend:build stage: backend:build
script: script:
- xzcat uniworx:lib:uniworx.nar.xz | nix-store --import - xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
- source .gitlab-ci/construct-flake-url.sh - nix -L build -o result ".#uniworx:exe:uniworxload"
- nix -L build -o result "${FLAKE}#uniworx:exe:uniworxload"
- nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworxload.nar.xz - nix-store --export $(nix-store -qR result) | xz -T0 -2 > uniworx:exe:uniworxload.nar.xz
before_script: *nix-before before_script: *nix-before
needs: needs:
@ -195,8 +189,7 @@ check:
script: script:
- xzcat frontend.nar.xz | nix-store --import - xzcat frontend.nar.xz | nix-store --import
- xzcat uniworx:lib:uniworx.nar.xz | nix-store --import - xzcat uniworx:lib:uniworx.nar.xz | nix-store --import
- source .gitlab-ci/construct-flake-url.sh - nix -L flake check .
- nix -L flake check ${FLAKE}
before_script: *nix-before before_script: *nix-before
needs: needs:
- job: node dependencies # transitive - job: node dependencies # transitive
@ -214,8 +207,7 @@ container:
stage: container:build stage: container:build
script: script:
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import - xzcat uniworx:exe:uniworx.nar.xz | nix-store --import
- source .gitlab-ci/construct-flake-url.sh - cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxDocker") uniworx.tar.gz
- cp -pr --reflink=auto -L $(nix build --print-out-paths "${FLAKE}#uniworxDocker") uniworx.tar.gz
before_script: *nix-before before_script: *nix-before
needs: needs:
- job: node dependencies # transitive - job: node dependencies # transitive
@ -239,6 +231,34 @@ container:
interruptible: true interruptible: true
rules: &release-rules rules: &release-rules
- if: $CI_COMMIT_TAG =~ /^v/ - if: $CI_COMMIT_TAG =~ /^v/
test container:
stage: container:build
script:
- xzcat uniworx:exe:uniworx.nar.xz | nix-store --import
- cp -pr --reflink=auto -L $(nix build --print-out-paths ".#uniworxTestDocker") uniworx.tar.gz
before_script: *nix-before
needs:
- job: node dependencies # transitive
artifacts: false
- job: well known # transitive
artifacts: false
- job: frontend # tranitive
artifacts: false
- job: uniworx:lib:uniworx # transitive
artifacts: false
- job: uniworx:exe:uniworx
artifacts: true
- job: check # sanity
artifacts: false
artifacts:
paths:
- uniworx.tar.gz
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
expire_in: "1 day"
retry: 2
interruptible: true
rules: &test-release-rules
- if: $CI_COMMIT_TAG =~ /^t/
parse changelog: parse changelog:
stage: prepare release stage: prepare release
@ -249,9 +269,30 @@ parse changelog:
before_script: *nix-before before_script: *nix-before
script: script:
- xzcat node-dependencies.nar.xz | nix-store --import - xzcat node-dependencies.nar.xz | nix-store --import
- source .gitlab-ci/construct-flake-url.sh - nix -L run ".#jqChangelogJson" -- -r '.versions[0].version' > .current-version
- nix -L run "${FLAKE}#jqChangelogJson" -- -r '.versions[0].version' > .current-version - nix -L run ".#jqChangelogJson" -- -r '.versions[0].body' > .current-changelog.md
- nix -L run "${FLAKE}#jqChangelogJson" -- -r '.versions[0].body' > .current-changelog.md - echo "VERSION=$(cat .current-version)" >> build.env
artifacts:
reports:
dotenv: build.env
paths:
- .current-version
- .current-changelog.md
name: "changelog-${CI_COMMIT_SHORT_SHA}"
expire_in: "1 day"
retry: 2
interruptible: true
parse test changelog:
stage: prepare release
needs:
- job: node dependencies
artifacts: true
rules: *test-release-rules
before_script: *nix-before
script:
- xzcat node-dependencies.nar.xz | nix-store --import
- nix -L run ".#jqChangelogJson" -- -r '.versions[0].version' > .current-version
- nix -L run ".#jqChangelogJson" -- -r '.versions[0].body' > .current-changelog.md
- echo "VERSION=$(cat .current-version)" >> build.env - echo "VERSION=$(cat .current-version)" >> build.env
artifacts: artifacts:
reports: reports:
@ -291,6 +332,33 @@ upload container:
artifacts: false artifacts: false
rules: *release-rules rules: *release-rules
retry: 2 retry: 2
upload test container:
variables:
GIT_STRATEGY: none
stage: release
image: quay.io/skopeo/stable:latest
script:
- skopeo --insecure-policy copy --dest-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" docker-archive://$(pwd)/uniworx.tar.gz docker://${CI_REGISTRY}/fradrive/fradrive/test:${CI_COMMIT_REF_NAME}
- skopeo --insecure-policy copy --src-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" --dest-creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" docker://${CI_REGISTRY}/fradrive/fradrive/test:${CI_COMMIT_REF_NAME} docker://${CI_REGISTRY}/fradrive/fradrive/test:latest
needs:
- job: node dependencies # transitive
artifacts: false
- job: well known # transitive
artifacts: false
- job: frontend # tranitive
artifacts: false
- job: uniworx:lib:uniworx # transitive
artifacts: false
- job: uniworx:exe:uniworx # transitive
artifacts: false
- job: test container
artifacts: true
- job: parse test changelog
artifacts: true
- job: check # sanity
artifacts: false
rules: *test-release-rules
retry: 2
release: release:
variables: variables:
@ -309,3 +377,20 @@ release:
artifacts: false artifacts: false
- job: parse changelog - job: parse changelog
artifacts: true artifacts: true
test release:
variables:
GIT_STRATEGY: none
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules: *test-release-rules
script:
- echo "Will create test release ${VERSION}-test..."
release:
name: "${VERSION}-test"
tag_name: '$CI_COMMIT_TAG'
description: .current-changelog.md
needs:
- job: check # sanity
artifacts: false
- job: parse test changelog
artifacts: true

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
if [ -n "${CI_COMMIT_TAG}" ]; then
ref="refs/tags/${CI_COMMIT_TAG}"
else
ref="refs/heads/${CI_COMMIT_BRANCH}"
fi
export FLAKE="git+${CI_REPOSITORY_URL}?rev=${CI_COMMIT_SHA}&ref=${ref}"

View File

@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [27.4.18](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v27.4.14...v27.4.18) (2023-07-17)
## [27.4.17](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v27.4.14...v27.4.17) (2023-07-17)
## [27.4.16](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v27.4.14...v27.4.16) (2023-07-17)
## [27.4.15](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v27.4.14...v27.4.15) (2023-07-17)
## [27.4.14](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v27.4.13...v27.4.14) (2023-07-14) ## [27.4.14](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v27.4.13...v27.4.14) (2023-07-14)

View File

@ -1,3 +1,3 @@
SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de> SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>
SPDX-License-Identifier: AGPL-3.0-or-later SPDX-License-Identifier: AGPL-3.0-or-later

View File

@ -127,7 +127,7 @@
inherit (pkgs.lib) recursiveUpdate; inherit (pkgs.lib) recursiveUpdate;
in { in {
packages = haskellFlake.packages // { packages = haskellFlake.packages // {
inherit (pkgs) uniworxNodeDependencies uniworxWellKnown uniworxFrontend uniworxDemoDocker uniworxDocker changelogJson; inherit (pkgs) uniworxNodeDependencies uniworxWellKnown uniworxFrontend uniworxTestDocker uniworxDocker changelogJson;
}; };
apps = haskellFlake.apps // { apps = haskellFlake.apps // {

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de> # SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>
# #
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
@ -13,15 +13,17 @@ if [ -n "$(git status --porcelain)" ]; then
exit 1 exit 1
fi fi
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then branch="$(git rev-parse --abbrev-ref HEAD)"
echo "Not on master" >&2
if [[ $branch != "master" && $branch != "test" ]]; then
echo "Not on master or test" >&2
exit 1 exit 1
fi fi
ourHash=$(git rev-parse HEAD) ourHash=$(git rev-parse HEAD)
theirHash=$(git ls-remote origin -h refs/heads/master | awk '{ print $1; }') theirHash=$(git ls-remote origin -h refs/heads/$branch | awk '{ print $1; }')
if [ "$theirHash" != "$ourHash" ]; then if [ "$theirHash" != "$ourHash" ]; then
echo "Local HEAD is not up to date with remote master" >&2 echo "Local HEAD is not up to date with remote $branch" >&2
exit 1 exit 1
fi fi

View File

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022-2023 Gregor Kleen <gregor@kleen.consulting>, Sarah Vaupel <sarah.vaupel@ifi.lmu.de>, Steffen Jost <jost@tcs.ifi.lmu.de> # SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor@kleen.consulting>, Steffen Jost <jost@tcs.ifi.lmu.de>
# #
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
@ -14,11 +14,11 @@ let
''); '');
in if self ? lastModified then fromDate else "1970-01-01T00:00:01Z"; in if self ? lastModified then fromDate else "1970-01-01T00:00:01Z";
mkUniworxDocker = { isDemo }: prev.dockerTools.buildImage { mkUniworxDocker = { isTest }: prev.dockerTools.buildImage {
name = "uniworx${optionalString isDemo "-demo"}"; name = "uniworx${optionalString isTest "-test"}";
tag = tag =
let let
versionFile = if isDemo then ./demo-version.json else ./version.json; versionFile = if isTest then ./test-version.json else ./version.json;
in (builtins.fromJSON (prev.lib.readFile versionFile)).version; in (builtins.fromJSON (prev.lib.readFile versionFile)).version;
inherit created; inherit created;
@ -44,7 +44,7 @@ let
curl wget netcat openldap curl wget netcat openldap
unixtools.netstat htop gnugrep unixtools.netstat htop gnugrep
locale locale
] ++ optionals isDemo [ postgresql_12 memcached uniworx.uniworx.components.exes.uniworxdb ]; ];
runAsRoot = '' runAsRoot = ''
#!${final.stdenv.shell} #!${final.stdenv.shell}
@ -62,18 +62,6 @@ let
# just to see how to create directories here # just to see how to create directories here
mkdir -p /testdir mkdir -p /testdir
${optionalString isDemo ''
install -d -g uniworx -o uniworx -m 0750 /var/lib/postgres
install -d -g uniworx -o uniworx -m 0750 /var/lib/memcached
install -d -g uniworx -o uniworx -m 0755 /var/log/postgres
install -d -g uniworx -o uniworx -m 0755 /var/log/memcached
mkdir -p /run
install -d -g uniworx -o uniworx -m 0755 /run/postgres
''}
''; '';
config = config =
@ -83,27 +71,6 @@ let
cTime=$(date -Is) cTime=$(date -Is)
${optionalString isDemo ''
pgDir=/var/lib/postgres
pgSockDir=/run/postgres
pgLogFile=/var/log/postgres/''${cTime}.log
export PGHOST=''${pgSockDir}
export PGLOG=''${pgLogFile}
pgNew=
if [[ -n "$(find ''${pgDir} -maxdepth 0 -type d -empty 2>/dev/null)" ]]; then
pgNew=1
fi
[[ -z "''${pgNew}" ]] || initdb --no-locale --encoding=UTF8 --username postgres --pgdata ''${pgDir}
pg_ctl start -D ''${pgDir} -l ''${pgLogFile} -w -o "-k ''${pgSockDir} -c listen_addresses= -c hba_file=${postgresHba} -c unix_socket_permissions=0777 -c max_connections=9990 -c shared_preload_libraries=pg_stat_statements -c auto_explain.log_min_duration=100ms"
[[ -z "''${pgNew}" ]] || psql -f ${postgresSchema} postgres postgres
( cd /var/lib/memcached; memcached -p 11212 ) &>/var/log/memcached/''${cTime}.log &
export SESSION_MEMCACHED_HOST=localhost
export SESSION_MEMCACHED_PORT=11212
''}
# export LOGDEST=/var/log/uniworx/''${cTime}.log # kubernetes prefers log via stdout # export LOGDEST=/var/log/uniworx/''${cTime}.log # kubernetes prefers log via stdout
typeset -a configs typeset -a configs
configs=() configs=()
@ -115,9 +82,6 @@ let
fi fi
configs+=('${uniworxConfig}') configs+=('${uniworxConfig}')
cd /var/lib/uniworx cd /var/lib/uniworx
${optionalString isDemo ''
[[ -z "''${pgNew}" ]] || uniworxdb -f ''${configs}
''}
exec -- uniworx ''${configs} exec -- uniworx ''${configs}
''; '';
postgresSchema = prev.writeText "schema.sql" '' postgresSchema = prev.writeText "schema.sql" ''
@ -142,13 +106,11 @@ let
Volumes = { Volumes = {
"/var/lib/uniworx" = {}; "/var/lib/uniworx" = {};
"/var/log" = {}; "/var/log" = {};
} // optionalAttrs isDemo {
"/var/lib/postgres" = {};
}; };
}; };
}; };
in in
mapAttrs (_name: mkUniworxDocker) { mapAttrs (_name: mkUniworxDocker) {
uniworxDemoDocker = { isDemo = true; }; uniworxTestDocker = { isTest = true; };
uniworxDocker = { isDemo = false; }; uniworxDocker = { isTest = false; };
} }

View File

@ -1,3 +0,0 @@
{
"version": "27.4.14"
}

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>
SPDX-License-Identifier: AGPL-3.0-or-later

View File

@ -0,0 +1,3 @@
{
"version": "27.4.18"
}

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>, Steffen Jost <jost@tcs.ifi.lmu.de>
SPDX-License-Identifier: AGPL-3.0-or-later

View File

@ -1,3 +1,3 @@
{ {
"version": "27.4.14" "version": "27.4.18"
} }

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor@kleen.consulting>
SPDX-License-Identifier: AGPL-3.0-or-later

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor@kleen.consulting>
SPDX-License-Identifier: AGPL-3.0-or-later

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "uni2work", "name": "uni2work",
"version": "27.4.14", "version": "27.4.18",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "uni2work", "name": "uni2work",
"version": "27.4.14", "version": "27.4.18",
"description": "", "description": "",
"keywords": [], "keywords": [],
"author": "", "author": "",
@ -23,9 +23,9 @@
"frontend:build": "webpack --progress", "frontend:build": "webpack --progress",
"frontend:build:watch": "webpack --watch --progress", "frontend:build:watch": "webpack --watch --progress",
"i18n:test": "./missing-translations.sh", "i18n:test": "./missing-translations.sh",
"prerelease": "npm run test", "prerelease": "./is-clean.sh && npm run test",
"release": "standard-version -a", "release": "./release.sh",
"postrelease": "git push --follow-tags origin master", "postrelease": "git push --follow-tags",
"parse-changelog": "changelog-parser ./CHANGELOG.md > changelog.json" "parse-changelog": "changelog-parser ./CHANGELOG.md > changelog.json"
}, },
"husky": { "husky": {

View File

@ -1,3 +1,3 @@
SPDX-FileCopyrightText: 2022 Felix Hamann <felix.hamann@campus.lmu.de>,Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de> SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel <sarah.vaupel@uniworx.de>, Felix Hamann <felix.hamann@campus.lmu.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>, Steffen Jost <jost@tcs.ifi.lmu.de>
SPDX-License-Identifier: AGPL-3.0-or-later SPDX-License-Identifier: AGPL-3.0-or-later

View File

@ -1,5 +1,5 @@
name: uniworx name: uniworx
version: 27.4.14 version: 27.4.18
dependencies: dependencies:
- base - base
- yesod - yesod

20
release.sh Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2023 Sarah Vaupel <sarah.vaupel@uniworx.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
set -e
case "$(git rev-parse --abbrev-ref HEAD)" in
"master" | "main")
standard-version -a
;;
"test")
standard-version -a -t t
;;
*)
echo "Current branch not supported for release!"
exit 1
;;
esac

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Steffen Jost <S.Jost@Fraport.de>
SPDX-License-Identifier: LicenseRef-Fraport-Corporate-Design

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Steffen Jost <S.Jost@Fraport.de>
SPDX-License-Identifier: LicenseRef-Fraport-Corporate-Design

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Steffen Jost <S.Jost@Fraport.de>
SPDX-License-Identifier: LicenseRef-Fraport-Corporate-Design

View File

@ -118,9 +118,8 @@ instance Finite JobTableAction
nullaryPathPiece ''JobTableAction $ camelToPathPiece' 1 nullaryPathPiece ''JobTableAction $ camelToPathPiece' 1
embedRenderMessage ''UniWorX ''JobTableAction id embedRenderMessage ''UniWorX ''JobTableAction id
-- Not yet needed, since there is no additional data for now (also, postprocess did not type somehow) data JobTableActionData = ActJobDeleteData
-- data JobTableActionData = ActJobDeleteData deriving (Eq, Ord, Read, Show, Generic)
-- deriving (Eq, Ord, Read, Show, Generic)
getAdminJobsR, postAdminJobsR :: Handler Html getAdminJobsR, postAdminJobsR :: Handler Html
@ -164,13 +163,13 @@ postAdminJobsR = do
prismAForm (singletonFilter "job" . maybePrism _PathPiece) mPrev $ aopt (hoistField lift textField) (fslI MsgTableJob) prismAForm (singletonFilter "job" . maybePrism _PathPiece) mPrev $ aopt (hoistField lift textField) (fslI MsgTableJob)
] ]
dbtStyle = def { dbsFilterLayout = defaultDBSFilterLayout } dbtStyle = def { dbsFilterLayout = defaultDBSFilterLayout }
acts :: Map JobTableAction (AForm Handler JobTableAction) acts :: Map JobTableAction (AForm Handler JobTableActionData)
acts = Map.singleton ActJobDelete $ pure ActJobDelete acts = Map.singleton ActJobDelete $ pure ActJobDeleteData
dbtParams = DBParamsForm dbtParams = DBParamsForm
{ dbParamsFormAdditional = { dbParamsFormAdditional =
renderAForm FormStandard renderAForm FormStandard
$ (, mempty) . First . Just $ (, mempty) . First . Just
<$> multiActionA acts (fslI MsgTableAction) Nothing <$> multiActionA acts (fslI MsgTableAction) Nothing
, dbParamsFormMethod = POST , dbParamsFormMethod = POST
, dbParamsFormAction = Nothing -- Just $ SomeRoute currentRoute , dbParamsFormAction = Nothing -- Just $ SomeRoute currentRoute
, dbParamsFormAttrs = [] , dbParamsFormAttrs = []
@ -185,8 +184,8 @@ postAdminJobsR = do
-- jobsDBTableValidator :: PSValidator (MForm Handler) (FormResult (First JobTableAction, DBFormResult QueuedJobId Bool (DBRow (Entity QueuedJob)))) -- jobsDBTableValidator :: PSValidator (MForm Handler) (FormResult (First JobTableAction, DBFormResult QueuedJobId Bool (DBRow (Entity QueuedJob))))
jobsDBTableValidator = def jobsDBTableValidator = def
& defaultSorting [SortDescBy "creation-time"] & defaultSorting [SortDescBy "creation-time"]
-- postprocess :: FormResult (First JobTableAction, DBFormResult QueuedJobId Bool (DBRow (Entity QueuedJob))) postprocess :: FormResult (First JobTableActionData, DBFormResult QueuedJobId Bool (DBRow (Entity QueuedJob)))
-- -> FormResult (JobTableAction, Set QueuedJobId) -> FormResult (JobTableActionData, Set QueuedJobId)
postprocess inp = do postprocess inp = do
(First (Just act), jobMap) <- inp (First (Just act), jobMap) <- inp
let jobSet = Map.keysSet . Map.filter id $ getDBFormResult (const False) jobMap let jobSet = Map.keysSet . Map.filter id $ getDBFormResult (const False) jobMap
@ -194,13 +193,13 @@ postAdminJobsR = do
(jobActRes, jobsTable) <- runDB (over _1 postprocess <$> dbTable jobsDBTableValidator jobsDBTable) (jobActRes, jobsTable) <- runDB (over _1 postprocess <$> dbTable jobsDBTableValidator jobsDBTable)
formResult jobActRes $ \case formResult jobActRes $ \case
(ActJobDelete, jobIds) -> do (ActJobDeleteData, jobIds) -> do
let jobReq = length jobIds let jobReq = length jobIds
rmvd <- fromIntegral <$> runDB (deleteWhereCount rmvd <- runDB $ fromIntegral <$> deleteWhereCount
[ QueuedJobLockTime ==. Nothing [ QueuedJobLockTime ==. Nothing
, QueuedJobLockInstance ==. Nothing , QueuedJobLockInstance ==. Nothing
, QueuedJobId <-. Set.toList jobIds , QueuedJobId <-. Set.toList jobIds
]) ]
addMessageI (bool Success Warning $ rmvd < jobReq) (MsgTableJobActDeleteFeedback rmvd jobReq) addMessageI (bool Success Warning $ rmvd < jobReq) (MsgTableJobActDeleteFeedback rmvd jobReq)
reloadKeepGetParams AdminJobsR reloadKeepGetParams AdminJobsR

View File

@ -1,3 +1,4 @@
-- SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel <sarah.vaupel@uniworx.de>, Steffen Jost <S.Jost@Fraport.de>
-- --
-- SPDX-License-Identifier: AGPL-3.0-or-later -- SPDX-License-Identifier: AGPL-3.0-or-later

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Steffen Jost <S.Jost@Fraport.de>
SPDX-License-Identifier: LicenseRef-Fraport-Corporate-Design

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Steffen Jost <S.Jost@Fraport.de>
SPDX-License-Identifier: LicenseRef-Fraport-Corporate-Design

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Steffen Jost <S.Jost@Fraport.de>
SPDX-License-Identifier: LicenseRef-Fraport-Corporate-Design

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Steffen Jost <S.Jost@Fraport.de>
SPDX-License-Identifier: LicenseRef-Fraport-Corporate-Design

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Steffen Jost <S.Jost@Fraport.de>
SPDX-License-Identifier: LicenseRef-Fraport-Corporate-Design

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Steffen Jost <S.Jost@Fraport.de>
SPDX-License-Identifier: LicenseRef-Fraport-Corporate-Design