nexB / purldb

Tools to create and expose a database of purls (Package URLs). This project is sponsored by NLnet project https://nlnet.nl/project/vulnerabilitydatabase/ and nexB for https://www.aboutcode.org/ Chat is at https://gitter.im/aboutcode-org/discuss
https://purldb.readthedocs.io/
29 stars 20 forks source link

Add collect_symbols to the default pipelines and store symbols in resources #351

Closed keshav-space closed 4 months ago

keshav-space commented 4 months ago
keshav-space commented 4 months ago
  • It doesn't look like merge_or_create_resource merges data, but just overwrites the existing values on the Resource with new values. (https://github.com/nexB/purldb/blob/main/minecode/model_utils.py#L428) In the case where we have an existing Resource with symbol data stored in the extra_data field, the contents of the extra_data field will be overwritten if the incoming Resource data has values in there. I think it would make sense to append the new extra_data to the existing one instead of overwriting it, but I wanted to know what you think.

@JonoYang We could append data, but wouldn't that be more confusing? Suppose we already have source_symbols in the resource. If we reindex this package with a new version of source_inspector I don't think it would make sense to append this to the existing source_symbols.

JonoYang commented 4 months ago

@JonoYang We could append data, but wouldn't that be more confusing? Suppose we already have source_symbols in the resource. If we reindex this package with a new version of source_inspector I don't think it would make sense to append this to the existing source_symbols.

That's a good point. I think it would be good to rename merge_or_create_resource to update_or_create_resource and remove the merged variable in the function.

keshav-space commented 4 months ago

@JonoYang I've renamed the merge_or_create_resource and also added the test.