-
Notifications
You must be signed in to change notification settings - Fork 56
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
Updated load_drains rake task. #198
Updated load_drains rake task. #198
Conversation
Made the following changes: * Delete all drains from DB that are no longer in the dataset. * Update properties on existing drains
Awesome, thank you @squidarth! This looks good, but would you mind addressing the rubocop failures? |
66562b7
to
9ae7bc4
Compare
@jszwedko all done! |
Awesome, thank you! This looks great. One functional question for @jeanwalshie -- this implementation would delete drains that are no longer in the PUC database. Is that OK? @squidarth for safety, in case the the PUC database gives an accidentally gives an incorrect response (e.g. an empty one), what would you think about adding a On a related note, when we go to add this as a schedule rake task it'd be cool to send an e-mail if any drains are added/removed. Thank you again for getting the ball rolling on this! |
I'd recommend having some flag to show any drains adopted that have been deleted or even leave adopted drains which might be deleted by the update operation. We'd be happy to take a feedback loop (if possible). One idea would be to have a "data steward" contact field in the app and a "data quality" feedback, both for users who find items which are missing or not located properly and for this kind of update. Maybe some email auto-notification loop on update including listing any adopted drains which are deleted by update. |
@jszwedko @alocalsewerhistorian I'll create an issue for discussion on feedback loops and maybe we do a design session to work through different alternatives and make sure we're. |
Cool--so sounds like the main action item for this PR is adding a Should I also add an email that notifies the maintainers when drains are added/removed? |
@alocalsewerhistorian I agree with @jasonlally that they are a out-of-scope for the initial implementation, but those are great ideas. @squidarth I think I've used that gem in the past -- I'm fine with using it here too (it's not too heavy and I'm sure they've thought of edge cases that we haven't). If you could e-mail users marked as |
* Send email on deleted drain * Soft-delete the removed rains
bdc3f48
to
7aa3911
Compare
@jszwedko Updated the PR w/ those two changes (admin email) and soft-deletion. Lemme know what you think & sorry for the late response on this. My test of the admin email sending is not super comprehensive (I would have change the fixture data to incorporate ALL of the drains created by the test fixtures, which is kinda annoying), but I think it's good enough for our purposes |
Hi sfbrigade,
Over here at SF Public Works Hydraulic Engineering Section we are the data stewards for Storm Drain mapping and data and are very interested in adopt-a-drain user deletion or addition user suggestions: what is the best way for us to access user generated data? Do we need to put in a github request for programming to periodically provide drain “correction” locations/user/time/comments from adopt-a-drain back to us? Autogenerated email would work…or? I have a github account but know nothing about the process other than my user name and password. What do you call a service request / where do we start?
Thanks,
John Seagrave | Engineering Associate
Hydraulic Engineering | Public Works | City and County of San Francisco
1680 Mission St | San Francisco, CA 94103 | (415) 554-8305 | [email protected]<mailto:[email protected]>
From: Sidharth Shanker [mailto:[email protected]]
Sent: Sunday, December 04, 2016 7:46 PM
To: sfbrigade/adopt-a-drain
Subject: Re: [sfbrigade/adopt-a-drain] Updated load_drains rake task. (#198)
@jszwedko<https://github.com/jszwedko> Updated the PR w/ those two changes (admin email) and soft-deletion. Lemme know what you think
My test of the admin email sending is not super comprehensive (I would have change the fixture data to incorporate ALL of the drains created by the test fixtures, which is kinda annoying), but I think it's good enough for our purposes
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#198 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AJPX29--9Ky3Hi0SGAEYoycGaLBvAuHiks5rE4jbgaJpZM4K3OUw>.
|
John,
Yes, the best way is to put in a new request.
I’ll work with you on this
Thanks everyone!
From: Seagrave, John (DPW)
Sent: Monday, December 05, 2016 10:50 AM
To: sfbrigade/adopt-a-drain
Cc: Braswell, Greg (DPW); Lally, Jason (MYR); Walsh, Jean (PUC)
Subject: RE: [sfbrigade/adopt-a-drain] Updated load_drains rake task. (#198)
Hi sfbrigade,
Over here at SF Public Works Hydraulic Engineering Section we are the data stewards for Storm Drain mapping and data and are very interested in adopt-a-drain user deletion or addition user suggestions: what is the best way for us to access user generated data? Do we need to put in a github request for programming to periodically provide drain “correction” locations/user/time/comments from adopt-a-drain back to us? Autogenerated email would work…or? I have a github account but know nothing about the process other than my user name and password. What do you call a service request / where do we start?
Thanks,
John Seagrave | Engineering Associate
Hydraulic Engineering | Public Works | City and County of San Francisco
1680 Mission St | San Francisco, CA 94103 | (415) 554-8305 | [email protected]<mailto:[email protected]>
From: Sidharth Shanker [mailto:[email protected]]
Sent: Sunday, December 04, 2016 7:46 PM
To: sfbrigade/adopt-a-drain
Subject: Re: [sfbrigade/adopt-a-drain] Updated load_drains rake task. (#198)
@jszwedko<https://github.com/jszwedko> Updated the PR w/ those two changes (admin email) and soft-deletion. Lemme know what you think
My test of the admin email sending is not super comprehensive (I would have change the fixture data to incorporate ALL of the drains created by the test fixtures, which is kinda annoying), but I think it's good enough for our purposes
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#198 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AJPX29--9Ky3Hi0SGAEYoycGaLBvAuHiks5rE4jbgaJpZM4K3OUw>.
|
@squidarth One question, if the drain is restored in the remote dataset, will the rake task handle restoring it in the Adopt a Drain database? The reason I ask, is that could finish a closed feedback loop:
@jszwedko @squidarth I think it could be as simple as sending a different subject. Admins can create email filters to parse these out. Subject: An adopted drain has been deleted Body: Just notifying you that drain with PUC_Maximo_Asset_ID: <%= @thing.city_id %>, and rails id <% @thing.id %>, has been removed from the database. Thoughts? @chaunceygraves @alocalsewerhistorian Per #200 we can tease out other designs for soliciting feedback from users. I just want to keep this PR as tightly defined around syncing and notifying admins. |
Regarding the email, depending on the number of drains we expected to be removed / added on a regular basis, I might opt for a "report" style e-mail. Something like: Subject: Adopt-a-Drain import ( If we don't expect this to happen often, than I'm fine with an individual email for each drain. |
Ah, I haven't considered this case yet. The way I've done this right now, if we try to re-create a deleted drain, it won't succeed, because there's a unique index on the
Let me know what you think!
Yeah, this sounds good, happy to do that too |
Yes, there is a chance that deleted drains might be re-activated. We've gotten reports from the field about drain locations (or the lack thereof) which are incorrect, probably because they thought they were on a different street. We usually use street view or other backup information (construction drawings are first choice) to substantiate but sometimes that's limited. It is likely to be rare however. The number of drains deleted on a weekly basis will be small, probably 1-2 max, however sometimes we'll do some focused field study and typically add 15+ and move 5-10 and delete a couple once in a while. |
👍 thank you for the additional context @alocalsewerhistorian -- give that expected magnitude of adding/removal of drains, I don't think it is imperative that we do a report style e-mail, but I feel like that would still be the preferable format. @squidarth if a drain is undeleted, I think we'd want to revive the existing drain since, e.g., we might be undeleting a drain that a user has adopted and would like their adoption status of the drain to persist. Thank you both! |
Cool, sounds good, will get this done by end of the weekend |
3f47eb2
to
526a597
Compare
3bc58f8
to
b9815c9
Compare
/cc @jszwedko @jasonlally |
@@ -0,0 +1,3 @@ | |||
Hi Adopt a drain admin! |
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.
Is this still used?
@squidarth this looks great, I can see that it required substantial refactoring so kudos for taking that on. I'll give others a chance to comment, but I think this is ready to go. |
I'll merge and roll this out this weekend if there are no objections |
Sounds good, thanks! |
@jszwedko - will you handle QA looking at pre- and post- import on a test DB with a copy of the real data? Do you want any help with that or a second set of eyes? I'm around this weekend. |
Closing in lieu of #217 |
@jszwedko @jasonlally Finally got around to this!
Broader context
@jasonlally and I discussed at the last civic hack night that we want to start syncing the drains in the database w/ the data set of drains on the open data website.
Changes
The main change I had to make here was delete all the drains in the DB that no longer exist in the dataset. We discussed the product implications of this (if you adopted a drain that doesn't exist, it'll disappear), and decided it's not that big a deal.
Fixed a couple other bugs--mainly
gsub!
actually returnsnil
, so we weren't properly doing updates.Let me know what you think!