feat: add pipeline specialized in Maven package scan - #1953
Conversation
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
- Update format Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
…1763 - Update package's license if missing while the same package has license detected in RESOURCES Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
tdruez
left a comment
There was a problem hiding this comment.
- Create a new maven pipe module in place of use resolve
- Opening and loading a large file to make edits multiple times in various steps is not great.
- To be discussed: Do we need a dedicated pipeline for just an extra step? Shouldn't the original
scan_single_packagedetect that it's a Maven package and apply the necessary? Any reason to keep this new logic separated?
Signed-off-by: Chin Yeung Li <tli@nexb.com>
- Create a new maven pipe module - Use database queries for update_package_license_from_resource_if_missing() - Add tests Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
|
@tdruez I’ve updated the code to include support for the "D2D" option.
The "deploy_to_devel" option is equivalent to the "map_deploy_to_develop" pipeline, which runs on Java, JavaScript, Kotlin, and Scala as these are the languages commonly found in Maven projects. |
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Some projects encountered a unique constraint violation when a resource was already mapped: ``` duplicate key value violates unique constraint "scanpipe_codebaserelation_unique_relation" DETAIL: Key (from_resource_id, to_resource_id, map_type)=(1512780, 1512790, jar_to_source) already exists. ``` Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
* Require for `"tab_context": {"VULNERABLECODE_URL": settings.VULNERABLECODE_URL},`
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung <tli@nexb.com>
|
I've redesigned the code. It now only takes 1 PURL as input. Example 1: Without fetching the remote POM and updating the package data, no packages are detected because the fetched binary (https://repo1.maven.org/maven2/aero/champ/cargojson/1.0/cargojson-1.0.jar) doesn't contain a pom.xml. However, with remote POM fetching and package data updates enabled, we successfully detect 1 package and update 17 dependencies in the summary: Example 2: Since there is no source available for this package, only a basic scan is performed. |
* Require for `"tab_context": {"VULNERABLECODE_URL": settings.VULNERABLECODE_URL},`
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
| {% endfor %} | ||
| </ul> | ||
| {% endif %} No newline at end of file | ||
| {% endif %} |
There was a problem hiding this comment.
This was likely auto‑corrected when I ran make check, but in any case the missing tag has now been added and fixed.
| {% endfor %} | ||
| </tbody> | ||
| </table> No newline at end of file | ||
| </table> |
There was a problem hiding this comment.
This was likely auto‑corrected when I ran make check, but in any case the missing tag has now been added and fixed.
Co-authored-by: tdruez <489057+tdruez@users.noreply.github.com> Signed-off-by: Chin Yeung <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
| self.assertEqual(0, project1.discoveredpackages.count()) | ||
|
|
||
| @skipIf(sys.platform == "darwin", "Not supported on macOS") | ||
| def test_scanpipe_scan_maven_package_single_file(self): |
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Co-authored-by: tdruez <489057+tdruez@users.noreply.github.com> Signed-off-by: Chin Yeung <tli@nexb.com>
tdruez
left a comment
There was a problem hiding this comment.
@chinyeungli a few issues still need to be addressed. Please also add or update unit tests to cover them, so we catch regressions on those.
Signed-off-by: Chin Yeung Li <tli@nexb.com>
* Better error handling * Fix update_scan_data to append rather than overwrite existing dependencies * Improve perfomance for update_package_license_from_resource_if_missing() Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
68dc17b to
62a29ac
Compare
tdruez
left a comment
There was a problem hiding this comment.
@chinyeungli see one last suggestion before the merge/
Signed-off-by: Chin Yeung Li <tli@nexb.com>






Uh oh!
There was an error while loading. Please reload this page.