Merge branch 'main' into feature/improved_errors

This commit is contained in:
Kevin Burnett 2023-01-19 12:18:02 -08:00 committed by GitHub
commit 6434f1bc9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 2554 additions and 12 deletions

View File

@ -8,6 +8,7 @@ trap 'error_handler ${LINENO} $?' ERR
set -o errtrace -o errexit -o nounset -o pipefail set -o errtrace -o errexit -o nounset -o pipefail
user_file_with_one_email_per_line="${1:-}" user_file_with_one_email_per_line="${1:-}"
keycloak_realm="${2:-spiffworkflow}"
if [[ -z "${1:-}" ]]; then if [[ -z "${1:-}" ]]; then
>&2 echo "usage: $(basename "$0") [user_file_with_one_email_per_line]" >&2 echo "usage: $(basename "$0") [user_file_with_one_email_per_line]"
exit 1 exit 1
@ -42,7 +43,7 @@ while read -r user_email; do
username=$(awk -F '@' '{print $1}' <<<"$user_email") username=$(awk -F '@' '{print $1}' <<<"$user_email")
credentials='{"type":"password","value":"'"${username}"'","temporary":false}' credentials='{"type":"password","value":"'"${username}"'","temporary":false}'
curl --fail --location --request POST 'http://localhost:7002/admin/realms/spiffworkflow/users' \ curl --fail --location --request POST "http://localhost:7002/admin/realms/${keycloak_realm}/users" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-H "Authorization: Bearer $backend_token" \ -H "Authorization: Bearer $backend_token" \
--data-raw '{"email":"'"${user_email}"'", "enabled":"true", "username":"'"${username}"'", "credentials":['"${credentials}"']}' --data-raw '{"email":"'"${user_email}"'", "enabled":"true", "username":"'"${username}"'", "credentials":['"${credentials}"']}'

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
alex@sartography.com
dan@sartography.com
kevin@sartography.com
jason@sartography.com
mike@sartography.com
elizabeth@sartography.com
jon@sartography.com
natalia@sartography.com

View File

@ -62,7 +62,7 @@ def setup_config(app: Flask) -> None:
"SPIFFWORKFLOW_BACKEND_ENV", "development" "SPIFFWORKFLOW_BACKEND_ENV", "development"
) )
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
app.config.from_object("spiffworkflow_backend.config.default") load_config_file(app, "spiffworkflow_backend.config.default")
env_config_prefix = "spiffworkflow_backend.config." env_config_prefix = "spiffworkflow_backend.config."
if ( if (

View File

@ -0,0 +1,10 @@
"""Default."""
from os import environ
environment_identifier_for_this_config_file_only = environ["SPIFFWORKFLOW_BACKEND_ENV"]
OPEN_ID_SERVER_URL = f"https://keycloak.{environment_identifier_for_this_config_file_only}.spiffworkflow.org/realms/sartography"
GIT_BRANCH = environ.get("GIT_BRANCH", default="main")
GIT_CLONE_URL_FOR_PUBLISHING = environ.get(
"GIT_CLONE_URL",
default="https://github.com/sartography/sartography-process-models.git",
)

View File

@ -1,6 +1,4 @@
"""Test_process_instance_processor.""" """Test_process_instance_processor."""
import os
from flask.app import Flask from flask.app import Flask
from tests.spiffworkflow_backend.helpers.base_test import BaseTest from tests.spiffworkflow_backend.helpers.base_test import BaseTest
from tests.spiffworkflow_backend.helpers.test_data import load_test_spec from tests.spiffworkflow_backend.helpers.test_data import load_test_spec
@ -21,11 +19,7 @@ class TestProcessInstanceService(BaseTest):
with_db_and_bpmn_file_cleanup: None, with_db_and_bpmn_file_cleanup: None,
with_super_admin_user: UserModel, with_super_admin_user: UserModel,
) -> None: ) -> None:
"""Test_does_not_log_set_data_when_calling_engine_steps_on_waiting_call_activity. """Test_does_not_log_set_data_when_calling_engine_steps_on_waiting_call_activity."""
"""
tmp_file = "/tmp/testfile.txt"
if os.path.isfile(tmp_file):
os.remove(tmp_file)
process_model = load_test_spec( process_model = load_test_spec(
process_model_id="test_group/call-activity-to-human-task", process_model_id="test_group/call-activity-to-human-task",
process_model_source_directory="call-activity-to-human-task", process_model_source_directory="call-activity-to-human-task",
@ -41,10 +35,10 @@ class TestProcessInstanceService(BaseTest):
).all() ).all()
initial_length = len(process_instance_logs) initial_length = len(process_instance_logs)
# ensure we have something in the logs
assert initial_length > 0
# logs should NOT increase after running this a second time since it's just waiting on a human task # logs should NOT increase after running this a second time since it's just waiting on a human task
print("HEY NOW")
with open(tmp_file, "w") as f:
f.write("HEY")
processor.do_engine_steps(save=True) processor.do_engine_steps(save=True)
process_instance_logs = SpiffLoggingModel.query.filter_by( process_instance_logs = SpiffLoggingModel.query.filter_by(
process_instance_id=process_instance.id process_instance_id=process_instance.id