Skip to content

Commit

Permalink
Pi migration 2 (#1902)
Browse files Browse the repository at this point in the history
* added migration detail table along with migration fe page w/ burnettk

* allow specifying bpmn process defintion when getting instance w/ burnettk

* added a test for migration reverting w/ burnettk

* added result states to migration page w/ burnettk

* updated spiffworkflow to fix migration revert issue w/ burnettk

* added test for the migration events api w/ burnettk

* fixed tests

* finished migration web page w/ burnettk

* coderabbit and other issues and added spiffworkflow-local realm and use that if running locally

* fixed pyl issue

* just check for the git revision key in tests instead of a value since the value could be None

* ruff

* updated configs for cypress tests

* use correct realm in ci

---------

Co-authored-by: jasquat <[email protected]>
  • Loading branch information
jasquat and jasquat authored Jul 11, 2024
1 parent 195aedc commit 2e1ee93
Show file tree
Hide file tree
Showing 31 changed files with 3,855 additions and 48 deletions.
7 changes: 3 additions & 4 deletions spiffworkflow-backend/bin/local_development_environment_setup
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ PORT="${SPIFFWORKFLOW_BACKEND_PORT:-7000}"
use_local_open_id="false"
acceptance_test_mode="false"

arg_1="${1:-}"

use_local_open_id="true"
if [[ "$arg_1" == "keycloak" ]]; then
# always check $@ so we can pass in multiple args
if [[ "${1:-}" == "keycloak" ]]; then
use_local_open_id="false"
shift
fi
if [[ "$arg_1" == "acceptance" ]]; then
if [[ "${1:-}" == "acceptance" ]]; then
acceptance_test_mode="true"
shift
fi
Expand Down
2 changes: 1 addition & 1 deletion spiffworkflow-backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:
- SPIFFWORKFLOW_BACKEND_DATABASE_URI=mysql+mysqldb://root:${SPIFFWORKFLOW_BACKEND_MYSQL_ROOT_DATABASE:-my-secret-pw}@127.0.0.1:7003/${SPIFFWORKFLOW_BACKEND_DATABASE_NAME:-spiffworkflow_backend_development}
- SPIFFWORKFLOW_BACKEND_ENV=${SPIFFWORKFLOW_BACKEND_ENV:-local_development}
- SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA=${SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA:-false}
- SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL=${SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL:-http://localhost:7002/realms/spiffworkflow}
- SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL=${SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL:-http://localhost:7002/realms/spiffworkflow-local}
- SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME=${SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME:-acceptance_tests.yml}
- SPIFFWORKFLOW_BACKEND_PORT=7000
# the background scheduler picks up process instances that we set in a certain state and then runs them like running not_started instances
Expand Down
13 changes: 7 additions & 6 deletions spiffworkflow-backend/keycloak/bin/start_keycloak
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function remove_traps() {
}

function error_handler() {
>&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}."
echo >&2 "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}."
exit "$2"
}
setup_traps
Expand All @@ -17,10 +17,10 @@ set -o errtrace -o errexit -o nounset -o pipefail

realm_name="${1:-}"
if [[ -z "$realm_name" ]]; then
realm_name="spiffworkflow"
realm_name="spiffworkflow-local"
fi

if ! docker network inspect spiffworkflow > /dev/null 2>&1; then
if ! docker network inspect spiffworkflow >/dev/null 2>&1; then
docker network create spiffworkflow
fi

Expand Down Expand Up @@ -53,7 +53,10 @@ docker run \
-D--spi-theme-cache-themes=false \
-D--spi-theme-cache-templates=false

script_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
script_dir="$(
cd -- "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)"
cp "${script_dir}/../realm_exports/${realm_name}-realm.json" /tmp/${realm_name}-realm.json
spiff_subdomain="for-local-dev.spiffworkflow.org"
perl -pi -e "s/replace-me-with-spiff-backend-host-and-path/${spiff_subdomain}/g" /tmp/${realm_name}-realm.json
Expand All @@ -80,11 +83,9 @@ if [ "${TURN_OFF_SSL:-}" == "true" ]; then
echo 'turned off SSL requirement'
fi


docker stop keycloak
docker start keycloak


# to export:
# /opt/keycloak/bin/kc.sh export --dir /tmp/hey --users realm_file
# change any js policies to role policies - just copy the config of one and change the type to role
Expand Down
Loading

0 comments on commit 2e1ee93

Please sign in to comment.