Add merge files files to GetCommitFileStatus (#20515)

Hi,

We'd like to add merge files files to GetCommitFileStatus fucntions so
API returns the list of all the files associated to a merged pull
request commit, like GitHub API does.
The list of affectedFiles for an API commit is fetched from toCommit()
function in routers/api/v1/repo/commits.go, and API was returning no
file in case of a pull request with no conflict, or just files
associated to the confict resolution, but NOT the full list of merged
files.

This would lead to situations where a CI polling a repo for changes
could miss some file changes due to API returning an empty / partial
list in case of such merged pull requests. (Hope this makes sense :) )

NOTE: I'd like to add a unittest in
integrations/api_repo_git_commits_test.go but failed to understand how
to add my own test bare repo so I can make a test on a merged pull
request commit to check for affectedFiles.
Is there a merged pull request in there that I could use maybe?
Could someone please direct me to the relevant ressources with
informations on how to do that please?

Thanks for your time,
Laurent.

---------

Co-authored-by: Thomas Desveaux <desveaux.thomas@gmail.com>
This commit is contained in:
Laurent Cahour 2023-08-24 12:03:49 +02:00 committed by GitHub
parent 86ee5b4b1b
commit b21b63c61a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,2 @@
x<01>ÍM
1 †a×=Eö$µÍLAÄ«ô'ÁiæþR½€g÷~_ÝÖu1 ˜@mZ)g<>2…Dj™Š*_“fŒÌs ¥4ïòaÏm“np>—Áˆç€Ì>!œÑ#ºú½1ù;p]ìxÿæuyIwÑN4Ã

View file

@ -0,0 +1,2 @@
x█нM
б0├aв9еЛ≥ЭM2 БU Ф ╛∙=©т╦yv/╪С╤╝к гН0:@╠Р$╠│Uя╛╚.≈[й>╚ ■l⌠▀IлsЙx РЗ8'T╞╟R╧д╓S,╙╠$x. ж И=n[╖│в═СНuГ╢s!+9╟┬ВBGvлfЧm Э≤▌uШ─зr┤ЫЪа>╝

View file

@ -0,0 +1,5 @@
xŤÎM
1 @a×=Eö¤?iń*mšÁÇ™xOŕćŰ=x˛.Ëlŕ™O¶©R˘Z80ŠÄ\[í*Ú%µb
<EFBFBD>&qď¶éË IŠŽČšÔç<C394>ť
7ęĚÔF쨜ĽwícŹuÓÝŕzx?¸ÜŔçš0ç
ś1 :ům™ţ¸6LóSÝŔí>&