最近做了一個backport的票,backport就是別人以前修復了這個bug,我只需要將fix移植到客戶的系統中。這是一
個沒有技術含量的票,遇到簡單的票,三下五除二就解決了。但是遇到目標版本與master差別大時,也許backport后不好用。結果這次就遇到了,并
且引起UI問題。
我先是查看所有commit的修復,發現沒有關于UI的修復。找了好久也沒有找出原因。后來我想到部分backport,只backport主要修復,但是這也需要對修復很了解才能做到合理取舍,只得放棄。
于是我采用最笨的方法,以文件為單位,單個測試。因為是UI問題,單個功能JSP文件錯誤就可能導致問題,我便找到可能的文件,將其還原到被修改前的狀態,全
部復制到backport后的版本上。這就相當于backport,但是唯獨不backport這個文件。發現UI問題不見了!那就確定是這個文件引起。
然后再找出此次修復的所有關于這個文件的commit,找到diff,每次應用一個commit,當應用到某個commit時,問題出現了,說明此次
commit的fix導致了這個問題,然后仔細分析此次修改,最后找到問題。
========================================================================
Recently I did a ticket about backport. Backport is just copy others
fix to fix customer’s issue. This kind of tickets has little tech. If
it’s simple, nothing progress. But if it’s not simple, that’s
disgusting. But this time, it’s the latter. And it’s an UI issue.
At first, I tried to look through the commits and found there’s no
fix about UI. And then I tried to part backport it. But this needs me
know the fix well, so that I can part backport it. So I give this
solution up.
At last, I use a stupid way, but it does make sence. I focus on each
file. Since this is an UI issue, it relates js, css, jsp files. I found
the JSP files which might be the reason. I took out one jsp, and find
the original status that didn’t apply any fix. And? I copied all the
content to the backported file, which means I backported all the fix,
but only left this JSP as “unfixed”. The result is, the UI issue was
gone! That was clear enough. Then I applied the commits of the file one
by one, until I can reproduce the issue. Then I located the commit that
made bad fix. Then I took care of this fix and found out the cause.