Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Playbook generator#1136

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
aantn wants to merge37 commits intomaster
base:master
Choose a base branch
Loading
fromnatan-streamlit-triggers-test1
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
37 commits
Select commitHold shift + click to select a range
e40e34c
Feature: Adding playbook builder
pavangudiwadaJul 25, 2023
7a9d084
initial commit - actions part is broken
aantnJul 28, 2023
c10a10c
get actions working
aantnJul 28, 2023
ee6e93f
fixing wrong functions (#1006)
Avi-RobustaJul 25, 2023
3253479
feat(helm): update kube-prometheus-stack to 47.2.0 (#964)
lippertmarkusJul 26, 2023
6ec5ec2
add dropdown for prom crd error
RoiGlinikJul 26, 2023
14126d9
Main page with sub pages but slow
pavangudiwadaSep 20, 2023
edaaf7b
recurssion issue - dont use
pavangudiwadaSep 21, 2023
37a0269
Working navigation between pages
pavangudiwadaOct 17, 2023
b55102c
Added new predefined playbooks
pavangudiwadaOct 26, 2023
1eb944e
Fixed ingress playbook
pavangudiwadaOct 27, 2023
368391c
Merge branch 'master' into natan-streamlit-triggers-test1
aantnOct 27, 2023
b595e09
Update poetry.lock
aantnOct 27, 2023
ab0195a
Fixed session_state code and variable name
pavangudiwadaOct 27, 2023
9e06e99
Removed extra methods, updated session variables, added a back button
pavangudiwadaOct 27, 2023
f8ba263
Updated deprecated code
pavangudiwadaOct 27, 2023
18ccbd1
simplify logic for expander_state
aantnOct 28, 2023
0cce345
Improve pydantic models to work better w/ playbooks generator
aantnOct 28, 2023
3fe1cd8
Improvements to playbook generator
aantnOct 28, 2023
feb0d88
Updated Playbook text
pavangudiwadaOct 30, 2023
9a6fee8
Single page playbook generator, simple navigation (#1140)
pavangudiwadaNov 4, 2023
29de126
more schema fixes
aantnNov 4, 2023
d17d25c
Fix helm triggers
aantnNov 5, 2023
027a244
Update playbook_generator.py
aantnNov 5, 2023
230e780
Use streamlit_antd_components for stepper and streamlit_extra for sty…
aantnNov 6, 2023
2c626d3
Use pydantic_form instead of streamlit_extras.stylable_container
aantnNov 6, 2023
723d077
Fix dependencies
aantnNov 6, 2023
16a07a7
clarify comment
aantnNov 6, 2023
0ebcad5
Switch back to styled container and not pydantic_form
aantnNov 13, 2023
241d747
Fix bug with Warning events trigger
aantnNov 13, 2023
dd98818
Issue with NonType
pavangudiwadaNov 16, 2023
bc46b1d
Fix a few bugs (not the main bug we're troubleshooting)
aantnNov 17, 2023
633c942
Fix bug with trigger_data being None
aantnNov 17, 2023
9a03a42
Give variable a better name
aantnNov 20, 2023
7aef5a0
Fix bug w/ yaml output
aantnNov 20, 2023
a9eb789
Fix bug when creating a playbook from scratch, not according to templ…
aantnNov 20, 2023
2e9c342
Fix another bug rendering triggers to yaml
aantnNov 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Fix bug w/ yaml output
Operation enum in on_ingress_all_changes was not converted to yaml properly in output
  • Loading branch information
@aantn
aantn committedNov 20, 2023
commit7aef5a06c310cf15d4b4af42b0d3d53ce20e813e
7 changes: 5 additions & 2 deletionsscripts/generate_kubernetes_code.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -358,7 +358,7 @@ def autogenerate_triggers(f: TextIO):
f"""\
class {resource}{get_trigger_class_name(trigger_name)}Trigger(K8sBaseTrigger):
kind: Literal[\"{resource}\"] = \"{resource}\"
operation: Literal[K8sOperationType] = {operation_type}
operation: Literal[{operation_type}] = {operation_type}

@staticmethod
def get_execution_event_type() -> type:
Expand All@@ -382,7 +382,7 @@ def get_execution_event_type() -> type:
f"""\
class KubernetesAny{get_trigger_class_name(trigger_name)}Trigger(K8sBaseTrigger):
kind: Literal[\"{resource}\"] = \"{resource}\"

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical bug: KubernetesAny triggers incorrectly set kind to last resource.

TheKubernetesAnyTrigger classes are incorrectly using{resource} in theirkind attribute, which resolves to the last resource from the outer loop ("Ingress"). This should be "Any" for these triggers.

-            kind: Literal["{resource}"] = "{resource}"+            kind: Literal["Any"] = "Any"
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
kind:Literal[\"{resource}\"]=\"{resource}\"
kind:Literal["Any"]="Any"
🤖 Prompt for AI Agents
In scripts/generate_kubernetes_code.py at line 384, the kind attribute forKubernetesAnyTrigger classes is incorrectly set to the last resource name due tousing the variable {resource}. Change the kind attribute value to the string"Any" explicitly for these triggers instead of using {resource} so that itcorrectly reflects the intended kind.

operation: Literal[K8sOperationType] = {operation_type}
operation: Literal[{operation_type}] = {operation_type}

@staticmethod
def get_execution_event_type() -> type:
Expand DownExpand Up@@ -439,3 +439,6 @@ def main():

if __name__ == "__main__":
main()
print("Done. Before committing, it is recommended to run:")
print("poetry run isort src/robusta/integrations/kubernetes/autogenerated")
print("poetry run black src/robusta/integrations/kubernetes/autogenerated")
10 changes: 2 additions & 8 deletionssrc/robusta/integrations/kubernetes/autogenerated/events.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,9 +33,7 @@
from hikaru.model.rel_1_26.v1 import DaemonSet as v1DaemonSet
from hikaru.model.rel_1_26.v1 import Deployment as v1Deployment
from hikaru.model.rel_1_26.v1 import Event as v1Event
from hikaru.model.rel_1_26.v1 import (
HorizontalPodAutoscaler as v1HorizontalPodAutoscaler,
)
from hikaru.model.rel_1_26.v1 import HorizontalPodAutoscaler as v1HorizontalPodAutoscaler
from hikaru.model.rel_1_26.v1 import Ingress as v1Ingress
from hikaru.model.rel_1_26.v1 import Job as v1Job
from hikaru.model.rel_1_26.v1 import Namespace as v1Namespace
Expand All@@ -51,11 +49,7 @@
from hikaru.utils import Response
from pydantic import BaseModel

from robusta.integrations.kubernetes.custom_models import (
RobustaDeployment,
RobustaJob,
RobustaPod,
)
from robusta.integrations.kubernetes.custom_models import RobustaDeployment, RobustaJob, RobustaPod

from ....core.model.events import ExecutionBaseEvent, ExecutionEventBaseParams
from ....core.reporting.base import FindingSubject
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
# This file was autogenerated. Do not edit.

from robusta.integrations.kubernetes.autogenerated.v1.models import KIND_TO_MODEL_CLASS as v1
VERSION_KIND_TO_MODEL_CLASS = {
"v1": v1
}

VERSION_KIND_TO_MODEL_CLASS = {"v1": v1}


def get_api_version(apiVersion: str):
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp