-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Refactor: remove kits #246
Conversation
Fixed the following TODO items:
Regarding the dates - I've (for now) left the added_at field on the "/user/:id" and "/devices/world_map" endpoints as, in the first case, "added_at" is probably a better name for this property on the user (they already have their own created_at date), and in the case of the world map, we need to check that the JS doesn't expect it to be there. It's removed elsewhere though. |
Hey @oscgonfer - I think this is now ready for a really thorough test on staging, and then a merge! We'll go through it on monday afternoon - have a good weekend in the meantime! |
Note - this will have to be release along with an update to fablabbcn/smartcitizen-web to remove references to the kits endpoint. We should check also that onboarding works against this branch, which i will do locally and report back |
TODO: a bit more tidying up of dates, while we're here:
|
107e5b0
to
f2b3bd1
Compare
Hi there! Will running the db:migrate seems like there is a small issue, I believe coming from
Raising:
|
Also, after checking the new structure, I believe we should have an additional column on the Conceptually, it will represent the idea of We will then have to write a parser on |
Hey Oscar! Aha, this is because of the primary key sequences getting out of sync when we restore from a backup, you'll need to run
in the rails console first (now we've deleted the weird devices, it shouldn't cause a problem). This shouldn't need to be done in production, it's only because we're restoring from a backup that it's an issue. |
(btw i've also pushed a small commit to get rid of the |
Aha!! OK! that did it! Great work! 👏 Will test it a bit and come back to you. I will put it on a separate comment for traceability of TO-DOs |
Keeping track here of things @timcowlishaw
|
Aha thanks @oscgonfer that's super helpful. I'll get all that sorted this week! |
0fba5c6
to
83d0241
Compare
Hey @oscgonfer , I've just pushed a commit with the following changes:
I think it'd be good to have a chat about "adding the timestamp of the actual measurement" and "populating the device description" next week if poss - there's a few things there i'm not clear on! |
Thanks @timcowlishaw ! Let's talk about these points in person. Only one comment: we should think about the |
Regarding the timestamp, let's take two payloads of the same device:
The second payload has data for only two sensors. But on the |
Added migration to rename 'location' to 'bus' - now just pending the work on per-component last reading times, which i'll get to after the remaining bugfixes elsewhere! |
I've also added per-component last_reading_at timestamps, updated with each new reading! |
BTW @oscgonfer when this refactor is done and merged, I'd like to start thinking about refactoring and improving the test coverage for the data storers and MQTT handler - they're extremely "enmarañados" at the moment and with quite flaky coverage, which is making me very nervous about changing anything to do with them, and they're a pretty key part of the system. We can discuss next time we see each other! |
678ee54
to
efc8929
Compare
Squashed and rebased onto |
This is the expected behaviour - legacy devices should be 'stealable' This reverts commit 0409811.
… Requires re-migration
61af320
to
32bca5d
Compare
We never made a separate issue for this, so just noting here that we fixed this with the change to the default_keys logic |
Yes, sorry! Thank you! |
Work in progress on #241 - this removes kits and makes devices relate directly to sensors via components.
The migration is probably a good place to start to work out what's going on here at a high level.
Still TODO:
See if we can remove OrphanDevices too