2022-10-12 10:22:22 -04:00
|
|
|
"""Conftest."""
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from flask.app import Flask
|
2022-11-09 15:02:19 -05:00
|
|
|
from flask.testing import FlaskClient
|
2022-10-31 09:28:03 -04:00
|
|
|
from tests.spiffworkflow_backend.helpers.base_test import BaseTest
|
|
|
|
|
Squashed 'spiffworkflow-backend/' changes from 031713a6..6cae736a
6cae736a Merge pull request #145 from sartography/data_size_script
241cb6ed Merge branch 'main' of github.com:sartography/spiff-arena
53e824ab set git user configs explicitly using the env vars w/ burnettk
741dab7e so we do not lose our minds when debugging on a server
8dd5d834 Merge branch 'main' of github.com:sartography/spiff-arena
44390824 show help text for textareas as well w/ burnettk
92042e9a why not dict, too
d0b67bb8 Cleanup
4ffba533 Getting ./bin/pyl to pass
d53d0c21 Provide info about keys in task data and python env
02db5acf Unfactor to fix size calculation/type hint issues
84fe64b0 Getting ./bin/pyl to pass
60a03f03 Adding python env size
a929ef91 Add cumulative task data size to script
32bb223b remove start and end events from simple logs view
54fdfd46 copy env so we are doing additive stuff rather than completely rewriting it
833a4125 fix git bash script unbound error w/ burnettk
46c62b90 more git config updates w/ burnettk
621e13fb disable strict host checking for git commands w/ burnettk
182d657d fixed tests w/ burnettk
40db077e give access to download process data files if a user has access to start a process model w/ burnettk
9083fcae backend: create SSH key file when contents provided
90aad09e backend: use sensible lock filename for git
0065b98b backend: specify --rebase when using git pull
94e1e15c backend: fix use of SSH private key for git ops
55252831 Look in task data/script engine environment for data, not just workflow data. (#143)
c5661f96 delint
d2d1ee50 backend/git_service: accept webhook test requests
782650d7 backend/git_service: check repo URLs from webhook
e76114c9 bump spiffworkflow hash
00d8eb55 put the env vars in the env section of the github action configs w/ burnettk
279e3042 added test for quickstart guide w/ burnettk
0e8ebc26 pyl
8732bd25 Merge remote-tracking branch 'origin/main' into feature/support_local_openid_in_cypress_tests
5b89d0cf use _GIT_SOURCE_BRANCH instead of _GIT_BRANCH
18917e62 fix unprefixed config
f32d83de update configs for publish feature
6139b411 added some support for using the backend openid server for cypress tests w/ burnettk
a2792e4d add new uses and delete ppg.ba.sme1
512bce0f the equal sign is not apart of the env var w/ burnettk
28b25fae updated terraform deployed env config name w/ burnettk
88fe9e66 more config updates w/ burnettk
6ad3224b cleaned up the default config file a bit
f328b5db pyl
4ef72a9c fixed some env vars for ci
9a31aff0 pyl
2a642f38 Merge remote-tracking branch 'origin/main' into feature/update_configs_with_prefix
9f144f54 remove unused import
ab6c45bc all tests pass w/ spiff lib upgrade, thanks for the help elizabeth
27870682 format
dd0a642a updated remaining configs manually w/ burnettk
d3153224 updated secret config names as well w/ burnettk
7160c702 updated configs to use the prefix using the script w/ burnettk
e57476ac updated default user group var name for better prefix w/ burnettk
6d3ef2b8 save task data to spiff step details when copmleting a user task as well w/ burnettk jbirddog
fde9ac7f append OPEN_ID to TENANT_SPECIFIC_FIELDS for clarification on what it is from w/ burnettk
df34d786 do not remove the default user group when refreshing permissions w/ burnettk
a80f7513 Merge branch 'main' of github.com:sartography/spiff-arena into main
7c63f409 The aud in a json web token can be a string or an array -- so also deal with the case that it is an array
76fd4c2d updates to user import scripts w/ burnettk
f0067eea commit user if it has changed any attributes w/ burnettk
2f1cb4c0 fix for mypy on python 3.9 w/ burnettk
b2db377d give some leeway to iat when validating auth w/ burnettk
bce49095 add in debug logging when failing to login to help debug auth failures
af2d9a66 Don't try to complete a ready task to move the process instance diagram to the next yellow. (#136)
ee7d5b1e Merge pull request #137 from sartography/failing_test
a1e5111f allow overriding keycloak url in add user script w/ burnettk
d3b20221 updated add test users script to use realm admin w/ burnettk
390287bd The End Event has a spiff step
4e6bee21 added script to import users w/ burnettk
ff8912f5 added api endpoint to allow logging in for the first time with an openid access_token w/ burnettk
7fab1f4f Merge pull request #135 from sartography/bug/len
73e4178d run_pyl
9c40e56e delete 15 users that are no longer needed
82c42a66 Merge remote-tracking branch 'origin/main' into bug/len
057102c1 commit before removing users
fbee1e31 This should fix the len issue - though there may be better ways to fix this. This reverts commit 52b496d1058a630ee60c50c3e8acc72b2df748dc.
e48c3188 Revert "more finally for better len"
b398f53a more finally for better len added a fixme for raising errors fixed up an error message
3d22455e fix employee id
9eb0c08d Update Spiffworkflow so we have the better error messages on service tasks.
54e17133 don't default to a broken environment.
44acb13d add five test users, rename peopleops users, delete two
27bbacaf Remove version from docker-compose, as this is causing issues for people still using docker-compose v2.
74984c8e turn off profiling for now to see if that is what is causing segfaults
733fe927 Save logs in finally (#134)
37f728a7 link to the spiff step from a task on the frontend and use the correct db in ci
3c120843 pyl w/ burnettk
af10992a call activities are also working w/ burnettk
d0aa6b1c tasks and subprocesses can are setting the task states properly now when getting task data w/ burnettk jbirddog
4791bda5 pyl w/ burnettk
ffa4fd78 Merge branch 'save_step_data' of github.com:sartography/spiff-arena into save_step_data
9e3a897b Fix bug where deletes from the environment were not removed from the task data as well
7eebf361 Merge remote-tracking branch 'origin/main' into save_step_data
b4f22984 Merge pull request #132 from sartography/feature/no_more_current_user
db3d4703 updated controller to use spiff step details to find correct task data to show w/ burnettk
b3a70d42 run_pyl
fca00361 remove the "current_user" from being added to the task_data.
747f91d1 Merge remote-tracking branch 'origin/main' into save_step_data
ac02e0a9 Merge remote-tracking branch 'origin/main' into save_step_data
cce05cab pyl
dc250235 Merge pull request #131 from sartography/feature/improved_service_task_errors
4d9a7a6a If you have an instance/config.py to override local development it would also override testing.
c06db317 Use a mock when making external calls in tests.
d6654e82 Merge remote-tracking branch 'origin/main' into feature/improved_service_task_errors
6e4b191c Merge branch 'main' of github.com:sartography/spiff-arena
0fd982a4 catch up with environment change
81a7cdc9 added additional columns to spiff_step_details w/ burnettk jbirddog
805b86ec fixing some missing types
8644561b run_pyl
72deffd8 Assure that when something goes wrong calling a service task that we get as much good information about the problem as possible.
687125bd Merge remote-tracking branch 'origin/main' into save_step_data
9c8ca3aa enable faulthandler to hopefully see seg faults in the logs w/ burnettk jbirddog
a9651211 Merge branch 'main' into save_step_data
bc556729 remove dup
10fa5edf add users
d7f52641 Merge pull request #114 from sartography/frontend/use-api-subpath
35efb091 allow setting configs for the frontend through env vars w/ burnettk
7552408a allow configuring gunicorn configs in boot_server_in_docker w/ burnettk
1007e8c7 sentences need spaces between them
1b7fec4a renamed development env to local_development and testing to unit_testing w/ burnettk
02750228 set up qa2 to only do path based routing w/ burnettk
ee3cb621 added backend url to qa2 configs
fab0a6bd added qa2 configs to use keycloak on qa1 to test different domains w/ burnettk
f7743ea4 Merge pull request #128 from sartography/feature/bug_fixes
384d65f6 Update tasks_controller.py
7f0c0926 update get_token
af5a4c50 pass tenant attributes when creating a user w/ burnettk
2cf6f1a5 pyl w/ burnettk
b7bdae94 Merge remote-tracking branch 'origin/main' into feature/tenant-specific-fields-from-openid
007eecdc added bambooid to status users w/ burnettk
3b0e3ff6 POC for saving some data about each step
98490b69 allow added custom attributes to users when adding to keycloak w/ burnettk
68358519 Backend do_engine_steps performance improvements (#129)
2a2855e0 use our json encoder to dump the user for get_current_user script w/ burnettk
706bb570 Use the same markdown library for displaying as for editing - could enable a security run_pyl
7aebec9d When catching non-jinja errors from Jinja, raise a good error message, and make a best effort at tracking down the line number and error line if possible.
b4a31562 move towards returning dict in get_current_user
19ccca40 Merge remote-tracking branch 'origin/main' into feature/tenant-specific-fields-from-openid
257de512 add test users
ecc70795 run_pyl
3eb0fd76 When searching for human tasks to determine if the current user can complete it, filter on the "completed" flag.
ad4fead4 Back to inserting every log
12c3a2b8 hoping to fix tests on windows
d8ba46b6 grab bamboo_id from keycloak
e5a56f6e lint
f1c61581 if there are tenant specific fields in the config, transfer them from openid token to db
35637ba0 Merge branch 'main' of github.com:sartography/spiff-arena into main
86b248fa Fix that dreadful unknown "KeyError" exception that was cropping up. Adding a bit of detail to the spiffworkflow exceptions when a duplicate process model is found. Disable the submit button on tasks after you click submit (avoid the double click and give users a better experience)
6fc2f2b2 Merge pull request #125 from sartography/feature/dynamically-hide-fields-w-task-data
9de6e0b3 refactor some stuff in task_show to separate functions
f2a12c5c show that hiding nested fields works as well
d7fd92e1 make form schema and form ui schema both dicts, add support for hiding fields based on task data
80649382 run_pyl
5a859f16 Merge branch 'main' into feature/more_better_errors
2d4f9d45 add more users, and try to prevent sentry notification again
83b9c901 remove service accounts, formalize j, add madhurya
698b3af8 make test_user_lists more complete and correct
a163d6f7 clean up sentry notification and avoid logger.exception when we do not want sentry
0fced76d couple last serializer updates
b17142bf import EventBasedGatewayConverter from correct package
5b7805d0 try to improve exception handling by avoiding raising ApiError from services
e9913d83 simplify spiff integration post serializer update, w/ elizabeth and jon
9baf0cb2 Quick fix for url building
4641b523 File download from workflow data (#122)
30a73e2a Allow for different Python Environments when executing scripts within SpiffWorkflow (#121)
650b91ed add keycloak users
6d18bd23 bulk insert logs for performance improvement
c50744a1 there is no need to ever sentry_sdk.start_transaction because the flask integration does that
1368d71c get some more insight into connector proxy timings
7ffcded9 avoid poetry installing deps when we have them cached if they do not change
5d50ee8e more spans to track performance
a23a0700 more sentry performance tracing
8a98e8d9 folks who can start instances can also view their logs
17fb81bc shuffle around Dockerfile to allow to work for background container
d9bcbd09 Merge pull request #117 from sartography/feature/authorization
c586e0ea allow overriding git related configs w/ env var and log permissions stuff on boot
f5ee3ec8 Merge branch 'main' into feature/more_better_errors
063ebda6 Merge pull request #115 from sartography/backend/improve-dockerfile
ba6d4c5f Fix typing issue.
b0a05adc Use the id_token, not the auth_token from the open id server for authentication with the front end. The auth_token should be kept safe, and not guranteeded to be a json token.
b9eb5dd8 add four new status users to spiff realm
553c93be backend: avoid redundant steps in Dockerfile
cf2e8975 removed old pin to spiffworkflow w/ burnettk
5970b1e3 tests are passing now w/ burnettk
a39aca6a some initial updates w/ burnettk
6fda0c5c Allow set to be called from scripts
a6482760 update lock file in backend and arena, though that one needs pruning
5b2046ab run_pyl
5328a2d4 Workflow Data Exceptions were not getting processed, we now catch the WorkflowDataException through the generic top level SpiffWorkflowException.
9f98cfee updated prefix for background instances w/ burnettk
acd26c04 Merge pull request #110 from sartography/feature/jinja_errors
864ae116 add keycloak users
f80836e7 pyl
71e20c9f set the correct type for task since SpiffTask and a backend task are not the same
26c791f9 increased the task data size
79dadcaa added pylint back to lock file
35b0871c Merge remote-tracking branch 'origin/main' into feature/jinja_errors
1dbac99a run_pyl had various recommendations that I find a bit of a pain in the butt, but that I did anyway.
b30081ab Merge pull request #109 from sartography/feature/upgrade_bandit
efb8fd0b removed debug print statements
58679f60 ensure we are passing the primary file name to the delete file test
9943cbbb fixed typo w/ burnettk
1fe63808 added some debug statements for ci w/ burnettk
d84942f0 upgraded bandit and flake8 w/ burnettk
72f599cb Merge remote-tracking branch 'origin/main' into feature/jinja_errors
c0530539 allow removing users from groups when refreshing permissions w/ burnettk
106500cf Added useMemo to error context No longer clear errors in the task bar, as that will constantly remove them as soon as they are shown.
08c3106c Merge branch 'main' of github.com:sartography/spiff-arena
957e0373 when changing the primary file name also change the primary process when updating a process model from the api w/ burnettk
b560b364 Making sure we create informative messages when encountering jinja2 syntax errors.
51c325da delete legacy flask-rendered html pages from initial prototype, since backend is now API-only
59ebcbb4 added the process model identifier for the diagram if it is not the top level w/ burnettk
a02a132e Merge pull request #107 from sartography/feature/metadata_on_instance_show
b22e8828 do not allow deleting primary bpmn file and do not allow instantiating models without a primary bpmn file w/ burnettk
002df3f9 show metadata on instance show page but for some reason it reorders elements w/ burnettk
81c3cfe1 removed uniqueness constraint from human task so we can loopback to a previous task with a gateway w/ burnettk
73cbef31 ensure order of permissions in tests
d5949b86 document future enhancement
c8bc2049 strip off newlines and spaces when importing secrets and pinning spiffworkflow to working version until we can debug issues with new one w/ burnettk
bb99d942 added locking system for process instances so hopefully background jobs will not take instances currently being run by the user w/ burnettk
a4e60a36 added uniqueness constraint to spiff step details w/ burnettk
5fd7197c add sum and format
53d99f7d expanded functionality of the form builder
f08ff45b Revert "allow updating models on staging for a bit"
f88d3250 Revert "commit on save yes for now"
6675c407 qa1
10180043 since accepting the github host entry programatically is no more secure
1517a3ee commit on save yes for now
5f1af4a6 allow updating models on staging for a bit
27fbd93d allow getting the GIT SSH key from an app config so we can set it in the secrets file w/ burnettk
9fa2f982 allow specifying an ssh key for git instead of a username and password w/ burnettk
09337070 updated admin user on sartography realm w/ burnettk
17124319 allow passing a realm name into start keycloak and added admin user to sartography realm
7d9600f4 find the top level process to find the task form when using subprocesses in called activities w/ burnettk danfunk
0bf13094 pyl w/ burnettk
97268226 Merge branch 'main' into feature/improved_errors
c1403a9e ensure we have something in the logs w/ burnettk
cdaf59b8 pyl w/ burnettk
55468b67 added configs for sartography env w/ burnettk
205dd4a5 pre-commit-in-ci
bd1058fe updating spiffworkflow version, and fixing the run_pyl (by removing the corft I stuck in earlier)
ecbe1948 Merges
5da88709 Lots of adjustments from running pyl Main change is in the ErrorDisplay.tsx to assure all error information is provided. and index.css to make it "pretty"
ab1d5c22 Removing dependency on flask-bpmn and taking it out of SpiffArena Slightly updating the APIError code for recent updates to SpiffWorkflow's error refactoring.
git-subtree-dir: spiffworkflow-backend
git-subtree-split: 6cae736acd232199447a44f7ff2a8dc4c7779631
2023-02-23 10:49:54 -05:00
|
|
|
from spiffworkflow_backend.models.db import db
|
|
|
|
from spiffworkflow_backend.models.db import SpiffworkflowBaseDBModel
|
Squashed 'spiffworkflow-backend/' changes from 7600e1e57..094de3563
094de3563 pyl w/ burnettk
7575ce459 Merge pull request #95 from sartography/feature/find_by_process_instance_id
bb3c9ebea fixed test w/ burnettk
4b8b5fc40 added fix to SpiffWorkflow to deepcopy operation params before evaluating them w/ burnettk
08909ae93 Add get_secret script (#94)
158cbb4bf basic support to find a process instance by id w/ burnettk
49a71d898 pyl w/ burnettk
3d87cc56a Merge branch 'main' into feature/process-nav-improvements
13ef0ab87 fixed issue displaying task data for call activities called multiple times in a diagram w/ burnettk
e99caf034 Merge branch 'main' into feature/process-nav-improvements
e64fe5eee add a bit more debugging info
f4907aeab pyl
ac079f881 added ability to filter process instances by process initiator
9d848effa pyl w/ burnettk
7ae3dca55 added process group display name to model search and cache the groups to avoid extra lookups w/ burnettk
fc30bd843 merged in main and resolved conflicts
9f036a1d0 Helper function to support reaping process instances (#91)
29fb40b3f pyl w/ burnettk
10e2ea6f9 added new page to create process models using english text w/ burnettk
7f9422ce2 added method to create process models based on english string w/ burnettk
8de7d1378 upgrade black, give it the preview flag, and let it rip on long strings
9310c8eec configure metadata extration paths appropriately
2adb6b206 actually create process model
afd6bcbc3 added basis of api to create process models from text w/ burnettk
141b19241 reformat file
119f2513e remove reset tasks from human task table
244c6178a added all users to waiting for column on task list tables w/ burnettk
787e1e1ee fix method overwritten by merge
8dd2457ce Merge branch 'main' into feature/process-nav-improvements
dab22e0ec ensure we get logs for both db and backend with docker compose w/ burnettk
a2aa3ae4f remove unused task method
ad17ca3f5 allow tests to determine what paginated entity id to use to determine a table has loaded
1fcaf8bdb create spiff steps for manual navigation
0bc9ae6f6 Merge remote-tracking branch 'origin/main' into feature/process_api_blueprint_refactor
71475ddf8 Merge pull request #78 from sartography/feature/process-navigation
534e2d468 move helpers where they belong
22cdc28a8 run ./bin/run_pyl
55eedd28c new service tasks controller
439106265 move status to health controller
e0f7da69a fix test
accde5d4e move helpers where they belong
524434a10 allow option to complete single tasks with or without execution
865fd6c8c get tests passing
7faf753e6 moved some more apis w/ burnettk
aa87d68d5 moved more api methods to own controllers w/ burnettk
6b78eddc8 add endpoint to reset process to earlier step
be5580a92 moved process groups, models, and instances api methods to own controller files w/ burnettk
3933c92a5 fix bug with opening call activities when processes conflict with dmn files
76c71a7e5 fix show previous spiff steps
7f09a92eb Minor fix to SpiffWorkflow library
d3136f8e4 Don't freak out if git is not yet setup in the working directory.
83e468d43 Merge branch 'main' into feature/process-navigation
42393d8d7 Make list available to script tasks (#86)
0972d9790 save the process instance even if it fails to run all the way w/ burnettk
626db0d78 delete human tasks when process instance is deleted w/ burnettk
1a71a44b5 Merge branch 'main' of github.com:sartography/spiff-arena
0cc6f2c2d fixed some cypress tests and fixed issue where an invalid date caused the page to constantly reload w/ burnettk
07a977f02 Revive report deletion (#85)
8aafd69db do not delete groups that were just added w/ burnettk
f4b01d957 update flask-bpmn w/ burnettk
b33947bda some cypress tests w/ burnettk
c56a2b0d7 update flask-bpmn w/ burnettk
e3d381a23 log api errors when sending to sentry w/ burnettk
568c2b7f2 give read access to process-data for all permission macro w/ burnettk
bf1ecb87d added ability to view data objects from the process instance show page w/ burnettk
2ba416f58 dev permissions copied from terraform deployed and terraform deployed now tiny, minor fixes
18ae75fa5 link to correct instances page, fix fin users, ignore coverage files
25022c35f trim down granted permissions to just the ones that exist in the API, improve output of permissions
3fd9aafe0 use spiffworkflow.org for admin and other minor permissions tweaks
fbfc0f118 fix flask bpmn poetry lock and change admin email to spiffworkflow.org
cd623fc97 fix qa1 and add script to get perms
8ed7800e5 lint and regen schema
0e8f6fc04 50 is not long enough to store our keycloak urls
3178909c1 add qa1 env
ffcfa7b37 added test to check only privileged users can call refresh_permissions w/ burnettk
833976ef0 updated permission yamls to have email addresses and look more the same w/ burnettk
73356471b pyl passes w/ burnettk
533beee8b removed scripts for permissions since that code has been mostly moved and superseded by refresh_permissions w/ burnettk
be228d405 added script to refresh permissions w/ burnettk
2b5d03beb pyl w/ burnettk
0ad370896 added script to get all permissions for the confirmation page when adding permissions from a process model w/ burnettk
d67ec1687 added test to for permission to process group w/ burnettk
f4558b616 fixed slashes to colons in permission macros w/ burnettk
a56734226 pyl
e3b9e127c added ALL macro for easier use with admin groups and some failure test cases
2a5954109 added remaining tests for current permission macros
f669d19ea added test for perm macros w/ burnettk
b73699e69 added method to add permissions based on macros w/ burnettk
4ac265433 Merge remote-tracking branch 'origin/main' into feature/bpmn_user_permissions
d45860254 minor tweak to test bpmn w/ burnettk
1c027df7c Merge branch 'main' of github.com:sartography/spiff-arena into main
91630588f Do not require a Git Repository to start a process.
d12696fcd do not force permissions to use the v1.0 path prefix but it can be used if desired w/ burnettk
7756165b0 pyl w/ burnettk
dc2a976b9 default requiring permissions to run a script to True w/ burnettk
71c4a2fdc added permission to run privileged scripts w/ burnettk
1033159b2 Merge pull request #79 from sartography/feature/better_unit_tests
6b886663f Merge remote-tracking branch 'origin/main' into feature/bpmn_user_permissions
c49355dec pyl fixed w/ burnettk
068c3f133 fixed get tasks and process instances by group w/ burnettk
66ebe1ad2 pyl w/ burnettk
a7256622d fixed completed instances filter w/ burnettk
0f18bb798 merged in main and resolved conflicts w/ burnettk
6a578b6f4 a little refactor w/ burnettk
f9fa7e514 set the completed by user on human task w/ burnettk
be47b7352 added remaining filter tests w/ burnettk
0d3506944 added another filter test
578481416 added test for report filters w/ burnettk
6cb0b068b reformat file again
e5a803f2b renamed test process instance create method w/ burnettk
4d2796fac some initial changes to refactor report filters w/ burnettk
e0ce9f71e fix more bs errors
e1d132cf6 fix lint errors
ca9587f1a fix conflicts for like the thousandth time
84749f194 fix filtering issue on completed instances tab and lint junk
3c2b71549 fix getting task info for a process instance w/ burnettk
90a5b0c31 added correct process instance permissions w/ burnettk
af03e4823 renamed active task to human task since we are no longer deleting them w/ burnettk
86cb5d77a created process instance list and show pages to handle all and for-me w/ burnettk
ec492b3cf fix conflicts yet again
6c64e7312 merged in main and resolved conflicts w/ burnettk
d4ef203da give everybody crud for reports w/ burnettk
a6a84beae fixed file upload and do not allow submitting task data to a suspended process instance w/ burnettk
bd835f980 fix typing problem
76481f57c updates to disallow modifying a process instance when it is not in the correct state w/ burnettk
b9642bfdf do not allow editing task data for process instances that are not suspended and some code cleanup w/ burnettk
a7fb08b11 add integration tests for process nav endpoints
51cfe2417 added updated and created at columns on user w/ burnettk
20f378922 set the auth header when calling git commit w/ burnettk
8ebd5f5b1 Fixing some tests.
3d769e185 Merge remote-tracking branch 'origin/main' into feature/bpmn_user_permissions
d24b53b7a Adding tests for the user service , and closing a few logic errors. Adding support for a single wild card for matching all users.
71a154db1 allow marking task complete without executing
b08496f4b fix conflicts again
d358f0e70 fix tests
f81851122 added completed column to active task w/ burnettk
10c92cd58 update url to allow permissions on send event
a32bf8993 some basic stuff for showing only relating items to user w/ burnettk
87b5d9aff fixed permissions w/ burnettk
ecc70c189 Merge remote-tracking branch 'origin/main' into feature/bpmn_user_permissions
07c5fe2e9 add a test group and put natalia in it
e2a7a5de2 updated some text for task tables w/ burnettk
d0fbd20ee merged in main and resolved conflicts w/ burnettk
609343d06 updated flask-bpmn so it does not send invalid token exceptions to sentry w/ burnettk
cd36bff52 Merge remote-tracking branch 'origin/main' into feature/better_unit_tests
06ea528c1 fix conflicts & update event url to match other process instance urls
3697c86c2 Merge branch 'feature/better_unit_tests' into feature/bpmn_user_permissions
b7d6448b8 Fixes a bug that was causing tests to be added to the incorrect task. Clean up UI for a better experience when viewing tests.
20f445d85 Updated migrations.
a75a5407e When loading permissions and the user does not exist, add records to the UserGroupAssignmentWaiting table that can be picked up later. Request "profile" scope over OpenID so we can get a few more bits of information when avilable. Add a "clear_perissions" script Add an "add_permissions" script Add an "add_permissions" script When logging in for the first time, check for any awaiting permissions and assign them. Add "enumerate" as a whitelisted function to React Schema Add a "display_name" to the user table
e10cb73f7 reformat & fix types
68c4aa2db Merge branch 'main' into feature/process-navigation
8f233106e Merge remote-tracking branch 'origin/unit_test_404' into feature/bpmn_user_permissions
9af47b207 Fix api endpoints for script unit tests
6c8cbe6f2 working but barely functional UI for manually sending events
a9673dd4b Assure our open-id system can return emails. Update our data from Open ID Systems when users log in
a66591833 Removing two fields from user table that were not used (uid, name) Request email from open id clients, as this would provide a handy way to uniquely reference users when assigning to groups. During Login do a lookup on email if possible -- so that permissions assignments based on email can be connected when sigining in through openid. Don't use "open_id" for the service name on user accounts, use the iss string provided through open id, this will allow us to support more than one open id platform. Update the KeyCloak configuration so it is able to return email addresses for users -- which will make permission assignment easier in the future. Removed several unused commands in the user_service class.
33d68368b split out completed instances by group as well
e7873c5be updated group api so it is not under tasks
88f6ea071 pyl
1582dca2d split group task tables by group and created component for group tables
37a516d99 some base work to try to get display names searchable for process models w/ burnettk
git-subtree-dir: spiffworkflow-backend
git-subtree-split: 094de3563ef9020743aaf116f98cbc8e81b9e5d6
2023-01-05 17:35:21 -05:00
|
|
|
from spiffworkflow_backend.models.human_task_user import HumanTaskUserModel
|
2022-10-12 10:22:22 -04:00
|
|
|
from spiffworkflow_backend.models.process_instance import ProcessInstanceModel
|
2022-10-20 16:00:12 -04:00
|
|
|
from spiffworkflow_backend.models.user import UserModel
|
2022-10-12 10:22:22 -04:00
|
|
|
from spiffworkflow_backend.services.process_instance_processor import (
|
|
|
|
ProcessInstanceProcessor,
|
|
|
|
)
|
|
|
|
from spiffworkflow_backend.services.process_instance_service import (
|
|
|
|
ProcessInstanceService,
|
|
|
|
)
|
|
|
|
from spiffworkflow_backend.services.process_model_service import ProcessModelService
|
|
|
|
|
2022-11-09 15:02:19 -05:00
|
|
|
# from tests.spiffworkflow_backend.helpers.test_data import load_test_spec
|
|
|
|
|
2022-10-12 10:22:22 -04:00
|
|
|
|
|
|
|
# We need to call this before importing spiffworkflow_backend
|
|
|
|
# otherwise typeguard cannot work. hence the noqa: E402
|
|
|
|
if os.environ.get("RUN_TYPEGUARD") == "true":
|
|
|
|
from typeguard.importhook import install_import_hook
|
|
|
|
|
|
|
|
install_import_hook(packages="spiffworkflow_backend")
|
|
|
|
|
|
|
|
|
|
|
|
from spiffworkflow_backend import create_app # noqa: E402
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
|
|
def app() -> Flask:
|
|
|
|
"""App."""
|
Squashed 'spiffworkflow-backend/' changes from 031713a6..6cae736a
6cae736a Merge pull request #145 from sartography/data_size_script
241cb6ed Merge branch 'main' of github.com:sartography/spiff-arena
53e824ab set git user configs explicitly using the env vars w/ burnettk
741dab7e so we do not lose our minds when debugging on a server
8dd5d834 Merge branch 'main' of github.com:sartography/spiff-arena
44390824 show help text for textareas as well w/ burnettk
92042e9a why not dict, too
d0b67bb8 Cleanup
4ffba533 Getting ./bin/pyl to pass
d53d0c21 Provide info about keys in task data and python env
02db5acf Unfactor to fix size calculation/type hint issues
84fe64b0 Getting ./bin/pyl to pass
60a03f03 Adding python env size
a929ef91 Add cumulative task data size to script
32bb223b remove start and end events from simple logs view
54fdfd46 copy env so we are doing additive stuff rather than completely rewriting it
833a4125 fix git bash script unbound error w/ burnettk
46c62b90 more git config updates w/ burnettk
621e13fb disable strict host checking for git commands w/ burnettk
182d657d fixed tests w/ burnettk
40db077e give access to download process data files if a user has access to start a process model w/ burnettk
9083fcae backend: create SSH key file when contents provided
90aad09e backend: use sensible lock filename for git
0065b98b backend: specify --rebase when using git pull
94e1e15c backend: fix use of SSH private key for git ops
55252831 Look in task data/script engine environment for data, not just workflow data. (#143)
c5661f96 delint
d2d1ee50 backend/git_service: accept webhook test requests
782650d7 backend/git_service: check repo URLs from webhook
e76114c9 bump spiffworkflow hash
00d8eb55 put the env vars in the env section of the github action configs w/ burnettk
279e3042 added test for quickstart guide w/ burnettk
0e8ebc26 pyl
8732bd25 Merge remote-tracking branch 'origin/main' into feature/support_local_openid_in_cypress_tests
5b89d0cf use _GIT_SOURCE_BRANCH instead of _GIT_BRANCH
18917e62 fix unprefixed config
f32d83de update configs for publish feature
6139b411 added some support for using the backend openid server for cypress tests w/ burnettk
a2792e4d add new uses and delete ppg.ba.sme1
512bce0f the equal sign is not apart of the env var w/ burnettk
28b25fae updated terraform deployed env config name w/ burnettk
88fe9e66 more config updates w/ burnettk
6ad3224b cleaned up the default config file a bit
f328b5db pyl
4ef72a9c fixed some env vars for ci
9a31aff0 pyl
2a642f38 Merge remote-tracking branch 'origin/main' into feature/update_configs_with_prefix
9f144f54 remove unused import
ab6c45bc all tests pass w/ spiff lib upgrade, thanks for the help elizabeth
27870682 format
dd0a642a updated remaining configs manually w/ burnettk
d3153224 updated secret config names as well w/ burnettk
7160c702 updated configs to use the prefix using the script w/ burnettk
e57476ac updated default user group var name for better prefix w/ burnettk
6d3ef2b8 save task data to spiff step details when copmleting a user task as well w/ burnettk jbirddog
fde9ac7f append OPEN_ID to TENANT_SPECIFIC_FIELDS for clarification on what it is from w/ burnettk
df34d786 do not remove the default user group when refreshing permissions w/ burnettk
a80f7513 Merge branch 'main' of github.com:sartography/spiff-arena into main
7c63f409 The aud in a json web token can be a string or an array -- so also deal with the case that it is an array
76fd4c2d updates to user import scripts w/ burnettk
f0067eea commit user if it has changed any attributes w/ burnettk
2f1cb4c0 fix for mypy on python 3.9 w/ burnettk
b2db377d give some leeway to iat when validating auth w/ burnettk
bce49095 add in debug logging when failing to login to help debug auth failures
af2d9a66 Don't try to complete a ready task to move the process instance diagram to the next yellow. (#136)
ee7d5b1e Merge pull request #137 from sartography/failing_test
a1e5111f allow overriding keycloak url in add user script w/ burnettk
d3b20221 updated add test users script to use realm admin w/ burnettk
390287bd The End Event has a spiff step
4e6bee21 added script to import users w/ burnettk
ff8912f5 added api endpoint to allow logging in for the first time with an openid access_token w/ burnettk
7fab1f4f Merge pull request #135 from sartography/bug/len
73e4178d run_pyl
9c40e56e delete 15 users that are no longer needed
82c42a66 Merge remote-tracking branch 'origin/main' into bug/len
057102c1 commit before removing users
fbee1e31 This should fix the len issue - though there may be better ways to fix this. This reverts commit 52b496d1058a630ee60c50c3e8acc72b2df748dc.
e48c3188 Revert "more finally for better len"
b398f53a more finally for better len added a fixme for raising errors fixed up an error message
3d22455e fix employee id
9eb0c08d Update Spiffworkflow so we have the better error messages on service tasks.
54e17133 don't default to a broken environment.
44acb13d add five test users, rename peopleops users, delete two
27bbacaf Remove version from docker-compose, as this is causing issues for people still using docker-compose v2.
74984c8e turn off profiling for now to see if that is what is causing segfaults
733fe927 Save logs in finally (#134)
37f728a7 link to the spiff step from a task on the frontend and use the correct db in ci
3c120843 pyl w/ burnettk
af10992a call activities are also working w/ burnettk
d0aa6b1c tasks and subprocesses can are setting the task states properly now when getting task data w/ burnettk jbirddog
4791bda5 pyl w/ burnettk
ffa4fd78 Merge branch 'save_step_data' of github.com:sartography/spiff-arena into save_step_data
9e3a897b Fix bug where deletes from the environment were not removed from the task data as well
7eebf361 Merge remote-tracking branch 'origin/main' into save_step_data
b4f22984 Merge pull request #132 from sartography/feature/no_more_current_user
db3d4703 updated controller to use spiff step details to find correct task data to show w/ burnettk
b3a70d42 run_pyl
fca00361 remove the "current_user" from being added to the task_data.
747f91d1 Merge remote-tracking branch 'origin/main' into save_step_data
ac02e0a9 Merge remote-tracking branch 'origin/main' into save_step_data
cce05cab pyl
dc250235 Merge pull request #131 from sartography/feature/improved_service_task_errors
4d9a7a6a If you have an instance/config.py to override local development it would also override testing.
c06db317 Use a mock when making external calls in tests.
d6654e82 Merge remote-tracking branch 'origin/main' into feature/improved_service_task_errors
6e4b191c Merge branch 'main' of github.com:sartography/spiff-arena
0fd982a4 catch up with environment change
81a7cdc9 added additional columns to spiff_step_details w/ burnettk jbirddog
805b86ec fixing some missing types
8644561b run_pyl
72deffd8 Assure that when something goes wrong calling a service task that we get as much good information about the problem as possible.
687125bd Merge remote-tracking branch 'origin/main' into save_step_data
9c8ca3aa enable faulthandler to hopefully see seg faults in the logs w/ burnettk jbirddog
a9651211 Merge branch 'main' into save_step_data
bc556729 remove dup
10fa5edf add users
d7f52641 Merge pull request #114 from sartography/frontend/use-api-subpath
35efb091 allow setting configs for the frontend through env vars w/ burnettk
7552408a allow configuring gunicorn configs in boot_server_in_docker w/ burnettk
1007e8c7 sentences need spaces between them
1b7fec4a renamed development env to local_development and testing to unit_testing w/ burnettk
02750228 set up qa2 to only do path based routing w/ burnettk
ee3cb621 added backend url to qa2 configs
fab0a6bd added qa2 configs to use keycloak on qa1 to test different domains w/ burnettk
f7743ea4 Merge pull request #128 from sartography/feature/bug_fixes
384d65f6 Update tasks_controller.py
7f0c0926 update get_token
af5a4c50 pass tenant attributes when creating a user w/ burnettk
2cf6f1a5 pyl w/ burnettk
b7bdae94 Merge remote-tracking branch 'origin/main' into feature/tenant-specific-fields-from-openid
007eecdc added bambooid to status users w/ burnettk
3b0e3ff6 POC for saving some data about each step
98490b69 allow added custom attributes to users when adding to keycloak w/ burnettk
68358519 Backend do_engine_steps performance improvements (#129)
2a2855e0 use our json encoder to dump the user for get_current_user script w/ burnettk
706bb570 Use the same markdown library for displaying as for editing - could enable a security run_pyl
7aebec9d When catching non-jinja errors from Jinja, raise a good error message, and make a best effort at tracking down the line number and error line if possible.
b4a31562 move towards returning dict in get_current_user
19ccca40 Merge remote-tracking branch 'origin/main' into feature/tenant-specific-fields-from-openid
257de512 add test users
ecc70795 run_pyl
3eb0fd76 When searching for human tasks to determine if the current user can complete it, filter on the "completed" flag.
ad4fead4 Back to inserting every log
12c3a2b8 hoping to fix tests on windows
d8ba46b6 grab bamboo_id from keycloak
e5a56f6e lint
f1c61581 if there are tenant specific fields in the config, transfer them from openid token to db
35637ba0 Merge branch 'main' of github.com:sartography/spiff-arena into main
86b248fa Fix that dreadful unknown "KeyError" exception that was cropping up. Adding a bit of detail to the spiffworkflow exceptions when a duplicate process model is found. Disable the submit button on tasks after you click submit (avoid the double click and give users a better experience)
6fc2f2b2 Merge pull request #125 from sartography/feature/dynamically-hide-fields-w-task-data
9de6e0b3 refactor some stuff in task_show to separate functions
f2a12c5c show that hiding nested fields works as well
d7fd92e1 make form schema and form ui schema both dicts, add support for hiding fields based on task data
80649382 run_pyl
5a859f16 Merge branch 'main' into feature/more_better_errors
2d4f9d45 add more users, and try to prevent sentry notification again
83b9c901 remove service accounts, formalize j, add madhurya
698b3af8 make test_user_lists more complete and correct
a163d6f7 clean up sentry notification and avoid logger.exception when we do not want sentry
0fced76d couple last serializer updates
b17142bf import EventBasedGatewayConverter from correct package
5b7805d0 try to improve exception handling by avoiding raising ApiError from services
e9913d83 simplify spiff integration post serializer update, w/ elizabeth and jon
9baf0cb2 Quick fix for url building
4641b523 File download from workflow data (#122)
30a73e2a Allow for different Python Environments when executing scripts within SpiffWorkflow (#121)
650b91ed add keycloak users
6d18bd23 bulk insert logs for performance improvement
c50744a1 there is no need to ever sentry_sdk.start_transaction because the flask integration does that
1368d71c get some more insight into connector proxy timings
7ffcded9 avoid poetry installing deps when we have them cached if they do not change
5d50ee8e more spans to track performance
a23a0700 more sentry performance tracing
8a98e8d9 folks who can start instances can also view their logs
17fb81bc shuffle around Dockerfile to allow to work for background container
d9bcbd09 Merge pull request #117 from sartography/feature/authorization
c586e0ea allow overriding git related configs w/ env var and log permissions stuff on boot
f5ee3ec8 Merge branch 'main' into feature/more_better_errors
063ebda6 Merge pull request #115 from sartography/backend/improve-dockerfile
ba6d4c5f Fix typing issue.
b0a05adc Use the id_token, not the auth_token from the open id server for authentication with the front end. The auth_token should be kept safe, and not guranteeded to be a json token.
b9eb5dd8 add four new status users to spiff realm
553c93be backend: avoid redundant steps in Dockerfile
cf2e8975 removed old pin to spiffworkflow w/ burnettk
5970b1e3 tests are passing now w/ burnettk
a39aca6a some initial updates w/ burnettk
6fda0c5c Allow set to be called from scripts
a6482760 update lock file in backend and arena, though that one needs pruning
5b2046ab run_pyl
5328a2d4 Workflow Data Exceptions were not getting processed, we now catch the WorkflowDataException through the generic top level SpiffWorkflowException.
9f98cfee updated prefix for background instances w/ burnettk
acd26c04 Merge pull request #110 from sartography/feature/jinja_errors
864ae116 add keycloak users
f80836e7 pyl
71e20c9f set the correct type for task since SpiffTask and a backend task are not the same
26c791f9 increased the task data size
79dadcaa added pylint back to lock file
35b0871c Merge remote-tracking branch 'origin/main' into feature/jinja_errors
1dbac99a run_pyl had various recommendations that I find a bit of a pain in the butt, but that I did anyway.
b30081ab Merge pull request #109 from sartography/feature/upgrade_bandit
efb8fd0b removed debug print statements
58679f60 ensure we are passing the primary file name to the delete file test
9943cbbb fixed typo w/ burnettk
1fe63808 added some debug statements for ci w/ burnettk
d84942f0 upgraded bandit and flake8 w/ burnettk
72f599cb Merge remote-tracking branch 'origin/main' into feature/jinja_errors
c0530539 allow removing users from groups when refreshing permissions w/ burnettk
106500cf Added useMemo to error context No longer clear errors in the task bar, as that will constantly remove them as soon as they are shown.
08c3106c Merge branch 'main' of github.com:sartography/spiff-arena
957e0373 when changing the primary file name also change the primary process when updating a process model from the api w/ burnettk
b560b364 Making sure we create informative messages when encountering jinja2 syntax errors.
51c325da delete legacy flask-rendered html pages from initial prototype, since backend is now API-only
59ebcbb4 added the process model identifier for the diagram if it is not the top level w/ burnettk
a02a132e Merge pull request #107 from sartography/feature/metadata_on_instance_show
b22e8828 do not allow deleting primary bpmn file and do not allow instantiating models without a primary bpmn file w/ burnettk
002df3f9 show metadata on instance show page but for some reason it reorders elements w/ burnettk
81c3cfe1 removed uniqueness constraint from human task so we can loopback to a previous task with a gateway w/ burnettk
73cbef31 ensure order of permissions in tests
d5949b86 document future enhancement
c8bc2049 strip off newlines and spaces when importing secrets and pinning spiffworkflow to working version until we can debug issues with new one w/ burnettk
bb99d942 added locking system for process instances so hopefully background jobs will not take instances currently being run by the user w/ burnettk
a4e60a36 added uniqueness constraint to spiff step details w/ burnettk
5fd7197c add sum and format
53d99f7d expanded functionality of the form builder
f08ff45b Revert "allow updating models on staging for a bit"
f88d3250 Revert "commit on save yes for now"
6675c407 qa1
10180043 since accepting the github host entry programatically is no more secure
1517a3ee commit on save yes for now
5f1af4a6 allow updating models on staging for a bit
27fbd93d allow getting the GIT SSH key from an app config so we can set it in the secrets file w/ burnettk
9fa2f982 allow specifying an ssh key for git instead of a username and password w/ burnettk
09337070 updated admin user on sartography realm w/ burnettk
17124319 allow passing a realm name into start keycloak and added admin user to sartography realm
7d9600f4 find the top level process to find the task form when using subprocesses in called activities w/ burnettk danfunk
0bf13094 pyl w/ burnettk
97268226 Merge branch 'main' into feature/improved_errors
c1403a9e ensure we have something in the logs w/ burnettk
cdaf59b8 pyl w/ burnettk
55468b67 added configs for sartography env w/ burnettk
205dd4a5 pre-commit-in-ci
bd1058fe updating spiffworkflow version, and fixing the run_pyl (by removing the corft I stuck in earlier)
ecbe1948 Merges
5da88709 Lots of adjustments from running pyl Main change is in the ErrorDisplay.tsx to assure all error information is provided. and index.css to make it "pretty"
ab1d5c22 Removing dependency on flask-bpmn and taking it out of SpiffArena Slightly updating the APIError code for recent updates to SpiffWorkflow's error refactoring.
git-subtree-dir: spiffworkflow-backend
git-subtree-split: 6cae736acd232199447a44f7ff2a8dc4c7779631
2023-02-23 10:49:54 -05:00
|
|
|
os.environ["SPIFFWORKFLOW_BACKEND_ENV"] = "unit_testing"
|
2022-10-12 10:22:22 -04:00
|
|
|
os.environ["FLASK_SESSION_SECRET_KEY"] = "super_secret_key"
|
|
|
|
app = create_app()
|
|
|
|
|
|
|
|
return app
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture()
|
|
|
|
def with_db_and_bpmn_file_cleanup() -> None:
|
|
|
|
"""Process_group_resource."""
|
Squashed 'spiffworkflow-backend/' changes from 7600e1e57..094de3563
094de3563 pyl w/ burnettk
7575ce459 Merge pull request #95 from sartography/feature/find_by_process_instance_id
bb3c9ebea fixed test w/ burnettk
4b8b5fc40 added fix to SpiffWorkflow to deepcopy operation params before evaluating them w/ burnettk
08909ae93 Add get_secret script (#94)
158cbb4bf basic support to find a process instance by id w/ burnettk
49a71d898 pyl w/ burnettk
3d87cc56a Merge branch 'main' into feature/process-nav-improvements
13ef0ab87 fixed issue displaying task data for call activities called multiple times in a diagram w/ burnettk
e99caf034 Merge branch 'main' into feature/process-nav-improvements
e64fe5eee add a bit more debugging info
f4907aeab pyl
ac079f881 added ability to filter process instances by process initiator
9d848effa pyl w/ burnettk
7ae3dca55 added process group display name to model search and cache the groups to avoid extra lookups w/ burnettk
fc30bd843 merged in main and resolved conflicts
9f036a1d0 Helper function to support reaping process instances (#91)
29fb40b3f pyl w/ burnettk
10e2ea6f9 added new page to create process models using english text w/ burnettk
7f9422ce2 added method to create process models based on english string w/ burnettk
8de7d1378 upgrade black, give it the preview flag, and let it rip on long strings
9310c8eec configure metadata extration paths appropriately
2adb6b206 actually create process model
afd6bcbc3 added basis of api to create process models from text w/ burnettk
141b19241 reformat file
119f2513e remove reset tasks from human task table
244c6178a added all users to waiting for column on task list tables w/ burnettk
787e1e1ee fix method overwritten by merge
8dd2457ce Merge branch 'main' into feature/process-nav-improvements
dab22e0ec ensure we get logs for both db and backend with docker compose w/ burnettk
a2aa3ae4f remove unused task method
ad17ca3f5 allow tests to determine what paginated entity id to use to determine a table has loaded
1fcaf8bdb create spiff steps for manual navigation
0bc9ae6f6 Merge remote-tracking branch 'origin/main' into feature/process_api_blueprint_refactor
71475ddf8 Merge pull request #78 from sartography/feature/process-navigation
534e2d468 move helpers where they belong
22cdc28a8 run ./bin/run_pyl
55eedd28c new service tasks controller
439106265 move status to health controller
e0f7da69a fix test
accde5d4e move helpers where they belong
524434a10 allow option to complete single tasks with or without execution
865fd6c8c get tests passing
7faf753e6 moved some more apis w/ burnettk
aa87d68d5 moved more api methods to own controllers w/ burnettk
6b78eddc8 add endpoint to reset process to earlier step
be5580a92 moved process groups, models, and instances api methods to own controller files w/ burnettk
3933c92a5 fix bug with opening call activities when processes conflict with dmn files
76c71a7e5 fix show previous spiff steps
7f09a92eb Minor fix to SpiffWorkflow library
d3136f8e4 Don't freak out if git is not yet setup in the working directory.
83e468d43 Merge branch 'main' into feature/process-navigation
42393d8d7 Make list available to script tasks (#86)
0972d9790 save the process instance even if it fails to run all the way w/ burnettk
626db0d78 delete human tasks when process instance is deleted w/ burnettk
1a71a44b5 Merge branch 'main' of github.com:sartography/spiff-arena
0cc6f2c2d fixed some cypress tests and fixed issue where an invalid date caused the page to constantly reload w/ burnettk
07a977f02 Revive report deletion (#85)
8aafd69db do not delete groups that were just added w/ burnettk
f4b01d957 update flask-bpmn w/ burnettk
b33947bda some cypress tests w/ burnettk
c56a2b0d7 update flask-bpmn w/ burnettk
e3d381a23 log api errors when sending to sentry w/ burnettk
568c2b7f2 give read access to process-data for all permission macro w/ burnettk
bf1ecb87d added ability to view data objects from the process instance show page w/ burnettk
2ba416f58 dev permissions copied from terraform deployed and terraform deployed now tiny, minor fixes
18ae75fa5 link to correct instances page, fix fin users, ignore coverage files
25022c35f trim down granted permissions to just the ones that exist in the API, improve output of permissions
3fd9aafe0 use spiffworkflow.org for admin and other minor permissions tweaks
fbfc0f118 fix flask bpmn poetry lock and change admin email to spiffworkflow.org
cd623fc97 fix qa1 and add script to get perms
8ed7800e5 lint and regen schema
0e8f6fc04 50 is not long enough to store our keycloak urls
3178909c1 add qa1 env
ffcfa7b37 added test to check only privileged users can call refresh_permissions w/ burnettk
833976ef0 updated permission yamls to have email addresses and look more the same w/ burnettk
73356471b pyl passes w/ burnettk
533beee8b removed scripts for permissions since that code has been mostly moved and superseded by refresh_permissions w/ burnettk
be228d405 added script to refresh permissions w/ burnettk
2b5d03beb pyl w/ burnettk
0ad370896 added script to get all permissions for the confirmation page when adding permissions from a process model w/ burnettk
d67ec1687 added test to for permission to process group w/ burnettk
f4558b616 fixed slashes to colons in permission macros w/ burnettk
a56734226 pyl
e3b9e127c added ALL macro for easier use with admin groups and some failure test cases
2a5954109 added remaining tests for current permission macros
f669d19ea added test for perm macros w/ burnettk
b73699e69 added method to add permissions based on macros w/ burnettk
4ac265433 Merge remote-tracking branch 'origin/main' into feature/bpmn_user_permissions
d45860254 minor tweak to test bpmn w/ burnettk
1c027df7c Merge branch 'main' of github.com:sartography/spiff-arena into main
91630588f Do not require a Git Repository to start a process.
d12696fcd do not force permissions to use the v1.0 path prefix but it can be used if desired w/ burnettk
7756165b0 pyl w/ burnettk
dc2a976b9 default requiring permissions to run a script to True w/ burnettk
71c4a2fdc added permission to run privileged scripts w/ burnettk
1033159b2 Merge pull request #79 from sartography/feature/better_unit_tests
6b886663f Merge remote-tracking branch 'origin/main' into feature/bpmn_user_permissions
c49355dec pyl fixed w/ burnettk
068c3f133 fixed get tasks and process instances by group w/ burnettk
66ebe1ad2 pyl w/ burnettk
a7256622d fixed completed instances filter w/ burnettk
0f18bb798 merged in main and resolved conflicts w/ burnettk
6a578b6f4 a little refactor w/ burnettk
f9fa7e514 set the completed by user on human task w/ burnettk
be47b7352 added remaining filter tests w/ burnettk
0d3506944 added another filter test
578481416 added test for report filters w/ burnettk
6cb0b068b reformat file again
e5a803f2b renamed test process instance create method w/ burnettk
4d2796fac some initial changes to refactor report filters w/ burnettk
e0ce9f71e fix more bs errors
e1d132cf6 fix lint errors
ca9587f1a fix conflicts for like the thousandth time
84749f194 fix filtering issue on completed instances tab and lint junk
3c2b71549 fix getting task info for a process instance w/ burnettk
90a5b0c31 added correct process instance permissions w/ burnettk
af03e4823 renamed active task to human task since we are no longer deleting them w/ burnettk
86cb5d77a created process instance list and show pages to handle all and for-me w/ burnettk
ec492b3cf fix conflicts yet again
6c64e7312 merged in main and resolved conflicts w/ burnettk
d4ef203da give everybody crud for reports w/ burnettk
a6a84beae fixed file upload and do not allow submitting task data to a suspended process instance w/ burnettk
bd835f980 fix typing problem
76481f57c updates to disallow modifying a process instance when it is not in the correct state w/ burnettk
b9642bfdf do not allow editing task data for process instances that are not suspended and some code cleanup w/ burnettk
a7fb08b11 add integration tests for process nav endpoints
51cfe2417 added updated and created at columns on user w/ burnettk
20f378922 set the auth header when calling git commit w/ burnettk
8ebd5f5b1 Fixing some tests.
3d769e185 Merge remote-tracking branch 'origin/main' into feature/bpmn_user_permissions
d24b53b7a Adding tests for the user service , and closing a few logic errors. Adding support for a single wild card for matching all users.
71a154db1 allow marking task complete without executing
b08496f4b fix conflicts again
d358f0e70 fix tests
f81851122 added completed column to active task w/ burnettk
10c92cd58 update url to allow permissions on send event
a32bf8993 some basic stuff for showing only relating items to user w/ burnettk
87b5d9aff fixed permissions w/ burnettk
ecc70c189 Merge remote-tracking branch 'origin/main' into feature/bpmn_user_permissions
07c5fe2e9 add a test group and put natalia in it
e2a7a5de2 updated some text for task tables w/ burnettk
d0fbd20ee merged in main and resolved conflicts w/ burnettk
609343d06 updated flask-bpmn so it does not send invalid token exceptions to sentry w/ burnettk
cd36bff52 Merge remote-tracking branch 'origin/main' into feature/better_unit_tests
06ea528c1 fix conflicts & update event url to match other process instance urls
3697c86c2 Merge branch 'feature/better_unit_tests' into feature/bpmn_user_permissions
b7d6448b8 Fixes a bug that was causing tests to be added to the incorrect task. Clean up UI for a better experience when viewing tests.
20f445d85 Updated migrations.
a75a5407e When loading permissions and the user does not exist, add records to the UserGroupAssignmentWaiting table that can be picked up later. Request "profile" scope over OpenID so we can get a few more bits of information when avilable. Add a "clear_perissions" script Add an "add_permissions" script Add an "add_permissions" script When logging in for the first time, check for any awaiting permissions and assign them. Add "enumerate" as a whitelisted function to React Schema Add a "display_name" to the user table
e10cb73f7 reformat & fix types
68c4aa2db Merge branch 'main' into feature/process-navigation
8f233106e Merge remote-tracking branch 'origin/unit_test_404' into feature/bpmn_user_permissions
9af47b207 Fix api endpoints for script unit tests
6c8cbe6f2 working but barely functional UI for manually sending events
a9673dd4b Assure our open-id system can return emails. Update our data from Open ID Systems when users log in
a66591833 Removing two fields from user table that were not used (uid, name) Request email from open id clients, as this would provide a handy way to uniquely reference users when assigning to groups. During Login do a lookup on email if possible -- so that permissions assignments based on email can be connected when sigining in through openid. Don't use "open_id" for the service name on user accounts, use the iss string provided through open id, this will allow us to support more than one open id platform. Update the KeyCloak configuration so it is able to return email addresses for users -- which will make permission assignment easier in the future. Removed several unused commands in the user_service class.
33d68368b split out completed instances by group as well
e7873c5be updated group api so it is not under tasks
88f6ea071 pyl
1582dca2d split group task tables by group and created component for group tables
37a516d99 some base work to try to get display names searchable for process models w/ burnettk
git-subtree-dir: spiffworkflow-backend
git-subtree-split: 094de3563ef9020743aaf116f98cbc8e81b9e5d6
2023-01-05 17:35:21 -05:00
|
|
|
db.session.query(HumanTaskUserModel).delete()
|
2022-10-21 16:28:09 -04:00
|
|
|
|
2022-10-12 10:22:22 -04:00
|
|
|
for model in SpiffworkflowBaseDBModel._all_subclasses():
|
|
|
|
db.session.query(model).delete()
|
2022-10-20 16:00:12 -04:00
|
|
|
db.session.commit()
|
2022-10-12 10:22:22 -04:00
|
|
|
|
|
|
|
try:
|
|
|
|
yield
|
|
|
|
finally:
|
|
|
|
process_model_service = ProcessModelService()
|
|
|
|
if os.path.exists(process_model_service.root_path()):
|
|
|
|
shutil.rmtree(process_model_service.root_path())
|
|
|
|
|
|
|
|
|
2022-10-20 16:00:12 -04:00
|
|
|
@pytest.fixture()
|
|
|
|
def with_super_admin_user() -> UserModel:
|
|
|
|
"""With_super_admin_user."""
|
|
|
|
return BaseTest.create_user_with_permission("super_admin")
|
|
|
|
|
|
|
|
|
2022-10-12 10:22:22 -04:00
|
|
|
@pytest.fixture()
|
2022-11-09 15:02:19 -05:00
|
|
|
def setup_process_instances_for_reports(
|
|
|
|
client: FlaskClient, with_super_admin_user: UserModel
|
|
|
|
) -> list[ProcessInstanceModel]:
|
2022-10-12 10:22:22 -04:00
|
|
|
"""Setup_process_instances_for_reports."""
|
2022-11-09 15:02:19 -05:00
|
|
|
user = with_super_admin_user
|
2022-10-12 10:22:22 -04:00
|
|
|
process_group_id = "runs_without_input"
|
|
|
|
process_model_id = "sample"
|
2022-11-09 15:02:19 -05:00
|
|
|
# bpmn_file_name = "sample.bpmn"
|
|
|
|
bpmn_file_location = "sample"
|
2022-11-11 11:40:59 -05:00
|
|
|
process_model_identifier = BaseTest().create_group_and_model_with_bpmn(
|
2022-11-09 15:02:19 -05:00
|
|
|
client,
|
|
|
|
with_super_admin_user,
|
|
|
|
process_group_id=process_group_id,
|
|
|
|
process_model_id=process_model_id,
|
|
|
|
# bpmn_file_name=bpmn_file_name,
|
|
|
|
bpmn_file_location=bpmn_file_location,
|
|
|
|
)
|
|
|
|
|
|
|
|
# BaseTest().create_process_group(
|
|
|
|
# client=client, user=user, process_group_id=process_group_id, display_name=process_group_id
|
|
|
|
# )
|
|
|
|
# process_model_id = "runs_without_input/sample"
|
|
|
|
# load_test_spec(
|
|
|
|
# process_model_id=f"{process_group_id}/{process_model_id}",
|
|
|
|
# process_model_source_directory="sample"
|
|
|
|
# )
|
2022-10-12 10:22:22 -04:00
|
|
|
process_instances = []
|
|
|
|
for data in [kay(), ray(), jay()]:
|
Squashed 'spiffworkflow-backend/' changes from c1ecc9035..ecbe97049
ecbe97049 comment out test not working in CI
942c18fa3 indicate main explicitly for ci
3cd57a1c8 pyl w/ burnettk
5b2917a59 update staging configs to allow env var overrides w/ burnettk
7645a5f8d need to set upstream when git pushing w/ burnettk
0413f3cdf added secret verification to webhook endpoint w/ burnettk
e7576d7ee fixed broken test w/ burnettk
bf507f8fc fixed mypy issue w/ burnettk
7c6e5c306 Merge branch 'main' of github.com:sartography/spiff-arena
87c986df0 cleaned up the git service and expanded the api git hook w/ burnettk
c7322f3c8 Sort primary file to top of files list (#71)
089d7d5e2 note
aa6fe8286 add skeleton of endpoint to receive github webhooks
7b9e99ad9 some reorder w/ burnettk cullerton
2081532f4 mypy w/ burnettk cullerton
ade7a41e7 added git creds for pushing on publish w/ burnettk cullerton
832d7c5c2 merged in main and resolved conflicts w/ burnettk cullerton
236e0e4ae favor os.path.join over hardcoding slash w/ burnettk
4ce7d6732 pyl passes
b525e3523 added new notification component that allows links based on carbons w/ burnettk cullerton
1e9b2e9ab Return URL where they can view changes and open PR
c8e8dae95 Clone into unique directory so we don't step on a previous publish that hasn't finished.
c5e7e9153 make process metadata saving more resilient
dbaa2c37c added frontend url as post redirect url in keycloak w/ burnettk
348595c19 syntax fix w/ burnettk
bbcfd5213 remove staging py config file in favor of terraform configs w/ burnettk
b150a8a69 moved some configs from deploy scripts to terraform env config w/ burnettk
acf641962 rename terraform configs from rb to py w/ burnettk
862937525 Add comment about the new environment variable
655e01a48 Merge branch 'main' into feature/create_containers
f580cadb2 Merge branch 'main' into feature/git-integration
e241ed5cd updated terraform permissions to match development better w/ burnettk
d102a4c84 Merging this unfinished test so I don't lose it. It doesn't test anything yet. Need to deal w/ a bunch of mock stuff
b5aecb072 Merge pull request #69 from sartography/feature/api_permission_cleanup
a0f351d16 Merge pull request #65 from sartography/new_report
88ad3b99a typing
da082e369 Merge branch 'main' into feature/git-integration
a1fe0193d First pass at git integration
1e029f427 break process instance log list page into two tabs, simple and detailed
11b994a81 Merge remote-tracking branch 'origin/main' into feature/api_permission_cleanup
b1199530d update cors handling to make it more efficient
ed6a4d8c9 more api cleanup w/ burnettk
b19825e17 cleaned up more api routes for permissions w/ burnettk
4b5f5d369 updated tasks endpoint to task-data for easier permission setting w/ burnettk
460cfb4e4 pyl w/ burnettk
85509c3d4 fixing an untyped method.
a7eeaa6d9 running py_pl -- mainly reordering imports.
c9e3e8d31 Merge remote-tracking branch 'origin/main' into feature/create_containers
786785693 Setting things up so it's easy to switch databases using a local configuration file (still works with environment variables) Swtiched from a "joinedload" to a "selectinload" which removes a problem with groupby columns in Postgres and sqlite. (https://docs.sqlalchemy.org/en/14/orm/loading_relationships.html#selectin-eager-loading)
f3760380e added support to order reports by given column and metadata headers w/ burnettk
0425293fd Fixes based off KB's super kind review. ------- * Remove unnecessary packages from dockerfile for the demo-connect proxy. * Rename an environment variable that mentioned Status.im in what is now a generic connector. * Fixed a spelling mistake.
bee4ea107 bump nox stuff and spiff
d7ff963da test for automatic saving of process instance metadata on instance save
fe7c4c923 remove dup test process model
eb2f64518 add order_by to make this query deterministic
9b2a40c87 lint
ceec518c9 add extraction, needs test
9af4cf3f3 fix tests
452c64cbf Merge remote-tracking branch 'origin/main' into new_report
809d8bfbf using an array for metadata extraction paths now instead of dictionaries w/ burnettk
49b02a9c2 added some support to add process model metadata. need to fix frontend w/ burnettk
d2d0cb0b1 getting the collect hit_policy to work correctly.
a3f4c2f48 filtering by metadata works w/ burnettk
f87d266a4 favor report id over identifier but support both and ui updates to allow setting a condition value on a metadata field, changing the display name, and fixes for saving and updating a report
52b288bd4 I can't say I love flake8. Removing dependency on rust (monkeytype)
3534b1896 fixing some typing issues, white space, etal...
389069fde added ability to update the display name for perspective columns w/ burnettk
d9b36f5e1 fixing some typing issues.
51ecd25fb Reorder config imports so that instance config is dead last - and can override everything else. Updated docker-compose for running a demo. run_pyl fixes
d7308ef67 Adding a demo permissions file.
8ade069dd A little cleanup of the ui Don't check authorization on static assets Do not require unique username on user table (uniqueness check is on the service and service id composite.)
1ebe6e108 some updates for process instance reports and metadata w/ burnettk
321fc0e75 Use the "well-known" configuration dictionary from openid to get the url endpoints, rather than trying to configure or guess the correct endpoint urls.
77c79e58b added correlations to message list table w/ burnettk
4df885fd3 Not all open id systems have realms like KeyCloak does -- so removing this in favor of setting just one value - which is the base url of the openid system -- which will work across all openid systems.
d4ad18ab9 Adding a blueprint for openid - a very lightweight embedded authentication system to make it eaiser to try out SpiffWorkflow when you don't have openID set up with Google etal. Removing all calls to open id's user_info endpoint - as these are unncessiary. Adding a users section to the permission files -- so we can handle all user/group/permissions in one file when needed. There was a very confusing is_admin function on the user model that needed killin.
9669f2898 removed file named ':'
341fb8cf5 added api to get list of process report columns
a6002ebac finished base for metadata reporting w/ burnettk
8e9828661 some cleanup for metadata w/ burnettk
91ea7f4b4 metadat reports work w/ burnettk
2571eb656 WIP more metadata reporting w/ burnettk
a2dbee712 WIP more metadata reporting w/ burnettk
a0081bdf7 some basics to add metadata to reports w/ burnettk cullerton
fcc5bce3e fixed issue ensuring active tasks are up to date w/ burnettk cullerton
3ef318e61 added script to save process instance metadata and fixed permissions issue w/ burnettk cullerton
46038eae3 only delete active tasks if needed w/ burnettk cullerton
3b6255147 Merge pull request #64 from sartography/group_query
3abdf8872 get rid of Project Lead group
ded78d9fe Getting ./bin/pyl to pass
c51e56e9b Query fix with the gang
38c37b927 everybody gets access to read processes
e2a3d67eb put sasha and manuchehr in demo group
61a2d858e upgrade keycloak
47b551b8a make sasha, harmeet, manuchehr, and admin have desired permissions for demo
3ecfe6ae4 add demo group access to the customer-contracts to give us 5 tiles for the dmeo.
327981e63 adding the username to the report tables
c90a0a330 Performance improvement in listing all process models.
d32575033 Don't create a processor for every thing all the time.
2f639352a Getting ./bin/pyl to pass
c8f561159 Merge branch 'main' into task_json
fe5f9995b Just save task_json
8f2784828 no global read since that gives configuration as well
e351f033e do not allow starting vendor invoice approval process for demo users
2e97efdbb Change permissions per request -- want everyone to have access to 4 process models.
ff63418ca Change permissions per request -- want everyone to have access to 4 process models.
6b4bcfd34 Merge branch 'main' of github.com:sartography/spiff-arena into main
bc6d80513 Change permissions changed from vendor to core-contributor for everyone.
dfed48057 upgrade keycloak
0f0f56e45 display name instead of id, margin under table sections, Download xml to Download
9af377307 lint
fe5d2fdec exclude instances you started in with_tasks_completed_by_me
bb76eeee5 lint
e30f12fab in completed tab, show display name, and filter by all stopped statuses rather than just complete
57a720c97 tests passing
dc0665c26 gotta fix usage of is_model
63b654c22 working on tests
aa4277d98 oh my god why were these ever instance methods
875bd1576 remove column
6081f6637 renames
aa2333f27 start adding display name and removing garbage
a9d5e121b add fin1, lead1, and Tasks actioned by me to Tasks completed by me
e32c3830b Fix the postgres job (#61)
adcfc53f4 Fix for updating xero token in the background (#60)
bd4f5d247 updated breadcrumb to use display name w/ burnettk
6b94bb260 update permissions per feedback in demo
71c1f7974 rename process_groups_list to process_group_list and fix lint
d4a1d0552 add perm to process instance report list
4f78b1958 some more perm updates for core user w/ burnettk
8fb5fd3c3 Merge branch 'main' of github.com:sartography/spiff-arena
b43a06f51 give core user access to instance tasks w/ burnettk
06ba17be1 Start of system report filters (#57)
213221214 Update oauth redirect url (#58)
75d3c0cea filter process models based on user permissions on the backend if specified w/ burnettk
acc88b9a9 created new users for keycloak and fixed some permissions for core user w/ burnettk cullerton
6eb24f10c Allow switching between user defined reports (#56)
d7cb24a56 fixed broken test
8f9d918ef added recursive option to process model list to recurse or not and fix some ui components
2b47eb7f5 upgrade apscheduler and fix mispelling
2f312e2ab pyl is passing
4fedc046d Merge branch 'main' of https://github.com/sartography/spiff-arena
e6230cb79 pyl is passing w/ burnettk
e5f7f5096 added a script to add a user to a group w/ burnettk
33897da2c mypy
7a9954d74 sort process groups by display name w/ burnettk cullerton
7e9331dd3 Merge branch 'main' into move-group-or-model
d87f47aaa allow getting all process models, process instances should not save when they are initialized, and fixed some cypress tests w/ burnettk
8ffd6203c use correct separator.
de7ebb6f5 Merge branch 'main' of github.com:sartography/spiff-arena into main
bf6645960 Remove MoneyType from dependencies to avoid a new dependency on a rust complier when upgrading to pytno 11.
9455366f5 lint
7866730f2 see if this solves the windows build problem
98e07cc85 add id_for_file_path helper method for process groups
fc476e3cc run_pyl
72da67f00 eliminate security issue by removing py
818bce07e update mysql-connector-python
37444f8bf asst syntax cleanup
7bde5d8cc mypy
ea82bf583 removed print statement and unused line of code
9717fb112 test for move model
d07114593 move model
38dc4570d process group move api endpoint
git-subtree-dir: spiffworkflow-backend
git-subtree-split: ecbe97049cbf46d1d7d240cb80051290de56fa7d
2022-12-10 23:39:01 -05:00
|
|
|
process_instance = ProcessInstanceService.create_process_instance_from_process_model_identifier(
|
2022-11-09 15:02:19 -05:00
|
|
|
# process_group_identifier=process_group_id,
|
|
|
|
process_model_identifier=process_model_identifier,
|
2022-10-12 10:22:22 -04:00
|
|
|
user=user,
|
|
|
|
)
|
|
|
|
processor = ProcessInstanceProcessor(process_instance)
|
|
|
|
processor.slam_in_data(data)
|
|
|
|
process_instance.status = "complete"
|
|
|
|
db.session.add(process_instance)
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
process_instances.append(process_instance)
|
|
|
|
|
|
|
|
return process_instances
|
|
|
|
|
|
|
|
|
|
|
|
def kay() -> dict:
|
|
|
|
"""Kay."""
|
|
|
|
return {"name": "kay", "grade_level": 2, "test_score": 10}
|
|
|
|
|
|
|
|
|
|
|
|
def ray() -> dict:
|
|
|
|
"""Ray."""
|
|
|
|
return {"name": "ray", "grade_level": 1, "test_score": 9}
|
|
|
|
|
|
|
|
|
|
|
|
def jay() -> dict:
|
|
|
|
"""Jay."""
|
|
|
|
return {"name": "jay", "grade_level": 2, "test_score": 8}
|