Code Monkey home page Code Monkey logo

sw360python's People

Contributors

deveaud-m avatar gernot-h avatar heliocastro avatar nzupan avatar t-graf avatar tngraf avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sw360python's Issues

fix: wrong return type of get_release_xyz methods

Methods get_releases_by_name, get_all_releases, get_releases_by_external_id specify the return type list.
In cases when the SW360 returns an empty response an empty dict is returned. This breaks clients that rely on specified return type.

download_xxx_attachment ignores HTTP status

If you try to download a non-existing attachment, we today create a file with the JSON error messages as we ignore the HTTP status.

> sw360.download_release_attachment("test.txt", "111","222")
> cat test.txt
{"timestamp":"2023-07-30T19:42:21.815136Z","status":404,"error":"Not Found","message":"Release does not exists! id=111"}

Instead, it should raise SW360Error as for any other failed operation, e.g.

> sw360.get_attachment("222")
---------------------------------------------------------------------------
SW360Error                                Traceback (most recent call last)
[...]
SW360Error: <Response [404]>

Increase attachment upload verbosity

Only two scenarios are covered by the API function upload_resource_attachment():

  1. response.ok does not raise
  2. Not response.ok raises SW360Error

If the HTTP response received for this call is 202, the function call simply returns however the attachment has not been uploaded to the e.g. component but a moderation request has been created. Example of the received response:

HTTP status = 202
{
  "message" : "Moderation request is created"
}

In that case the client should be informed about the result of the call instead of expecting that the attachment has properly been transferred.

/cc @t-graf @gernot-h

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.