-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Labels
issue/regressionIndicates a previously functioning feature or behavior that has broken or regressed after a changeIndicates a previously functioning feature or behavior that has broken or regressed after a changetype/bug
Description
Description
Creating a new CSV file as part of a pull request doesn't display the files content in the PRs Files changed
tab:
https://try.gitea.io/otbutz99/test/pulls/1/files
The file is valid and renders just fine if viewed directly:
The CSV diff works fine for me if the content of the CSV is just changed in the PR:
https://try.gitea.io/otbutz99/test/pulls/2/files
Gitea Version
1.17.2
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
Git Version
No response
Operating System
No response
How are you running Gitea?
Release binary via systemd
Database
PostgreSQL
Metadata
Metadata
Assignees
Labels
issue/regressionIndicates a previously functioning feature or behavior that has broken or regressed after a changeIndicates a previously functioning feature or behavior that has broken or regressed after a changetype/bug
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
KN4CK3R commentedon Sep 16, 2022
That's a regression from #19552. This PR enforces base and head to be valid csv files which is not the case if a csv gets created.
delvh commentedon Sep 16, 2022
Or deleted?
KN4CK3R commentedon Sep 16, 2022
That may fail too.
KN4CK3R commentedon Sep 16, 2022
What #19530 (comment) states is wrong because
CreateCsvDiff
is intended to handlenil
readers. I could revert the other PR but without test case for the other issue there may be a new error.otbutz commentedon Sep 16, 2022
Confirmed: https://try.gitea.io/otbutz99/test/pulls/3/files
wxiaoguang commentedon Sep 16, 2022
Oh yes, I misunderstood the csvReaderFromCommit and CreateCsvDiff logic at that time. Then the question is whether #19552 really fixed the problem (#19530 (comment) said that the 500 error occurs on deleted files)
Update (2023-02-17): #22946, CreateCsvDiff should be able to process the situation when base and head are both nil.
KN4CK3R commentedon Sep 16, 2022
I will add a new PR with better error handling which should work in these cases.
Fix CSV diff for added/deleted files (#21189)
Fix CSV diff for added/deleted files (go-gitea#21189)
Fix CSV diff for added/deleted files (#21189) (#21193)