How to check bad fix
最近做了一個backport的票,backport就是別人以前修復(fù)了這個bug,我只需要將fix移植到客戶的系統(tǒng)中。這是一 個沒有技術(shù)含量的票,遇到簡單的票,三下五除二就解決了。但是遇到目標(biāo)版本與master差別大時,也許backport后不好用。結(jié)果這次就遇到了,并 且引起UI問題。
我先是查看所有commit的修復(fù),發(fā)現(xiàn)沒有關(guān)于UI的修復(fù)。找了好久也沒有找出原因。后來我想到部分backport,只backport主要修復(fù),但是這也需要對修復(fù)很了解才能做到合理取舍,只得放棄。
于是我采用最笨的方法,以文件為單位,單個測試。因?yàn)槭荱I問題,單個功能JSP文件錯誤就可能導(dǎo)致問題,我便找到可能的文件,將其還原到被修改前 的狀態(tài),全部復(fù)制到backport后的版本上。這就相當(dāng)于backport,但是唯獨(dú)不backport這個文件。發(fā)現(xiàn)UI問題不見了!那就確定是這個 文件引起。然后再找出此次修復(fù)的所有關(guān)于這個文件的commit,找到diff,每次應(yīng)用一個commit,當(dāng)應(yīng)用到某個commit時,問題出現(xiàn)了,說 明此次commit的fix導(dǎo)致了這個問題,然后仔細(xì)分析此次修改,最后找到問題。
========================================================================
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.
?
我的github: https://github.com/bejondshao
轉(zhuǎn)載于:https://www.cnblogs.com/bejond/p/4307270.html
總結(jié)
以上是生活随笔為你收集整理的How to check bad fix的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 老式21寸彩电视机拆多少铜?
- 下一篇: 随机生成六位不重复数值