Skip to content

API /v1/bom should have a parameter parent #2412

Closed

Description

@oers

Current Behavior

At the moment the API does not hava a parameter to specifiy the parent, when uploading a bom and using projectname/version.

Proposed Behavior

Add a parameter "parent" to /v1/bom which consumes and sets the parant on upload.

Checklist

Activity

  1. added
    enhancement
    on Jan 27, 2023
  2. ch-k commented on Jan 27, 2023

    @ch-k

    Would be very helpful und maybe even necessary for something like that: jenkinsci/dependency-track-plugin#139

    Workaround is to create project via /v1/bom (by project name and version), retrieve IDs using /v1/project/lookup and finally update the project (including parent) with POST to /v1/project. But that's not very convenient.

  3. weinzierl commented on Jan 27, 2023

    @weinzierl

    "...finally update the project (including parent) with POST to /v1/project"

    Have you tried that? I can't get it to work, because /v1/project doesn't seem to accept neither "parent": "uuid" nor "parentUuid": "uuid" (400 Bad Request).
    /v1/project/uuid with a PUT gives me a 500. Specifying a "uuid" field does create the project but the uuid doesn't seem to be used. Setting the project uuid in the parent as "children": ["uuid"] didn't work either. How can I create a child project via the API at all?

  4. ch-k commented on Jan 27, 2023

    @ch-k

    "...finally update the project (including parent) with POST to /v1/project"

    Have you tried that? I can't get it to work, because /v1/project doesn't seem to accept neither "parent": "uuid" nor "parentUuid": "uuid" (400 Bad Request). /v1/project/uuid with a PUT gives me a 500. Specifying a "uuid" field does create the project but the uuid doesn't seem to be used. Setting the project uuid in the parent as "children": ["uuid"] didn't work either. How can I create a child project via the API at all?

    I didn't test this step manually via curl or similar. But that's the way that the Dependency Track frontend takes. It uses the same API. When you open the "Project Details" dialog of a project without parent, you can select a new parent and press the "Update" button (that's the call to /v1/project).

  5. roadSurfer commented on Jan 31, 2023

    @roadSurfer

    #2401 was recently addressed which allows setting the parent via a PATCH after the project has been created,
    The parent can be set via POST, the frontend does this, but that requires having to include all the other project details as well; not just those which have changed.
    FWIW I have tried the POST method and it works, but I have elected to ignore parent for now until the next release.

    Edit: Being able to do it on bom upload (via name/version or UUID) could be advantageous as it would avoid the need for multiple quests.

  6. codenox-vs commented on Feb 8, 2023

    @codenox-vs

    I was searching for this feature right now (/bom and parent). I thought I just missed it, but looks like I have to what a bit longer...

  7. added this to the 4.8 milestone on Apr 10, 2023
  8. github-actions commented on May 12, 2023

    @github-actions
    Contributor

    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.

  9. locked as resolved and limited conversation to collaborators on May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions