Skip to content

[Bug][Org] Uploading project_mapping.csv does not remove mappings that are not in the file #9449

Done

Description

@henry-rystic

Search before asking

  • 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.

  1. 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.
  2. Send the file again with only the first two rows. Result: success.
  3. 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.

Version

main (52d63a1)

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. 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
  2. added a commit that references this issue on Nov 25, 2026
    fe7dcf1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ Proxy