stephenyeargin / hubot-grafana

📈🤖 Query Grafana dashboards
http://docs.grafana.org/tutorials/hubot_howto/
MIT License
154 stars 48 forks source link

Split to a Grafana Service #180

Closed KeesCBakker closed 3 months ago

KeesCBakker commented 3 months ago

Partially fixes #177 in which we do a refactor to:

┌────────────────────────────┐   ┌────────────────────────┐    ┌────────────────────────┐ 
│ BOT                        │   │ ADAPTER                │    │ CUSTOM RESPONDER       │ 
│                            │   │                        │    │                        │ 
│ handles request from Hubot ├───► respond to a specific  ├────► influence the way the  │ 
│ responsible for response   │   │ chat platform          │    │ response is written    │ 
│ formatting                 │   │                        │    │                        │ 
└──────────────┬─────────────┘   └────────────────────────┘    └────────────────────────┘ 
               │                                                                          
┌──────────────▼─────────────┐                                                            
│ SERVICE                    │                                                            
│                            │                                                            
│ business rules for         │                                                            
│ querying of dashboards     │                                                            
└──────────────┬─────────────┘                                                            
               │                                                                          
┌──────────────▼─────────────┐                                                            
│  CLIENT                    │                                                            
│                            │                                                            
│  interaction with the      │                                                            
│  Grafana API over HTTP     │                                                            
└────────────────────────────┘

So in this PR we are doing the following:

KeesCBakker commented 3 months ago

Interesting coverage. We might need to add some extra tests.

image

KeesCBakker commented 3 months ago

"It's not easy being green!" 😁

image

KeesCBakker commented 3 months ago

Will test it on a live Hubot today. Have a great new feature I want to add to our bot, so at the end of the day we'll know.

KeesCBakker commented 3 months ago

Did some testing and some further refactoring. All my tests with a live Hubot were also OK.

image

@stephenyeargin, we can merge if you don't see anything crazy.

stephenyeargin commented 3 months ago

Looks good to me, I'll let you do the honors. I see you're sneaking it a bit of TypeScript. 😉

KeesCBakker commented 3 months ago

Looks good to me, I'll let you do the honors. I see you're sneaking it a bit of TypeScript. 😉

Hahaha. Yeah the d.ts files work great together with JS Docs.