 This summer we started a journey with humanitarian toolbox to build an application for disaster preparedness What we do with humanitarian toolbox is we focus on how can we get volunteers involved and and not just have them do manual labor Test, but as somebody who has technical skills, there's more you can do. There's more impact You can have what we're trying to do from a preparedness aspect is we're trying to get smoke detectors into people's homes You know who don't have them or and that's where this kind of app can come in to make Getting this program working much more more effectively The reality is you're gonna spend three days dedicating your time working on an application Something that's gonna be carried forward by others. So this is your choice to be here and spend that time. So thank you We're really proud of the work we've been able to do with 15 developers over the last three days But this is only the beginning This is already this is a project for the Red Cross now We had a few codathons since July and gotten quite a bit of code written that led to a whole new rack of work items That's a little details And so the work items went from a few Prototype features to this larger block of what's the things we must have to actually run a field trial There was an opportunity to get a really amazing group of people together and push through to the final detail So that we can put this project in the field. It's really exciting to see All of these volunteers come together with just this very unique skill set and this sort of a codathon is really incredible And it's really neat to see all this expertise in one room The only way for me to volunteer and help in any kind of humanitarian effort has been okay Well put down Visual Studio put down get put down anything that you know about working In your craft and go pick up power tools and I'm like no you don't have enough band-aids for me to build a house For someone this is just a fantastic opportunity a to work with some great people and be to use our skills of software developers to actually build some software that can help people this is the reality of right software is a superpower and Getting all those superheroes to fly in the same direction is a trick Coordinating a project can be quite difficult. Let's see how they managed everything in GitHub So Bill hey Seth, how we doing great? Tell us what you're doing on the project, but well I've been incredibly busy today. I saw you know, you've been talking to everybody here I was going to keep so the way we're managing the project and managing reviews is we're using the github flow model So basically anybody who's working on a task They fork our repo so they take our github repo fork it into their own account Okay, once it's in their own account, they bring it down to their desktop They do all the work in Visual Studio all the things that happen there submit it into their copy of the already repo Okay, and then when they say they're done they submit a pull request I see and then one of the key committers Tony or I or we've now added James as a member of the commit team Can go through and look through each one of these awesome. So I just want to show you just today's activity Okay, so here's one page. That's all today. Wow. Okay. We got more This is page two. We're still on today November 7th. We're rolling down here. We've got all these merges and when we get down here into We see the first ones that we did this morning the third page down in our commit log, you know for just today You know and yesterday we were working quite a bit. There's another Several pages there for yesterday. Okay, so we've got a lot of work Now the way we do this here's basically the process that goes through so I've got three open pull requests right now Okay, and here's where they're sitting here. You know, this is gonna be fun I get to review rocky look as code. Okay, so we get to say dude. Did you do great? Okay, and there's a comment here So I'll look at this one and you can see this one screen and I'll explain where we're going there So when I look at his pull request You know, I can see what he's changed. So he's added a couple tests here You can see Dave Fakett one of the people already is Reviewing this and there's the emoji here. This is the ship it emoji. So in this case, I don't have to review Rocky's code, right Dave already did. He said this is great. This is wonderful This next block here says we have some checks that we do to make sure a pull request is ready and doesn't break the build Okay, so the first one here the check that we have and this is an app fare One so we're doing a continuous integration of every pull request using app fare So what happens is when somebody submits a pull request This software in the cloud Builds it runs all the tests and then says, okay, it's good Okay, and then it also checks to make sure that it's up to date with the base branch So I don't have to do any manual merge. I said, which would be the other reason we pull it back So we got new tests. We've got this happening and I'm gonna do the merge great and improve some tests Okay, confirm the merge great. And now it's in place. Okay, so that's one more thing that just got done Now the other thing that I should probably show The way we're tracking this and especially if anybody even after this goes live and you're watching We're looking at we basically track everything as issues. So you go under the issues and we take milestones here that We're trying to track. This is what we're trying to finish today and tomorrow And you can see these are the tasks that we're assigned to this milestone and when we finish we're gonna take Set a new milestone basically a new scrum and say let's try to get as many as we can done By building this an ASP.net 5 it gives a chance for developers to learn some new skills You know, you may not get to use the latest of bits in your day job. Come join us and see what they do And so there's there's a little bit of a learning curve, but it's interesting and how Now we have the ability to do certain things that sort of speed up the development process Even though, you know, there are some struggles when you're working with a beta version But overall that it's interesting how you can Pull in all your assets that you need and new ways, you know That's more integrated using growing Gulf things like that where you had to really work toward that in previous versions Now it's all part of it, you know, it makes it a lot easier Some of these developers were using some really cool techniques Let's look at a pattern that one of them was using in this project. All right So why don't you tell us now because we've talked about all this great stuff. Who are you dude? And what do you do? Do I'm just a dude who works out of his basement and Brandon Manitoba. So this is good stuff My name is James Chambers, I'm an ASP net IIS MVP I'm I've been a four-time awardee and I'm just really loving the new stuff in Azure and on ASP net v-next ASP net 5. I guess we're called now and so yeah a blog in this space I'm working in the space and this opportunity to work with the already crews just awesome like to take our Craft and to apply it to something that's like for the greater good is just really cool What we wanted to do was to basically You know take the workload that was happening in the website itself, okay, and move it off into the cloud We let's let the website keep moving as quickly as possible But the long-running tasks the IO the email sending the calling the rest apis out to send SMS messages We want to make sure that that's not tying up the tasks on the website property We knew up this command we put in all of the details that we need to we post it onto a queue And then we've got a job that's running in the back and a web job Okay, that's just part of our Azure website got it and it runs in the back end and when it's triggered automatically when a new Entry goes into the queue once you explain a little bit what a queue is sure this so the storage queue is one of the Features of Azure and it allows us just to post a message and in my case all I'm doing is taking that command that I've got I Use jason.net to serialize it as a jason document. We pitch it up just as a string So it's super easy and then on the on the other side of it when that queue is actually when we want to start processing the queue You know and back to what a queue actually is it's it's just a it's just that it's just you know The way that we think about you stand in line for something and then eventually you get to the front of the line So the queue works that way as well and the storage queue there's some cool things about it Like it's gonna keep retrying for us if there's failures and everything rather than writing all of that logic inside of our app We just install the Azure SDK throw our message on to the bus and then we wait for it to be triggered in our web job And that's not a completely different process. Awesome. Well, let's let's take a look at it Yeah, absolutely one of the scenarios for notifications that we want to use is when we have an Activity that set up and there's all these tasks that need to be completed. We're gonna assign volunteers these tasks So we want them to be notified, you know, you signed up to help on this project Here's an opportunity for you to help this matches your skill set. We'd like you to try this out. Well, that's awesome Well, let's look at the code of how you do that. Absolutely. So I'm in the code itself here We basically we get a list of all the updates that are coming in we have you know We just knew up a couple of lists We add anything that had been changed from the view model that's posted back into our controller action here And then very easily we just set up a view model for this command and we send it off to the bus And that's that's all that's needed to make that happen. Maybe you can help educate me Are you guys using the CQRS type pattern command inquiry, but we're not doing full-blown events. Yeah, okay So now that's I've got my bus that gets passed in by a DI. I've got my controller here that does the Interesting bits of building up my model. I send it off to the bus and then without waiting for any Crazy processing to actually happen. I get to just resume rendering the website. Awesome Well, let's take a look at the one for sending messages. It looks like it's right there Yeah, this is it right here. This is the command and you can see it's it's pretty straightforward What we're doing is we've got a single command that lets any caller Choose to send out The sms messages the email messages are both So you build up that body of sms recipients You build up the body of email recipients and when you pass that in if there's anything in that collection It's going to loop over them and then cue the messages the sms's have a recipient and a message The email recipients have an email And a subject as well and we're actually because we're using send grid We're actually going to be able to use templates as well. So all the emails that go out are going to look like super like Awesome. Yeah, they're gonna they're gonna look tight. That's cool. Yeah Can we see where the event happens when you actually get the cue the message in the queue and then It notifies somebody that it gets a message right and this is the super simple part So down here we've got a web job called notification processor And you configure it to deploy side by side with your web app When you actually the tooling and visual studio 2015 now supports you can like right click and add a web job to this Oh, that's so much nicer than it used to be. Let's look at the job getting this stuff off the Right. So to start off the job what we do in my case. I'm using user secrets So the azure storage connection string is stored in my user secrets And this is or in this case an environment variable. I apologize But that's the pattern that you know that pattern that we're doing got it And it looks like the job host is the actual thing that's going to be running That's right So we do we do run and block and then the way the stk works is it scans for anything that looks like Something that is part of the azure stk. So I've got this functions.cs And I've got a process sms cue message It's got a cue trigger property attribute on it And when when this compiles when this builds when this runs it Dives in and basically pulls these functions out and says this is something that we're going to use to Participate in that job host. Okay. So let's look at the cue trigger attribute that's happening on this function anytime something Goes into that cue execute this function. Exactly. Yeah, and then so, you know, we know that it's that jason object that we had serialized previously So we do serialize it back out. We've got a shared type with a common core library or whatever So we do serialize that back out We read from our environment variables to pull out things like our twilio id and our token the phone number that we're sending from And then the rest of it is send the to we got the message that we've got we create an instance of the twilio Rest client. This is all like code that you can just pull right off of there Yeah, absolutely. Yeah, and then we just send it out if there's an exception If there's something goes wrong with sending it via twilio, they populate this rest exception object So if that's not null and there's a message in there then we know something went wrong and we just log it out Man, you're going full Elvis operator and string interpolation. I know I love it. Hey, it's great c sharp six Yeah, okay. Well, thanks so much for spending time on this bud. Yeah, absolutely All right back to work. Sounds good. All right, thanks We've got this process of of wanting to make the website as responsive as possible But we don't want to have to We want to make sure that there's guaranteed delivery on things rather than writing a whole complex set of code that that we need to in order to ensure delivery We've got automatic retries in a storage queue out in azure We can ship a command up there and wait for a queue processor to pick it up and then deliver emails and deliver sms via other cloud services that are connected to our to our azure project and It things like that just weren't even possible five years ago So it's very interesting how they sort of structured this into these lots of little decoupled pieces that We probably should have more tests for but you always want more tests in a project like this I'm here with rocky. Why don't you introduce yourself and tell us what you've been working on, but sure I'm rocky lotka. I'm the cto at meganic and here Adding some tests to the toolbox project. So that sounds like super easy But when you're looking at adding tests to a project that's already existing Sometimes that requires a little retooling. Did you did you have any of that happen? Oh, yeah Testings never actually. No, I know I'm just saying it sounds easy But if you go to your manager and you're like, hey, we're gonna add some tests We're like, oh that's super easy, but that's not what it is, right? No. In fact, there's uh, you know a lot of Existing code. So we've got to figure out what the code is doing and then in some cases figure out ways to Be able to generate sample data or known data sets and and run through the code. And so we've had to Change a few things here and there. Luckily. I've only found one real bug so far today. So that's good All right. Well, let's take a look at what you've done and see if we can find any of that Sure. So Really the project had very limited testing to start with but then I've added some new ones here. So for example, we've got a test that is running through the idea of can we get activity detail and On the surface you'd say, well, that's that's easy, right? If we look down here, the actual tests are not that hard We basically create a query Uh, and then call the handler and then in this case, I expect not to get anything back. So I'm saying, well, is it, you know, An all So that was the easy part But then when you start saying, well, what about the test for something that does exist Say, well, we do expect to get something back. Okay fair enough Then there's all this code here because we have to actually have something to get back, right and And day has gone by and I'm sure a lot of people maybe still do this We'd set up a test database and have some sort of script every time you run your tests It would re-initialize the data the actual database and you know Why I remember those days So in this case what we've got is we're using entity framework with an in-memory database model. I see and uh So in fact, if I go up one level higher And here's one of the areas where we started refactoring some of this is we've got a base class For the tests that at least sets up some of the base configuration Information and in this case in particular is setting up our entity framework Creates essentially an empty in-memory database And all of this is using dependency injection to pull the appropriate resources Just like the app itself does So let's talk a little bit about the tooling and how the tooling is helping you with unit tests Is the tooling doing anything for you when it comes to unit tests? Well, the tooling is fairly nice You know built into visual studio is this idea of the test explorer and test runner So I'm able to just run up here and say I'd like to you know run all of my tests Um, we'll do a quick build and if we go back to the test explorer now, we'll see Um right across here the bar. I've got one failing test, which I know I'm working on that now Oh, awesome. So I expect that to be failing. I'm not done with it. Cool. So in your experience and you've been doing this for a long time Coat coverage. What do you feel sort of like a good sort of smell for how much should I be testing? I really think It's it's difficult to narrow down on a specific percentage Certainly, I've worked or interacted with places that are oh, we want a hundred percent and I don't think that's Use effective, right? I mean, yeah, if if you can even achieve it you're spending way more money than you should be right Um, yeah, 20 percent is typically bad pretty pretty bad Yeah, so you probably want somewhere, you know, well north of 50 percent But I also think that you have to look at what you're testing because there's um Code that's a lot more complex or a lot more on the critical path And then there's code that's that's arguably less important. So what do you have? What kind of work do you have ahead of you? Uh, well boy, we're just really getting started on this testing. Um, so we're You know, I've got to flesh out some of the tests that are here and now that we've got a model I think it'll be easier Maybe to get more people involved in writing some more tests on more handlers. Well, awesome. Well, I'll let you get to work But great. Thanks. All right. Thanks bud. So one of the biggest challenges we had today is we literally couldn't have people test We had the code it seemed to be working on my machine It always works on my machine on their machine someone's machine And we finally figured out how to get that thing deployed So the testers weren't testing code that was a week or two old And getting that was a huge moment because it basically doubled the amount of manpower that we had working today We're trying to pull in a bunch of different technologies And so we had lots of different ways. It just wasn't working We tried looking at splitting up the build. We tried deploying instead of automatically doing it manually Tried a lot of different options. What we finally found is that we had to kind of break it down into separate pieces So for deployment, we focused on how do we deploy it manually versus get automated stuff from continuous deployment And then we were able to figure out what the actual issue was there and solve that What we did is we took the code and manually deployed it So I was kind of playing the role of the continuous deployment mechanism And we figured out that what was happening is was getting there. We're running into an error But we weren't seeing an error screen. So we went in we made some changes to the azure configuration We're actually able to see some of the logs behind the scenes of stuff We weren't seeing through the web page. All right, bill So it looks like you got some cool stuff to show us right so once again, we talked earlier We were having trouble with our deployment scripts and with some Help from david fowler actually who wrote some of the build engine. He's coming in and helping us get this through So here's the how the process works when it's supposed to work. Okay, so now now Let me see if we got this right. So now you were having some build problems before we saw that So now you were able to resolve that with some help right and now we're going to see how this whole process works I've got pull requests. You can see the one here with the yellow that says it's it's building All right when I click into it and that page was a little bit A little bit old you can see we come down here and you can see now it says again all checks have passed Up to date with the base branch before we got on camera. I reviewed all the code normally I do that at this stage So I go ahead and just merge this And I confirm the merge. Okay And now if I switch over to this other window, I'm showing our deployments and what we should see here really shortly Is now you can see it's grabbing it expecting the changes It's going to run the build in the cloud It's going to deploy those bits and we'll have new bits on the site That's awesome. So what was the challenge? What was going on in the background that was causing this issue? So what was going on is we're running In order to get our web jobs running we're trying to build both xproj and csproj Which are which are not necessarily compatible. We don't even know if they are so what we needed was One of the guys from the build team David Fowler just was looking at our deployment script and pointing out where oh, yeah You got to do this when you're in this situation got to do this on this deploy and and there you go Well, that's super handy It is it was great to get the the support we've gotten as we're trying to use Some of the latest and greatest and even not yet release stuff has been really super So can you get into sort of the details while this is still baking of what sort of things you had to change? There were a couple different ones and I'm going to end up writing a blog post about this by the time you watch right now, so When you go to say, please generate the deployment script for me and there's a way in kudu and it can use the azure The azure tools that get installed by a new get and it'll say, okay Please generate the script that the default script that actually runs on the site So then we get that and I was starting to modify Well that default script assumes that your solution file is in the root of your repo Okay, well at our repository. It's one directory down. I see so I had to modify that whole default script Okay, okay, you can configure that so it knows and runs correctly, but we just had to change that That bit in the configuration And then it was trying to get everything to build in the right order And once we started building then it was primarily we had to make some change to point for the cs project Is to point to the v2 new get feed and Once we got that going then the same command we were running that I showed you earlier So reviewing the pull request that's now running exactly the same order exact same commands up in kudu up in azure To deploy from our main repo awesome So let's watch this how long does this usually take to build probably more time than we really want to sit and watch this All right Well, it can't take as much as about eight or nine minutes Okay, because it has to do all that and install the runtime and everything And then what would happen is this deploying one then would suddenly become that active deployment Just as you see the next one down And what we'll see when it's done is once it's active I can go and I can look at everything and see about how long it takes And you can see it takes that one took about four minutes. Oh, that's not bad. There we go And see and now we have new bits. So if I flip back over this other browser here If I go to this page right here and I refresh I'll be refreshed and running the new bits This is awesome. So you're able to now sort of as things get checked into whatever release or development branch you have It'll just pull it right in run the bill get it going This push this last few weeks from culminating this weekend is just getting to the minimal buy of a product All the bits that we can actually go take it into the field And I'm very cogs in the fact that that's the point where we find out if we actually have a clue Like have we built the right things can people who are not computer people Use this app and actually get some results from it All right, so i'm here with tony and sarah and we're going to sort of get a demo of what you guys have been able to Accomplish in the last couple of days. Yeah, why don't we get started last couple of days in the last couple of months We pulled together a whole bunch of code So we're going to look at it from two point of views The first one is from the technology we have for individual volunteers or users who come And so you'll be able to search with this giant search magnet there Or otherwise what you can do is you can see the campaigns all of the organizations who are on the on the application Can just list whatever preparedness campaigns they've got going on anywhere in the country That's pretty cool. I mean you get in there. It seems like it's pretty easy to just get in there and do it Yep, and so I can look in a campaign I can find out what are some of the activities available So I can go from I want to do something to actually want to start to volunteer for a particular task So do you have to be logged in to do this part? Nope, all of this is visible from the public site We want it to be as easy to get to and then it's not until you volunteer that you have to start giving information and logging in So that would be the site where you would be able to see exactly what types of events and activities are going on in your own neighborhood Basically, yeah So for example here, I can find out that maybe in a particular neighborhood There's a fire prevention day and I can go ahead and click volunteer It'll ask me some for information some skills I might have and then connect me up to somebody like Sarah who might actually assign me to a task So what's going to happen after they volunteer? You'd get this feedback and what would you do from there? Yeah, so I would see a list of all of the people who want to volunteer for a certain task or a certain activity And then I would look at all of the tasks that we need to accomplish during that activity And I would start to assign people tasks based on all of their various skill sets awesome And we're not quite fully there, but I can actually show you what she's talking about So from an admin point of view, I can go and look at a campaign So Sarah would go in look at a campaign and find out okay for this particular activity I've got obviously this is sample data, but I've got some users here who have signed up to volunteer I've got a set of tasks and then she can actually go in here and start to match up Different volunteers to different tasks now. We don't have it done today But what we're going to do is be able to show past history So it'll help her pick the best volunteer for a task as well as matching up skills Maybe I need people who are carpenters or electrical for this task And I can find out are there people who are volunteers who have that skill set Can you give us a sense for how long this would have taken before something like this? Not really It it it takes weeks to and we're basically doing call downs So we've got all of our list of volunteers and we're doing call downs We're putting word out there for what we call event-based volunteers who are just spontaneous volunteers who want to get involved Then you've got to call them You've got to see what their comfort level is how long they're able to participate in the event And it just it takes a long time. So having having volunteers proactively kind of step up and then to already know what they're Comfortable doing is going to make that that process a lot smoother. You literally don't have to call anybody Well, you're still going to make some calls, but this is going to sort of alleviate a lot of that pressure Oh, absolutely. And I something we were talking about earlier, which I'm really excited about at the At the task level I'm just exporting that out as work assignments being able to get just a nice report of Look, these are all the people who are going to do that task for that day And here's all their contact information and have that for the people who are managing the event That's fantastic. And our motivation in building this is the less she can spend time having to do this work Then the more time she's actually spending doing good and helping out in the community So we talked about skills. So one of the other capabilities we have here is they can create their own sort of taxonomy of skills We've obviously got some sample data here, but you can go in and you can specify Carpenter skills, electrical skills, um, maybe the ability to do heavy lifting or particular certifications All those things that you'd have to gather from somebody so you can have a list that they can supply to you You can also request and you can do that matching as you assign somebody to a task So traditionally there'd probably be like some huge excel spreadsheet when you're doing call downs That someone's just literally filling out or something like that Yeah, if we're lucky if we even have that formalized information Mostly it's a project manager just kind of keeping it on their head And they sort of have the lay of the land and person x is going to do this and person y is going to do that And just hope for the best on the day of So one of the things here that's less about an individual organization But we also have the ability to have multiple organizations Ultimately, this is multi 10 if you will from a technical point of view because the goal is for a community say Chicago to be able to see Everybody who's active doing something in a preparedness campaign so that I as an individual can go to a campaign And I can not only volunteer But eventually there'll be the ability for me to go in here and say, you know what I actually would like To receive the benefit of that I'd like a smoke detector So you can kind of sign up to be part of that which helps direct them as to who to help first Awesome And we're hoping over time we'll be able to pull data out of this so that we can also show sort of overall indexes of Resilience and reliability and what people are able to do in their own communities And also help you give the data to know when you're going out and doing something in a large community Where do you go first? What's going to have the sort of bang for the buck if you will awesome You know the thing that's interesting about a project like this is it becomes people's hobby You know this is What people want to work on like you could go bowling on wednesdays But instead you pick up a work item for already and help move it along So I love working on this project because I feel like I'm making a difference And that's what it that's the core of what matters to me So the things I do on a day-to-day basis. I want to improve someone's life So after several weeks of work leading up to the codathon and a mainly amazing three days We're now ready with what we call a minimal viable product all of the basic pieces to now take this into the field We want to just build the least necessary to truly try because we know As soon as it hits the field, it's going to be different. They're going to learn things about the way it works They're going to be making some changes. So we got there. We've got those pieces together We're just getting waiting now to get it out in the field and we're hoping by the end of november We'll be rather than you set a requirements to go further It's been three days and we're really proud of the work. We've been able to accomplish There's still a lot more to be done go to humanitarian toolbox to see how you can help make it even better