Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CodeBuddy 와 함께하는 AI 코드리뷰

kakao
November 01, 2024

CodeBuddy 와 함께하는 AI 코드리뷰

#AI #LLM #CodeReview

코드 리뷰는 결함을 찾아내는 것이 목적일까요? 그렇다면, AI 코드 리뷰어는 사람을 대체해서 결함만 찾아주는 도구일까요? 그렇지 않습니다!
이 발표에서는 카카오의 코드 리뷰에 대한 철학과, AI 코드 리뷰에 대한 접근 방식을 공유하고자 합니다.
KCP(Kakao Cloud Platform), KAP(Kakao AI Platform)를 기반으로 카카오 내부에 On-Premise로 구축된 Codebuddy의 상위 아키텍처와 주요 기능, 최적화 과정에 대해 살펴봅니다.
단순히 프로세스를 자동화하고, AI기능이 추가된 도구로서가 아닌 새로운 동료로서 CodeBuddy의 AI Native @dev 여정을 엿볼수 있는 시간이 될 것입니다.

발표자 : benedict.lee, sam.717
(benedict)소프트웨어 품질, 개발 생산성, 협업을 어떻게 더 잘할 수 있을까를 항상 고민하며 개발자에서 애자일코치로, 다시 AI응용 개발자로 일하고 있는 베네딕트입니다.
(sam) AI 토끼굴에 빠져버린 샘입니다. 개발자들을 도와 코드 리뷰를 열심히 도와줄 AI SW를 만들어가고있습니다.

kakao

November 01, 2024
Tweet

More Decks by kakao

Other Decks in Programming

Transcript

  1. 1MBO "OBMZTJT%FTJHO *NQMFNFOU 5FTU 0QFSBUF 5PPMT 1SPDFTT $VMUVSF %FWFMPQFSBDUT 4%-$

    TXEFWFMPQNFOUMJGFDZDMF 1SPDFTT $VMUVSF $MBSJ fi DBUJPO $PMMFDUJPO $SFBUJPO *NQMFNFOUBUJPO &YFDVUJPO &YQMPSBUJPO 3FJOUFHSBUJPO $PSSFDUJPO 0QUJNJ[BUJPO 7FSJ fi DBUJPO
  2. $MBSJ fi DBUJPOਃҳࢎ೦੄੉೧ $PMMFDUJPO੿ࠁࣻ૘ $SFBUJPOӝࠄౣ ইఃఫ୊ *NQMFNFOUBUJPO௏٘ҳഅ &YFDVUJPOप೯ &YQMPSBUJPOఐ࢝ 3FJOUFHSBUJPO௏٘

    ޙࢲ੤ా೤ $PSSFDUJPOࣻ੿ 0QUJNJ[BUJPO୭੸ച ܻಂష݂ 7FSJ fi DBUJPOѨૐ  "*/BUJWF!EFW tݽٚѐߊ੗ഝزীࢲ"*ഝਊ੉ ੗োझۣѱ֣ই٘חѪu %FWFMPQFSBDUT  IUUQT CMPHDPOUJOVFEFWIPX - UP - VTF - BO - MMN - XIJMF - DPEJOH 5PPMT 1SPDFTT $VMUVSF
  3. ؊ա਷ࢲ࠺झܳ ਤೠಿ૕ ࢤ࢑ࢿ  ഈসъച $PEF#VEEZ ೐۽ࣁझ بҳ ޙച 


    "* ѐߊࢤ࢑ࢿ "*/BUJWF 1SPCMFN 4PMVUJPO EFTJHO EFWFMPQNFOU PQFSBUJPO %JTDPWFSZ %FMJWFSZ
  4. &&0O - QSFNJTF 6TFS *%& (JU)VC &OUFSQSJTF $PEF#VEEZ(BUFXBZ 
 BQJLFZ

    SPVUJOH SBUFMJNJU FUD $PEF#VEEZ0CTFSWFS USBDFMMNJOPVU MBUFODZ FUD ,BLBP"*1MBUGPSN $PEF#VEEZ$PO fi H 0QFO4PVSDF .PEFMT PCTFSWF "ENJO ,$1 ,BLBP$MPVE1MBUGPSN DIBU BVUPDPNQMFUF QSBHFOU $PEF#VEEZ .PEFM ,"1
  5. $POUFYU0QUJNJ[BUJPO  IUUQT QMBUGPSNPQFOBJDPNEPDTHVJEFTPQUJNJ[JOH - MMN - BDDVSBDZMMN - PQUJNJ[BUJPO

    - DPOUFYU  'PSBDDVSBDZ BOETVJUBCJMJUZ PGSFTQPOTF 'PSDPOTJTUFODZPGCFIBWJPS 0QUJNJ[JOH--."QQMJDBUJPO
  6. $POUFYU0QUJNJ[BUJPO (JU)VC &OUFSQSJTF $POUFYU3FUSJFWFS .PEVMBS3"( #BTF$POUFYU 5JUMF %FTDSJQUJPO (JUCSBODI (JUDPNNJUT

    1BUDI EJGG t13ਸ؊ੜ੉೧ೞӝਤೠ$0/5&95ഛ੢ ഛ੢ػDPOUFYUܳ؊ੜഝਊೞӝਤೠ*/4536$5*0/੸ਊu ,"1 3"( (JU)VC +*3" $PEF#VEEZ .PEFM &UD %FGBVMU*OTUSVDUJPO &YUFOEFE*OTUSVDUJPO 6TFS*OTUSVDUJPO &YUFOEFE$POUFYU 5JUMF %FTDSJQUJPO (JUCSBODI (JUDPNNJUT &YUFOEFE1BUDI EJGG +*3"*TTVFT 5FBNsT$PEJOH3VMF *ODJEFOUSFQPSUT FYQFSJNFOUBM 13
  7. --.0QUJNJ[BUJPO 0QFO4PVSDF .PEFM tࢎղ(JU)VC੄13ؘ੉ఠ۽೨बӝמ୶о೟णu 1SFQBSF 3BX%BUB (JU)VC &OUFSQSJTF L 13T

    L 13T 1SFQBSF 4'5%BUBTFU 5SBJOJOH &WBMVBUJPO 5 &  5BTLT fi MUFSJOH DPOWFSUUPTGUEBUBTFU $PEF#VEEZ .PEFM \ 
 t4ZTUFNut t*OTUSVDUJPOu t0VUQVUu ^ BEKVTU USBJOJOH QBSBNT 4'5'SFF[F ؘ੉ఠরష௾ (16"HY ള۲दрI DIFDLQPJOU 8IJDI SFTQPOTFJT CFUUFS 
 UBTL 
 SFTQPOTF SFTQPOTF FWBMVBUJPO QSPNQU KVEHF HQUP DMBVEF  TPOOFU $IPJDF#FTU$IFDLQPJOU ೨बӝמࢿמೱ࢚ fi OF UVOJOH
  8. 13ਃড 13ղਊਸ࠙ࢳೞৈਃডࢸݺઁҕ  135ZQF13ਬഋ -BCFM୶о  %FTDSJQUJPO13ࢸݺ  +JSB*TTVFTҙ۲૑ۄ 

    $PEJOH3VMFTҙ۲௏٬ӏ஗  $IBOHFTXBMLUISPVHI౵ੌ߹߸҃ࢎ೦ਃড EFTDSJCF
  9. 13ܻ࠭ 13ղਊਸ࠙ࢳೞৈܻ࠭ೖ٘ߔ੘ࢿ  դ੉ب௏ܻ٘࠭դ੉ب  ੼ࣻ13ಿ૕ী؀ೠ੼ࣻ৬੉ਬ  పझ౟௏٘੘ࢿৈࠗ  ࠁউ੉ग

     431ળࣻৈࠗ 13ܻ࠙  ઱ਃܻ࠭೦ݾ  ਬഋ ࢸݺ ௏٘ۄੋ݂௼ ૑ۄ੉ग ౱௏٬ܙӝ߈ઁউоמ EFTDSJCF
  10. %F fi OF 5BTL 4UPSZ #VH 8IZ+*3"*TTVF$POUFYU 13  XSJUF

    133FWJFXFS 13"VUIPS SFWJFX +*3" (JU)VC VOEFSTUBOE DBOVOEFSTUBOEUIF $0/5&95 $0/5&95
  11. (JU)VC &OUFSQSJTF $POUFYU3FUSJFWFS #BTF$POUFYU 5JUMF %FTDSJQUJPO (JUCSBODI (JUDPNNJUT 1BUDI EJGG

    *OTUSVDUJPO +*3"SFUSJFWFS +JSB$POUFYU3FUSJFWFS FYUSBDUJTTVFLFZT +*3"4FSWFS SFUSJFWFJTTVFEFUBJMT TVNNBSJ[F $PEF#VEEZ .PEFM &YUFOEFE $POUFYU 13
  12. (JU)VC &OUFSQSJTF $POUFYU3FUSJFWFS (JU)VC #SJOH:PVS0XO3VMFT 3FQP-FWFM 0SH-FWFM XSJUFUFBNsTDPEJOHSVMFUPUFBNSFQP SFUSJFWFDVUPGG $PEF#VEEZ

    .PEFM #BTF$POUFYU 5JUMF %FTDSJQUJPO (JUCSBODI (JUDPNNJUT 1BUDI EJGG *OTUSVDUJPO &YUFOEFE $POUFYU 13
  13. (JU)VC &OUFSQSJTF $POUFYU3FUSJFWFS *ODJEFOU 3FUSJFWFS ੢গܻನ౟3"(1JQFMJOF (JU)VC *ODJEFOU 3FQPSU SFUSJFWFSFQPSU

    SFUSJFWF JODJEFOU fi YFE13 *ODJEFOU *OEFYFS BOBMZ[FJODJEFOU ,"1 3"( JOEFYJOH BSFUSJFWFJODJEFOUT CSF - SBOLJODJEFOUT $PEF#VEEZ .PEFM *OTUSVDUJPO &YUFOEFE $POUFYU 13
  14. ਬࢎ੢গࢎ۹ઁউ җѢ੄੢গܻನ౟ܻܳ࠭Ѿҗ৬ೣԋઁҕ  13җোҙ੓חҗѢ੄੢গܻನ౟  ੢গܻನ౟ҳࢿ೦ݾ  ੢গܻನ౟ਗࠄ  ੢গղਊ

    ਗੋ  ਗੋ௏٘  ೧Ѿ௏٘ t੉ߣ13ীҗѢ੢গா੉झ৬࠺त ೠ௏٘оࠁৈ ೠߣ؊࢓ಝࠅې u
  15. ਬ੷ੑ۱чޙઁ ਬഋ ৘द ৔ೱ ੑ۱чन܉ࢿ ղਊࠗ੤ ਽׹੿ഛب੷ೞ ࠛ೙ਃೠਃࣗ 1MBDFIPMEFS -BCFM

    ੌҙࢿহחನݘ ޙ୓ ஶఫझ౟ӡ੉ ૑ա஘߈ࠂ ъઑ ஶఫझ౟੄ղਊীҗبೞѱ૘઺ ࠼ডೠղਊ ஶఫझ౟оࢤۚؼоמࢿ +*3"ੑ۱ч੉गਬഋ
  16. --.੉ਊஶఫझ౟੿ઁ߂ਃড ਗࠄ ਃড "*3&7*&8ܻ࠭೐܁೐౟ѐࢶ  DPNQPOFOUT$PEF#VEEZ  MBCFMT೐܁೐౟ ѐࢶ੘স 

    EFTDSJQUJPO 
 <ݾ੸> 
 $PEF#VEEZоӟஶఫझ౟੄௏ܻ٘࠭ܳೡٸ੿ഛ بܳ֫੉Ҋয়ܨܳ઴੉ب۾ѐࢶ 
 <୊ܻ> 
 दझమ೐܁೐౟חݺഛೠ૑ஜਸઁҕೞҊ ࢎਊ੗೐ ܁೐౟חѨష೦ݾਸҳ୓੸੉Ҋࣁࠗ੸ਵ۽ࣻ੿ೞח ߑೱਵ۽ઑ੿ <"*3&7*&8>ܻ࠭೐܁೐౟ѐࢶ 
 $PEF#VEEZ੄௏ܻ٘࠭੿ഛبܳ֫੉ӝਤ೧ दझమ ೐܁೐౟חੋझ౟۟࣌ਤ઱۽ݺഛೞѱ ࢎਊ੗೐܁೐౟ חܻ࠭೦ݾਸ࢚ࣁೞѱѐࢶ೤פ׮
  17. .PEFM$MBTT%F fi OJUJPO 0OF4IPU Here is the model definition for

    code review output. class ReviewOutput(BaseModel): score: int = Field(description=“The score of the given PR. Between 1 and 10.”) pr_type: str = Field(description=“Type of the given PR such as feature, fix, etc.”) description: str = Field(description=“Summary of the review of the given PR. Respond in Korean(ೠҴয).”) security_concerns: List[SecurityConcern] = Field(description=“does this PR code introduce possible vulnerabilities such as exposure of sensitive information.”) … Here is an example for code review output (YAML). review_output: score: 8 pr_type: bugfix description: … … Ѩૐػߑߨਵ۽ࡅܰѱ੸ਊ߂ࣻ੿ ೙٘߹਽׹੿੄
  18.  о߸੸ੋ1VMM3FRVFTU౵ੌ߸҃ࣻ৬ӡ੉  ܻ࠭ಿ૕ೱ࢚ਸਤ೧׮নೠஶఫझ౟୶о  ஶఫझ౟੹୊ܻ ਃড 3FSBOL١ ۽ੋೠ 


    --.ഐ୹പࣻૐо ஶఫझ౟ӡ੉ޙઁ ª ୭؀ஶఫझ౟ഛ੢L -> L -> L ª ؀۝NFSHF13୹۱ઑ੿ ª ੗زप೯TLJQ২࣌୶о ª UJNFPVUҗSFUSZ۽૒୭੸ചߡӒࣻ੿ @;;
  19. ௏ܻ٘࠭ !,BLBP $PEF#VEEZݾ੸ જ਷ աࢂ ௏٘੄ҕਬ Ѥъೠࣗా ౱ղഈসъച ѐߊ੗੄ ૑ࣘ੸ੋࢿ੢

    ѾೣߊѼ਷ rؒs   13TEBZ  ܻ࠭য 13  ܻ࠭ 13 133FWJFXFS 13"VUIPS )FMQT ઱ਃӝמ ୭੸ച 13ਃড ܻ࠭ೖ٘ߔ ௏٘ઁউ ݽ؛୭੸ച ஶఫझ౟୭੸ച && 0O - QSFNJTF $PEF#VEEZQBHFTVNNBSZ
  20. ݒ਋݅઒  ݅઒  ݒ਋ࠛ݅઒  ࠛ݅઒  ࠁా 

    2௏٘ߡ٣ী؀ೠ ੹߈੸ੋ݅઒بח ୶ୌೣ  ୶ୌೞ૑ঋ਺  2زܐীѱ௏٘ߡ٣ܳ ୶ୌೡ੄ೱ੉੓աਃ $PEF#VEEZ6TFS'FFECBDL
  21. ݒ਋ز੄  ز੄  ߈؀  ࠁా  2௏٘ߡ٣ח13ղਊਸ ബҗ੸ਵ۽ਃডೠ׮

    ݒ਋ز੄  ز੄  ߈؀  ࠁా  ݒ਋ز੄  ز੄  ߈؀  ݒ਋߈؀  ࠁా  2௏٘ߡ٣੄ܻ࠭ח ղо֬சࣻ੓ח ੉गܳߊѼೠ׮ 2௏٘ߡ٣੄௏٘ઁউ਷ ਬਊೞ׮ $PEF#VEEZ6TFS'FFECBDL
  22. 2௏٘ߡ٣ܳࢎਊೞݶࢲѻ਷ য۰਑਷ޖ঺੉੓աਃ ࠗ੿ഛೠ ੢ടೠ ਃড 13ߧਤܳߩযդ ܻ࠭ೖ٘ߔ ޖ੄޷ೠ ࠗ੿ഛೠ ௏٘ઁউ

    וܽࢿמ ੉೧ೞӝয۰਍਽׹ оՔ৔য۽؀׹ೣ ੣਷ӥ೸ݫੌ झ௼܀঑߅ $PEF#VEEZ6TFS'FFECBDL ਗೞחࠗ࠙݅ ܻ࠭ܳ߉Ҋर਺
  23. t13ࢤࢿद%FTDSJQUJPO੘ࢿীन҃ਸ݆੉ॄঠ೮חؘ  ௏٘ߡ٣оਃডਸ೧઱׮ࠁפખ؊оߺѱࢤࢿೡࣻ੓חѪэणפ׮u tਃডҗઁউ੄ղਊਸࠁҊनాߑాೞ׮ҊוՙҊ੓णפ׮݅  ೧׼ղਊ݅޺ҊֈযоҊ੓૑חঋই ই૒਷ܻ࠭दр੉ױ୷ػ׮Ҋೡࣻহणפ׮ ׮݅ न܉оऺৈоҊ੿ഛࢿ੉ખ؊֫ই૓׮ݶ рױೠ13੄҃਋ܻ࠭दр੉؀಩ױ୷ؼѪэणפ׮u

    t13߂DPEFഈসSVMF੉ҳ୓ചغҊ  ੹ޙѐߊ੗оইצ%#"ܳ؀࢚ਵ۽ ௏ܻ٘࠭ޙചо੿଱غחؘب਑ਸ઱঻णפ׮u t13ਃডਸղоೞ૑ঋҊ  ೧઱ݶ߸҃ೞחߑधਵ۽૓೯೧ಞ೧઎׮u NBLFDIBOHFT $PEF#VEEZ6TFS'FFECBDL %FWFMPQFSBDUT $VMUVSF 1SPDFTT "*/BUJWF!EFW
  24. $POUJOVBM 1SF - USBJOOJOH $PEF#BTF3"( ௏٘ߡ٣о ஠஠য়੄௏٘ܳ؊ੜ੉೧ೞҊ ؊੿ഛೞҊ࢚ടীݏח਽׹ਸೡࣻ੓ب۾ ௏٘ߡ٣о җѢ੄ݽٚ੢গܳ੉೧ೞҊ

     ޷ې੄੢গܳ৘ߑೡࣻ੓ب۾ 8IBUsT/FYU "*о੉೧ೞח 
 t੹ࢎ੢গؘ੉ఠੋؙझҳ୷u MFTTPOT - MFBSOFE --. 3"(١"*ӝࣿب઺ਃೞ૑݅  "*ӝࣿ੉ղࠗ೐۽ࣁझաبҳ ޙച৬঴݃աੜਲ਼೤غח૑о೨ब
  25. 2"