Conversation
mkanoor
added a commit
that referenced
this pull request
Sep 7, 2023
Following up on similar idea from #513, and the "_Report on: Kubernetes + Event Driven Ansible using Rulebooks_" document shared with the team, this PR proposes a "dev reload" similar to [Quarkus dev mode](https://quarkus.io/guides/maven-tooling#dev-mode), that will monitor for rulebook changes and auto-reload when supplied on cli with `--dev`. In the following, I provide a demo of its use. "alternative 0" with the command line parameter NOT supplied, behaves as before:  Now I launch the same, but with `--dev` command line parameter:  it does not auto-terminate, and waits for file changes. Now I want to modify from using the generic source to the webhook source:  I wanted to send analogous events as those from the generic source, but through the webhook by using the postman application, but my rule is not triggering anymore 🤔 ... [this was intentional for the purpose of the demo] Ah yes! 😉 I should update the condition to reflect accordingly:  In the previous screenshot, I just: 1. changed the rulebook 2. saved the rulebook 3. the ansible-rulebook dev mode downscaled and restarted automatically As I send the same event from postman:  It is now working as expected. I hope this demo exemplify the intended workflow of the proposed dev mode for ansible-rulebook, inspired by Quarkus dev mode. --------- Co-authored-by: Alex <aizquier@redhat.com> Co-authored-by: Madhu Kanoor <mkanoor@redhat.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file contains hidden or 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
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.
Proposing adding per $subject based on modest personal experience new to this world 😅
For instance this helped me realise the
genericsource:when compared to the

webhookdoes not want the.payload.:and used some unicode tricks to better notice the lines I was looking for:

The suggested flow in the docs imho helps in order not to having to retrigger the command manually.