Skip to content
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

Core Refactoring, Krkn Scenario Plugin API #694

Merged
merged 33 commits into from
Oct 3, 2024

Conversation

tsebastiani
Copy link
Collaborator

@tsebastiani tsebastiani commented Sep 12, 2024

main goals:

  • Introduce an API for the Krkn Scenario Plugins
  • Introduce a dynamic plugin loader for all the classes implementing the API
  • Convert all the existing scenarios in classes that implement the API
  • Define a strict naming convention for Scenario Plugins validated by the loader to give to the comunity a clear guideline on how to implement new scenarios (MVC Frameworks approach)
  • reduce the run_krkn.py line numbers and complexity
  • minimize the code changes in the run_krkn.py to introduce a new scenario (plugins are loaded dynamically)
  • Produce a clear documentation on how to develop new Krkn scenarios
  • Unit test the scenarios

main benefits:

  • speed up the on-boarding on scenario development (community and new team members)
  • create more traction around the project
  • increase the test coverage
  • streamline the codebase to increase readability

@tsebastiani tsebastiani changed the title Codebase refactoring, Krkn Scenario Plugin API introduction [IMPORTANT] Refactoring, Krkn Scenario Plugin API introduction Sep 12, 2024
@tsebastiani tsebastiani force-pushed the plugin_api branch 2 times, most recently from 14879d1 to 47edcf8 Compare September 13, 2024 08:51
@tsebastiani tsebastiani force-pushed the plugin_api branch 3 times, most recently from a8e5a87 to d04d35f Compare September 13, 2024 14:59
@tsebastiani tsebastiani marked this pull request as ready for review September 17, 2024 11:19
@tsebastiani tsebastiani force-pushed the plugin_api branch 6 times, most recently from 388197f to 9719473 Compare September 19, 2024 08:15
@tsebastiani tsebastiani force-pushed the plugin_api branch 3 times, most recently from 6694b13 to d1ea877 Compare September 26, 2024 13:34
Copy link
Collaborator

@chaitanyaenr chaitanyaenr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits

config/config.yaml Outdated Show resolved Hide resolved
config/config.yaml Outdated Show resolved Hide resolved
Copy link
Collaborator

@chaitanyaenr chaitanyaenr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work as always @tsebastiani! Minor nits, other than that it's good for merge!

config/config.yaml Outdated Show resolved Hide resolved
config/config.yaml Outdated Show resolved Hide resolved
@chaitanyaenr
Copy link
Collaborator

@tsebastiani funtional tests are failing

Error: -01 16:49:36,210 [ERROR] impossible to find scenario application_outages, plugin not found. Exiting

Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>

scenarios post_actions

Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>

fix

Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>

test fix

Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>

test fix

Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>

typos

Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>

typo

Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
@tsebastiani tsebastiani changed the title [IMPORTANT] Refactoring, Krkn Scenario Plugin API introduction Core Refactoring, Krkn Scenario Plugin API Oct 3, 2024
@tsebastiani tsebastiani merged commit d91172d into krkn-chaos:main Oct 3, 2024
5 of 7 checks passed
@tsebastiani tsebastiani deleted the plugin_api branch October 3, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants