-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Update stable 1.1 with main #726
Merged
zkayyali812
merged 8 commits into
ansible:stable-1.1
from
zkayyali812:update-stable-1.1-with-main
Dec 9, 2024
Merged
chore: Update stable 1.1 with main #726
zkayyali812
merged 8 commits into
ansible:stable-1.1
from
zkayyali812:update-stable-1.1-with-main
Dec 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When we unconditionally send event data to the controller for a workflow template the launch of the workflow template fails. With this option in a rulebook the user can prevent event data from being sent by setting - include_events: false The default value is true so existing rulebooks will keep sending events to controller. Fixes ansible#622 https://issues.redhat.com/browse/AAP-13456 Root Cause Analysis: In the Controller if you are running a workflow template you cannot send event data to it unconditionally like we can do with job template. We get an error from Controller **Check the Prompt on Launch setting on the Workflow Job Template to include Extra Variables.** If a survey spec is involved then there are more constraints if there are certain parameters that are marked as required in the survey spec. So we get 2 distinct items - Prompt on Launch for Extra Variables - Survey Spec The following use cases are supported for workflow job template with and without survey spec. The use cases are based on a rulebook that looks like the following with the action being updated for every case. ``` --- - name: Test run job templates hosts: all sources: - ansible.eda.generic: payload: - name: Fred age: 25 rules: - name: "Run job template" condition: event.age == 25 action: run_workflow_template: name: workflow_mk organization: Default ``` ### **Case 1:** If your Workflow Template doesn't support Prompt on Launch for Extra Vars and a Survey Spec is not enabled ``` run_workflow_template: name: workflow_mk include_events: false organization: Default ``` ### **Case 2:** If your Workflow Template supports Prompt on Launch for Extra Vars and a Survey Spec is not enabled ``` run_workflow_template: name: workflow_mk organization: Default job_args: extra_vars: name: "{{ event.name }}" ``` The payload sent to Controller ``` name: Fred ansible_eda: ruleset: Test run job templates rule: Run job template event: meta: source: name: ansible.eda.generic type: ansible.eda.generic received_at: '2024-09-26T05:29:10.983346Z' uuid: 9570c7f8-9bc9-438f-9199-803707e31ccf name: Fred age: 25 ``` ### **Case 3:** If your Workflow Template doesn't support Prompt on Launch for Extra Vars and a Survey Spec is enabled ``` run_workflow_template: name: workflow_mk include_events: false organization: Default job_args: extra_vars: name: "{{ event.name }}" ``` The payload sent to Controller ``` name: Fred ``` ### **Case 4:** If your Workflow Template supports Prompt on Launch for Extra Vars and a Survey Spec is enabled ``` action: run_workflow_template: name: workflow_mk organization: Default job_args: extra_vars: name: "{{ event.name }}" ``` The payload sent to Controller ``` name: Fred ansible_eda: ruleset: Test run job templates rule: Run job template event: meta: source: name: ansible.eda.generic type: ansible.eda.generic received_at: '2024-09-26T07:26:42.160723Z' uuid: 46169e51-ba6f-4a55-963b-b626fff7cfdc name: Fred age: 25 ``` ### **Case 5:** Survey Spec has a required parameter and its not provided ``` action: run_workflow_template: name: workflow_mk organization: Default ``` Missing args 2024-09-26 12:59:03,738 - ansible_rulebook.job_template_runner - ERROR - Error {'variables_needed_to_start': ["'name' value missing"]} ### **Case 6:** Survey Spec has no required parameter and its not provided ``` action: run_workflow_template: name: workflow_mk organization: Default ``` The Default Value is provided by the Survey Spec and it works ``` name: fred ansible_eda: ruleset: Test run job templates rule: Run job template event: meta: source: name: ansible.eda.generic type: ansible.eda.generic received_at: '2024-09-26T07:55:15.320036Z' uuid: 68a6c25d-dcf5-4a1c-8eb2-7432376d2d88 name: Fred age: 25 ```
Signed-off-by: Alex <[email protected]>
Yesterday, 3.11 version of `aiohttp` was released with [breaking changes ](https://github.com/aio-libs/aiohttp/releases/tag/v3.11.0 ) which breaks `aioresponses` library used for our mocks and as consequence some of our tests are failing. Ref: pnuckowski/aioresponses#262 Regardless of whether this is fixed in aioresponses, aiohttp can introduce breaking changes in minor versions, so I pin it to the latest tested version as this library is critical for the stability in some of our features. Signed-off-by: Alex <[email protected]>
Adds support for python 3.12. Also updates a test with a race condition in 3.12 --------- Signed-off-by: Alex <[email protected]>
…nsible#711) AAP Credential Types support File contents via file injectors. https://docs.ansible.com/automation-controller/latest/html/userguide/credential_types.html We create temporary files with the data sent from Server The source plugin can access the temporary file names to access the data. Supports single file as well as multiple files. To access the filenames in the source rulebook you can use the following extra vars - eda.filename or - eda.filename.<<key_name1>> - eda.filename.<<key_name2>> e.g. ``` - name: Use payload file to check events hosts: all sources: - ansible.eda.generic: payload_file: "{{ eda.filename.test_payload_file }}" ``` The env variables are treated like extra_vars and added to the current processes environment https://issues.redhat.com/browse/AAP-25519
Fixes ansible#681 --------- Signed-off-by: Alex <[email protected]>
This is a little enhancement when the source plugin fails and raises an exception without message. Also extends the source plugin development guide. Related with https://issues.redhat.com/browse/AAP-19598
Updates ansible-rulebook version to 1.1.2
Quality Gate passedIssues Measures |
ttuffin
approved these changes
Dec 9, 2024
Alex-Izquierdo
approved these changes
Dec 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates stable-1.1 branch with latest main
In draft state until version PR is merged - #725