Commit Graph

1080 Commits

Author SHA1 Message Date
jasquat 8d67e8cc87 we can save the top level spec to the database with its tasks w/ burnettk 2023-03-02 17:28:31 -05:00
jasquat 971de5cb7c created models to hold the bpmn_json w/ burnettk 2023-03-02 16:31:21 -05:00
jasquat 6e23a179b7 wait 120 seconds before processing user_input_required process instances w/ burnettk 2023-03-02 12:06:12 -05:00
burnettk 612d63f141 Merge branch 'main' of github.com:sartography/spiff-arena 2023-03-02 10:43:05 -05:00
burnettk 5cbffe2e96 allow open id to come in via env 2023-03-02 10:43:02 -05:00
jasquat 989c0932cd some pyl issues 2023-03-02 10:06:05 -05:00
jasquat cf9b796e1a avoid creating new processors if it is not necessary 2023-03-02 10:00:08 -05:00
jasquat 9bc99e2ef7 updates SpiffWorkflow w/ burnettk 2023-03-01 17:25:03 -05:00
Kevin Burnett 64b51a0792 Merge pull request #163 from sartography/feature/process_name_for_log_list
prefer the bpmn process name over the identifier on the logs list pag…
2023-03-01 14:21:37 -08:00
jasquat 695e51a1fb use workflow_spec to match task_spec naming w/ burnettk 2023-03-01 17:21:24 -05:00
jasquat 90b1772215 do not require task to be given to evaluate a task unless that script specifically needs it w/ burnettk 2023-03-01 17:18:58 -05:00
Dan afec26fbd5 Bumping spiffworkflow lib changes for messages 2023-03-01 16:40:56 -05:00
jasquat 716986a483 prefer the bpmn process name over the identifier on the logs list page w/ burnettk 2023-03-01 16:28:42 -05:00
jasquat dcb2a23baa Merge pull request #162 from sartography/feature/move_task_data_into_tables
Feature/move bpmn_json data into separate tables
2023-03-01 15:56:51 -05:00
jasquat 6521998a54 fixed the downgrade in new migration w/ burnettk 2023-03-01 15:54:50 -05:00
jasquat 59c5ed296d removed old branch migrations and created single one for this branch w/ burnettk 2023-03-01 15:40:17 -05:00
jasquat 76e654ca60 remove some debug code w/ burnettk 2023-03-01 15:38:05 -05:00
jasquat 53486823b6 always save the serialized bpmn definition for now w/ burnettk 2023-03-01 15:01:29 -05:00
Dan be482ea6bc Don't attempt to gather the augmented methods if no task is provided -- if we aren't working within the context of a task, we are not working in a context where augmented methods can work (at least not all of them). This was causing an error when attepting to use the custom engine to execute extraction expressions on messages. 2023-03-01 13:46:20 -05:00
jasquat d1b8de9ea3 pyl 2023-03-01 12:35:08 -05:00
jasquat b54ace56a2 fixed get call activity task data w/ burnettk 2023-03-01 12:23:04 -05:00
jasquat e2891425fc store the process instance data id on the process instance and not the other way around w/ burnettk 2023-03-01 11:39:03 -05:00
jasquat ab50e7ac03 all backend tests except for report tests are now passing 2023-03-01 10:58:12 -05:00
jasquat 035475f58f unit tests are passing except for test_process_instance_report which cannot work currently 2023-03-01 10:36:11 -05:00
jasquat 6257a402db save full_bpmn_json in a var 2023-03-01 09:55:20 -05:00
jasquat abe21db517 must add data to db 2023-03-01 09:42:41 -05:00
jasquat 950106fe21 most unit tests are passing now and the use of bpmn_json is almost gone in src 2023-03-01 09:22:38 -05:00
jasquat f74ce0f568 some logic to attempt to use the new bpmn json tables w/ burnettk 2023-02-28 17:46:14 -05:00
jasquat d5acd5a16d added new table and some notes on how to get a delta w/ burnettk jbirddog 2023-02-28 16:30:52 -05:00
jasquat 27f3da2458 added config to turn on sentry profiling w/ burnettk 2023-02-28 11:23:50 -05:00
jasquat b00de0d1a7 fixed python 3.9 syntax issue 2023-02-28 08:56:44 -05:00
burnettk a5c6d262b8 slam migrations file one last-ish time, increase task_name column length 2023-02-27 22:03:42 -05:00
burnettk 350daf0b3d allow task_name to be long 2023-02-27 22:01:08 -05:00
burnettk a1ec494ab3 let env var work on windows and fixing typing issue on python 3.9 w/ messaging stuff 2023-02-27 19:16:06 -05:00
jasquat 45feb38168 recreated all migrations to resolve postgres migration failures w/ burnettk 2023-02-27 17:27:53 -05:00
jasquat 5a873a9e2d do not run mysql commands if not doing mysql w/ burnettk 2023-02-27 17:19:03 -05:00
jasquat 35c93e3f7e do not return human tasks from errored process instances w/ burnettk 2023-02-27 16:11:26 -05:00
jasquat 09a46712d4 added debug logging when adding spiff step details w/ burnettk 2023-02-27 15:53:56 -05:00
Dan 24839a34dd Merge branch 'main' of github.com:sartography/spiff-arena into main 2023-02-27 14:40:52 -05:00
Dan 43e41fe848 Point to the latest spiffworkflow 2023-02-27 14:40:47 -05:00
jasquat 7c12709fdd fixed conflict with db migrations w/ burnettk 2023-02-27 14:33:55 -05:00
jasquat dfac872606 Merge remote-tracking branch 'origin/main' into feature/script_get_last_user_completing_task 2023-02-27 14:28:23 -05:00
jasquat 29ada38904 added script to get process initiator w/ burnettk 2023-02-27 14:28:19 -05:00
Dan e00fbdb490 run_pyl 2023-02-27 14:21:22 -05:00
Dan f16150b02b Merging main 2023-02-27 14:17:10 -05:00
Dan 150b95070c run_pyl 2023-02-27 14:05:00 -05:00
Dan e060e28c28 Needed an additional check for empty correlation keys - which on a RECEIVE message, should always match anything.
When finding messages to match a send, assure they are RECIEVE messages.

Fix some of the json output for messages sent to the front end
2023-02-27 14:01:21 -05:00
jasquat 6a4dc0f14e remove unwanted test files w/ burnettk 2023-02-27 12:08:40 -05:00
jasquat 9f84564457 script to get last user completing a task is working w/ burnettk 2023-02-27 12:08:07 -05:00
jasquat e07a122674 Merge remote-tracking branch 'origin/main' into feature/script_get_last_user_completing_task 2023-02-27 10:45:04 -05:00
Jon Herron a766e7d9a6 poetry remove orjson 2023-02-27 09:35:51 -05:00
burnettk e9b3ababc1 wip for get_last_user_completing_task script task 2023-02-25 23:31:23 -05:00
burnettk f7dc076f75 postgres really will just order however it wants if you do not specify an order_by clause 2023-02-25 22:35:46 -05:00
burnettk 647d5ee92a add ppg.ba4.sme and ba5 2023-02-24 23:42:19 -05:00
burnettk 5eb9da00f1 fix postgres db name and comment out debug job 2023-02-24 16:57:53 -05:00
jasquat b71419616d removed some unused code from task and fixed the logs table a bit w/ burnettk 2023-02-24 16:18:49 -05:00
Dan ff069cb862 run_pyl 2023-02-24 15:02:03 -05:00
jasquat 425cf3f8c1 skip failing test if postgres and added comment about cause w/ burnettk 2023-02-24 14:57:17 -05:00
Dan 0dc2bc3316 # SpiffWorkflow:
1) Type Safe checking on correlation properties (no more str())
2) A running workflows Correlations are once again at the key level.

# Backend
1) Both send and receive messages can have correlation_keys - and we compare these to each other to quickly assure a match (if they both exist - otherwise we fall back to comparing the properties on the receive to the sending messages payload)
2) Cleaned up the migrations to just one file
2023-02-24 14:53:22 -05:00
jasquat d5712a915c look users up by service and username instead of service_id since usernames have to be unique anyway w/ burnettk 2023-02-24 10:41:57 -05:00
jasquat 7a1e712c14 avoid using task-data endpoint for task data and only use it to get tasks based on spiff step instead 2023-02-24 09:21:21 -05:00
jasquat 4651eaee94 put back the task data code when getting tasks 2023-02-23 18:32:59 -05:00
jasquat 1f95fe7037 Merge remote-tracking branch 'origin/main' into feature/task_data_api_refactor 2023-02-23 17:10:23 -05:00
jasquat d53b79b18a removed commented out code w/ burnettk 2023-02-23 17:09:33 -05:00
jasquat a4c1eb96b5 removed task-data endpoints since we no longer need them w/ burnettk 2023-02-23 17:07:53 -05:00
burnettk 441bd62652 turn off profiling again 2023-02-23 16:54:38 -05:00
burnettk 5c43967ee9 add two users and update one 2023-02-23 16:39:30 -05:00
Dan 5a3b4b8792 BPMN Parser was returning all retrieval expressions, rather than the ones specific to a correlation property, as was intended.
Adding a correlation cache - so we have a reference of all the messages and properties (though still lacking a description of keys)
Adding yet another migration, maybe should squash em.
2023-02-23 16:36:32 -05:00
jasquat a9694c7678 added api to get task data and do not return from task data list anymore w/ burnettk 2023-02-23 15:59:19 -05:00
Dan 0d468a825a run_pyl (part 2) 2023-02-23 15:09:22 -05:00
jasquat 15b00bcceb Merge branch 'main' of github.com:sartography/spiff-arena 2023-02-23 15:06:27 -05:00
jasquat 68a5fe3f16 added comment about refactoring getting task data w/ burnettk jbirddog 2023-02-23 15:06:23 -05:00
burnettk ab631aab99 lint 2023-02-23 15:01:45 -05:00
burnettk 973be69df5 add test users 2023-02-23 14:58:14 -05:00
Dan 8466d823c2 Adding Migration. 2023-02-23 14:42:00 -05:00
jasquat 49fb41eff9 remove task size check since it can take a long time to run and we do not do anything with it w/ burnettk jbirddog 2023-02-23 14:41:45 -05:00
Dan 7c12dffe41 Merge remote-tracking branch 'origin/main' into feature/message_fixes 2023-02-23 14:26:04 -05:00
Dan 0030a46938 run_pyl 2023-02-23 14:17:22 -05:00
Dan 0f3ef00d72 BPMN.io -- Just show the message names not the ids - to assure we are only exposing the names.
SpiffWorkflow -
    - start_messages function should return message names, not ids.
    - don't catch external thrown messages within the same workflow process
    - add an expected value to the Correlation Property Model so we can use this well defined class as an external communication tool (rather than building an arbitrary dictionary)
    - Added a "get_awaiting_correlations" to an event, so we can get a list of the correlation properties related to the workflows currently defined correlation values.
    - workflows.waiting_events() function now returns the above awaiting correlations as the value on returned message events
 Backend
    - Dropping MessageModel and MessageCorrelationProperties - at least for now.  We don't need them to send / receive messages though we may eventually want to track the messages and correlations defined across the system - these things (which are ever changing) should not be directly connected to the Messages which may be in flux - and the cross relationships between the tables could cause unexpected and unceissary errors.  Commented out the caching logic so we can turn this back on later.
    - Slight improvement to API Errors
    - MessageInstances are no longer in a many-to-many relationship with Correlations - Each message instance has a unique set of message correlations specific to the instance.
    - Message Instances have users, and can be linked through a "counterpart_id" so you can see what send is connected to what recieve.
    - Message Correlations are connected to  recieving message instances.  It is not to a process instance, and not to a message model.  They now include the expected value and retrieval expression required to validate an incoming message.
    - A process instance is not connected to message correlations.
    - Message Instances are not always tied to a process instance (for example, a Send Message from an API)
    - API calls to create a message use the same logic as all other message catching code.
    - Make use of the new waiting_events() method to check for any new recieve messages in the workflow (much easier than
    churning through all of the tasks)
    - One giant mother of a migration.
2023-02-23 13:53:03 -05:00
jasquat 216bd799bf do not call serialize if we can use the cached bpmn_json instead w/ burnettk 2023-02-23 13:48:27 -05:00
jasquat 7dd72c72e1 Merge branch 'main' of github.com:sartography/spiff-arena 2023-02-23 11:19:26 -05:00
jasquat 2bf31fc135 turn on sentry detailed tracing for task-data w/ burnettk 2023-02-23 11:19:22 -05:00
burnettk 55f3b765ee update spiff 2023-02-23 11:02:40 -05:00
Kevin Burnett c65aeafbe3 Merge pull request #145 from sartography/data_size_script
Data size script
2023-02-22 17:36:31 -08:00
jasquat 44f31ffc36 Merge branch 'main' of github.com:sartography/spiff-arena 2023-02-22 15:35:02 -05:00
jasquat a3126da7ef set git user configs explicitly using the env vars w/ burnettk 2023-02-22 15:34:47 -05:00
burnettk 1a29e123c1 so we do not lose our minds when debugging on a server 2023-02-22 15:16:13 -05:00
jasquat 9b14510cd1 Merge branch 'main' of github.com:sartography/spiff-arena 2023-02-22 14:42:46 -05:00
jasquat c6b45dbdc3 show help text for textareas as well w/ burnettk 2023-02-22 14:42:43 -05:00
burnettk 9fb490c7f9 why not dict, too 2023-02-22 14:36:26 -05:00
Jon Herron 7fe8955adf Cleanup 2023-02-22 13:42:45 -05:00
Jon Herron 7f2d69163e Getting ./bin/pyl to pass 2023-02-22 13:34:26 -05:00
Jon Herron 488abc03ea Provide info about keys in task data and python env 2023-02-22 13:13:28 -05:00
Jon Herron 2afc19175e Unfactor to fix size calculation/type hint issues 2023-02-22 11:17:23 -05:00
Jon Herron a4c0dd52ae Getting ./bin/pyl to pass 2023-02-22 11:04:07 -05:00
Jon Herron d5fa8eae21 Adding python env size 2023-02-22 10:55:09 -05:00
Jon Herron 2fa4623876 Add cumulative task data size to script 2023-02-22 10:39:35 -05:00
burnettk bb6dd35bbd remove start and end events from simple logs view 2023-02-21 22:43:23 -05:00
burnettk 54248ca568 copy env so we are doing additive stuff rather than completely rewriting it 2023-02-21 22:00:02 -05:00
jasquat 012f5c20aa fix git bash script unbound error w/ burnettk 2023-02-21 17:08:09 -05:00
jasquat 90de749ab9 more git config updates w/ burnettk 2023-02-21 16:43:52 -05:00
jasquat c5d611f03b disable strict host checking for git commands w/ burnettk 2023-02-21 16:42:11 -05:00
jasquat e5b83d0919 fixed tests w/ burnettk 2023-02-21 15:28:54 -05:00
jasquat b0d132fc1e give access to download process data files if a user has access to start a process model w/ burnettk 2023-02-21 15:08:19 -05:00
Jakub Sokołowski 819415d487 backend: create SSH key file when contents provided
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-21 20:02:16 +01:00
Jakub Sokołowski 56a913e33c backend: use sensible lock filename for git
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-21 19:58:39 +01:00
Jakub Sokołowski 1bbf3a264c backend: specify --rebase when using git pull
Otherwise it fails with:
```
Pulling without specifying how to reconcile divergent branches is discouraged.
```

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-21 19:58:38 +01:00
Jakub Sokołowski 1e8e6a7968 backend: fix use of SSH private key for git ops
Primarily this is supposed to fix the `git pull` aciton triggered by
webhooks from GitHub. But in addition to that the point is to simplify
that committing wrapper which has far too much in it.

Instead of passing everything as CLI arguments one should make use of
already supported environment variables and the `env` argument to
`subprocess` functions like `run()`. Writing extra logic in the wrapper
only makes it unnecessarily complicated.

By passing both user, email, and the SSH options in `run_shell_command`
we avoid the need to repeat the same boilerplate to provide Git config
and SSH credentials.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-21 19:58:36 +01:00
jbirddog 01a95011ad Look in task data/script engine environment for data, not just workflow data. (#143) 2023-02-20 18:12:50 -05:00
Dan 790483a421 run_pyl 2023-02-20 12:34:42 -05:00
Dan 5f6a61c93f * SpiffWorkflow event_definitions wanted to return a message event's correlation properties mested within correlation keys. But messages are directly related to properties, not to keys - and it forced a number of conversions that made for tricky code. So Messages now contain a dictionary of correlation properties only.
* SpiffWorkflow did not serialize correlations - so they were lost between save and retrieve.

* When comparing Correlation Property values - we are storing these values as strings in the database and can't convert them back to integers later, so I'm changing everying everywhere to compare after conversion to a string.  Don't feel great about this one.
* By using an SQL Alchemy join table, there is a lot of db queries we don't need to write.
* A few handy fucntions on db models to make it easier to work with correlations.
* Updated tests because I changed some of the BPMN models we were testing against.
* Database migration to use the new constraint names with the alternate form of the join table between correlation mesages to instance messages.
2023-02-20 11:50:35 -05:00
burnettk a600736e67 delint 2023-02-20 10:58:04 -05:00
Jakub Sokołowski fb024a49f7 backend/git_service: accept webhook test requests
https://docs.github.com/en/webhooks-and-events/webhooks/testing-webhooks

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-20 13:11:21 +01:00
Jakub Sokołowski e47c0752db backend/git_service: check repo URLs from webhook
Since we are cloning a private repo we are using `ssh_url` in our case.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-20 13:02:54 +01:00
Dan d46502cd2b Allow people to run commands like "flask db upgrade" without setting specific environment variables like FLASK_SESSION_SECRET_KEY everytime - they just need to add in their own /instance/config.py with their local configuration. 2023-02-19 10:37:00 -05:00
Dan 2a800e844f * Re-work message tests so I could wrap my simple head around what was happening - just needed an example that made sense to me.
* Clear out complex get_message_instance_receive how that many-to-many works.
* Create decent error messages when correlations fail
* Move correlation checks into the MessageInstance class
* The APIError could bomb out ugly if it hit a workflow exception with not Task Spec.
2023-02-18 13:09:58 -05:00
Dan f2ca47e798 bump spiffworkflow hash 2023-02-17 13:08:45 -05:00
Dan ecbd30af00 failing test. 2023-02-17 12:10:32 -05:00
Dan ef4297331d Merge branch 'main' into feature/message_fixes 2023-02-17 12:01:38 -05:00
Dan 8e257600af work in progress -
* Link between message instance and correlations is now a link table and many-to-many relationships as recommended by SQLAlchemy
* Use the correlation keys, not the process id when accepting api messages.
2023-02-17 10:45:01 -05:00
jasquat b22c33e1d6 put the env vars in the env section of the github action configs w/ burnettk 2023-02-16 15:19:01 -05:00
jasquat 0839214fa5 added test for quickstart guide w/ burnettk 2023-02-16 15:05:55 -05:00
jasquat 435dc147df pyl 2023-02-16 14:38:19 -05:00
jasquat f5a5059ce0 Merge remote-tracking branch 'origin/main' into feature/support_local_openid_in_cypress_tests 2023-02-16 14:25:51 -05:00
burnettk 9f3bb283b3 use _GIT_SOURCE_BRANCH instead of _GIT_BRANCH 2023-02-16 14:10:31 -05:00
burnettk 888547642e fix unprefixed config 2023-02-16 13:56:48 -05:00
burnettk 5918501083 update configs for publish feature 2023-02-16 13:47:26 -05:00
jasquat a98892be32 added some support for using the backend openid server for cypress tests w/ burnettk 2023-02-16 12:09:44 -05:00
burnettk 76a701e9dd add new uses and delete ppg.ba.sme1 2023-02-16 11:53:08 -05:00
jasquat 39763c8c79 the equal sign is not apart of the env var w/ burnettk 2023-02-16 11:18:50 -05:00
jasquat cc17f31958 updated terraform deployed env config name w/ burnettk 2023-02-16 10:51:05 -05:00
jasquat 641d237e83 more config updates w/ burnettk 2023-02-16 10:21:02 -05:00
jasquat 97f23e6d4f cleaned up the default config file a bit 2023-02-16 09:05:40 -05:00
jasquat 6a6c17d71e pyl 2023-02-16 08:33:39 -05:00
jasquat c9c1ae4c16 fixed some env vars for ci 2023-02-16 07:59:51 -05:00
jasquat 5707e2c4e5 pyl 2023-02-16 07:39:40 -05:00
jasquat 7689380411 Merge remote-tracking branch 'origin/main' into feature/update_configs_with_prefix 2023-02-16 07:17:39 -05:00
burnettk 1650486a32 remove unused import 2023-02-16 06:34:03 -05:00
burnettk 01668368e7 all tests pass w/ spiff lib upgrade, thanks for the help elizabeth 2023-02-15 22:56:12 -05:00
burnettk 3cfd81efa6 format 2023-02-15 22:35:55 -05:00
jasquat 26875f13bf updated remaining configs manually w/ burnettk 2023-02-15 17:21:37 -05:00
jasquat 9b93504945 updated secret config names as well w/ burnettk 2023-02-15 17:17:47 -05:00
jasquat 3e4fc1259f updated configs to use the prefix using the script w/ burnettk 2023-02-15 17:07:12 -05:00
jasquat 909060e985 updated default user group var name for better prefix w/ burnettk 2023-02-15 16:43:40 -05:00
jasquat 09f3921236 save task data to spiff step details when copmleting a user task as well w/ burnettk jbirddog 2023-02-15 15:34:51 -05:00
jasquat 5a2e810fd6 append OPEN_ID to TENANT_SPECIFIC_FIELDS for clarification on what it is from w/ burnettk 2023-02-15 11:12:30 -05:00
jasquat 7b96335221 do not remove the default user group when refreshing permissions w/ burnettk 2023-02-15 11:09:04 -05:00
Dan 759b2bffa5 Merge branch 'main' of github.com:sartography/spiff-arena into main 2023-02-14 19:39:46 -05:00
Dan c8a83f80b6 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 2023-02-14 19:39:35 -05:00
jasquat 84f27082d4 updates to user import scripts w/ burnettk 2023-02-14 17:39:42 -05:00