DependencyTrack / dependency-track

Dependency-Track is an intelligent Component Analysis platform that allows organizations to identify and reduce risk in the software supply chain.
https://dependencytrack.org/
Apache License 2.0
2.64k stars 558 forks source link

PATCH v1/project/{id} doesn't update properties #2937

Open matts-au opened 1 year ago

matts-au commented 1 year ago

Current Behavior

Similar to #2695, but for project properties instead of external references.

Reproducing on api-server 4.7.0 using curl:

curl -H "Content-Type: application/json" -H "X-API-Key: for-my-eyes-only" https://dependency-track-is-awe.some/api/v1/project/098f5f0b-2e3c-43c6-bcd9-0885d6524611 -X PATCH -d '{"properties": [{"groupName": "my-group", "propertyName": "my-prop-name", "propertyValue": "1234", "propertyType": "STRING"}]}'

Result: http 304, no change in the project. Same technique worked for project tags though.

Steps to Reproduce

See #2695.

Expected Behavior

Project properties get updated using PATCH v1/project/{id}.

Dependency-Track Version

4.7.x

Dependency-Track Distribution

Container Image

Database Server

PostgreSQL

Database Server Version

No response

Browser

Google Chrome

Checklist

valentijnscholten commented 1 year ago

PATCH seems to go via the v1/project/{uuid}/patchProject endpoint

matts-au commented 1 year ago

@valentijnscholten That is the endpoint I'm using. Note, the URL path passed to curl is v1/project/{uuid}. "patchProject" is just the method name. It translates to an operation ID in the Swagger spec file.

antoinbo commented 1 year ago

Hi @matts-au, There is a dedicated endpoint to manage project properties, /v1/project/{uuid}/property, see file ProjectPropertyResource.java.

matts-au commented 1 year ago

@antoinbo I can use that and it works, but it requires a request per property.

marob commented 1 month ago

Hi. Will this be implemented (updating properties from updateProject endpoint) or is it not planned?