Feature: Support CSV file import in Batch Analytics
Description
🛠 ️ Before You Raise an Issue
Summary
Currently, the Batch Analytics page only supports uploading usernames via .txt files (one username per line). Many users manage team data in spreadsheets, so adding support for .csv file imports would significantly streamline the workflow.
Current Behavior
- File uploader only accepts
.txtfiles. - Users must manually convert CSV exports to TXT files before uploading.
Proposed Changes
Modify the file upload logic in src/gitlab_compliance_checker/ui/batch.py to:
-
Update File Uploader: Change
type=["txt"]totype=["txt", "csv"]. -
Add CSV Parsing: Use
pandasor standard Pythoncsvmodule to handle.csvfiles.- If it's a CSV, it should ideally look for a column named
usernameor just use the first column if no header is present.
- If it's a CSV, it should ideally look for a column named
-
Maintain Backward Compatibility: Ensure
.txtfile uploads and manual text area input continue to work seamlessly.
Acceptance Criteria
- Users can select and upload a
.csvfile in the Batch Analytics configuration.-
The app correctly extracts usernames from the uploaded CSV. -
Error handling is implemented for malformed CSV files. -
Manual entry and .txtuploads still function as expected.
-
Technical Details
-
File to modify:
src/gitlab_compliance_checker/ui/batch.py -
Logic: Use
pd.read_csv(uploaded_file)when the file type is detected as CSV. 
