-
Notifications
You must be signed in to change notification settings - Fork 23
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
Update purlcli documentation, data structure and logging, add cocoapods support #436
base: main
Are you sure you want to change the base?
Conversation
- Also replaced PURL normalization option with default deduplication. Reference: #365 Signed-off-by: John M. Horan <[email protected]>
@pombredanne This set of changes includes a portion of your detailed feedback from last week -- will address your remaining comments next. @TG1999 @keshav-space I will also address your remaining comments on the cocoapods support I've added to packageurl-python/purl2url.py and fetchcode/package.py once I've finished updating the purlclci.py and related code and tests. |
Signed-off-by: John M. Horan [email protected]
#365 #249 Reference: #365 Reference: #249 Signed-off-by: John M. Horan <[email protected]>
@pombredanne @AyanSinhaMahapatra I've just committed and pushed my latest PURLCLI-related changes, including adding details to the RTD re the use of the four current PURLCLI tools. I stuck with the existing RTD structure and thus made all my RTD changes in This latest push also includes numerous detailed changes to
I look forward to your comments. |
For easy reference the RTD update is here (although the new TOC doesn't show up in this simple .rst file). |
Reference: #365 Signed-off-by: John M. Horan <[email protected]>
Reference: #365 Signed-off-by: John M. Horan <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
@pombredanne Now that I'm removing all logging/messaging, how do you want to handle a command run on a PURL whose type is not supported? Supported types are different for each command (some overlap some not) and changes over time as we add more support. I used to provide a warning like
with all of the details included in the console. I can avoid this by first testing whether the particular query returns a value, e.g., for |
@pombredanne Given our recent discussions as well as the feedback you just provided re the fetchcode cocoapods work (thank you!), I think the answer to my question is: let the exception be raised and displayed in the console -- do not use |
Not exactly:
class UnsupportedPackageType(Exception):
pass
# later in a call:
raise UnsupportedPackageType(purl_type
|
Thanks @pombredanne . Adding a new exception is an interesting option. For testing, in purlcli.py, I've added
and for the
For testing right now, when I run an unsupported PURL type with
I also added a simple test that seems to work:
|
@pombredanne I'm cleaning up I realize you've had no time to read and reply to my question yesterday about the implementation of your example However, since this might not be what you have in mind, I am going to remove that for As discussed in this morning's huddle,
and
|
@johnmhoran re: #436 (comment)
This works, but a simpler and better option in the CLI is to implement a callback instead that will parse the purl and raise an exception IFF the type is not in a supported list of types. See https://github.com/nexB/purldb/blob/4a9ba34901ac494d063d786daf3a5e002abcf9a9/purldb-toolkit/src/purldb_toolkit/purlcli.py#L1045 for an example of such a callback.
Using a callback enable an early validation and is a better option for the command line.
So the behavior is to return None in these cases. This looks fine to me. You could test if you have a value if needed. But for now, keep things simple, let exceptions bubble up. |
@pombredanne I did not follow all that you wrote but for now I am not making any more changes along these lines until we can discuss and I can ask questions real time. At this point my goal is to clean up the logging/messaging structure and related tests I added in purldb-toolkit and then fix the fecthcode cocoapods logging/messaging -- then we can discuss improvements going forward and I'll be eager to learn and implement. |
Reference: #365 Signed-off-by: John M. Horan <[email protected]>
Signed-off-by: John M. Horan <[email protected]>
Reference: Signed-off-by: John M. Horan <[email protected]>
Reference: #365 Signed-off-by: John M. Horan <[email protected]>
@pombredanne I've finished removing the PURL CLI logging/messaging structure I'd added, merged the most recent |
Reference: #365 Signed-off-by: John M. Horan <[email protected]>
Reference: #365 Signed-off-by: John M. Horan <[email protected]>
I've just committed and pushed my remaining updates for the metadata command in purlcli.py. Waiting for the GH checks to run. |
@pombredanne @keshav-space @TG1999 All GitHub checks have passed. This PR is ready for review at your convenience. Please note that the purlcli code relies in part on updates I've recently pushed to PRs for fetchcode (aboutcode-org/fetchcode#119) and packageurl-python (package-url/packageurl-python#153), which also need review when time permits. |
Reference: #365