-
-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to tag projects on BOM upload #1674
Comments
I like this proposal, but why not support |
I agree - providing multiple project tags would be even better |
Great suggestion! What would the desired behavior be if the project already exists?
|
I personally think that option number three is the best one. This way the behavior is consistent with the {
"uuid":"ad143ba-1c1d-40ca-8054-2cf57f101206",
"name":"SampleProject",
"version":"2022-05-30 11:18:08",
"classifier":"APPLICATION",
"tags":[
{
"name":"production"
},
{
"name":"another-tag"
}
],
"active":true
} The existing tags are overridden with the ones from the the request: So I think it makes sense that tagging projects on SBOM upload should work the same |
love to see this coming. Adding tags during BOM upload has been on the wish list for a while now (#586). |
Why not just allow users to decide how to handle tags? Just provide a {
"uuid":"ad143ba-1c1d-40ca-8054-2cf57f101206",
"name":"SampleProject",
"version":"2022-05-30 11:18:08",
"classifier":"APPLICATION",
"tags":["production", "another"],
"tagMergeStrategy": "merge",
"active":true
} the merge strategy can then be Or, to keep things semantically separated provide it as a parameter: PUT /tags?tagMergeStrategy=merge
Content-Type: application/json
{
"uuid":"ad143ba-1c1d-40ca-8054-2cf57f101206",
"name":"SampleProject",
"version":"2022-05-30 11:18:08",
"classifier":"APPLICATION",
"tags":["production", "another"],
"active":true
} |
I think the most common use case is just to be able to provide some tags when uploading a BOM to not yet existing project. Would it be OK to start with a PR that supports that? If the project exists, tags will just be added to the existing tags. A more complex implementation with a merge strategy could also be done, but makes things more complex. And it doesn't support all use cases. For example when you want to add 1 tag and remove 1 specific tag. If we want to support that scenario, we would need more fields like I worry that the BOM upload endpoint becomes more and more complex. Maybe we should support the basic use case here (add tags) and leave the more complex stuff to the client to use other endpoints to query/update/delete tags? |
I've also bumped into that case recently - to do not need to assign tags manually in the app (especially with a way to later display only - let's say: Java projects). |
@clemlesne curl --location '.../api/v1/project' \
--header 'X-API-Key: <api_key>' \
--header 'Content-Type: application/json' \
--data '{
"uuid": "<project_uuid>",
"name": "<project_name>",
"version": "<project_version>",
"tags": [
{
"name": "alioune"
}
]
}' The |
Hi, any new with this? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
It would be useful for automation if projects could be tagged on BOM upload.
Current Behavior:
Currently, when uploading BOMs via
PUT /v1/bom
, we can specify the following properties:This works fine, but in order to tag a project we need to make one more request to
POST /api/v1/project
with the following payload:This is cumbersome for automation processes, it would be nice if we could upload BOM & tag the project with a single request.
Proposed Behavior:
Add
projectTag
as an accepted field toPUT /v1/bom
.Inside
BomResource
classPUT /v1/bom
handler - accept a tag field & use it when creating a project.Currently, we have the following code:
null
is being passed in as atag
parameter toqm.createProject
It would be better to use
null
for a tag when no tag is provided by the user, but if the tag is provided - use it.E.g. pseudocode
Cheers
The text was updated successfully, but these errors were encountered: