Stars

Woke up a bit ago. 3:00 AM Costa Rica time. Took a look outside. The clouds had cleared and all I could see were stars. Everywhere. Blackest sky I’ve ever seen, completely filled with the familiar winter stars. Grabbed my binoculars and went outside. So many stars. Thick. Everywhere. Milky Way cloud, amazingly bright. Binoculars so full of stars. Impossible to count. Looked down into the pool — stars and more stars reflecting there. Nebula, easy to spot with naked eye, exploded in the binoculars. Southern stars that I’ve never seen before, all the way down to the horizon, saying hello to the Pacific. And now the clouds have started to move back in. Time for a little more sleep.

Code Reviews and fishing

First, a little story . . .

Years ago, before I joined Microsoft, a team at one of the companies I worked for decided to start doing code reviews. This was back before modern IDEs that would show you side by side code comparisons with color highlighting of the proposed changes. And before VSTS which allows you to annotate the code that you’re looking at — add questions, notes, or recommendations about the code you’re reviewing — which is kept as metadata for the code. All good stuff.

So, no, we didn’t have anything fancy, so up front we agreed that we’d print out the source code before the meeting. We’d have to find a spot on our calendars when all ten of us could meet. We’d book a room. Then we’d meet.

The first review was pretty awkward. Nobody wanted to be the first, then Tony relented and agreed to be the Guinea Pig. He printed out his code for everyone, we met in the room, and we all started looking over the code. Things started off OK. There was some nervous laughter, Tony described the section of code we were going to review, and people asked a few questions and made some general comments. It went on like this for several minutes. We didn’t really know what we were doing.

One of the senior people on the team was Steve. He’d had a lot of programming experience, had worked on a number of different systems, and could crank out code. He was also the team lead, and the other newbies and I would sort of look up to him. But, Steve had an especially sharp tongue.

Steve asked a question. “Why in the world did you write your code this way?” Then another. Then made a barbed comment about the code. And another one. During this first code review his questions and comments began to come out as grilling and accusations. He’d say stuff like, “That’s a horrible name for a variable.” And, “I could have written this in half the lines and it would be 10 times faster.”

It went on like this for what seemed like hours. Steve even said, “This is really bad stuff. Why did you become a programmer? How did you get a job here?” I was so glad that I hadn’t volunteered to go first. I looked over at Gregg. He was wincing. Sandy had a look of horror on her face. The others, same. And Tony. Poor, Tony. He was shrinking into his chair.

After about 15 minutes of this, Gregg finally got up the nerve and broke in. “Hey, wow. OK. I think it’s time for a break.” Everyone agreed. We all grabbed our stuff and got out of the conference room as fast as we could.

And we never had another code review.

Culture. . .

Developing software is so much more than language, syntax, patterns, IDEs, and mad technical chops. (Although they do come in handy.) Developing software is more about people. It’s about soft skills, being able to understand and communicate with others. It’s about solving problems.

Developers — even beginning developers — pour their souls into the code they write. They can be passionate about their code. They’re totally invested. It’s their baby, and nobody likes to have their baby called ugly. And nobody wants to be put down or humiliated.

So, some things to think about before the code review. . .

  • What’s the purpose? Why?
  • If the code has some issues, is that a good thing or a bad thing?
  • Is the code review for punishing or for teaching, mentoring? Blaming or training?
  • If issues are found, explain why. Reach an understanding. Teach.
    • What are the consequences of the way the code was written?
    • Help them figure it out. Don’t simply mandate or dictate. Teach them how to fish

Code reviews can be so beneficial to everyone if they’re done the right way. And so harmful if they’re not.

Be kind to each other. Play nice.

Simple things

Was in Olympia most of the week, followed by a night in Seattle. Avoided a long early morning drive to SeaTac. Walking into the DoubleTree saw a stunning tree. Colors that we don’t have in Tampa. Ever.

3AM Pacific Time alarm. Early morning flight back to Tampa. At the airport, breakfast in the Sky Club. Set the food on the table. “Huh. That looks pretty cool.” Happened to be delicious, too.

Saw this during my flight. Looks like I got away just in time.

VSTS–Mac build agent fail restoring NuGet packages

Heads up if you’re running VSTS build agent on a Mac for Xamarin.Forms iOS projects.

You may see this error message from the NuGet package restore step:
”To connect to NuGet feeds hosted in your Team Services account/TFS project collection with NuGet 3.1 or below, edit your build definition to specify a path to a NuGet.config containing the package sources you wish to use.”
 
And this error message in the agent’s _diag log file on the Mac:
                MsBuild.exe does not exist at ‘/Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/4.5/msbuild.exe’.
 
It’s a closed issue on GitHub, but you’ll need to do a workaround.
 
See https://github.com/Microsoft/vsts-tasks/issues/2828 for details. The issue was opened about 10 days ago.
 
I hadn’t changed anything with my build definition, source code, or build agent, but the build failed this morning. (It had been a couple of weeks since I’d run it, and it had always worked before. Quite a surprise.
 
I ended up putting this in the VSTS NuGet package restore step and it resolved the issue for me:

2016-10-17_10-26-36

Note from Joe Sauve:

You can also use:
“/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/nuget/NuGet.exe”

Note the “Current” instead of a specific version number. There should be a symlinked “Current” folder in there that always points to the most recent version.

Thanks Joe!

bliz

Android Keystore file and password in VSTS builds

I was on site with a client last week working with them on DevOps for Xamarin.Forms builds using VSTS. The question came up of what to do about the Android Keystore file and its password – where to put them, keep them safe, etc.

Keystore file
If you’re running the build agent on a local build server (or Azure VM), the keystore file can be placed in a secure location on the build server. If you’re using the hosted build controller the Keystore file could be put into source control with limited access given to that file.

Keystore file password
For the Keystore file password, create a private variable in the Android build definition . Once the variable is set it cannot be displayed again. Then set the permissions in VSTS so only those who have Build Edit permissions can change this variable, and restrict who you give those permissions to accordingly.

clip_image001
The build step with a reference to the Keystore file in VSTS source control and a variable for the password.

image
The Keystore password saved as a Variable in the build definition.

Then you’ll need to set the security on the Build itself to limit who is allowed to edit the build definition.

image

image

And that’s it. Setting up the VSTS build in this way will keep the Keystore file and password safe in your Xamarin Android build definitions.

Enjoy!
–bliz