Skip to content

License files#1215

Merged
paigerube14 merged 1 commit intokrkn-chaos:mainfrom
paigerube14:license_files
Mar 31, 2026
Merged

License files#1215
paigerube14 merged 1 commit intokrkn-chaos:mainfrom
paigerube14:license_files

Conversation

@paigerube14
Copy link
Copy Markdown
Collaborator

Type of change

  • Refactor
  • New feature
  • Bug fix
  • Optimization

Description

Adding license block to all files

Related Tickets & Documents

If no related issue, please create one and start the converasation on wants of

  • Related Issue #:
  • Closes #:

Documentation

  • Is documentation needed for this update?

If checked, a documentation PR must be created and merged in the website repository.

Related Documentation PR (if applicable)

<-- Add the link to the corresponding documentation PR in the website repository -->

Checklist before requesting a review

[ ] Ensure the changes and proposed solution have been discussed in the relevant issue and have received acknowledgment from the community or maintainers. See contributing guidelines
See testing your changes and run on any Kubernetes or OpenShift cluster to validate your changes

  • I have performed a self-review of my code by running krkn and specific scenario
  • If it is a core feature, I have added thorough unit tests with above 80% coverage

REQUIRED:
Description of combination of tests performed and output of run

python run_kraken.py
...
<---insert test results output--->

OR

python -m coverage run -a -m unittest discover -s tests -v
...
<---insert test results output--->

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Add Apache 2.0 license headers to all Python source files

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add Apache 2.0 license headers to all Python source files
• License block includes copyright notice for 2025 The Krkn Authors
• Covers main modules, scenario plugins, utilities, and entry points
• Minor fix to pre-commit config regex pattern for CI directory exclusion
Diagram
flowchart LR
  A["Python Source Files"] -- "Add License Header" --> B["Files with Apache 2.0 License"]
  C["Pre-commit Config"] -- "Fix Regex Pattern" --> D["Updated Exclusion Rules"]
Loading

Grey Divider

File Changes

1. krkn/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/init.py


2. krkn/cerberus/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/cerberus/init.py


3. krkn/cerberus/setup.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/cerberus/setup.py


View more (101)
4. krkn/chaos_recommender/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/chaos_recommender/init.py


5. krkn/chaos_recommender/analysis.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/chaos_recommender/analysis.py


6. krkn/chaos_recommender/kraken_tests.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/chaos_recommender/kraken_tests.py


7. krkn/chaos_recommender/prometheus.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/chaos_recommender/prometheus.py


8. krkn/invoke/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/invoke/init.py


9. krkn/invoke/command.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/invoke/command.py


10. krkn/prometheus/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/prometheus/init.py


11. krkn/prometheus/client.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/prometheus/client.py


12. krkn/prometheus/collector.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/prometheus/collector.py


13. krkn/resiliency/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/resiliency/init.py


14. krkn/resiliency/resiliency.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/resiliency/resiliency.py


15. krkn/resiliency/score.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/resiliency/score.py


16. krkn/rollback/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/rollback/init.py


17. krkn/rollback/command.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/rollback/command.py


18. krkn/rollback/config.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/rollback/config.py


19. krkn/rollback/handler.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/rollback/handler.py


20. krkn/rollback/serialization.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/rollback/serialization.py


21. krkn/rollback/signal.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/rollback/signal.py


22. krkn/scenario_plugins/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/init.py


23. krkn/scenario_plugins/abstract_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/abstract_scenario_plugin.py


24. krkn/scenario_plugins/application_outage/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/application_outage/init.py


25. krkn/scenario_plugins/application_outage/application_outage_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/application_outage/application_outage_scenario_plugin.py


26. krkn/scenario_plugins/container/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/container/init.py


27. krkn/scenario_plugins/container/container_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/container/container_scenario_plugin.py


28. krkn/scenario_plugins/hogs/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/hogs/init.py


29. krkn/scenario_plugins/hogs/hogs_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/hogs/hogs_scenario_plugin.py


30. krkn/scenario_plugins/kubevirt_vm_outage/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/kubevirt_vm_outage/init.py


31. krkn/scenario_plugins/kubevirt_vm_outage/kubevirt_vm_outage_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/kubevirt_vm_outage/kubevirt_vm_outage_scenario_plugin.py


32. krkn/scenario_plugins/managed_cluster/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/managed_cluster/init.py


33. krkn/scenario_plugins/managed_cluster/common_functions.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/managed_cluster/common_functions.py


34. krkn/scenario_plugins/managed_cluster/managed_cluster_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/managed_cluster/managed_cluster_scenario_plugin.py


35. krkn/scenario_plugins/managed_cluster/scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/managed_cluster/scenarios.py


36. krkn/scenario_plugins/native/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/native/init.py


37. krkn/scenario_plugins/native/native_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/native/native_scenario_plugin.py


38. krkn/scenario_plugins/native/network/ingress_shaping.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/native/network/ingress_shaping.py


39. krkn/scenario_plugins/native/network/kubernetes_functions.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/native/network/kubernetes_functions.py


40. krkn/scenario_plugins/native/plugins.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/native/plugins.py


41. krkn/scenario_plugins/native/pod_network_outage/kubernetes_functions.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/native/pod_network_outage/kubernetes_functions.py


42. krkn/scenario_plugins/native/pod_network_outage/pod_network_outage_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/native/pod_network_outage/pod_network_outage_plugin.py


43. krkn/scenario_plugins/native/run_python_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/native/run_python_plugin.py


44. krkn/scenario_plugins/network_chaos/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos/init.py


45. krkn/scenario_plugins/network_chaos/network_chaos_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos/network_chaos_scenario_plugin.py


46. krkn/scenario_plugins/network_chaos_ng/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/init.py


47. krkn/scenario_plugins/network_chaos_ng/models.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/models.py


48. krkn/scenario_plugins/network_chaos_ng/modules/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/modules/init.py


49. krkn/scenario_plugins/network_chaos_ng/modules/abstract_network_chaos_module.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/modules/abstract_network_chaos_module.py


50. krkn/scenario_plugins/network_chaos_ng/modules/node_network_chaos.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/modules/node_network_chaos.py


51. krkn/scenario_plugins/network_chaos_ng/modules/node_network_filter.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/modules/node_network_filter.py


52. krkn/scenario_plugins/network_chaos_ng/modules/pod_network_chaos.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/modules/pod_network_chaos.py


53. krkn/scenario_plugins/network_chaos_ng/modules/pod_network_filter.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/modules/pod_network_filter.py


54. krkn/scenario_plugins/network_chaos_ng/modules/utils.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/modules/utils.py


55. krkn/scenario_plugins/network_chaos_ng/modules/utils_network_chaos.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/modules/utils_network_chaos.py


56. krkn/scenario_plugins/network_chaos_ng/modules/utils_network_filter.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/modules/utils_network_filter.py


57. krkn/scenario_plugins/network_chaos_ng/network_chaos_factory.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/network_chaos_factory.py


58. krkn/scenario_plugins/network_chaos_ng/network_chaos_ng_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/network_chaos_ng/network_chaos_ng_scenario_plugin.py


59. krkn/scenario_plugins/node_actions/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/init.py


60. krkn/scenario_plugins/node_actions/abstract_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/abstract_node_scenarios.py


61. krkn/scenario_plugins/node_actions/alibaba_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/alibaba_node_scenarios.py


62. krkn/scenario_plugins/node_actions/aws_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/aws_node_scenarios.py


63. krkn/scenario_plugins/node_actions/az_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/az_node_scenarios.py


64. krkn/scenario_plugins/node_actions/bm_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/bm_node_scenarios.py


65. krkn/scenario_plugins/node_actions/common_node_functions.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/common_node_functions.py


66. krkn/scenario_plugins/node_actions/docker_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/docker_node_scenarios.py


67. krkn/scenario_plugins/node_actions/gcp_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/gcp_node_scenarios.py


68. krkn/scenario_plugins/node_actions/general_cloud_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/general_cloud_node_scenarios.py


69. krkn/scenario_plugins/node_actions/ibmcloud_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/ibmcloud_node_scenarios.py


70. krkn/scenario_plugins/node_actions/ibmcloud_power_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/ibmcloud_power_node_scenarios.py


71. krkn/scenario_plugins/node_actions/node_actions_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/node_actions_scenario_plugin.py


72. krkn/scenario_plugins/node_actions/openstack_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/openstack_node_scenarios.py


73. krkn/scenario_plugins/node_actions/vmware_node_scenarios.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/node_actions/vmware_node_scenarios.py


74. krkn/scenario_plugins/pod_disruption/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/pod_disruption/init.py


75. krkn/scenario_plugins/pod_disruption/models/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/pod_disruption/models/init.py


76. krkn/scenario_plugins/pod_disruption/models/models.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/pod_disruption/models/models.py


77. krkn/scenario_plugins/pod_disruption/pod_disruption_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/pod_disruption/pod_disruption_scenario_plugin.py


78. krkn/scenario_plugins/pvc/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/pvc/init.py


79. krkn/scenario_plugins/pvc/pvc_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/pvc/pvc_scenario_plugin.py


80. krkn/scenario_plugins/scenario_plugin_factory.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/scenario_plugin_factory.py


81. krkn/scenario_plugins/service_disruption/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/service_disruption/init.py


82. krkn/scenario_plugins/service_disruption/service_disruption_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/service_disruption/service_disruption_scenario_plugin.py


83. krkn/scenario_plugins/service_hijacking/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/service_hijacking/init.py


84. krkn/scenario_plugins/service_hijacking/service_hijacking_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/service_hijacking/service_hijacking_scenario_plugin.py


85. krkn/scenario_plugins/shut_down/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/shut_down/init.py


86. krkn/scenario_plugins/shut_down/shut_down_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/shut_down/shut_down_scenario_plugin.py


87. krkn/scenario_plugins/syn_flood/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/syn_flood/init.py


88. krkn/scenario_plugins/syn_flood/syn_flood_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/syn_flood/syn_flood_scenario_plugin.py


89. krkn/scenario_plugins/time_actions/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/time_actions/init.py


90. krkn/scenario_plugins/time_actions/time_actions_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/time_actions/time_actions_scenario_plugin.py


91. krkn/scenario_plugins/zone_outage/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/zone_outage/init.py


92. krkn/scenario_plugins/zone_outage/zone_outage_scenario_plugin.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/scenario_plugins/zone_outage/zone_outage_scenario_plugin.py


93. krkn/utils/ErrorCollectionHandler.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/utils/ErrorCollectionHandler.py


94. krkn/utils/ErrorLog.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/utils/ErrorLog.py


95. krkn/utils/HealthChecker.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/utils/HealthChecker.py


96. krkn/utils/TeeLogHandler.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/utils/TeeLogHandler.py


97. krkn/utils/VirtChecker.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/utils/VirtChecker.py


98. krkn/utils/__init__.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/utils/init.py


99. krkn/utils/functions.py 📝 Documentation +13/-0

Add Apache 2.0 license header

krkn/utils/functions.py


100. run_kraken.py 📝 Documentation +13/-0

Add Apache 2.0 license header

run_kraken.py


101. server.py 📝 Documentation +13/-0

Add Apache 2.0 license header

server.py


102. setup.py 📝 Documentation +13/-0

Add Apache 2.0 license header

setup.py


103. utils/chaos_recommender/chaos_recommender.py 📝 Documentation +13/-0

Add Apache 2.0 license header

utils/chaos_recommender/chaos_recommender.py


104. .pre-commit-config.yaml ⚙️ Configuration changes +1/-1

Fix CI directory exclusion regex pattern

.pre-commit-config.yaml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Mar 30, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. Encoding cookie displaced 🐞 Bug ⚙ Maintainability
Description
In setup.py, the "# -*- coding: utf-8 -*-" declaration was moved down to line 14 by the inserted
license block, so Python will not treat it as an encoding declaration. This makes the encoding
cookie ineffective and can cause future breakage if non-ASCII content is added while relying on that
declaration.
Code

setup.py[R14-16]

# -*- coding: utf-8 -*-
import sys
Evidence
The PR inserts the license header at the top of setup.py, pushing the encoding cookie to line 14.
Per PEP 263, an encoding declaration is only recognized if it appears on the first or second line of
the file (after an optional shebang), so this declaration will be ignored.

setup.py[1-18]
Best Practice: PEP 263

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`setup.py` contains an encoding declaration (`# -*- coding: utf-8 -*-`) that was pushed down by the new license header block. Python only recognizes encoding cookies when they appear on line 1 or 2 (after an optional shebang), so the current declaration is ineffective.

## Issue Context
This is a low-risk but real correctness/maintainability issue: the encoding cookie currently provides no value and could mislead future edits.

## Fix Focus Areas
- setup.py[1-16]

## Suggested fix
Either:
1) Remove the encoding cookie entirely (Python 3 defaults to UTF-8), or
2) Move the encoding cookie to line 1 (or line 2 if there is a shebang), and keep the license header immediately after it.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Copy link
Copy Markdown
Collaborator

@tsebastiani tsebastiani left a comment

Choose a reason for hiding this comment

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

/lgtm

@paigerube14 paigerube14 force-pushed the license_files branch 3 times, most recently from 49fa552 to bde17c3 Compare March 31, 2026 18:44
Signed-off-by: Paige Patton <prubenda@redhat.com>
@paigerube14 paigerube14 merged commit ef50aa8 into krkn-chaos:main Mar 31, 2026
11 of 12 checks passed
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.

2 participants