DependencyTrack / DependencyTrack/dependency-track
Tags are not updated on subsequent BOM uploads
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 811
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 237
Description
### Current Behavior
I've encountered what appears to be a bug with the tag management when uploading BOMs via the API. When using the PUT `/api/v1/bom` endpoint with the `projectTags `parameter, tags are correctly applied on initial project creation but are not updated on subsequent uploads.
Seems the same as https://github.com/DependencyTrack/dependency-track/issues/4539 but on `/api/v1/bom` API.
### Steps to Reproduce
Make an initial API call to PUT /api/v1/bom with the following parameters:
```
{
"projectName": "subProject",
"projectVersion": "prod",
"parentName": "parentProject",
"projectTags": ["tag1"],
"autoCreate": true,
"bom": "ewogICJib21Gb3JtYXQiOiAiQ3ljbG9uZURYIiwKICAic3BlY1ZlcnNpb24iOiAiMS40IiwKICAiY29tcG9uZW50cyI6IFsKICAgIHsKICAgICAgInR5cGUiOiAibGlicmFyeSIsCiAgICAgICJuYW1lIjogImFjbWUtbGliIiwKICAgICAgInZlcnNpb24iOiAiMS4wLjAiCiAgICB9CiAgXQp9"
}
```
2. Verify that the project is created with the tag "tag1"
3. Make a second API call with modified tags:
```
{
"projectName": "subProject",
"projectVersion": "prod",
"parentName": "parentProject",
"projectTags": ["tag1", "tag2"],
"autoCreate": true,
"bom": "ewogICJib21Gb3JtYXQiOiAiQ3ljbG9uZURYIiwKICAic3BlY1ZlcnNpb24iOiAiMS40IiwKICAiY29tcG9uZW50cyI6IFsKICAgIHsKICAgICAgInR5cGUiOiAibGlicmFyeSIsCiAgICAgICJuYW1lIjogImFjbWUtbGliIiwKICAgICAgInZlcnNpb24iOiAiMS4wLjAiCiAgICB9CiAgXQp9"
}
```
4. Observe that the project tags remain unchanged (still only "tag1")
### Expected Behavior
When uploading a BOM with updated tags, the project's tags should be updated to match the new set provided in the API call.
### Dependency-Track Version
4.13.0
### Dependency-Track Distribution
Executable WAR, Container Image
### Database Server
PostgreSQL
### Database Server Version
14.5
### Browser
Mozilla Firefox
### Checklist
- [x] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [x] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported
Contributor guide
Assessment
This issue has not been assessed yet.