Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One team showing 0 files changes #2254

Open
damithc opened this issue Nov 13, 2024 · 2 comments
Open

One team showing 0 files changes #2254

damithc opened this issue Nov 13, 2024 · 2 comments

Comments

@damithc
Copy link
Collaborator

damithc commented Nov 13, 2024

Happening in this dashboard

image

One team is showing '0 files changed' for all team members. All other teams are fine.

Any idea about the case?

Repo https://github.com/nus-cs2113-AY2425S1/tp-dashboard

@gok99
Copy link
Contributor

gok99 commented Nov 13, 2024

Diagnosis

This seems to be caused by a line ending issue in this file which used CRLF line endings. When we read the file with BufferedReader::readLine, lines are split by LF or CRLF until EOF. However, git blame (and the GitHub file viewer) sees this as a single line file and only produces authorship for the first line. The produced authorship.json line info for this file then has missing fields for subsequent lines, which fails frontend schema validation, causing it to erroneously display "0 files changed".

Potential Fix

In reading non-binary files, we should probably split lines by only \n, perhaps using Scanner and Scanner::useDelimiter to match git output. We should also add tests for files with CRLF line endings, and have a check during report generation to ensure that the final authorship (and other) configs contain all required fields.

In the meantime, having the team standardize their line endings to LF (and their git autocrlf settings) is a quick temporary fix.

@damithc
Copy link
Collaborator Author

damithc commented Nov 14, 2024

@gok99 Thanks for the quick investigation. I'll inform the team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants