-
Notifications
You must be signed in to change notification settings - Fork 48
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
The Big Refactor #166
The Big Refactor #166
Conversation
To make sure things are done right we use the Hubot types. msg was not really the message, but the response object, so we renamed it to es.
Logging was in the wrong place.
😲 Gonna set aside some time to review it with my full attention. If you don't hear from me by Monday, give me a nudge. |
Removes the class and wraps everything in the one function scope. No `this` needed anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Ran it through a few tests with and without a registered adapter/uploader.
feat: add kiosk mode to show complete dashboards
Also added kiosk mode for dashboards, so we fix #72 |
@stephenyeargin would you be able to test RocketChat, BearyChat and Telegram to see if they are still OK? |
We're not testing the timezone here, so it should not be included.
So, those were introduced by other contributors, I don't actually have accounts with any of them. Can tag folks and give them some time to give it a spin. Generally speaking, if the tests pass, I'm not too worried about a regression. 😁 BearyChat - @shonenada via #65 |
I'm okay with merging and publishing. |
This big refactor is about the following:
GrafanaClient
that is a small wrapper over the Hubot HTTP to aide with interactions with Grafana. The client is created in thecreateGrafanaClient
function and it takes care of theHUBOT_GRAFANA_PER_ROOM
setting based on the response.hubot-mock-adapter
and a small wrapper (more here: https://keestalkstech.com/2023/08/hubot-testing-revisited/). We leveraged Promises / async / await instead of usingsetTimeout
. All tests will now finish within a second, which makes committing and pushing better. By moving some of the testcases to theTestBot
, we don't have to setup all the tests every time. By droppinghubot-test-helper
, we're able to test against version 7 of Hubot (earlier versions had problems with the Log feature). We can now also dropsinon
,require-dir
andsinon-chai
. The new test setup has no knowledge of rooms and users -- when I look to the testcases we don't need them.kiosk
parameter. Added the test cases as well.With this refactor there comes some ifs and buts:
msg
object was not the message, but theres
object, which contains a message. So I refactored some of those references. Not all of them, because that would muddy the PR a bit, we need to do that later.This has been a huge refactor, but I think it helps us with going forward. I think we should test some more platforms before releasing. When we release let's make sure we release a major version, so everyone can double check before upgrading.
Fixes #165
Fixes #164