diff --git a/.github/workflows/debug-workflow.yml b/.github/workflows/debug-workflow.yml index 949b0c8673..63d61530a8 100644 --- a/.github/workflows/debug-workflow.yml +++ b/.github/workflows/debug-workflow.yml @@ -1,4 +1,4 @@ -on: push +on: deployment jobs: test-job: @@ -6,7 +6,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Test - run: echo "Hey" - name: Test actions - uses: Janmtbehrens/OpenSlides/dev/actions/test-submodule@main \ No newline at end of file + uses: Janmtbehrens/OpenSlides/dev/actions/build-and-test-service@all-in-one + with: + service: auth \ No newline at end of file diff --git a/.github/workflows/pick-to-staging.yml b/.github/workflows/pick-to-staging.yml index 7191ed4d14..5cdab2b51f 100644 --- a/.github/workflows/pick-to-staging.yml +++ b/.github/workflows/pick-to-staging.yml @@ -63,4 +63,3 @@ jobs: reviewers: ${{ github.event.pull_request.user.login }} assignees: ${{ github.event.pull_request.user.login }} labels: picked-to-staging - milestone: 4 diff --git a/Makefile b/Makefile index 256729a55f..5540dd9c6d 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ run-dev-otel: | build-dev build-dev: sed -i "1s/.*/$(GO_VERSION)/" $(DOCKER_PATH)/workspaces/*.work chmod +x $(SCRIPT_PATH)/makefile/build-all-submodules.sh - $(SCRIPT_PATH)/makefile/build-all-submodules.sh + $(SCRIPT_PATH)/makefile/build-all-submodules.sh dev # Run the tests of all services run-service-tests: diff --git a/VERSION b/VERSION index 166f28a9bd..c0b0f22a1f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.8-dev +4.2.14 diff --git a/dev/actions/build-and-test-service/action-run.sh b/dev/actions/build-and-test-service/action-run.sh new file mode 100644 index 0000000000..d586db646a --- /dev/null +++ b/dev/actions/build-and-test-service/action-run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +bash dev/run-tests.sh + diff --git a/dev/actions/build-and-test-service/action.yml b/dev/actions/build-and-test-service/action.yml new file mode 100644 index 0000000000..d57cebe190 --- /dev/null +++ b/dev/actions/build-and-test-service/action.yml @@ -0,0 +1,19 @@ +name: 'Build and run service tests' +description: 'Build test context image and runs all tests of service.' + +inputs: + service: + description: 'Name of the service. Examples: proxy, auth, datastore' + required: true + +runs: + using: "composite" + steps: + - name: "Build Test" + uses: Janmtbehrens/OpenSlides/dev/actions/build-service@all-in-one + with: + service: ${{ inputs.service }} + context: tests + - name: "Test Service" + shell: bash + run: bash $GITHUB_ACTION_PATH/action-run.sh diff --git a/dev/actions/build-service/action-run.sh b/dev/actions/build-service/action-run.sh index db86c9390d..d40b95b911 100644 --- a/dev/actions/build-service/action-run.sh +++ b/dev/actions/build-service/action-run.sh @@ -1,6 +1,4 @@ #!/bin/bash -printenv - -chmod +x ${GITHUB_ACTION_PATH}/../../scripts/makefile/build-service.sh -${GITHUB_ACTION_PATH}/../../scripts/makefile/build-service.sh ${SERVICE} ${CONTEXT} ${MODULE} ${PORT} \ No newline at end of file +chmod +x "${GITHUB_ACTION_PATH}"/../../scripts/makefile/build-service.sh +"${GITHUB_ACTION_PATH}"/../../scripts/makefile/build-service.sh "${SERVICE}" "${CONTEXT}" "${MODULE}" "${PORT}" \ No newline at end of file diff --git a/dev/actions/test-submodule/action-run.sh b/dev/actions/test-submodule/action-run.sh deleted file mode 100644 index 4997771322..0000000000 --- a/dev/actions/test-submodule/action-run.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo "I know my path" -echo $GITHUB_ACTION_PATH - diff --git a/dev/actions/test-submodule/action.yml b/dev/actions/test-submodule/action.yml deleted file mode 100644 index b0f635d39d..0000000000 --- a/dev/actions/test-submodule/action.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: 'Run submodule tests' -description: 'Runs make run-test and supplies all necessary files.' - -runs: - using: "composite" - steps: - - name: "Test Build" - shell: bash - run: bash $GITHUB_ACTION_PATH/action-run.sh diff --git a/dev/docker/build.sh b/dev/docker/build.sh index da804976e3..277032edfa 100755 --- a/dev/docker/build.sh +++ b/dev/docker/build.sh @@ -37,7 +37,7 @@ OPT_IMAGES= usage() { cat << EOF -Usage: $(basename ${BASH_SOURCE[0]}) [] ... +Usage: $(basename "${BASH_SOURCE[0]}") [] ... Options: -D, --docker-repo Specify a Docker repository @@ -58,8 +58,8 @@ fi shortopt="hr:D:t:" longopt="help,docker-repo:,tag:,no-cache,ask-push,yes,images" -ARGS=$(getopt -o "$shortopt" -l "$longopt" -n "$ME" -- "$@") -if [ $? -ne 0 ]; then usage; exit 1; fi +ARGS=$(getopt -o "$shortopt" -l "$longopt" -n "$ME" -- "$@") || { usage; exit 1; } + eval set -- "$ARGS"; unset ARGS @@ -75,7 +75,7 @@ while true; do shift 2 ;; --no-cache) - OPTIONS+="--no-cache" + OPTIONS+=("--no-cache") shift 1 ;; --ask-push) @@ -96,9 +96,8 @@ while true; do esac done -SELECTED_TARGETS=($@) -[[ "${#SELECTED_TARGETS[@]}" -ge 1 ]] || SELECTED_TARGETS=("${DEFAULT_TARGETS[@]}") -[[ "${SELECTED_TARGETS[@]}" != "all" ]] || SELECTED_TARGETS=("${!TARGETS[@]}") +SELECTED_TARGETS=("$@") +if [ "$#" == 0 ]; then SELECTED_TARGETS=("${DEFAULT_TARGETS[@]}"); elif [ "$*" = "all" ]; then SELECTED_TARGETS=("${!TARGETS[@]}"); fi OPTIONS+=(--build-arg "VERSION=$DOCKER_TAG") @@ -122,7 +121,7 @@ for i in "${SELECTED_TARGETS[@]}"; do fi echo "Building $img..." - cd $loc + cd "$loc" || exit 1 { printf '{\n' printf '\t"service": "%s,\n' "${i}" @@ -152,7 +151,7 @@ if [[ "${#BUILT_IMAGES[@]}" -ge 1 ]]; then printf "\nSuccessfully built images:\n\n" for i in "${BUILT_IMAGES[@]}"; do read -r img x <<< "$i" - printf " - $img\n" + printf " - %s\n" "$img" done else echo "No images were built." @@ -161,14 +160,14 @@ fi [[ -n "$ASK_PUSH" ]] || exit 0 -if [ -n $OPT_YES ] || ! hash whiptail > /dev/null 2>&1; then +if [ -n "$OPT_YES" ] || ! hash whiptail > /dev/null 2>&1; then echo for i in "${BUILT_IMAGES[@]}"; do read -r img x <<< "$i" - if [ -n $OPT_YES ]; then + if [ -n "$OPT_YES" ]; then REPL=y else - read -p "Push image '$img' to repository? [Y/n] " REPL + read -r -p "Push image '$img' to repository? [Y/n] " REPL fi case "$REPL" in N|n|No|no|NO) exit 0;; @@ -176,12 +175,12 @@ if [ -n $OPT_YES ] || ! hash whiptail > /dev/null 2>&1; then esac done else - while read img; do + while read -r img; do echo "Pushing ${img}." docker push "$img" done < <( whiptail --title "OpenSlides build script" \ --checklist "Select images to push to their registry." \ 25 78 16 --separate-output --noitem --clear \ - ${BUILT_IMAGES[@]} \ + "${BUILT_IMAGES[@]}" \ 3>&2 2>&1 1>&3 ) fi diff --git a/dev/docker/docker-compose.dev.yml b/dev/docker/docker-compose.dev.yml index fe7f158242..389d4ef353 100644 --- a/dev/docker/docker-compose.dev.yml +++ b/dev/docker/docker-compose.dev.yml @@ -1,6 +1,13 @@ version: "3" services: datastore-reader: + build: + context: ../../openslides-datastore-service + target: "dev" + args: + CONTEXT: "dev" + MODULE: "reader" + PORT: "9010" image: openslides-datastore-reader-dev depends_on: - postgres @@ -15,6 +22,13 @@ services: - 5680:5678 datastore-writer: + build: + context: ../../openslides-datastore-service + target: "dev" + args: + CONTEXT: "dev" + MODULE: "writer" + PORT: "9011" image: openslides-datastore-writer-dev depends_on: - postgres @@ -37,6 +51,11 @@ services: - POSTGRES_DB=openslides client: + build: + context: ../../openslides-client + target: "dev" + args: + CONTEXT: "dev" image: openslides-client-dev env_file: services.env environment: @@ -46,6 +65,11 @@ services: - ../../openslides-client/client/cli:/app/cli backend: + build: + context: ../../openslides-backend + target: "dev" + args: + CONTEXT: "dev" image: openslides-backend-dev depends_on: - datastore-reader @@ -77,6 +101,11 @@ services: - ../../openslides-backend/scripts:/app/scripts autoupdate: + build: + context: ../../openslides-autoupdate-service + target: "dev" + args: + CONTEXT: "dev" image: openslides-autoupdate-dev depends_on: - datastore-reader @@ -95,6 +124,11 @@ services: - "9012:9012" icc: + build: + context: ../../openslides-icc-service + target: "dev" + args: + CONTEXT: "dev" image: openslides-icc-dev depends_on: - datastore-reader @@ -112,6 +146,11 @@ services: - "9007:9007" search: + build: + context: ../../openslides-search-service + target: "dev" + args: + CONTEXT: "dev" image: openslides-search-dev depends_on: - autoupdate @@ -129,6 +168,11 @@ services: - "9050:9050" auth: + build: + context: ../../openslides-auth-service + target: "dev" + args: + CONTEXT: "dev" image: openslides-auth-dev depends_on: - datastore-reader @@ -142,6 +186,11 @@ services: - "9004:9004" media: + build: + context: ../../openslides-media-service + target: "dev" + args: + CONTEXT: "dev" image: openslides-media-dev depends_on: - backend @@ -153,6 +202,11 @@ services: - ../../openslides-media-service/src:/app/src manage: + build: + context: ../../openslides-manage-service + target: "dev" + args: + CONTEXT: "dev" image: openslides-manage-dev depends_on: - auth @@ -169,6 +223,11 @@ services: - "6379:6379" proxy: + build: + context: ../../openslides-proxy + target: "dev" + args: + CONTEXT: "dev" image: openslides-proxy-dev depends_on: - client @@ -185,6 +244,11 @@ services: - "8025:8025" # web ui to check mails manually vote: + build: + context: ../../openslides-vote-service + target: "dev" + args: + CONTEXT: "dev" image: openslides-vote-dev depends_on: - auth diff --git a/dev/scripts/co-branch.sh b/dev/scripts/co-branch.sh index 7d2a07d74c..80d636b07f 100755 --- a/dev/scripts/co-branch.sh +++ b/dev/scripts/co-branch.sh @@ -24,7 +24,7 @@ set_remote() { } verify_branch() { - git fetch $REMOTE_NAME + git fetch "$REMOTE_NAME" git rev-parse --verify remotes/"$REMOTE_NAME"/"$BRANCH_NAME" &>/dev/null || BRANCH_NAME=main } @@ -35,8 +35,8 @@ pull_latest_commit() { git checkout "$REMOTE_NAME/$BRANCH_NAME" else echo "git checkout $BRANCH_NAME && git pull --ff-only $REMOTE_NAME $BRANCH_NAME ..." - git checkout "$BRANCH_NAME" && - git pull --ff-only "$REMOTE_NAME" "$BRANCH_NAME" || { + { git checkout "$BRANCH_NAME" && + git pull --ff-only "$REMOTE_NAME" "$BRANCH_NAME"; } || { echo "ERROR: make sure a local branch $BRANCH_NAME exists and can be fast-forwarded to $REMOTE_NAME" exit 1 } @@ -46,10 +46,10 @@ pull_latest_commit() { run_switch () { # First check for changes and stash them if wanted. echo "Check for changes..." - if [[ `git status --porcelain --ignore-submodules --untracked-files=no` ]]; then + if [[ $(git status --porcelain --ignore-submodules --untracked-files=no) ]]; then echo "The repository $mod has changes. Stash them? [y/n]" - read decision - if [ $decision == "y" ]; then + read -r decision + if [ "$decision" == "y" ]; then git stash else exit 0 @@ -59,10 +59,10 @@ run_switch () { ( echo "Check for changes..." cd "$mod" - if [[ `git status --porcelain` ]]; then + if [[ $(git status --porcelain) ]]; then echo "The repository $mod has changes. Stash them? [y/n]" - read decision - if [ $decision == "y" ]; then + read -r decision + if [ "$decision" == "y" ]; then git stash else exit 0 @@ -88,8 +88,8 @@ if [ $# -eq 0 ]; then usage echo "" echo "Do you want to want to proceed with branch main in remote ${REMOTE_NAME}? [y/n]" - read sw - if [ $sw == "y" ]; then + read -r sw + if [ "$sw" == "y" ]; then run_switch fi exit 0 diff --git a/dev/scripts/db.sh b/dev/scripts/db.sh index d81320ebff..fa233c91b0 100755 --- a/dev/scripts/db.sh +++ b/dev/scripts/db.sh @@ -1,3 +1,3 @@ #!/bin/bash -cd "$(dirname $0)" +cd "$(dirname "$0")" || exit 1 docker compose -f ../docker/docker-compose.dev.yml exec datastore-writer psql postgresql://openslides:openslides@postgres/openslides diff --git a/dev/scripts/dc-dev.sh b/dev/scripts/dc-dev.sh index 730a3397f9..30ec131795 100755 --- a/dev/scripts/dc-dev.sh +++ b/dev/scripts/dc-dev.sh @@ -1,3 +1,3 @@ #!/bin/bash -cd "$(dirname $0)" -docker compose -f ../docker/docker-compose.dev.yml $@ +cd "$(dirname "$0")" || exit 1 +docker compose -f ../docker/docker-compose.dev.yml "$@" diff --git a/dev/scripts/export-ds.sh b/dev/scripts/export-ds.sh index 9eb82d82e4..8f6eaa47a2 100755 --- a/dev/scripts/export-ds.sh +++ b/dev/scripts/export-ds.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -cd "$(dirname $0)" +cd "$(dirname "$0")" || exit 1 TARGET=${1:-export.json} docker compose -f ../docker/docker-compose.dev.yml exec -T datastore-writer python cli/export_data_only.py > "$TARGET" diff --git a/dev/scripts/extract-translations.sh b/dev/scripts/extract-translations.sh index 6ed71d96b3..b2644cf0ef 100755 --- a/dev/scripts/extract-translations.sh +++ b/dev/scripts/extract-translations.sh @@ -1,6 +1,6 @@ #!/bin/bash -cd "$(dirname $0)" +cd "$(dirname "$0")" || exit 1 # extract translations ./dc-dev.sh exec client npm run extract @@ -8,7 +8,7 @@ cd "$(dirname $0)" # merge translations echo "merging POT files..." -cd ../.. +cd ../.. || exit 1 xgettext --no-location --omit-header -o i18n/template-en.pot \ openslides-client/client/src/assets/i18n/template-en.pot \ openslides-backend/openslides_backend/i18n/messages/template-en.pot diff --git a/dev/scripts/git-fetch-and-merge-upstream.sh b/dev/scripts/git-fetch-and-merge-upstream.sh new file mode 100644 index 0000000000..eb17b7b0ec --- /dev/null +++ b/dev/scripts/git-fetch-and-merge-upstream.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# Import OpenSlides utils package +. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/util.sh" + +# Fetches and merges all submodules with their respective upstream/main repositories. + +export SINGLE_TARGET=$1 + +fetch_merge_push() { + export SUBMODULE=$1 + export SOURCE=$2 + + info "Fetch & merge for ${SUBMODULE} " + + GIT_UPDATE=$(git remote update "$SOURCE") + export GIT_UPDATE + GIT_FETCH=$(git fetch "$SOURCE") + export GIT_FETCH + + export ERROR=0 + git merge "$SOURCE"/main || export ERROR=1 + + if [ "$SOURCE" == 'origin' ]; then return; fi + + if [ "$ERROR" == 1 ]; then (git commit && git push) ; fi + if [ "$ERROR" == 0 ]; then (git push) ; fi +} + +update_meta(){ + if [ -d "meta" ] + then + ( + cd meta || exit + (fetch_merge_push meta origin) + ) + fi +} + + +IFS=$'\n' +for DIR in $(git submodule foreach --recursive -q sh -c pwd); do + # Extract submodule name + cd "$DIR" || exit && \ + + DIRNAME=${PWD##*/} && \ + export DIRNAME && \ + SUBMODULE=${DIRNAME//"openslides-"} && \ + export SUBMODULE && \ + + if [ "$SUBMODULE" == 'go' ]; then continue; fi && \ + if [ "$SUBMODULE" == 'meta' ]; then continue; fi && \ + + # Check for single target + if [ $# -eq 2 ]; then if [[ "$SINGLE_TARGET" != "$SUBMODULE" ]]; then continue; fi; fi && \ + + # Recursively Update Meta too + update_meta && \ + + # Git commit + fetch_merge_push "${SUBMODULE}" upstream +done +wait \ No newline at end of file diff --git a/dev/scripts/git-push-all-submodules.sh b/dev/scripts/git-push-all-submodules.sh index 1cae1f9443..8f9fe51fa9 100644 --- a/dev/scripts/git-push-all-submodules.sh +++ b/dev/scripts/git-push-all-submodules.sh @@ -1,7 +1,7 @@ #!/bin/bash # Import OpenSlides utils package -. $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/util.sh +. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/util.sh" # Commits and pushes all submodules to their respective repositories. # The same Commit Message is reused for all Commits @@ -20,20 +20,23 @@ export SINGLE_TARGET=$2 IFS=$'\n' for DIR in $(git submodule foreach --recursive -q sh -c pwd); do # Extract submodule name - cd "$DIR" && \ - export DIRNAME=${PWD##*/} && \ - export SUBMODULE=${DIRNAME//"openslides-"} && \ + cd "$DIR" || exit && \ - if [ $SUBMODULE == 'go' ]; then continue; fi && \ - if [ $SUBMODULE == 'meta' ]; then continue; fi && \ + DIRNAME=${PWD##*/} && \ + export DIRNAME && \ + SUBMODULE=${DIRNAME//"openslides-"} && \ + export SUBMODULE && \ + + if [ "$SUBMODULE" == 'go' ]; then continue; fi && \ + if [ "$SUBMODULE" == 'meta' ]; then continue; fi && \ # Check for single target - if [ $# -eq 2 ]; then if [[ $SINGLE_TARGET != $SUBMODULE ]]; then continue; fi; fi && \ + if [ $# -eq 2 ]; then if [[ "$SINGLE_TARGET" != "$SUBMODULE" ]]; then continue; fi; fi && \ # Git commit info "Commit & push for ${SUBMODULE} " && \ git add -u . && \ - git commit -a -m $MESSAGE && \ + git commit -a -m "$MESSAGE" && \ git push done wait \ No newline at end of file diff --git a/dev/scripts/git-setup-forked-submodule.sh b/dev/scripts/git-setup-forked-submodule.sh index be9082e29c..47def6d4f2 100644 --- a/dev/scripts/git-setup-forked-submodule.sh +++ b/dev/scripts/git-setup-forked-submodule.sh @@ -1,13 +1,21 @@ +#!/bin/bash + +# Import OpenSlides utils package +. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/util.sh" + # Creates a remote to given submodule. # Call this from project root path # Parameter #1 : abbreviated name of the submodule (eg. auth-service, backend, proxy, icc-service) # Parameter #2 : name of your github fork repository -if [ -z $1 ]; then echo "Parameter #1 missing"; exit; fi -if [ -z $2 ]; then echo "Parameter #2 missing"; exit; fi +if [ -z "$1" ]; then echo "Parameter #1 missing"; exit; fi +if [ -z "$2" ]; then echo "Parameter #2 missing"; exit; fi + +info "Forking $2/openslides-$1" -cd ./openslides-$1 +( +cd ./openslides-"$1" || exit git remote rename origin upstream -git remote add origin git@github.com:$2/openslides-$1.git +git remote add origin git@github.com:"$2"/openslides-"$1".git git fetch upstream git remote -v -cd .. \ No newline at end of file +) \ No newline at end of file diff --git a/dev/scripts/lint-dockerfiles.sh b/dev/scripts/lint-dockerfiles.sh index 3825cb189f..b067785376 100644 --- a/dev/scripts/lint-dockerfiles.sh +++ b/dev/scripts/lint-dockerfiles.sh @@ -1,7 +1,7 @@ #!/bin/bash # Import OpenSlides utils package -. $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/util.sh +. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/util.sh" export SINGLE_TARGET=$1 @@ -14,19 +14,23 @@ LOCAL_PWD=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) IFS=$'\n' for DIR in $(git submodule foreach --recursive -q sh -c pwd); do - # Extract submodule name - cd "$DIR" && \ - export DIRNAME=${PWD##*/} && \ - export SUBMODULE=${DIRNAME//"openslides-"} && \ - if [ $SUBMODULE == 'meta' ]; then continue; fi && \ - if [ $SUBMODULE == 'go' ]; then continue; fi && \ + # Extract submodule name + cd "$DIR" || exit && \ + + DIRNAME=${PWD##*/} && \ + export DIRNAME && \ + SUBMODULE=${DIRNAME//"openslides-"} && \ + export SUBMODULE && \ + + if [ "$SUBMODULE" == 'go' ]; then continue; fi && \ + if [ "$SUBMODULE" == 'meta' ]; then continue; fi && \ # Check for single target - if [ $# -eq 1 ]; then if [[ $SINGLE_TARGET != $SUBMODULE ]]; then continue; fi; fi && \ + if [ $# -eq 1 ]; then if [[ "$SINGLE_TARGET" != "$SUBMODULE" ]]; then continue; fi; fi && \ # Execute test info " Linting Dockerfile for ${SUBMODULE}:" && \ - docker run --rm -i -v /${LOCAL_PWD}/.hadolint.yaml:/.config/hadolint.yaml ghcr.io/hadolint/hadolint < Dockerfile + docker run --rm -i -v /"${LOCAL_PWD}"/.hadolint.yaml:/.config/hadolint.yaml ghcr.io/hadolint/hadolint < Dockerfile done wait \ No newline at end of file diff --git a/dev/scripts/lint-shell-scripts.sh b/dev/scripts/lint-shell-scripts.sh new file mode 100644 index 0000000000..e9c77ef0a3 --- /dev/null +++ b/dev/scripts/lint-shell-scripts.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Import OpenSlides utils package +. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/util.sh" + +export SINGLE_TARGET=$1 + +lint_all_files() { + # Finds all files with a valid shebang at the beginning. Grep outputs the filename as well as the shebang itself. + # The shebang is cut out so that only the filename remains. This filename is then used as an input parameter for shellcheck + find . -type f -exec grep -EH '^#!(.*/|.*env +)(sh|bash|ksh)' {} \; | cut -d: -f1 | xargs shellcheck -e SC1090,SC1091 +} + +# This uses Shellcheck (https://github.com/koalaman/shellcheck) to lint all Service shell-scripts as well as the dev folder + +# Call Shellcheck on each Submodule shell-scripts +[[ "$*" != "" ]] || ( + LOCAL_PWD=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + cd "$LOCAL_PWD"/.. || exit + info " Linting shell-scripts for dev:" && \ + lint_all_files +) + +IFS=$'\n' +for DIR in $(git submodule foreach --recursive -q sh -c pwd); do + # Extract submodule name + cd "$DIR" || exit && \ + + DIRNAME=${PWD##*/} && \ + export DIRNAME && \ + SUBMODULE=${DIRNAME//"openslides-"} && \ + export SUBMODULE && \ + + if [ "$SUBMODULE" == 'go' ]; then continue; fi && \ + if [ "$SUBMODULE" == 'meta' ]; then continue; fi && \ + + # Check for single target + if [ $# -eq 1 ]; then if [[ "$SINGLE_TARGET" != "$SUBMODULE" ]]; then continue; fi; fi && \ + + # Execute test + info " Linting shell-scripts for ${SUBMODULE}:" && \ + lint_all_files +done + +wait \ No newline at end of file diff --git a/dev/scripts/loc.sh b/dev/scripts/loc.sh index 76c050a016..8d46af0aa5 100755 --- a/dev/scripts/loc.sh +++ b/dev/scripts/loc.sh @@ -54,18 +54,18 @@ list=$(while read -r author; do main=$(git log --since="$start_date" --numstat --pretty="%H" --author="^$author" |\ grep -v -f <(IFS=$'\n'; echo "${exclude[*]}") |\ awk 'NF==3 {plus+=$1; minus+=$2} END {printf("%d %d\n", plus, minus)}') - plus=$(( $(cut -d " " -f 1 <<< $submodules) + $(cut -d " " -f 1 <<< $main) )) - minus=$(( $(cut -d " " -f 2 <<< $submodules) + $(cut -d " " -f 2 <<< $main) )) + plus=$(( $(cut -d " " -f 1 <<< "$submodules") + $(cut -d " " -f 1 <<< "$main") )) + minus=$(( $(cut -d " " -f 2 <<< "$submodules") + $(cut -d " " -f 2 <<< "$main") )) total=$((plus + minus)) echo " $total | $author | $plus | $minus" -done <<< $(git submodule foreach --quiet git log --format='%aN' --since="$start_date" \ - | sort -u | sed 's/\[bot\]//g')) +done <<< "$(git submodule foreach --quiet git log --format='%aN' --since="$start_date" \ + | sort -u | sed 's/\[bot\]//g')") # For authors who have several names... for m in "${merge_list[@]}"; do - list=$(merge_authors "$(cut -d ":" -f 1 <<< $m)" "$(cut -d ":" -f 2 <<< $m )") + list=$(merge_authors "$(cut -d ":" -f 1 <<< "$m")" "$(cut -d ":" -f 2 <<< "$m" )") done echo "All changed lines per author since $start_date:" -printf "$list\n" | sort -nr | column --table-columns " TOTAL, AUTHOR, PLUS, MINUS" \ +printf "%s\n" "$list" | sort -nr | column --table-columns " TOTAL, AUTHOR, PLUS, MINUS" \ --table-order " AUTHOR, TOTAL, PLUS, MINUS" -ts '|' -o '|' diff --git a/dev/scripts/make-update.sh b/dev/scripts/make-update.sh index 3034679426..f21a29eb2f 100755 --- a/dev/scripts/make-update.sh +++ b/dev/scripts/make-update.sh @@ -1,5 +1,8 @@ #!/bin/bash +# Import OpenSlides utils package +. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../util.sh" + set -ae ME=$(basename "$0") @@ -71,46 +74,6 @@ MODES: EOF } -ask() { - local default_reply="$1" reply_opt="[y/N]" blank="y" REPLY= - shift; [[ "$default_reply" != y ]] || { - reply_opt="[Y/n]"; blank="" - } - - read -rp "$@ $reply_opt: " - case "$REPLY" in - Y|y|Yes|yes|YES|"$blank") return 0 ;; - *) return 1 ;; - esac -} - -# echocmd first echos args in blue on stderr. Then args are treated like a -# provided command and executed. -# This allows callers of echocmd to still handle their provided command's stdout -# as if executed directly. -echocmd() { - echo "${COL_BLUE}$ $@${COL_NORMAL}" >&2 - "$@" - return $? -} - -info() { - echo "${COL_GRAY}$@${COL_NORMAL}" -} - -warn() { - echo "${COL_YELLOW}[WARN] ${COL_GRAY}$@${COL_NORMAL}" >&2 -} - -error() { - echo "${COL_RED}[ERROR] ${COL_GRAY}$@${COL_NORMAL}" >&2 -} - -abort() { - echo "Aborting." - exit "$1" -} - set_remote() { REMOTE_NAME=upstream git ls-remote --exit-code "$REMOTE_NAME" &>/dev/null || @@ -123,7 +86,7 @@ confirm_version() { echocmd git fetch "$REMOTE_NAME" "$STABLE_BRANCH_NAME" STABLE_VERSION="$(git show "$REMOTE_NAME/$STABLE_BRANCH_NAME:VERSION")" info "Guessing staging version from stable version $STABLE_VERSION found in $REMOTE_NAME." - STAGING_VERSION="$(echo $STABLE_VERSION | awk -v FS=. -v OFS=. '{$3=$3+1 ; print $0}')" # 4.N.M -> 4.N.M+1 + STAGING_VERSION="$(echo "$STABLE_VERSION" | awk -v FS=. -v OFS=. '{$3=$3+1 ; print $0}')" # 4.N.M -> 4.N.M+1 # Give the user the opportunity to adjust the calculated staging version read -rp "Please confirm the staging version to be used [${STAGING_VERSION}]: " case "$REPLY" in @@ -143,19 +106,19 @@ check_current_branch() { # If remote branch exists ensure we are up-to-date with it [[ "$(git rev-parse --abbrev-ref HEAD)" == "$BRANCH_NAME" ]] || { - warn "$BRANCH_NAME branch not checked out ($(basename $(realpath .)))" - ask y "Run \`git checkout $BRANCH_NAME && git submodule update --recursive\` now?" && - echocmd git checkout $BRANCH_NAME && echocmd git submodule update --recursive || + warn "$BRANCH_NAME branch not checked out ($(basename "$(realpath .)"))" + { ask y "Run \`git checkout $BRANCH_NAME && git submodule update --recursive\` now?" && + echocmd git checkout "$BRANCH_NAME" && echocmd git submodule update --recursive; } || abort 0 } echocmd git fetch "$REMOTE_NAME" "$BRANCH_NAME" if git merge-base --is-ancestor "$BRANCH_NAME" "$REMOTE_NAME/$BRANCH_NAME"; then - echocmd git merge --ff-only "$REMOTE_NAME"/$BRANCH_NAME + echocmd git merge --ff-only "$REMOTE_NAME"/"$BRANCH_NAME" else warn "$BRANCH_NAME and $REMOTE_NAME/$BRANCH_NAME have diverged." - ask n "Run \`git reset --hard $REMOTE_NAME/$BRANCH_NAME\` now?" && - echocmd git reset --hard "$REMOTE_NAME/$BRANCH_NAME" || + { ask n "Run \`git reset --hard $REMOTE_NAME/$BRANCH_NAME\` now?" && + echocmd git reset --hard "$REMOTE_NAME/$BRANCH_NAME"; } || abort 0 fi } @@ -181,7 +144,7 @@ check_ssh_remotes() { { $remote_cmd - git submodule foreach --quiet --recursive $remote_cmd + git submodule foreach --quiet --recursive "$remote_cmd" } | awk '/^https?:\/\// {print " " $1; x=1} END {exit x}' || { warn "The above $REMOTE_NAME remotes seem not to use ssh." warn "$ME will attempt to directly push to these." @@ -269,8 +232,8 @@ check_meta_consistency() { # Doing a nested loop rather than foreach --recursive as it's easier to get # both the path of service submod and the (potential) meta submod in one # iteration - while read mod; do - while read meta_name meta_path; do + while read -r mod; do + while read -r meta_name meta_path; do [[ "$meta_name" == 'openslides-meta' ]] || continue @@ -288,7 +251,7 @@ check_meta_consistency() { [[ -z "$meta_sha_last" ]] || [[ "$meta_sha" == "$meta_sha_last" ]] || ret_code=1 meta_sha_last="$meta_sha" - done <<< "$(git -C $mod submodule foreach -q 'echo "$name $sm_path"')" + done <<< "$(git -C "$mod" submodule foreach -q 'echo "$name $sm_path"')" done <<< "$(git submodule foreach -q 'echo "$sm_path"')" return $ret_code @@ -306,7 +269,7 @@ check_go_consistency() { target_rev_at_str="(at $target_rev) " info "Checking openslides-go consistency $target_rev_at_str..." - while read mod_name mod_path; do + while read -r mod_name mod_path; do grep -q openslides-go "$mod_path/go.mod" 2>/dev/null || continue @@ -353,7 +316,11 @@ add_changes() { for mod in $(git submodule status | awk '$1 ~ "^\+" {print $2}'); do ( set_remote - local target_sha= mod_sha_old= mod_sha_new= log_cmd= merge_base= + local target_sha="" + local mod_sha_old="" + local mod_sha_new="" + local log_cmd="" + local merge_base="" mod_sha_old="$(git diff --submodule=short "$mod" | awk '$1 ~ "^-Subproject" { print $3 }')" mod_sha_new="$(git diff --submodule=short "$mod" | awk '$1 ~ "^\+Subproject" { print $3 }')" log_cmd="git -C $mod log --oneline --no-decorate $mod_sha_old..$mod_sha_new" @@ -398,7 +365,7 @@ choose_changes() { add_changes - check_meta_consistency && check_go_consistency || { + { check_meta_consistency && check_go_consistency; } || { warn "openslides-meta AND openslides-go have to be consistent across services." warn "Please rectify and rerun $ME" abort 1 @@ -414,7 +381,7 @@ commit_staged_changes() { [[ "$BRANCH_NAME" == stable/* ]] && commit_message="Update $(cat VERSION) ($(date +%Y%m%d))" [[ $# == 0 ]] || - commit_message="$@" + commit_message="$*" ask y "Commit on branch $BRANCH_NAME now?" && { echocmd git commit --message "$commit_message" @@ -561,8 +528,8 @@ merge_stable_branch_meta() { # Doing a nested loop rather than foreach --recursive as it's easier to get # both the path of service submod and the (potential) meta submod in one # iteration - while read mod; do - while read meta_name meta_fullpath; do + while read -r mod; do + while read -r meta_name meta_fullpath; do [[ "$meta_name" == 'openslides-meta' ]] || continue @@ -577,7 +544,7 @@ merge_stable_branch_meta() { fi info "" - done <<< "$(git -C $mod submodule foreach -q 'echo "$name $toplevel/$sm_path"')" + done <<< "$(git -C "$mod" submodule foreach -q 'echo "$name $toplevel/$sm_path"')" done <<< "$(git submodule foreach -q 'echo "$sm_path"')" } @@ -615,14 +582,14 @@ merge_stable_branch_services() { # Add previously stable-merged and pushed go if grep -q openslides-go "$service_mod/go.mod" 2>/dev/null; then go_url="$(awk '$1 ~ "/openslides-go" {print $1}' "$service_mod/go.mod")" - go_sha="$(git -C lib/openslides-go rev-parse $BRANCH_NAME)" + go_sha="$(git -C lib/openslides-go rev-parse "$BRANCH_NAME")" ( info "Adding stable go for $service_mod" cd "$service_mod" - echocmd $GO get "$go_url@$go_sha" - echocmd $GO mod tidy + echocmd "$GO" get "$go_url@$go_sha" + echocmd "$GO" mod tidy ) - echocmd git -C $service_mod add go.mod go.sum + echocmd git -C "$service_mod" add go.mod go.sum fi # Commit it all @@ -672,8 +639,8 @@ make_stable_update() { ask y "Including these staging updates for the new stable update. Continue?" || abort 0 - check_meta_consistency "$REMOTE_NAME/$STAGING_BRANCH_NAME" && - check_go_consistency "$REMOTE_NAME/$STAGING_BRANCH_NAME" || { + { check_meta_consistency "$REMOTE_NAME/$STAGING_BRANCH_NAME" && + check_go_consistency "$REMOTE_NAME/$STAGING_BRANCH_NAME"; } || { error "openslides-meta OR openslides-go is not consistent at $target_sha." error "This is not acceptable for a stable update." error "Please fix this in a new staging update before trying again." @@ -689,7 +656,7 @@ make_stable_update() { merge_stable_branch commit_staged_changes - check_meta_consistency && check_go_consistency || { + { check_meta_consistency && check_go_consistency; } || { error "Apparently merging $BRANCH_NAME went wrong and eit openslides-meta OR" error "openslides-go is not consistent anymore." error "You probably need to investigate what did go wrong." @@ -701,8 +668,8 @@ make_stable_update() { } staging_log() { - echocmd git fetch -q $REMOTE_NAME $STAGING_BRANCH_NAME - git log --graph --oneline -U0 --submodule $REMOTE_NAME/$STABLE_BRANCH_NAME..$REMOTE_NAME/$STAGING_BRANCH_NAME | \ + echocmd git fetch -q "$REMOTE_NAME" "$STAGING_BRANCH_NAME" + git log --graph --oneline -U0 --submodule "$REMOTE_NAME"/"$STABLE_BRANCH_NAME".."$REMOTE_NAME"/"$STAGING_BRANCH_NAME" | \ awk -v version="$STAGING_VERSION" ' /^\*.*Staging update [0-9]{8}/ { printf("\n# %s-staging-%s-%s\n", version, $NF, substr($2, 0, 7)) } /^\*/ { printf(" %s\n",$0) } @@ -718,14 +685,14 @@ command -v awk > /dev/null || { error "'awk' not installed!" exit 1 } -command -v $GO > /dev/null || { +command -v "$GO" > /dev/null || { error "'$GO' not installed!" exit 1 } shortopt='phl' longopt='pull,help,local' -ARGS=$(getopt -o "$shortopt" -l "$longopt" -n "$ME" -- $@) +ARGS=$(getopt -o "$shortopt" -l "$longopt" -n "$ME" -- "$@") # reset $@ to args array sorted and validated by getopt eval set -- "$ARGS" unset ARGS diff --git a/dev/scripts/makefile/build-all-submodules.sh b/dev/scripts/makefile/build-all-submodules.sh index d1aeb94b88..94d55d4d5b 100755 --- a/dev/scripts/makefile/build-all-submodules.sh +++ b/dev/scripts/makefile/build-all-submodules.sh @@ -1,7 +1,7 @@ #!/bin/bash # Import OpenSlides utils package -. $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../util.sh +. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../util.sh" # Iterates all submodules and executes the make-target 'build-aio' using parameter context as build target # Ignores meta directory @@ -13,7 +13,7 @@ export CONTEXT=$1 -if [ "${CONTEXT}" != "prod" -a "${CONTEXT}" != "dev" -a "${CONTEXT}" != "tests" ]; then +if [ "${CONTEXT}" != "prod" ] && [ "${CONTEXT}" != "dev" ] && [ "${CONTEXT}" != "tests" ]; then warn "No build context specified. Building for prod per default." >&2 export CONTEXT="prod" fi @@ -22,16 +22,21 @@ export SINGLE_TARGET=$2 IFS=$'\n' for DIR in $(git submodule foreach --recursive -q sh -c pwd); do - # Extract submodule name - cd "$DIR" && \ - export DIRNAME=${PWD##*/} && \ - export SUBMODULE=${DIRNAME//"openslides-"} && \ + # Extract submodule name + cd "$DIR" || exit && \ + DIRNAME=${PWD##*/} && \ + export DIRNAME && \ + SUBMODULE=${DIRNAME//"openslides-"} && \ + export SUBMODULE && \ + + if [ "$SUBMODULE" == 'meta' ]; then continue; fi && \ + # Check for single target - if [ $# -eq 2 ]; then if [[ $SINGLE_TARGET != $SUBMODULE ]]; then continue; fi; fi && \ + if [ $# -eq 2 ]; then if [[ "$SINGLE_TARGET" != "$SUBMODULE" ]]; then continue; fi; fi && \ # Execute test info " --- Building service ${SUBMODULE} for context ${CONTEXT} --- " && \ - echocmd eval "make build-dev" + echocmd make build-"${CONTEXT}" done wait \ No newline at end of file diff --git a/dev/scripts/makefile/build-service.sh b/dev/scripts/makefile/build-service.sh index cb288d1718..162e2084ac 100644 --- a/dev/scripts/makefile/build-service.sh +++ b/dev/scripts/makefile/build-service.sh @@ -1,7 +1,7 @@ #!/bin/bash # Import OpenSlides utils package -. $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../util.sh +. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../util.sh" # Builds a single Submodule Service. This expects to be in the directory/subdirectory of the respective service @@ -15,21 +15,21 @@ if [ -z "${SERVICE}" ]; then exit 1 fi -if [ "${CONTEXT}" != "prod" -a "${CONTEXT}" != "dev" -a "${CONTEXT}" != "tests" ] ; then \ +if [ "${CONTEXT}" != "prod" ] && [ "${CONTEXT}" != "dev" ] && [ "${CONTEXT}" != "tests" ] ; then \ error "Please provide a context for this build (bash build-service.sh , possible options: prod, dev, tests)"; \ exit 1; \ fi -export TAG=openslides-${SERVICE}- +export TAG=openslides-${SERVICE} export OPT_ARGS= if [ -n "${MODULE}" ]; then - export TAG=${TAG}${MODULE}- + export TAG=${TAG}-${MODULE} export OPT_ARGS="--build-arg MODULE=${MODULE} --build-arg PORT=${PORT}" fi -export TAG=${TAG}${CONTEXT} +if [ "${CONTEXT}" != "prod" ]; then export TAG="${TAG}-${CONTEXT}"; fi info "Building submodule '${SERVICE}' for ${CONTEXT} context" -echocmd docker build -f ./Dockerfile ./ --tag ${TAG} --build-arg CONTEXT=${CONTEXT} --target ${CONTEXT} ${OPT_ARGS} +echocmd docker build -f ./Dockerfile ./ --tag "${TAG}" --build-arg CONTEXT="${CONTEXT}" --target "${CONTEXT}" "${OPT_ARGS}" diff --git a/dev/scripts/makefile/test-all-submodules.sh b/dev/scripts/makefile/test-all-submodules.sh index 10e0de80a2..4f07dae7da 100644 --- a/dev/scripts/makefile/test-all-submodules.sh +++ b/dev/scripts/makefile/test-all-submodules.sh @@ -1,7 +1,7 @@ #!/bin/bash # Import OpenSlides utils package -. $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../util.sh +. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../util.sh" # Iterates all submodules and executes the make-target 'run-tests' # Ignores meta directory @@ -18,25 +18,30 @@ declare -A outputs IFS=$'\n' for DIR in $(git submodule foreach --recursive -q sh -c pwd); do # Extract submodule name - cd "$DIR" && \ - export DIRNAME=${PWD##*/} && \ - export SUBMODULE=${DIRNAME//"openslides-"} && \ - if [ $SUBMODULE == 'meta' ]; then continue; fi && \ + cd "$DIR" || exit && \ + + DIRNAME=${PWD##*/} && \ + export DIRNAME && \ + SUBMODULE=${DIRNAME//"openslides-"} && \ + export SUBMODULE && \ + + if [ "$SUBMODULE" == 'meta' ]; then continue; fi && \ # Check for single target - if [ $# -eq 1 ]; then if [[ $SINGLE_TARGET != $SUBMODULE ]]; then continue; fi; fi && \ + if [ $# -eq 1 ]; then if [[ "$SINGLE_TARGET" != "$SUBMODULE" ]]; then continue; fi; fi && \ # Execute test info "Testing service ${SUBMODULE}" && \ export ERROR_FOUND="" &&\ - echocmd make "run-tests" || export ERROR_FOUND="1" && \ + echocmd make run-tests || export ERROR_FOUND="1" && \ outputs[$SUBMODULE]="${?}${ERROR_FOUND}" done for x in "${!outputs[@]}"; do - export VALUE=${outputs[${x}]} && \ - if [ $VALUE != '0' ]; then error "Tests for service ${x} failed"; fi && \ - if [ $VALUE == '0' ]; then success "Tests for service ${x} successful"; fi + VALUE=${outputs[${x}]} + export VALUE && \ + if [ "$VALUE" != '0' ]; then error "Tests for service ${x} failed"; fi && \ + if [ "$VALUE" == '0' ]; then success "Tests for service ${x} successful"; fi done wait \ No newline at end of file diff --git a/dev/scripts/reset-db-import-sql.sh b/dev/scripts/reset-db-import-sql.sh index 1684cf3860..8671aa892a 100755 --- a/dev/scripts/reset-db-import-sql.sh +++ b/dev/scripts/reset-db-import-sql.sh @@ -2,10 +2,10 @@ set -e -DC="$(dirname $0)/dc-dev.sh" +DC="$(dirname "$0")/dc-dev.sh" FILE="$1" -[ -n "$FILE" -a -r "$FILE" ] || { +{ [ -n "$FILE" ] && [ -r "$FILE" ]; } || { echo "ERROR: cannot read file $FILE" exit 1 } diff --git a/dev/scripts/set-ds.sh b/dev/scripts/set-ds.sh index e08f0c9230..282aa1904c 100755 --- a/dev/scripts/set-ds.sh +++ b/dev/scripts/set-ds.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -cd "$(dirname $0)" +cd "$(dirname "$0")" DATA=${1:-../../openslides-backend/data/example-data.json} docker compose -f ../docker/docker-compose.dev.yml exec -T datastore-writer python cli/import_data_only.py < "$DATA" diff --git a/dev/scripts/submodules-do.sh b/dev/scripts/submodules-do.sh index c940c5182f..1c6772d6ec 100755 --- a/dev/scripts/submodules-do.sh +++ b/dev/scripts/submodules-do.sh @@ -7,17 +7,17 @@ if [ -z "$1" ]; then exit 1 fi -COMMAND="$@" +COMMAND="$*" IFS=$'\n' for DIR in $(git submodule foreach --recursive -q sh -c pwd); do - printf "\n\"${DIR}\": \"${COMMAND}\" started!\n" \ + printf "\n\"%s\": \"%s\" started!\n" "${DIR}" "${COMMAND}"\ && \ - cd "$DIR" \ + cd "$DIR" || exit 1 \ && \ eval "$COMMAND" \ && \ - printf "\"${DIR}\": \"${COMMAND}\" finished!\n" \ + printf "\"%s\": \"%s\" finished!\n" "${DIR}" "${COMMAND}" \ & done wait \ No newline at end of file diff --git a/dev/scripts/util.sh b/dev/scripts/util.sh index 7bfdb407a4..08be4e1991 100644 --- a/dev/scripts/util.sh +++ b/dev/scripts/util.sh @@ -29,7 +29,7 @@ ask() { reply_opt="[Y/n]"; blank="" } - read -rp "$@ $reply_opt: " + read -rp "$* $reply_opt: " case "$REPLY" in Y|y|Yes|yes|YES|"$blank") return 0 ;; *) return 1 ;; @@ -41,21 +41,25 @@ ask() { # This allows callers of echocmd to still handle their provided command's stdout # as if executed directly. echocmd() { - echo "${COL_BLUE}$ $@${COL_NORMAL}" >&2 - "$@" + ( + IFS=$' ' + echo "${COL_BLUE}$ $*${COL_NORMAL}" >&2 + local command="$*" + eval "$command" return $? + ) } info() { - echo "${COL_GRAY}$@${COL_NORMAL}" + echo "${COL_GRAY}$*${COL_NORMAL}" } warn() { - echo "${COL_YELLOW}[WARN] ${COL_GRAY}$@${COL_NORMAL}" >&2 + echo "${COL_YELLOW}[WARN] ${COL_GRAY}$*${COL_NORMAL}" >&2 } error() { - echo "${COL_RED}[ERROR] ${COL_GRAY}$@${COL_NORMAL}" >&2 + echo "${COL_RED}[ERROR] ${COL_GRAY}$*${COL_NORMAL}" >&2 } abort() { @@ -64,14 +68,14 @@ abort() { } success() { - echo "${COL_GREEN}$@${COL_NORMAL}" + echo "${COL_GREEN}$*${COL_NORMAL}" } fancy() { echo "" echo " -*~=$§{}§$=~*-" echo "" - echo " $@" + echo " $*" echo "" echo " -*~=$§{}§$=~*-" echo "" @@ -81,7 +85,7 @@ shout() { echo "" echo "${COL_CYAN}========================================================${COL_NORMAL}" echo "" - echo "${COL_CYAN}$@${COL_NORMAL}" + echo "${COL_CYAN}$*${COL_NORMAL}" echo "" echo "${COL_CYAN}========================================================${COL_NORMAL}" echo "" diff --git a/i18n/de.po b/i18n/de.po index 0219e91a75..e2910adc59 100644 --- a/i18n/de.po +++ b/i18n/de.po @@ -112,9 +112,6 @@ msgstr "Annehmen" msgid "Access data (PDF)" msgstr "Zugangsdaten (PDF)" -msgid "Access groups" -msgstr "Zugriffsgruppen" - msgid "" "Access only possible for participants of this meeting. All other accounts " "(including organization and committee admins) may not open the closed " @@ -1726,15 +1723,15 @@ msgid "Default visibility for new agenda items (except topics)" msgstr "" "Voreingestellte Sichtbarkeit für neue Tagesordnungspunkte (außer Themen)" -msgid "Default vote method" -msgstr "Voreingestellte Abstimmungsmethode" - msgid "Default vote weight" msgstr "Standard-Stimmgewicht" msgid "Default voting duration" msgstr "Voreingestellte Dauer der Stimmabgabe" +msgid "Default voting method" +msgstr "Voreingestellte Abstimmungsmethode" + msgid "Default voting type" msgstr "Voreingestellte Art der Stimmabgabe" @@ -2023,6 +2020,9 @@ msgstr "Wahl" msgid "Election documents" msgstr "Wahlunterlagen" +msgid "Election method" +msgstr "Wahlmethode" + msgid "Elections" msgstr "Wahlen" @@ -2657,6 +2657,9 @@ msgstr "Bezeichner" msgid "If deactivated it is displayed below the title." msgstr "Wenn deaktiviert erfolgt die Anzeige unterhalb des Antragstitels." +msgid "If empty, everyone can access." +msgstr "Voller Zugriff, wenn keine Gruppe eingetragen." + msgid "" "If it is an amendment, you can back up its content when editing it and " "delete it afterwards." @@ -5577,7 +5580,7 @@ msgid "Voting is currently in progress." msgstr "Stimmabgabe läuft aktuell " msgid "Voting method" -msgstr "Wahlmethode" +msgstr "Abstimmungsmethode" msgid "Voting opened" msgstr "Abstimmung eröffnet" diff --git a/i18n/template-en.pot b/i18n/template-en.pot index e8ee5b0661..18f3c14d05 100644 --- a/i18n/template-en.pot +++ b/i18n/template-en.pot @@ -88,9 +88,6 @@ msgstr "" msgid "Access data (PDF)" msgstr "" -msgid "Access groups" -msgstr "" - msgid "" "Access only possible for participants of this meeting. All other accounts " "(including organization and committee admins) may not open the closed " @@ -1571,15 +1568,15 @@ msgstr "" msgid "Default visibility for new agenda items (except topics)" msgstr "" -msgid "Default vote method" -msgstr "" - msgid "Default vote weight" msgstr "" msgid "Default voting duration" msgstr "" +msgid "Default voting method" +msgstr "" + msgid "Default voting type" msgstr "" @@ -1841,6 +1838,9 @@ msgstr "" msgid "Election documents" msgstr "" +msgid "Election method" +msgstr "" + msgid "Elections" msgstr "" @@ -2431,6 +2431,9 @@ msgstr "" msgid "If deactivated it is displayed below the title." msgstr "" +msgid "If empty, everyone can access." +msgstr "" + msgid "" "If it is an amendment, you can back up its content when editing it and " "delete it afterwards." diff --git a/lib/openslides-go b/lib/openslides-go index 8aac50248e..e9269a9aa4 160000 --- a/lib/openslides-go +++ b/lib/openslides-go @@ -1 +1 @@ -Subproject commit 8aac50248ebfa6bdd37d25590d87f6095adfb012 +Subproject commit e9269a9aa4d7aae0da8aa4c11f6c9b76abc50b6c diff --git a/openslides-auth-service b/openslides-auth-service index afb7498a3d..749bb02e61 160000 --- a/openslides-auth-service +++ b/openslides-auth-service @@ -1 +1 @@ -Subproject commit afb7498a3d305108b9707acdc21bd365ebfb9414 +Subproject commit 749bb02e61a2394949be2d256a6072a661357a2e diff --git a/openslides-autoupdate-service b/openslides-autoupdate-service index 94135bf182..4435667d88 160000 --- a/openslides-autoupdate-service +++ b/openslides-autoupdate-service @@ -1 +1 @@ -Subproject commit 94135bf1821b6de8d4c2541e3701394c10045c97 +Subproject commit 4435667d88b69435ee850fa531a79cce81c428e5 diff --git a/openslides-backend b/openslides-backend index 866b89378f..c5366078d3 160000 --- a/openslides-backend +++ b/openslides-backend @@ -1 +1 @@ -Subproject commit 866b89378f052eeef84db58f371a7f31c513d61c +Subproject commit c5366078d37b1a6465951ff6d089e0011fef5e6a diff --git a/openslides-client b/openslides-client index 61ce4217f5..d42d589604 160000 --- a/openslides-client +++ b/openslides-client @@ -1 +1 @@ -Subproject commit 61ce4217f5351e1451e464ebc3a417dd94703d05 +Subproject commit d42d589604b738133af198e51c4cf4dbc96276aa diff --git a/openslides-datastore-service b/openslides-datastore-service index 749429e1cd..a24fe577cd 160000 --- a/openslides-datastore-service +++ b/openslides-datastore-service @@ -1 +1 @@ -Subproject commit 749429e1cd742c7884e5f56d88704274a9f83332 +Subproject commit a24fe577cd5f54d4bfe3e30869adf5852dad9bb4 diff --git a/openslides-icc-service b/openslides-icc-service index 0b9c6d5b13..9ce1c0464d 160000 --- a/openslides-icc-service +++ b/openslides-icc-service @@ -1 +1 @@ -Subproject commit 0b9c6d5b13286d81f2c19a5802259be981bd3a21 +Subproject commit 9ce1c0464d23e87c3b31749d1459fca11e71c118 diff --git a/openslides-manage-service b/openslides-manage-service index 40062fca20..81a7c74453 160000 --- a/openslides-manage-service +++ b/openslides-manage-service @@ -1 +1 @@ -Subproject commit 40062fca20651939174d71b0e68c9be50e3fabee +Subproject commit 81a7c74453e451adc35ee1fe72dc77f886ff5d77 diff --git a/openslides-media-service b/openslides-media-service index 296057104e..df84d58e6e 160000 --- a/openslides-media-service +++ b/openslides-media-service @@ -1 +1 @@ -Subproject commit 296057104e1892d87f4cdb5d5478eacd721f745f +Subproject commit df84d58e6ee0fd79a3b0552913eef4e948f67a1e diff --git a/openslides-proxy b/openslides-proxy index 0a9514cedf..ec1892c31d 160000 --- a/openslides-proxy +++ b/openslides-proxy @@ -1 +1 @@ -Subproject commit 0a9514cedfde1676f6c67b1e6d27ac5c6ea0a194 +Subproject commit ec1892c31de5d14023b29f007158c1d5f7956f9f diff --git a/openslides-search-service b/openslides-search-service index 35dbc4cd9a..c0e4347747 160000 --- a/openslides-search-service +++ b/openslides-search-service @@ -1 +1 @@ -Subproject commit 35dbc4cd9aa21608ffd97f4fb20b01e07f270b3f +Subproject commit c0e434774760319e3ebcc6d6a7e9d3c83eca7f8b diff --git a/openslides-vote-service b/openslides-vote-service index 448d52a24f..600e54ffad 160000 --- a/openslides-vote-service +++ b/openslides-vote-service @@ -1 +1 @@ -Subproject commit 448d52a24f6d34958cd26ece11e544dce1d7bbc9 +Subproject commit 600e54ffad40cf66bb6a15b936bff617504e68e8 diff --git a/patchnotes/4.2.10.md b/patchnotes/4.2.10.md new file mode 100644 index 0000000000..4f00904571 --- /dev/null +++ b/patchnotes/4.2.10.md @@ -0,0 +1,9 @@ +## Patchnotes 4.2.10 + +### Optimizations +- Dialogs: Closing/canceling all dialogs is now possible with ESC. +- eVoting > Result display: Comma or point is used as decimal separator for results depending on the meeting language. + +### Bug fixes +- Motions > Export: Fixed a bug where the sorting was done by IDs and not by the displayed sorting when exporting via multiselect. +- eVoting > Progress bar in autopilot: Progress bar was not visible in autopilot. diff --git a/patchnotes/4.2.11.md b/patchnotes/4.2.11.md new file mode 100644 index 0000000000..8b781f1a7c --- /dev/null +++ b/patchnotes/4.2.11.md @@ -0,0 +1,4 @@ +## Patchnotes 4.2.11 + +### Bug Fixes +- eVoting: The progress bar shows reliable data. diff --git a/patchnotes/4.2.12.md b/patchnotes/4.2.12.md new file mode 100644 index 0000000000..02c4386cda --- /dev/null +++ b/patchnotes/4.2.12.md @@ -0,0 +1,8 @@ +## Patchnotes 4.2.12 + +### Optimizations +- Motions > detail view > Forwarding buttons: The ‘Forward’ button is hidden in the application if forwarding is no longer possible. Note: The button in the three-dot menu is only hidden after the motion detail page has been reloaded. This will be revised in an upcoming version. +- Motions > Detail view: Layout of the editor in editorial final version improved +- Layout of drop-down menus improved +- eVoting: linguistic clarifications for voting and voting method selection menus integrated +- Translations added diff --git a/patchnotes/4.2.13.md b/patchnotes/4.2.13.md new file mode 100644 index 0000000000..ea2aaba5e2 --- /dev/null +++ b/patchnotes/4.2.13.md @@ -0,0 +1,3 @@ +## Patchnotes 4.2.13 + +Fix merge artifacts in last stable updates diff --git a/patchnotes/4.2.9.md b/patchnotes/4.2.9.md new file mode 100644 index 0000000000..cb1566c68f --- /dev/null +++ b/patchnotes/4.2.9.md @@ -0,0 +1,10 @@ +## Patchnotes 4.2.9 + +### New Features + +### Optimizations +- PDF export: PDF files are exported in the PDF/A-3a standard + +### Bug Fixes +- Motions > Change recommendations: Editing of change recommendations with changed line numbering was not possible +- Motions > Forwarding: Fixed a bug where newly created change recommendations were not visible in forwarded motions.