openmainframeproject / software-discovery-tool

Software Discovery Tool
Apache License 2.0
31 stars 40 forks source link

Added IBM Validated Solftware List function to bin/package_build #122

Closed Princee215 closed 1 year ago

Princee215 commented 1 year ago

This is the fix for #100 @arshPratap @pleia2. Please take a look. I've added an IBM Validated Software List function in the bin/package_build.py file.

arshPratap commented 1 year ago

Nice work @Princee215 ..seems alright to me..might have to change the way we save the files but this should do for now. I would like to know your thoughts on this @pleia2

xtanion commented 1 year ago

Hi @Princee215 , This LGTM, one suggestion as @pleia2 mentioned

We could add this to package_build.py but my inclination is to create a separate script that allows you to specify which distributions from the list you want to build the JSON for.

You should create it as a separate script and make the user choose which .json file they want to build.

pleia2 commented 1 year ago

I think it's OK to keep it with the rest in package_build.py, but my concern is that it gets a little confusion as to how to use it.

My first concern is that "opensource" is incredibly vague, especially since everything we currently index with this tool is technically opensource :smile: Instead, maybe the keyword should be "ibm-validated"? We also want to make sure these are put into /opt/software-discovery-tool/distro_data/data_files/ like all the other output of this script (right now it's putting them in the current directory, which may be confusing since it's different from the rest).

We also need to be clearer to the user of the tool what's happening. For example, if they follow instructions from the help for Debian, it's very clear, it's generating the data for every Debian version supported in the tool and gives you the filenames in STDOUT:

elizabeth@r2d2:~$ ./package_build.py debian Extracting debian data ... Saved! filename: Debian_Buster_List.json Saved! filename: Debian_Bullseye_List.json Thanks for using SDT!

By contrast, this is what happens when you run this for "opensource":

elizabeth@r2d2:~$ ./package_build.py opensource Extracting data for opensource ... Thanks for using SDT!

...What just happened? So you'll want to do something similar to the others, where it tells you what filenames it's creating as it goes through them.

The last thing is that the code is just doing a small subset of the distributions used in validated software list (@arshPratap started his work as a proof of concept), so you'll want to look at the live list and make sure you're including everything, which means the RHEL versions as well: https://www.ibm.com/community/z/open-source-software/

I'm really happy to see this coming together! It's the last step for including this in the production tool, and a lot of folks have been asking for it.

Princee215 commented 1 year ago

Thanks @pleia2 for the suggestion, I'm trying and working out all the changes that you've asked for. I'm working on the changes and will update the PR.

arshPratap commented 1 year ago

@Princee215 I understand some of the requested changes might be complex but fret not I and @pleia2 are around to help you and if you ever feel stuck please do ask your queries either here or on the slack channel. Thanks !

pleia2 commented 1 year ago

@Princee215 Do you think you'd have some time this week to take a look at this one? It would be a nice early win and help get this source into production.

Princee215 commented 1 year ago

Sure @pleia2 I'll take a look into this and try to solve these issues which you pointed out.

Princee215 commented 1 year ago

Hey, @pleia2 and @arshPratap, I've maded the changes as asked. Thanks, @xtanion for the suggestion. Instead of creating different script I've added an argument for the user to choose which IBM-Validated .json file they want to build.

Please take a look!

arshPratap commented 1 year ago

Great Work @Princee215 , just needs some rebasing ! works well for me (have attached a screenshot below for the same ). @pleia2 would like to know your thoughts on this

Screenshot from 2023-06-24 23-27-44

Princee215 commented 1 year ago

I've made the required changes asked above. Please take a look and let me know if any more changes need to be made. @pleia2