There is this guy in my company who is very nice, always in a good mood, quite hardworking and has all the amiable qualities that you can think of but he is not really good at his job. I am inclined to think that he is rather poor at his job.
Me and my team lead are currently working on a project, the code freeze for which is on monday. The project is very important which is one of the reasons why it got assigned to us. On thursday night, my team lead called me to try and come early on friday so we can finish all the pending tasks. We were rather swamped with work on friday. Well, we finished everything nicely.
Now about this guy I mentioned above, on thursday, there was a bug found in some code he had written that needed to be fixed urgently. He sought my help on it and I did help him. We have a proper code review system in place and he asked me to review his code. While reviewing I found too many simple issues in his code which I pointed out to him and he said he would fix them. Well, thursday was over and I left for the day.
On friday morning, I saw a mail from him sent at 1 AM in the night saying that he is on leave for one week starting friday. He had done all the changes I suggested and updated the code review. He also sent me a final patch requesting me to commit the changes for him. I think he was working till 1 AM to finish his task and I feel truly sorry for him.
However, after applying his patch to the code, I found that the changes didn't compile, the unittests he had written were not running. All this probably because his own copy of code was really old. He didn't add anyone as moderator on his review, so no one could really edit his review. Even after the changes, his code had too many issues and I can't really commit such poor code. We have a policy of closing code reviews before the code is committed, and his review is going to hang around till he is back.
However, given the urgency of his own bug, I fixed the code myself, created a new review and got it reviewed from someone else and committed it. This was a bit difficult as some of the files that he was changing were also being changed by me and like I said earlier, I was swamped with my own work on friday. I was rather frustrated on his passing the responsibility to me without even asking me once and that too on a really busy day for me, although he was not aware of this.
And in all the frustration, I sent him a strongly worded reply highlighting all his mistakes and saying that I can't really commit his changes as such. On my team lead's suggestion, I even included his manager in the mail. I informed him that I had done the fix however. Late at night I saw a concise "Thank You" from him. And now I am feeling all guilty.
So questions: Was I wrong in sending a rather harsh reply. Did I do something wrong by including his manager. That would make him look bad. I wouldn't have cared a bit if he was some lazy, insincere jerk who never made an effort to do anything properly. But he is a really nice, hardworking person and I certainly don't want him to be scared of asking me for help in the future. Is there something I can do to make him understand my own difficulties without sounding like the person who starts listing his own problems the moment you ask them for help. Should I apologize about something.