Commit Graph

175 Commits

Author SHA1 Message Date
AlanCoding
653850fa6d Remove duplicated index 2020-03-23 22:54:04 -04:00
AlanCoding
5e595caf5e Add workflow node identifier
Generate new modules WFJT and WFJT node
Touch up generated syntax, test new modules

Add utility method in awxkit

Fix some issues with non-name identifier in
  AWX collection module_utils

Update workflow docs for workflow node identifier

Test and fix WFJT modules survey_spec
Plug in survey spec for the new module
Handle survey spec idempotency and test

add associations for node connections
Handle node credential prompts as well

Add indexes for new identifier field

Test with unicode dragon in name
2020-03-23 22:00:00 -04:00
AlanCoding
7d0b207571 Organization on JT as read-only field
Set JT.organization with value from its project

Remove validation requiring JT.organization

Undo some of the additional org definitions in tests

Revert some tests no longer needed for feature

exclude workflow approvals from unified organization field

revert awxkit changes for providing organization

Roll back additional JT creation permission requirement

Fix up more issues by persisting organization field when project is removed

Restrict project org editing, logging, and testing

Grant removed inventory org admin permissions in migration

Add special validate_unique for job templates
  this deals with enforcing name-organization uniqueness

Add back in special message where config is unknown
  when receiving 403 on job relaunch

Fix logical and performance bugs with data migration

within JT.inventory.organization make-permission-explicit migration

remove nested loops so we do .iterator() on JT queryset

in reverse migration, carefully remove execute role on JT
  held by org admins of inventory organization,
  as well as the execute_role holders

Use current state of Role model in logic, with 1 notable exception
  that is used to filter on ancestors
  the ancestor and descentent relationship in the migration model
    is not reliable
  output of this is saved as an integer list to avoid future
    compatibility errors

make the parents rebuilding logic skip over irrelevant models
  this is the largest performance gain for small resource numbers
2020-03-12 15:45:46 -04:00
AlanCoding
daa9282790 Initial (editable) pass of adding JT.organization
This is the old version of this feature from 2019
  this allows setting the organization in the data sent
  to the API when creating a JT, and exposes the field
  in the UI as well

Subsequent commit changes the field from editable
  to read-only, but as of this commit, the machinery
  is not hooked up to infer it from project
2020-03-12 15:45:46 -04:00
Ryan Petrello
88571f6dcb save approval node start time *before* sending "started" notifications
see: https://github.com/ansible/awx/issues/6267
2020-03-12 14:14:56 -04:00
Ryan Petrello
862de0b6f3 record a start time for WorkflowApproval jobs
see: https://github.com/ansible/awx/issues/6202
2020-03-06 14:16:27 -05:00
Rebeccah
eca516f8ce removed 'self' from positional arguemnt of workflow attribute 'all_parents_must_converge' per Alans suggestion, since django takes it to be verbose_name, which is not needed 2020-02-05 17:38:36 -05:00
Rebeccah
fd60cd1a35 fixed copy functionality to include convergence as is instead of reseting ALL nodes to be default ANY nodes 2020-02-05 15:34:54 -05:00
Rebeccah
f7f648b956 included all_parents_must_converge in the get_workflow_job_fieldnames so that the true/false is copied into the job node and not just in the template node. Also added in the migration for the DB, also relocated logic from bfs_nodes_to_run down into mark_dnr_nodes to prevent nodes not being marked as DNR but not being marked to run, causing them to run anyways 2020-02-05 14:28:34 -05:00
Rebeccah
780f104ab2 shifted from dependants/dependencies to children/parents for clarity in function names, also added in toggle logic 2020-02-05 14:28:34 -05:00
Rebeccah
cf24c81b3e updated syntax from python2 to 3 2020-02-05 14:28:34 -05:00
Jim Ladd
71d7bac261 Rename job_summary_dict to job_metadata
* Clarifies purpose of notification template variable
2019-10-29 11:24:14 -04:00
Jim Ladd
4809c40f3c Render WF approval notifications w/ custom templates 2019-10-29 11:24:13 -04:00
Graham Mainwaring
08839e1381 Add approved_by field to workflow approvals 2019-10-11 16:57:13 -04:00
beeankha
02b13fd4ae Enable notifications to send at org level, ...
... and list the URL in body of approval notification messages.
2019-10-07 15:34:09 -04:00
Jeff Bradberry
095aa77857 Create a new model mixin for Job and WorkflowJob webhook fields 2019-09-30 13:26:04 -04:00
Jeff Bradberry
d6116490c6 Add the webhook-specific fields to JobTemplate and WorkflowJobTemplate 2019-09-30 13:23:26 -04:00
beeankha
9ed4e1682d Remove redundant whitespace 2019-09-27 15:48:00 -04:00
beeankha
96689f45c8 Update approval notification message 2019-09-27 15:48:00 -04:00
beeankha
8eb1484129 Update migration file, change status syntax 2019-09-27 15:48:00 -04:00
beeankha
1ddf9fd1ed Fix up models, clean up code re: PR comments 2019-09-27 15:48:00 -04:00
beeankha
f835c8650b Enable org-level approval notifications to work. 2019-09-27 15:48:00 -04:00
beeankha
aa5a4d42c7 Enable email notifications to work,
...and customize default messages
2019-09-27 15:48:00 -04:00
beeankha
57fd6b7280 Set default messages for approval notifications 2019-09-27 15:48:00 -04:00
beeankha
13450fdbf9 Set up approval notifications to send 2019-09-27 15:48:00 -04:00
beeankha
6be2d84adb Add endpoints for approval node notifications
...and also add a migration file.
2019-09-27 15:48:00 -04:00
AlanCoding
e8581f6892 Implement WFJT prompting for limit & scm_branch
add feature to UI and awxkit

restructure some details of create_unified_job
  for workflows to allow use of char_prompts
  hidden field
avoid conflict with sliced jobs in char_prompts copy logic

update developer docs

update migration reference

bump migration
2019-09-16 14:51:53 -04:00
Ryan Petrello
b7e8044d69 fix a 500 error that can occur when a WorkflowApproval's node is deleted 2019-09-04 21:12:22 -04:00
softwarefactory-project-zuul[bot]
2918b6c927 Merge pull request #4264 from beeankha/workflow_pause_approve
Workflow Approval Nodes

Reviewed-by: Ryan Petrello
             https://github.com/ryanpetrello
2019-08-28 22:25:39 +00:00
beeankha
582bbda9c4 Fix bug in Activity Stream, add tests. 2019-08-27 15:38:11 -04:00
beeankha
667fce5012 Fix flake8 errors, update doc strings, ...
... and return full object details when doing a POST to create new approval nodes.
2019-08-27 15:37:22 -04:00
Ryan Petrello
dd89e46ee6 change up a few activity stream and approval drawer issues 2019-08-27 15:36:32 -04:00
beeankha
f7d6f4538c Emit approve/deny status for websockets, update doc string + a comment 2019-08-27 15:36:30 -04:00
beeankha
9186cb23a6 Update summary field for activity stream 2019-08-27 15:36:27 -04:00
beeankha
f6f6e5883a Update websockets for pending approvals, change timeout expiration to 2019-08-27 15:36:27 -04:00
Ryan Petrello
7814592285 when copying workflows w/ pause nodes, copy the WorkflowApprovalTemplate 2019-08-27 15:36:26 -04:00
Ryan Petrello
4a75edf549 fix a few nits w/ workflow approval activity stream records 2019-08-27 15:36:25 -04:00
beeankha
d9f3fed06f Update UJ/UJT endpoints, update approval RBAC, update approval timeout 2019-08-27 15:36:25 -04:00
beeankha
544a5063f3 Update timeout implementation, placeholder code for possible websocket support 2019-08-27 15:36:24 -04:00
Ryan Petrello
0522d45ab0 fixed a few issues related to approval role RBAC for normal users 2019-08-27 15:36:23 -04:00
beeankha
28289e85c1 Add timeout for workflow approval nodes 2019-08-27 15:36:22 -04:00
beeankha
64c94d478d Add more RBAC, filter out AJT/AJs from unified jobs lists
Comment out placeholder in serializer
2019-08-27 15:36:17 -04:00
beeankha
453e142635 Fix UJT-related error, add notification placeholders 2019-08-27 15:35:43 -04:00
beeankha
294d6551b9 Polishing up work on new endpoint 2019-08-27 15:30:48 -04:00
beeankha
320284267c Add new endpoint for creation of approval nodes 2019-08-27 15:30:47 -04:00
beeankha
82e0b2121b Add approve/deny endpoints, fix some typos 2019-08-27 15:30:43 -04:00
beeankha
9024a514a6 Add API endpoints for workflow approvals 2019-08-27 15:30:39 -04:00
beeankha
b88b1111bd Add workflow pause/approve node 2019-08-27 15:29:30 -04:00
Ryan Petrello
f22adca6f7 improve parsing of JSON inputs
see: https://github.com/ansible/awx/issues/4573
see: https://github.com/ansible/awx/issues/2371
2019-08-27 12:47:27 -04:00
Jeff Bradberry
6737bd4c19 Replace {} as field default values with the callable dict 2019-07-12 15:11:22 -04:00