You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][Org] Uploading project_mapping.csv does not remove mappings that are not in the file #9449
I had searched in the issues and found no similar issues.
What happened
An upload of project_mapping.csv adds and updates rows, but it never removes rows. If a mapping is not in the new file, it stays in project_mapping. So a project keeps data scopes that the user removed.
Cause:
project_mapping.go:86 saves the rows without deleting first. The teams, users and account-mapping uploads delete first (team.go:87, user.go:90, user_account_mapping.go:80).
The delete in the divider (batch_save_divider.go:85) also does not run, because store.go:45 passes an empty table and empty params.
What do you expect to happen
After an upload, each project in the file has exactly the mappings in the file. This matches how the other org uploads replace their tables.
How to reproduce
Tested with the image apache/devlake:main_261124_0230_52d63a1 and MySQL 8.4.
Send PUT /plugins/org/project_mapping.csv with three rows for the project Payments (github:GithubRepo:1:7301, jira:JiraBoard:1:7302, github:GithubRepo:1:7303). Result: success.
Send the file again with only the first two rows. Result: success.
GET /plugins/org/project_mapping.csv still lists all three rows. The project_mapping table has three rows for Payments.
Anything else
Do not delete all rows before saving, because that also removes mappings that blueprints create. Delete only the mappings for the project names in the uploaded file.
changed the title [-][Bug][Org] Uploading project_mapping.csv never removes mappings left out of the file[/-][+][Bug][Org] Uploading project_mapping.csv does not remove mappings that are not in the file[/+]on Nov 25, 2026
Activity
[-][Bug][Org] Uploading project_mapping.csv never removes mappings left out of the file[/-][+][Bug][Org] Uploading project_mapping.csv does not remove mappings that are not in the file[/+]fix(org): replace the mappings of each project in an uploaded file